1
0
Fork 0
Commit Graph

384 Commits (3eb89f04b5b52fb7ce892ab0c341379dd3feaae7)

Author SHA1 Message Date
Peter Nelson 3eb89f04b5
Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Rubidium 0de7fd3c24 Codefix: check the result of dynamic_cast for nullptr 2025-03-09 19:35:14 +01:00
Peter Nelson b55af05626 Codechange: Pass encoded script strings as EncodedString.
This removes the ambiguity of having std::strings that may or may not be encoded.
2025-03-04 21:40:39 +00:00
Peter Nelson 92e4ef7e77 Codechange: Move to GetWidgetString for toolbar windows. 2025-03-03 22:34:22 +00:00
Peter Nelson edf9f597ec Codechange: Use parameterised GetString() for remaining windows. 2025-03-02 07:29:25 +00:00
Peter Nelson e2c1b9f03e
Codechange: Use only raw strings in drop down lists. (#13667)
Strings with parameters are now pre-formatted, avoiding global parameters.

Helper functions still allow StringID.
2025-02-27 21:11:16 +00:00
Rubidium 5cee804f98 Codechange: remove ZeroedMemoryAllocator from NWidgetBase 2025-02-22 14:38:33 +01:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Peter Nelson 3ade64954c
Change: Restore wider spacers in main toolbars. (#12039)
Width for all spacers was included only due to an off-by-one from counting buttons and not excluding the normally hidden switcher button.

Spacer width of quarter the button width is now included explicitly,
2025-02-16 14:51:07 +00:00
Rubidium ab8177ea77 Codechange: strongly type CompanyID 2025-02-16 14:02:18 +01:00
Rubidium 1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 2025-02-16 14:02:18 +01:00
Peter Nelson 6cf7a899e9
Codechange: Use EnumBitSet for PauseMode. (#13553) 2025-02-14 08:30:04 +00:00
Peter Nelson 20e57a02a2
Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Peter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Tyler Trahan b2f5a4901b
Add: Setting to allow placing houses manually in-game (#13266) 2025-02-09 18:34:31 +00:00
Rubidium ec492cb267 Codechange: make CompanyMask a BaseBitSet implementation 2025-02-09 19:24:51 +01:00
Rubidium 6c8915fdbc Codechange: strongly type LeagueTableID and LeagueTableElementID 2025-02-09 15:07:29 +01:00
Peter Nelson c3643e3ee0
Codechange: Pass raw string to editable query window. (#13481)
This avoids separating string id and parameters. EncodedString is not needed as it is the raw text that is editable.
2025-02-07 17:03:53 +00:00
Peter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson efb05396a7 Codechange: Use EnumBitSet for WindowFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson b70438b76a
Fix #13392: Signs of removed stations are no longer visible. (#13395)
Add "Ghost" option for station sign visibility.
2025-01-28 19:10:32 +00:00
Peter Nelson f6ab2b69c6
Codechange: Define GRFConfigList alias and pass by reference. (#13358)
This adds the distinction between a single GRFConfig and a GRFConfig list, and simplifies how GRFConfig lists are passed to various functions.
2025-01-22 22:30:32 +00:00
Peter Nelson 4c8f1b0f81
Add: Ability to toggle visibility of station signs by facility. (#13207) 2025-01-14 21:23:35 +00:00
Rubidium bfc8ae6c52 Codechange: use accessor for (scrollbar_)index as they are read only 2025-01-04 20:51:47 +01:00
Rubidium 99d790c4bb Codechange: split widget_data into its actual components 2025-01-04 11:33:24 +01:00
Rubidium d8d03212b8 Codechange: replace SetDataTip(SPR_ with SetSpriteTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidium 4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidium c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
Peter Nelson 98e980c478
Codechange: WWT_TEXT, WWT_LABEL and WWT_EMPTY don't use colour. (#13218)
Set colour for these widget types to INVALID_COLOUR to avoid giving the impression that the colour has a purpose.

A runtime exception is added to catch this the existing widget unit test.
2025-01-01 15:38:19 +00:00
Rubidium 3956ed086a Codechange: use Date/Year constructor explicitly 2025-01-01 16:25:32 +01:00
Peter Nelson 1ba0598a2c Codechange: Use _TOOLTIP suffix for scenario editor toolbar tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson 806831af46 Codechange: Use _TOOLTIP suffix for genworld tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson 100dd7b6d1
Codechange: Use find_if to get default writeable saveload format. (#12849)
* Codechange: Use find_if to get default writeable savegame format.

This removes the last of lastof, and so the lastof macro is removed.
2024-07-09 17:07:40 +01:00
Rubidium 14200212b7 Codechange: use std::optional<std::string> over char * for text query results 2024-06-29 16:33:16 +02:00
Peter Nelson 55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
Peter Nelson 4cf6d1dd79
Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
Peter Nelson ed67aedabf Feature: Allow manually placing town buildings in scenario editor.
House picker is accessed from the Landscaping toolbar as there is no town toolbar.

Once placed these houses behave like any other and can be removed by players and towns.

Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
2024-05-14 21:11:48 +01:00
Rubidium 4f3db8eeaf Feature: authorize specific clients to join network company without password 2024-05-07 00:03:15 +02:00
Peter Nelson de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00
Peter Nelson 2047c27445 Codechange: Move drop down list item definitions to separate header.
This reduces the scope of the definitions which are no longer needed to create the common lists.
2024-04-01 22:33:16 +01:00
Peter Nelson 56cac21086 Codechange: Use functions to create common drop down list items. 2024-04-01 22:33:16 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Loïc Guilloux 82470f5c0d
Codechange 80ebcc7: OptionMenuEntries prefix is OME not ONE (#12036) 2024-02-08 00:22:01 +00:00
Patric Stout 11f5ac72a9
Fix #12029: don't show Sandbox Options in multiplayer (#12032) 2024-02-08 00:33:24 +01:00
Patric Stout 80ebcc72fb
Change: rebrand Cheats as Sandbox Options (#11874) 2024-01-26 19:56:01 +01:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Peter Nelson 06a5fa6239 Codechange: Use CompanyMask to pass Companies to PopupMainCompanyToolbMenu().
It's like the type was designed for it.
2024-01-05 22:26:07 +00:00
Peter Nelson 6828b6014a Codechange: Use company group statistics to test for vehicles for drop down list state.
This avoids iterating full the vehicle pool to find out if a company has any vehicles of a particular type.
2024-01-05 22:26:07 +00:00