Commit Graph

2053 Commits

Author SHA1 Message Date
Duncan a01bd32132
Construction Window ToolUpdate (#1119)
* Start Implementing track tool update

* Further work

* Finish function

* Fix bugs

* Fix view issue

* Extract out common function

* Implement road tool update
2021-08-26 21:42:41 +01:00
Aaron van Geffen 070ec04888
Fix caption 22 widget text rendering (#1124) 2021-08-23 10:47:48 +02:00
Marijn van der Werf d793467167
Remove calls to already implemented functions (#1116)
* Remove calls to already implemented functions

* Fix location comment for getClosestTownAndUnk

* Move buildDeliveredCargoPaymentsTable (Maybe just keep in UI?)

* Remove terraform hooks
2021-08-22 18:48:18 +02:00
Aaron van Geffen 2d1b9944b7
Fix crash on save game open (#1121)
My previous PR, #1118, removed the hooks to the prompt browse window. This was working fine for all except saving games! 
Turns out the toolbar menu was still calling the vanilla function, thereby relying on the hook.

Replacing this call revealed a bug in hiding with the save prompt being initialised to the wrong save path.
This has been addressed as well.
2021-08-22 18:37:43 +02:00
rdrdrdrd95 ce8f6bca9f
Implement exception message box popups (#1104) 2021-08-20 14:53:10 +02:00
Aaron van Geffen 7d0f7f9dba
Finish PromptBrowseWindow's prepare draw function (#1118)
* Implement loadFileDetails (0x00446E87)

* Implement the rest of prepareDraw (0x00445C8F)

* Rename file_entry to FileEntry; apply code style

* Remove superfluous hooks for the browse window
2021-08-20 12:31:03 +02:00
Duncan 65895bcab1
Implement Tree Paint (#1115)
* Implement tree drawing

Co-authored-by: Marijn van der Werf <marijn.vanderwerf@gmail.com>
2021-08-18 22:09:34 +01:00
Duncan 18422de137
Implement tile element paint (#1113) 2021-08-18 12:19:54 +01:00
Aaron van Geffen f4d0d9215c
Handle missing strings more gracefully (#1114) 2021-08-17 13:20:30 +02:00
Duncan a48d0c7c74
Further Point refactoring (#1111)
* Split up viewport transforms

* Make naming more concistent

* Move into namespace, make constexpr
2021-08-17 11:59:41 +01:00
Duncan 055def4215
TrackAndDirection (#1017)
* Create new helper struct for trackdirection

* Split up into clear road or track

* Try name offsets where possible

* Update with knowledge from track branch
2021-08-17 07:15:40 +01:00
Duncan 6e74345b08
Remove track Construction Window (#1110)
* Implement track removal

* Add road equivalent connections

* Implement removeRoad
2021-08-17 07:14:50 +01:00
Duncan ef420ec6e6
Construction Window StationTab toolDown (#1105)
* Implement airport toolDown

* Implement dock toolDown

* Tidy up

* Refactor and use alternative simpler search

* Implement roadStation toolDown

* Implement trainStation toolDown

* Revert vehicle body changes as no longer required

* Include correct headers

* Fix off by one error
2021-08-16 21:11:15 +01:00
Duncan 191e6d567c
Implement constructTrack (#1109) 2021-08-16 19:47:02 +01:00
Duncan f4f3d0d72c
Implement various manager resets (#1112) 2021-08-16 14:19:53 +01:00
Aaron van Geffen 51789bd329
Implement RoadElement::update (#1106) 2021-08-16 15:19:02 +02:00
Margen67 14edc842b6
CI improvements (#1107)
Add workflow_dispatch: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
Remove unneeded brackets and shell.
Windows:
 Opt out of PowerShell telemetry.
 Use default ErrorView.
 Simplify vswhere commands.
 Add -m to msbuild.
 Fix typos in artifact steps.
 upload-artifact:
  Use v2.
  Use runner.os in name.
Use -B instead of mkdir where applicable.
upload-artifact:
 Remove unneeded quotation marks.
 Add if-no-files-found: error
mac:
 Add name.
 Require check-code-formatting like other jobs.
 Remove unneeded shell.
 Add names to steps.
 Make dependency version into variable.
 Don't hardcode job number.
 Use tar instead of zip.
2021-08-15 13:18:19 +01:00
Duncan 3c4937e7ca
Fix road dropdown not remembering selection (#1108)
* Fix road dropdown not remembering selection

Incorrectly signed type was causing comparisons of equality to fail

* Update changelog
2021-08-14 14:20:48 +01:00
duncanspumpkin 29b405007e Start v21.08+ 2021-08-12 22:14:56 +01:00
duncanspumpkin 7aecfa55ef Update OpenLoco version to v21.08 2021-08-12 22:11:49 +01:00
Marijn van der Werf 9c24c21227
Compile macOS builds (32-bit) using osxcross (#924)
* Compile macOS release using osxcross

* Symlink system

* Remove modules bit

* Include YAML dir

* Conditionally build icns

* Merge yaml-cpp branches in cmakelists

* Move toolchain file
2021-08-12 23:03:25 +02:00
Duncan 22cf266773
Introduce doCommand template (#1082)
* Introduce doCommand template

* Continue using template

* Swap around arguments

* Add remaining structs

* Start next batch

* Fix rebase issues and mistake
2021-08-12 22:00:35 +01:00
Duncan f2f9719b75
AnimationManager and WaveManager split (#1097)
* Move wave and animations into seperate manager

* Add game state knowledge

* Move update functions to managers

* Move reset to manager

* Cleanup and implement reset

* Implement Wave Manager update

* Hook create wave earlier to improve interface
2021-08-12 13:35:25 +01:00
Duncan cba3bd06d1
Fix: #366. Implement deliver cargo to nearby stations (#1101)
* Fix: #366. Implement deliver cargo to nearby stations

Original game had a bug where it would write to bad memory and end up
delivering cargo to stations that it shouldn't

* Add note and break

* Update changelog

* Adjust variable name
2021-08-12 11:52:41 +01:00
Aaron van Geffen 44f5210c2f
Prevent invalid filename due to off-by-one in file browser (#1102) 2021-08-11 23:16:49 +02:00
Duncan 8026daa22c
Fix #1099: Unable to place signal properly (#1103)
Actually pass the mouse position to the side calculator.
2021-08-11 23:15:09 +02:00
Duncan 904abdecce
Building tile element update (#1100)
Co-authored-by: Marijn van der Werf <marijn.vanderwerf@gmail.com>
2021-08-11 20:52:21 +01:00
Duncan 498911fd81
Implement base of TileManager::update (#1098)
Co-authored-by: marijnvdwerf
2021-08-10 20:45:57 +01:00
Aaron van Geffen f7fcba0e6a
Implement more company manager functions (#1096)
* Minor refactor to use isPlayerCompany

* Implement CompanyManager::reset (add hook?)

* Replace instances of second getOwnerStatus signature

* Implement CompanyManager::getOwnerStatus
2021-08-10 21:35:01 +02:00
Aaron van Geffen ae294ad80e
Only use red text colour for expenditure sums (#1095) 2021-08-10 15:14:01 +02:00
Duncan 8461ad721b
Implement construction open At functions (#1094)
* Implement openAtTrack

* Split up functions for reuse

* Implement openAtRoad

* Minor refactorings

* Update changelog
2021-08-10 11:53:41 +01:00
Duncan 80952a1c99
Implement Signal toolUpdate/Down (#1093)
* Start implementing toolUpdate signal

* Implement getSide and finish signal tool update

* Implement signal toolDown

* Actually name the game command

* Use correct global address
2021-08-10 05:57:25 +01:00
Duncan 99049e5fab
Track/Road Mods Tool Update/Down (#1092)
* Implement road overhead tool down

* Implement track mod tool down

* Implement overhead tool update

* Apply review comments
2021-08-09 13:04:41 +01:00
Duncan b08815aeaf
Pass by ref Gfx::rect functions (#1091)
* fillRect pass context by ref

* drawRect pass context by ref

* draw/fillRect pass context by ref

* drawLine pass context by ref
2021-08-08 20:43:23 +01:00
Duncan 8333ece44e
Interaction rightOver (#1071)
* Start implementing interaction rightOver

* Implement rightOverTrackExtra

* Implement rightOverSignal and TrackStation

* Implement rightOver road extra station

* Implement rightOver airport dock

* Implement rightOver Tree Wall

* Implement rightOver Headquarters BuildingConstruct

* Implement rightOverBuilding remove call

* Minor refactor and naming

* Make gcc happy

* Fix conditional

* Use ternary
2021-08-08 20:42:53 +01:00
Duncan bd794b21dc
Implement the last company window function (#1077)
* Implement the last company window function

* Rename

* Remove pointless loop

* Fix off by 2 error
2021-08-08 20:42:28 +01:00
Duncan 4e3f77a1d9
Construction Window Tab1 Refactor (#1086)
* Split up two functions

* Rename and split off duplications

* Reorg and label

* Extract out function

* Reintroduce code back from function

* Split out function

* Remove dead code

* Integrate function into base code

* Split out into function

* Refactor track similarly

* Consolidate into one templated function

* Pass by ref

* Fix compile error

* Add missing static
2021-08-08 13:39:57 +01:00
Duncan e698c13357
Implement Clip Context (#1072)
* Implement clipContext

* Switch over all callers to use new version
2021-08-08 13:33:58 +01:00
Aaron van Geffen 139eebf1c0
Make tree clusters cost money outside editor (#1089)
* Change: tree clusters now cost money outside editor

* Query viability before executing placement command

* Fix error title for cluster tools

* Only play sound if tree planting was successful

* Refactor the tree cluster tool to use one templated func

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-08-08 13:56:35 +02:00
Duncan f5494630c6
Ui::Point (#1088)
* Introduce Ui::Point and Ui::Point32

* Remove xy32 replace with Point / Point32

* Remove empty file

* Fix compiler error

* Rename UiSize to Size
2021-08-08 12:46:27 +01:00
Duncan b427523621
Townlist (#1090)
* Close #1039. Implement removeBuildingGhost

* Implement placeBuildingGhost

* Close #1040. Implement town toolUpdate

* Close #1041. Implement town toolDown

* Fix bug

* Add missing title
2021-08-08 11:09:48 +01:00
Duncan 33c28eff12
Pass context by ref for all string functions (#1087) 2021-08-06 19:54:52 +01:00
Duncan 43b670507d
Vehicle Tool Down (#1084)
* Implement air tool down

* Implement pickup tool down water

* Implement pickup tool down land

* Fix broken land placement
2021-08-06 09:24:52 +01:00
Aaron van Geffen a57af0e1f1
Implement removeTree game command (#1083) 2021-08-05 23:44:18 +02:00
Duncan 4c54152737
Prevent implicit conversions from Pos2 and xy32 (#1051) 2021-08-05 22:17:54 +01:00
Duncan 3616ec0f7d
Modify drawScroll event to pass by reference (#1085) 2021-08-05 22:17:31 +01:00
Duncan da39ecf082
Terraform2: Clear and Water tools (#1081)
* Implement terraform clear area tool update

* Implement terraform water update

* Implement missing function, fix compile issue

* Fix rebase issues
2021-08-05 18:52:39 +01:00
Duncan b756c2e440
Implement Tree and Wall toolUpdate Down (#1078)
* Implement Wall toolUpdate Down

* Start implementation of tree tool Update Down

* Continue

* Finish scatter down

* Refactor trig function into Math file

* Implement second cluster tool function

* Name tree flags where possible

* Add land object flags

* Try alternative constant

* Add missing error titles and widget checks

* Add missing error title from industrylist

* Clang format

* Simplify sine wave
2021-08-05 16:06:58 +01:00
Duncan c82281540f
VehicleHead::updateLoadCargo (#983)
* Implement cargo load function

* Fix loop

Fix minor issues

Fix cargo rating mistake
2021-08-05 12:55:31 +01:00
Duncan 17bd0e605c
Implement bringToFront (#1068) 2021-08-05 10:37:00 +01:00