Cyprian Klimaszewski
d405e4cb09
Codechange: Use proper widget type and update widgets properly ( #14870 )
...
For vehicle window.
2026-01-08 22:31:00 +00:00
Rubidium
2e6f8fe191
Codefix: use constructor to set index of PoolItems over 'magic'/UB
2026-01-03 16:04:32 +01:00
Rubidium
ee9e8ab9b2
Codechange: replace 'new (index) PoolItem(...' with 'PoolItem::CreateAtIndex(index, ...'
2026-01-03 16:04:32 +01:00
Rubidium
2fcd4e189a
Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...'
2026-01-03 16:04:32 +01:00
Peter Nelson
ebbb7cf3e9
Codechange: Pass company ID to SubtractMoneyFromCompany. ( #15018 )
...
This avoids needing to backup and restore `_current_company` just for SubtractMoneyFromCompany to use it.
2026-01-03 09:33:37 +00:00
Rito12
f57c2cc56e
Fix: Company query popups do not update in multiplayer.
2026-01-01 16:53:26 +01:00
Cyprian Klimaszewski
99f04f27de
Doc: Update information for receiving a copy of GPL. ( #14869 )
2025-12-07 11:25:08 +00:00
Peter Nelson
73660bfaf2
Codechange: Replace favorite with favourite.
2025-11-18 00:02:48 +00:00
Peter Nelson
34bbae05db
Codechange: Use enum/EnumBitSet for livery in use flags. ( #14746 )
...
Replaces magic numbers.
2025-11-01 14:25:24 +00:00
Peter Nelson
5c89dff677
Codechange: Iterate road/tram masks instead of checking each type. ( #14716 )
2025-10-23 20:59:58 +01:00
Peter Nelson
75ca1e3cda
Fix a46a3a97f3: Incorrect parameter order for CmdSetCompanyManagerFace.
...
Style and bits were mixed up. Switch everything to style first, as the most significant parameter.
2025-10-19 17:32:48 +01:00
Rubidium
7c0f69a8fe
Codefix: typos in comments and strings
2025-08-31 10:30:37 +02:00
Peter Nelson
8e2df7809b
Codechange: Add distinct type to hold pixel drawing colour. ( #14457 )
...
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Peter Nelson
df5237e721
Fix: Vehicle liveries did not update when switching company. ( #14456 )
...
Vehicle liveries must be refreshed if "Show vehicle-type specific liveries" is set to "Own company".
2025-07-18 23:43:07 +00:00
Peter Nelson
a46a3a97f3
Change: New company face definition system and UI. ( #14319 )
...
Bits used by company faces are now defined by a variable system instead of being hardcoded, allowing future expansion.
The four face types covering gender and skin colour are now separate face styles with their own definitions.
2025-06-24 07:59:49 +01:00
Jonathan G Rennison
63f1c2aa3a
Codechange: Use TypedIndexContainer for typed index containers
...
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
Peter Nelson
156f98ba06
Fix #14256 , dfd9fbf873: Company finance windows not updated when paused. ( #14258 )
...
Refresh company finance windows via a WindowTimer instead of in game loop.
As the invalidation affects multiple windows this is a global timer instead of window-specific.
2025-05-13 01:23:27 +01:00
frosch
0d5b3ebd7f
Codechange: Declare all IntervalTimers const, which can be const.
2025-05-06 18:29:41 +02:00
Peter Nelson
aa9e8b422c
Fix #14166 , dfd9fbf873: Loan was no longer invalidated when refreshing finance window. ( #14168 )
...
In most cases the company loan does not change, but it should be updated in case it does.
2025-04-29 23:52:11 +01:00
Peter Nelson
4a5db57f7b
Fix #14107 : Mark the company value in the company view window dirty when it changes. ( #14112 )
2025-04-26 11:56:11 +00:00
Peter Nelson
dfd9fbf873
Codechange: Defer refreshing company finance windows. ( #14111 )
...
During each game tick every cargo payment will issue an Invalidate of the status bar and company finance window. While this doesn't paint the window yet, it does need to search for open windows, and then mark a area of dirty blocks, which is done for every Invalidate.
Instead, set a bit in a CompanyMask, and test these bits once after the game tick is complete.
This reduces the amount of dirtying, and allows more specific widgets to be dirtied instead of the whole window.
2025-04-26 10:50:51 +00:00
frosch
cde350dc01
Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette.
2025-04-18 23:41:37 +02:00
Peter Nelson
79ef4e98fe
Codechange: Use std::swap() instead of Swap() ( #13883 )
2025-03-24 23:47:34 +00:00
Peter Nelson
fc7b6c6cbb
Codechange: Use .fill() to clear an array instead of assigning a new array. ( #13880 )
...
Avoids allocating a temporary on the stack.
2025-03-23 22:09:45 +00:00
Björn Wärmedal
dc343ca141
Fix: GenerateCompanyName sends incorrect renaming event ( #13794 )
2025-03-13 08:24:35 +00:00
Peter Nelson
2c211630cb
Fix #13759 : Really don't set error owner to OWNER_TOWN. ( #13761 )
2025-03-07 23:35:28 +00:00
Loïc Guilloux
c5e01c1907
Fix: More AI than max_no_competitors could start with competitors_interval=0 ( #13670 )
2025-03-03 13:39:31 +01:00
Rubidium
09716dba75
Codechange: do not use MallocT for the pool
...
Needed to make the placement new operator use Tindex over size_t because of
ambiguity for the delete operator variant that also has the size.
2025-02-28 20:15:42 +01:00
Peter Nelson
6e10584b91
Codechange: Use EncodedStrings for News messages. ( #13654 )
2025-02-23 20:24:02 +00:00
Rubidium
24a7cde9cc
Codechange: explicitly initialise Company member variables
2025-02-22 16:33:05 +01:00
Rubidium
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Rubidium
380e7b48ce
Codechange: use std::variant instead of a custom version for news references
2025-02-16 14:50:15 +01:00
Rubidium
ab8177ea77
Codechange: strongly type CompanyID
2025-02-16 14:02:18 +01:00
Rubidium
5401ab1f7b
Codechange: use ReferenceThroughBaseContainer for containers that are index by 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
2d7d085e8e
Codechange: Use EncodedString for error messages. ( #13569 )
2025-02-16 10:04:32 +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
Rubidium
c3d5e6d2a0
Codechange: Use EnumBitSet for DoCommandFlags
2025-02-14 00:28:57 +01:00
Rubidium
37c215f1fd
Fix #13513 , ec492cb267: std::numeric_limits<CompanyMask> not working causes no vehicles to exist
...
std::numeric_limits<T>::max() returns 0 instead of an error when the type is unknown.
Solve it by implementing and using Set() and All() in BaseBitSet in same way as std::bitset.
2025-02-09 22:50:55 +01:00
Rubidium
ec492cb267
Codechange: make CompanyMask a BaseBitSet implementation
2025-02-09 19:24:51 +01:00
Peter Nelson
9a6fc4eb76
Codechange: Use enum class for NewsReferenceType.
2025-02-07 19:36:52 +00:00
Peter Nelson
ca75a8ce19
Codechange: Use enum class for NewsType.
2025-02-07 19:36:52 +00:00
Peter Nelson
eaa765d615
Codechange: Disentangle news window style from news flags. ( #13482 )
...
This avoids NewsFlags being used as both bitmask and bitstuffed data.
2025-02-07 13:10:39 +00:00
Rubidium
2c7b3bb55d
Codechange: rename ClientIndex to ClientPoolID
2025-02-01 11:15:51 +01:00
Rubidium
4ca1fe6c32
Codechange: replace MAX_UVALUE with std::numeric_limits::max
2025-02-01 01:29:02 +01:00
Rubidium
29129e12fd
Add: [Script] Event for when a company's president name changes
2025-01-14 11:35:35 +01:00
Björn Wärmedal
9ab936f76b
Add: [Script] ScriptEventCompanyRename ( #12878 )
2025-01-14 09:24:28 +00:00
Rubidium
65731bb964
Codechange: use SPECSTR_..._END over _LAST, to prevent + 1 everywhere
2025-01-04 21:06:07 +01:00
Peter Nelson
e9e603b4fd
Codefix: Company name is a StringID. ( #13224 )
...
StringID was passed to Company's constructor as a uint16_t.
2025-01-01 20:16:59 +00:00
Peter Nelson
1e77fd0b61
Codechange: Remove unnecessary 'return_cmd_error` macro. ( #13160 )
...
This macro is a leftover from when errors used to be packed into a single int32_t.
`return CommandCost` is clearer, and doesn't need a macro.
2024-12-08 18:02:30 +00:00