Commit Graph

296 Commits (1ba4dcc92458b078dc869d381075b6c071221950)

Author SHA1 Message Date
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
1 year ago
Peter Nelson e5af5907ec Change: Make all dropdown lists extend width if necessary.
This removes the auto_width parameter from ShowDropDown(At).
1 year ago
Tyler Trahan 066ae6f3fb Codechange: Simplify some CodeQL-flagged trivial switches 1 year ago
glx22 b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 1 year ago
Rubidium bcfe0fb076 Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
1 year ago
Jonathan G Rennison 1a05e95945 Fix #10214: League and graph buttons in toolbar not having a default action 1 year ago
dP 5e14a20b3b
Feature: [GS] Scriptable league tables (#10001) 2 years ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2 years ago
Peter Nelson dd9f6bc803 Change: Use RectPadding Horizontal()/Vertical() helpers. 2 years ago
Peter Nelson 04cbe57d2a Change: Use RectPadding for widget padding/uz_padding. 2 years ago
Peter Nelson 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2 years ago
Peter Nelson 632464a623 Codechange: Use Rect in DropDownListItem::Draw(). 2 years ago
Artin Alavi cbac243216
Feature: [UI] Split AI/Game Script configuration windows and add them to world gen window (#10058) 2 years ago
Peter Nelson dc1b84aa1e Cleanup: Text widgets are capable of drawing text without assistance.
Remove custom text drawing of some widgets in favour of standard text
widgets.
2 years ago
PeterN 0c20a5f39f
Fix: Open scenario editor date query once. (#10050)
Clearing `_left_button_clicked` causes the button callback to be fired
constantly while the mouse button is held.
2 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
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.
3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Danny de Bruijne 753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 3 years ago
Patric Stout cd03bac3dd
Fix: add back 'Spectate' option to company toolbar menu (#9556)
This was removed in ce7406f88b, but people used this to quickly
mark themselves as away.

Co-authored-by: dP <dp@dpointer.org>
3 years ago
Peter Nelson 63cc340dc1 Codechange: Apply minimum size to toolbar widgets 3 years ago
Patric Stout a924b2ff81 Add: move "New Company" inside the Online Players GUI 3 years ago
Patric Stout 5266359424 Feature: rework in-game Online Players GUI
The GUI now more clearly shows some basic information about the
server you joined, your client name (and the ability to change it),
and what players are in which company.

It also contains useful buttons to press to join companies, chat
with other people, and for admins to kick/ban people.

Additionally, renamed "advertised" to "visibility"; this has to
do with future additions, but also because it is more clear in
wording.
3 years ago
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
3 years ago
Patric Stout 85a49a0d36 Change: always allow to click on the toolbar icons for road/rail/dock/airport
This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
TechGeekNZ 3c8d0aa354 Cleanup: Give `TakeScreenshot` a more sensible name 4 years ago
TechGeekNZ ed6f31f601 Cleanup: Remove redundant implementation of TakeScreenshot 4 years ago
arikover 1e3e960fce Add: Hotkey for Land Info in normal mode
- added a hotkey for land_info in normal mode
- no default key is set
4 years ago
pnda e558aa8ff4 Feature: Screenshot window 4 years ago
glx 90f4abe03f Fix #7887: missing beep for some main toolbar buttons 4 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Peter Nelson 21edf67f89 Codechange: Untangle game and scenario toolbars. 5 years ago
pnda 8cc6ee60ed Add: Icons on air/water/landscape construction menus (#7485) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
peter1138 aafce47596 Codechange: Use override specifier for DropDownListItem classes. 5 years ago
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
5 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
5 years ago
peter1138 9cb84a1bad Feature: Add road icon to road construction drop down list. 5 years ago
peter1138 fb35cb5ed2 Remove: Unnecessary virtual destructors on drop down list items. 5 years ago
peter1138 811bf22620 Codechange: Use Colours type instead of byte. 5 years ago
Patric Stout 91eee793e1 Fix c3dbe836b4: also compile without ENABLE_NETWORK defined again 5 years ago
glx aadcf40b9b Fix 1585eb1a3: wrong default selection for goals and story book 5 years ago
Joan Josep 548ec05a48 Add: News menu entry and shortcut for deleting all messages. (#7240) 5 years ago