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
Peter Nelson
6f8e30c55d
Codechange: Use unique_ptr throughout instead of new raw pointer for company news data. ( #13148 )
...
The pointer was already captured and converted to a unqiue_ptr, but hidden within the call stack.
This now makes it clearer that the object passed to Add.*NewsItem will become owned by the news item.
2024-12-04 12:18:34 +00:00
Peter Nelson
0446123194
Change: Show company finances column if it has any values in it. ( #13112 )
...
This solves finances not being show if the company inauguration date is in the future.
Current period is now always shown in the same position instead of moving for the first 2 years.
2024-11-24 11:59:30 +00:00
Jonathan G Rennison
e477706bf5
Codechange: Add AssignBit function to assign the value of a single bit ( #12934 )
...
* Codechange: Add AssignBit function to assign the value of a single bit
* Codechange: Replace various uses of SB with AssignBit
* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00
Kaiden Joy
7a698c7f1c
Fix #12365 : Company Window now displays proper inauguration year and period while in wallclock mode.
2024-08-13 20:13:51 +02:00
Rubidium
fea9ffa808
Codechange: also allow removing clients from the company allow lists
2024-05-22 22:20:10 +02:00
Tyler Trahan
9f63b9f65d
Fix #12594 : Give descriptive error when company takeover fails due to vehicle limit ( #12676 )
2024-05-13 10:10:03 -04:00
Rubidium
a313676189
Doc: reason for using ::SendNet over ::Post in few cases
2024-05-09 21:51:26 +02:00
Rubidium
a9318cf653
Cleanup: remove UI for changing the password
2024-05-07 00:03:15 +02:00
Rubidium
66354ab9eb
Codechange: introduce allow list infrastructure for companies
2024-05-07 00:03:15 +02:00
Jonathan G Rennison
11ec156b64
Codechange: Add a priority field to TimerGameTick::TPeriod
...
Use this as the primary sort key for TimerGameTick::TPeriod,
to avoid container sort order changes on timer period saveload.
See: #12509
2024-04-25 20:08:24 +02:00
Loïc Guilloux
c5ef47ee09
Codechange: [Script] Use std::unique_ptr for Company::ai_instance ( #12544 )
2024-04-20 16:58:46 +02:00
Peter Nelson
197fb00d31
Fix #12395 : Ensure president name widget is tall enough. ( #12419 )
2024-04-04 17:56:16 +01:00
Peter Nelson
d683ec0183
Codechange: Move dropdown and slider out of widgets directory. ( #12403 )
...
Also shuffle headers to place widget includes near end.
This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Patric Stout
a3cfd23cf9
Codechange: rename byte to uint8_t ( #12308 )
2024-03-16 23:59:32 +01:00
Rubidium
bab5a8a787
Codechange: use std::source_location over __FILE__ and __LINE__ for Backup
2024-03-10 10:14:20 +01:00
Peter Nelson
912d7bd80e
Codechange: Give ColourShade values names instead of numbers.
2024-02-25 12:38:07 +00:00
Peter Nelson
ae3390fe48
Codechange: Add ColourShade enum.
2024-02-25 12:38:07 +00:00
Peter Nelson
0463d4c198
Codechange: Remove direct access to _colour_gradient.
...
Access is now through GetColourGradient, which ensures parameters are in range.
2024-02-25 12:38:07 +00:00
Damian Laczak
49c3215751
Fix #10983 : [AdminPort] Correct order of messages
2024-02-18 15:11:00 +01:00
Loïc Guilloux
977aba73be
Change: Store running AI config inside Company ( #12003 )
2024-02-09 22:55:49 +01:00
Jonathan G Rennison
cb13ee90ef
Fix: Second colour vehicle-type default liveries not being updated
...
When changing company default second colour
2024-02-04 07:14:39 +01:00
dP
897b59c158
Add: [GS] Allow to set max loan for each company separately ( #11224 )
2024-01-30 19:15:19 +01:00
merni-ns
5a88027a19
Feature: Infinite money mode ( #11902 )
2024-01-30 18:01:02 +00: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
c0ab436077
Codechange: Store Colours in Colours type. ( #11625 )
...
This reduces casts, some magic numbers, and introduces a bit of type-safety.
2024-01-21 13:23:04 +00:00
Peter Nelson
06050f7bb3
Fix: Pass townnameparts as parameter when testing townname based companyname. ( #11685 )
...
Length of returned string could vary and pass/fail the length check with a different
string than the final selection.
2024-01-04 23:10:54 +00:00
Peter Nelson
bfb4254226
Fix: Changing default livery did not propagate to group liveries.
...
#11614 attempted to address this but did not handle 2CC properly, and changes to the default livery were not handled.
2023-12-28 23:16:19 +00:00