Commit Graph

2053 Commits

Author SHA1 Message Date
Duncan f59a373168
Fix #914. Ships not marking stations as occupied (#917)
This would cause ships to never leave the approaching dock mode
2021-04-13 08:09:08 +01:00
Duncan d668605fda
Fix #915: Money subtractions with large values incorrectly calculated (#916)
Mistake in the currency struct caused large values to be interpreted as negatives
2021-04-12 12:30:26 +02:00
Aaron van Geffen dfdb813f67 Start v21.04+ 2021-04-10 22:32:46 +02:00
Aaron van Geffen 84090672d7 Update OpenLoco version to v21.04 2021-04-10 21:40:06 +02:00
Duncan 4b551cff23
Update changelog for #391 2021-04-10 21:35:24 +02:00
Duncan 329e60f1fb
Stop looking for order station after finding one (#909)
This was causing the incorrect order station to show as where a vehicle was travelling to
2021-04-09 08:39:22 +01:00
Duncan 7b279f3be5
Move label frame out into standalone file (#902) 2021-04-07 21:34:42 +01:00
Aaron van Geffen 999c37e1b6
Use logical string comparison for vehicle list order (#900)
* Use logical string comparison for vehicle list order

* Convert to a string_view version of function

* Implement our own from_chars for unsuported platforms

Co-authored-by: Ted John <ted@brambles.org>
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-07 22:24:08 +02:00
Duncan 2bf5d70c78
Enforce coding style for messages (#905)
* Enforce coding style for messages

* Readd c header for size_t
2021-04-07 12:43:02 +01:00
Duncan 4e56aa84c7
Enforce coding style on Station (#903) 2021-04-07 11:00:11 +01:00
Duncan 963cb9d785
Enforce coding style on company names (#901) 2021-04-06 22:12:02 +01:00
Aaron van Geffen dc86bddbf4
Fix vehicle list offsetting rows being off by 2px per row (#899) 2021-04-05 22:03:40 +02:00
Duncan d170de22f0
Fix off-by-one in vehicle list bounds check (#898) 2021-04-05 21:53:04 +02:00
Aaron van Geffen 8b642c07a4
Fix vehicle pickup tool abort event (#897)
The condition is slightly different from an inverted isPlaced.
Regression from #889.
2021-04-05 21:14:40 +02:00
Duncan 2545e8050a
Industry coding style (#896)
* Rename industry to Industry and rework header

* Rename industry_id_t to IndusrtyId_t
2021-04-05 13:14:16 +01:00
Duncan e8f001f3db
Name Vehicle Status fields 2 and 3 (#895) 2021-04-05 12:56:55 +01:00
Duncan 9d180574e5
Town coding style (#893)
* Rename town to Town

* Rename town_id_t to TownId_t

* Rename town_size to TownSize
2021-04-05 12:34:46 +01:00
Peter Gaal 3e23caad85
Fix #884: UTF8 problems with path in Windows (#885) 2021-04-05 11:16:51 +02:00
Duncan e6843199bc
VehicleHead::getStatus (#890)
* Start work on getStatus

* Finished implementing getStatus
2021-04-05 07:48:39 +01:00
Aaron van Geffen c9b5d5148f
Implement the vehicle list window (#878)
* Implementing open function

* Implement widgets, stub events.

* Implement company switching (mouse down, dropdown events)

* Implement update and tooltip events.

* Implement remaining events

* Implement tab and sort mode switching.

* Implement prepareDraw and draw events.

* Implement VehicleList::drawTabs

* Implement refreshVehicleList

* WIP updateVehicleList

* Fix vehicle type checking

* Implement orderByProfit

* Implement orderByAge

* Implement orderByReliability

* Implement onScrollMouseDown

* Implement drawScroll event

* WIP onScrollMouseOver

* Move generateCargoTotalString into VehicleHead

* Finish onScrollMouseOver

* Use VehicleType type in more places.
2021-04-04 20:13:43 +02:00
Duncan ee3172afae
Merge pull request #889 from AaronVanGeffen/cleanup/isplaced
Cleanup isPlaced instances; move generateCargoTotalString
2021-04-04 18:56:31 +01:00
Duncan 6d3d05a3e5
Fix load save window crashing Windows builds (#888)
Sub_441FA7 in a lot of situations will cause a crash this prevents just one of them which is gauranteed to happen. It is quite likely that there are other crashes here that will still happen. Full implementation of all callers and the function will need to be done before we can be confident that there is no sources of crashes here
2021-04-04 18:55:30 +01:00
Aaron van Geffen 73b504d21b
Set regs.ebx for loadSaveQuit and togglePause game commands. (#887)
Fixes #886
2021-04-03 07:37:56 +01:00
Aaron van Geffen a245793271 Move generateCargoTotalString into VehicleHead 2021-04-02 21:29:43 +02:00
Aaron van Geffen 701b18364a
Name Vehicle1 and Vehicle2 fields; minor cleanup (#881)
* Name Vehicle1::dayCreated

* Name Vehicle2::profit array (var_62 to var_6E)

* Replace _tooltipTimeout globals with Input::setTooltipTimeout

* Remove duplicate vehicle status function (sub_4B671C)
2021-04-02 10:17:01 +02:00
Peter Gaal 2876fc6e2f
Fix grammatical error in string 2099 (#882) 2021-04-01 21:52:41 +01:00
Aaron van Geffen d6e13ceed3 Refactor instances of isPlaced into VehicleHead member function 2021-04-01 17:33:02 +02:00
Aaron van Geffen 6ea518d149
Name VehicleHead var_22 (name) and var_44 (ordinalNumber) (#880) 2021-04-01 16:27:56 +02:00
ζeh Matt 6af0b6e6b1
Rename argswrapper to ArgsWrapper and simplify usage (#875) 2021-03-31 23:36:45 +02:00
Aaron van Geffen e665e9b32d
Merge pull request #828 from AaronVanGeffen/gc/loadsavequit
Implement the PromptSave window and the LoadSaveQuit and TogglePause game commands.
2021-03-31 23:29:35 +02:00
Aaron van Geffen 7ca7e1433c Implement GameCommand::pause_game 2021-03-31 23:23:26 +02:00
Aaron van Geffen c010ef6c7d Address reviewer comments 2021-03-31 23:23:26 +02:00
Aaron van Geffen 7552704846 Expose and use CompanyManager::setControllingId 2021-03-31 23:23:26 +02:00
Aaron van Geffen 7dafa196df Implement confirmSaveGame 2021-03-31 23:23:26 +02:00
Aaron van Geffen b0c1ba2fda Implement the loading branch of the LoadSaveQuit command 2021-03-31 23:23:26 +02:00
Aaron van Geffen 810ffbfeeb Implement quitting (networked) games
Add noreturn attribute to exitCleanly to avoid hitting compiler warnings.
Disable MSVC warning 4702 for related reasons.
2021-03-31 23:22:53 +02:00
ζeh Matt fbcaae5f1a
Move GameCommands.h and cpp into GameCommands folder (#877) 2021-03-31 17:17:46 +02:00
Duncan b44c0921f2
Vehicle update 2 Part 4f: Implements landReverseFromSignal and sub_4AA36A (#847)
* Implement landReverseFromSignal

* Implements sub_4AA36A

* Add further comments and label where possible

* Add note
2021-03-31 15:01:51 +01:00
Duncan a7c0800ec2
Add bounded add/subtract to simplify some field updates (#861)
* Add bounded add/subtract to simplify some field updates

* Make bounds STL compatabile

* Add cstdint

* Add compile time checks to bound check
2021-03-31 14:49:43 +01:00
Aaron van Geffen abaee38a8a
Fix route tab not being displayed as active (#873) 2021-03-31 15:48:15 +02:00
Duncan ded2ea28d4
Fix rebase issue in applyPaymentToCompany (#874) 2021-03-31 15:41:09 +02:00
ζeh Matt 92ca3ac490
Minor refactor work in TileManager.cpp (#852) 2021-03-31 14:23:11 +01:00
Duncan 8abc9679b1
Implement applyPaymentToCompany (#867)
* Implement applyPaymentToCompany

* Refactor to remove global variables
2021-03-31 14:10:24 +01:00
Duncan 839d7f34bf
Use a map_pos3 for game command position and add accesors (#872) 2021-03-31 14:08:56 +01:00
Duncan 83779ba719
Move fastSquareRoot to Math folder (#862)
* Move fastSquareRoot to Math folder

* Take on suggestions
2021-03-31 14:08:33 +01:00
Duncan cbfca1475b
Implement create money effect (#869)
* Implement create money effect

* Move where functions are located

* Fix compile issues

* Remove unused using
2021-03-31 13:57:47 +01:00
ζeh Matt 2b87ecbb34
Use correct declaration for company_id_t[2] at 0x00525E3C (#870)
* Use correct declaration for company_id_t[2] at 0x00525E3C

* Add iterator trait info in loco_global_iterator
2021-03-31 13:50:30 +01:00
ζeh Matt f45c89672a
Use std::vector for height map in map generator (#871) 2021-03-31 13:49:42 +01:00
Duncan d710ee10e5
Remove a thing (#868)
* Move things into entities folder

* Rename files to entity

* Make compilable

* Change namespace to EntityManager

* Rename enums and constants

* Rename class to EntityBase

* Rename classes to EntityList...

* Continue rename

* And more renames

* Further enforcing the style

* Rename thing_id_t to EntityId_t

* More minor renames
2021-03-31 06:26:12 +01:00
Aaron van Geffen 19cf4d082a
Merge pull request #831 from AaronVanGeffen/feature/tile-inspector
Implement a basic tile inspector
2021-03-29 17:37:45 +02:00