Commit Graph

246 Commits

Author SHA1 Message Date
Peter Nelson 0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Peter Nelson e18f688db5 Codechange: Remove various COMMA strings. 2023-05-05 07:07:54 +01:00
Peter Nelson 35ba49bfb4 Change: Rename text colour NWidgetPart to SetTextStyle and add font size.
This allows to set both text colour and size for any widget with default
drawing.
2023-04-30 11:47:53 +01:00
Rubidium c829930440 Codechange: replace strnatcmp with C++ string capable version 2023-04-29 12:07:45 +02:00
Patric Stout 36a0818bc5
Remove: buying/selling/owning company shares (#10709) 2023-04-29 10:16:49 +02:00
Charles Pigott 80bd5ad727
Codechange: Use std::strto* variants everywhere (#10720) 2023-04-26 12:56:14 +01:00
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
PeterN 018f0f63a6
Change: Centre company face in scaled widget. (#10688) 2023-04-21 19:54:04 +01:00
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
2023-04-15 13:58:55 +02:00
Peter Nelson 701092003d Fix: DropDownListColourItem didn't provide width nor scale vertical padding. 2023-04-13 20:57:47 +01:00
PeterN 2d3250923c
Fix #10554: Let Scrollbar::SetPosition clamp instead of assert. (#10555) 2023-03-09 10:19:58 -05:00
Rubidium 947a789bf6 Codechange: split large function into smaller steps and simplify logic 2023-02-25 23:57:36 +01:00
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
Rubidium b3b8c3fd2d Codechange: pass the randomizer to use directly to the company face generation 2023-01-14 22:00:11 +01:00
Rubidium 170f37d07f Codechange: silence some potentially uninitialized local variable errors
In these cases technically they are false positives, however dismissing the
alerts when the underlying code may make them true positives does not seem
like the safest solution.
2023-01-06 19:34:35 +01:00
Rubidium 496ec1f012 Fix: use reference and array indexing to prevent suspicious pointer scaling 2023-01-06 19:34:35 +01:00
Tyler Trahan 0d631a6fda Change: Reword Finance window's Net Profit to Profit 2022-11-13 19:01:43 -07:00
Tyler Trahan adf94d7970 Change: Add a Total caption to each category of the finance window 2022-11-13 19:01:43 -07:00
Tyler Trahan bba1a16836 Change: Make Company GUI Bank Balance text white 2022-11-13 19:01:43 -07:00
Peter Nelson 920e588334 Change: Use standard dimensions instead of custom widths. 2022-11-12 18:28:39 +00:00
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter Nelson 46a1ab0937 Change: Use Rect when drawing infrastructure window. 2022-11-12 18:28:39 +00:00
Peter Nelson 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Peter Nelson 632464a623 Codechange: Use Rect in DropDownListItem::Draw(). 2022-11-12 18:28:39 +00:00
Peter Nelson eb4ba1991b Change: Use CenterBounds function in more places.
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2022-11-12 18:28:39 +00:00
SamuXarick e604b76d18 Fix: List a max of four share owners instead of three
An AI company may have four different share owners, but the company information window is limited to display a max of three. This commit increases that limit.
2022-10-16 18:27:54 +02:00
PeterN d7ceb7efea
Change: Use widget string parameters for face window. (#10046)
The face window previously drew the buttons of face settings itself.
Instead we can provide parameters for each widget and let the widget
system draw the buttons.
2022-09-23 17:09:35 +01:00
Tyler Trahan a4e00c5cb5
Fix #9989: Zero Net Profit is neither negative nor positive (#9991) 2022-09-21 12:38:03 +02:00
Tyler Trahan 41de69c5b7 Feature: Improved Finance window 2022-04-25 21:51:51 +02:00
Rubidium c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2022-03-09 18:05:12 +01:00
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2021-12-16 22:28:32 +01:00
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
2021-12-16 22:28:32 +01:00
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 2021-05-29 21:08:25 +02:00
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 2021-05-27 18:30:56 +02:00
Peter Nelson de81afdf4b Cleanup: Replace FOR_ALL_SORTED_ROADTYPES macro with range iterator. 2021-04-28 23:54:31 +01:00
Peter Nelson 3b3d80c8ef Cleanup: Replace FOR_ALL_SORTED_RAILTYPES macro with range iterator. 2021-04-28 23:54:31 +01:00
Peter Nelson 994ffaa382 Codechange: Use alignment feature in company finances window. 2021-04-22 16:42:04 +01:00
Peter Nelson c361246bec Codechange: Replace face window custom drawing with new widget features. 2021-04-22 16:42:04 +01:00
Peter Nelson 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric Stout 62cdadb582 Change: move "give money" from client-list to company window
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.

This is based on work done by JGRPP in:
f820543391
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311

We did modify it to fix several bugs and clean up the code while
here anyway.

The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
2021-01-05 21:56:24 +01:00
Patric Stout d6e15d4943 Fix: make the "password" button the same size as the other buttons in Company window
Currently password-lock icon + button was the same size, but this
looks really weird. Now they are in sync, even with other fonts
and languages.
2021-01-05 21:56:24 +01:00
Patric Stout a3f0ee3b63 Codechange: fix alignment of Company GUI
Code acted as if WWT_TEXT starts a scope; it does not.
2021-01-05 21:56:24 +01:00
Patric Stout fc474b02fa Fix: change all Company planes on paint, not only the first that needs changing
Otherwise it can take a few OnPaint() calls before all planes are
set correctly when switching companies.
2021-01-05 21:56:24 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00