Commit Graph

347 Commits

Author SHA1 Message Date
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00: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 e5af5907ec Change: Make all dropdown lists extend width if necessary.
This removes the auto_width parameter from ShowDropDown(At).
2023-04-13 20:57:47 +01:00
Tyler Trahan 066ae6f3fb Codechange: Simplify some CodeQL-flagged trivial switches 2023-03-25 18:03:16 -04:00
glx22 b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2023-02-05 19:27:25 +01:00
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.
2023-01-14 21:15:23 +01:00
Jonathan G Rennison 1a05e95945 Fix #10214: League and graph buttons in toolbar not having a default action 2022-12-16 21:07:36 +01:00
dP 5e14a20b3b
Feature: [GS] Scriptable league tables (#10001) 2022-11-26 18:03:03 +01:00
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter Nelson dd9f6bc803 Change: Use RectPadding Horizontal()/Vertical() helpers. 2022-11-12 18:28:39 +00:00
Peter Nelson 04cbe57d2a Change: Use RectPadding for widget padding/uz_padding. 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
Artin Alavi cbac243216
Feature: [UI] Split AI/Game Script configuration windows and add them to world gen window (#10058) 2022-11-10 21:39:09 +01:00
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.
2022-10-16 14:24:51 +02:00
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.
2022-09-25 16:08:52 +01:00
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining 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 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Danny de Bruijne 753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 2021-09-23 21:03:00 +02:00
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>
2021-09-18 20:27:56 +02:00
Peter Nelson 63cc340dc1 Codechange: Apply minimum size to toolbar widgets 2021-04-30 17:08:15 +01:00
Patric Stout a924b2ff81 Add: move "New Company" inside the Online Players GUI 2021-04-24 21:43:58 +02:00
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.
2021-04-24 21:43:58 +02:00
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
2021-02-28 18:04:51 +00:00
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.
2021-01-08 16:43:51 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
TechGeekNZ 3c8d0aa354 Cleanup: Give `TakeScreenshot` a more sensible name 2020-06-27 14:19:35 +01:00
TechGeekNZ ed6f31f601 Cleanup: Remove redundant implementation of TakeScreenshot 2020-06-27 14:19:35 +01:00
arikover 1e3e960fce Add: Hotkey for Land Info in normal mode
- added a hotkey for land_info in normal mode
- no default key is set
2020-04-10 10:00:16 +02:00
pnda e558aa8ff4 Feature: Screenshot window 2020-01-01 10:19:12 +00:00
glx 90f4abe03f Fix #7887: missing beep for some main toolbar buttons 2020-01-01 10:34:26 +01:00
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Peter Nelson 21edf67f89 Codechange: Untangle game and scenario toolbars. 2019-05-01 21:36:27 +02:00
pnda 8cc6ee60ed Add: Icons on air/water/landscape construction menus (#7485) 2019-04-29 18:42:00 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
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.
2019-04-09 22:45:15 +02:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
peter1138 aafce47596 Codechange: Use override specifier for DropDownListItem classes. 2019-03-24 16:10:04 +01:00
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.
2019-03-24 16:10:04 +01:00
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.
2019-03-20 19:24:55 +01:00
peter1138 9cb84a1bad Feature: Add road icon to road construction drop down list. 2019-03-10 10:31:37 +00:00
peter1138 fb35cb5ed2 Remove: Unnecessary virtual destructors on drop down list items. 2019-03-10 09:20:11 +00:00
peter1138 811bf22620 Codechange: Use Colours type instead of byte. 2019-03-10 09:20:11 +00:00
Patric Stout 91eee793e1 Fix c3dbe836b4: also compile without ENABLE_NETWORK defined again 2019-02-24 01:11:08 +01:00
glx aadcf40b9b Fix 1585eb1a3: wrong default selection for goals and story book 2019-02-17 16:04:52 +01:00
Joan Josep 548ec05a48 Add: News menu entry and shortcut for deleting all messages. (#7240) 2019-02-16 23:15:58 +00:00
glx 1585eb1a3e Fix: use more descriptive "spectator" strings for story book and goal dropdown menus 2019-02-16 22:19:16 +01:00
glx 8e7fe3973f Add: CompanyCtrlAction enum for CMD_COMPANY_CTRL actions 2019-02-04 21:08:36 +01:00
PeterN c3dbe836b4
Add: Draw network password indicator lock in company drop down list. (#7079) 2019-01-22 12:42:52 +00:00
Peter Nelson 806e7d25dd Change: Use GUITimer class instead of bare int/uints. 2019-01-11 11:56:21 +00:00
Peter Nelson 2a8fa5fef9 Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks. 2019-01-11 11:56:21 +00:00
Niels Martin Hansen 2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2018-07-19 21:17:07 +02:00
Joan Josep 944f785be8 Fix: Spelling errors (#6769) 2018-04-30 18:52:32 +02:00
frosch 30574a7cad (svn r27671) -Codechange: Replace magic numbers in the toolbar with the already existing WID_TN_xxx. (Wolf01) 2016-10-30 17:36:57 +00:00
alberth 0adfb1ac6f (svn r27653) -Fix(r27647): Rename FileOperation enum and values to SaveLoadOperation to avoid nameclash with windows compiler toolkit. 2016-09-04 16:06:50 +00:00
alberth 88bdf482c0 (svn r27648) -Codechange: Remove remaining _saveload_mode usage. 2016-09-04 12:56:56 +00:00
frosch ca6493f2e6 (svn r27626) -Codechange: Do not use the cursor sprite as PlaceObject status in the main toolbar. 2016-08-15 18:32:25 +00:00
frosch 780e595933 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 2015-03-07 18:27:01 +00:00
frosch 64e943d32a (svn r27150) -Fix (r27146): Forgot scenario toolbar. 2015-02-14 21:22:47 +00:00
frosch e113f5e4a1 (svn r27146) -Fix: Make statusbar and chat-entry window use the same width as the toolbar. Otherwise they lack a size definition. 2015-02-13 21:13:45 +00:00
frosch 33f4f0b464 (svn r26986) -Change: Rename 'Advanced Settings' to just 'Settings'. 2014-10-09 21:16:29 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 167f232623 (svn r26314) -Fix [FS#5899]: The giant-screenshot confirmation window only triggered for rediculously big screenshots, for ludicrously big ones. 2014-02-06 22:24:02 +00:00
rubidium f480c5a623 (svn r26217) -Change: blitter autoselection based on full animation state, so the non-animated optimizations can actually be used in an easy manner (based on patch by MJP) 2014-01-03 08:51:49 +00:00
rubidium 83eeba28b7 (svn r26086) -Codechange: use AutoDeleteSmallVector instead std::list for dropdowns 2013-11-24 14:46:26 +00:00
fonsinchen 5ab204c8a1 (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 2013-10-15 17:32:31 +00:00
zuu a8c9322729 (svn r25772) -Add: Additional layered main toolbar arrangement 2013-09-14 12:58:58 +00:00
zuu 4e74a4c5cc (svn r25761) -Change: Disable story/goal buttons when there is no content to show instead of when there is zero companies 2013-09-13 12:45:25 +00:00
frosch 5cb174c6b8 (svn r25412) -Codechange: Make use of Window::OnHotkey 2013-06-15 15:30:44 +00:00
frosch 1b8b1f3f6c (svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member. 2013-06-15 15:28:09 +00:00
frosch d9e9710cb3 (svn r25408) -Codechange: Simplify hotkeys by removing unused stuff. 2013-06-15 15:27:33 +00:00
zuu be8645e137 (svn r25383) -Fix (r25376): Remove now redundant menu entries for story book and goals 2013-06-09 15:36:31 +00:00
zuu a724a9924b (svn r25376) -Feature: Allow access to goal list and story book of other companies than your own 2013-06-09 13:37:04 +00:00
zuu eaede14b8f (svn r25372) -Add: Allow opening a goal list window specific to a company 2013-06-09 13:23:03 +00:00
zuu 8980cb427d (svn r25369) -Add: allow opening a story window specific to a company 2013-06-09 13:13:47 +00:00
zuu a2d84868e7 (svn r25344) -Feature: GUI for viewing story pages 2013-06-09 12:48:27 +00:00
frosch 3ff6d19238 (svn r25335) -Change: Revisit the map menu in scenario editor: Remove linkgraph legend, add industry list. 2013-06-08 16:54:19 +00:00
frosch 2547523c0f (svn r25304) -Change: Move the GS goals window from the subsidies to the league menu. 2013-05-29 18:49:58 +00:00
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 2013-05-26 19:25:01 +00:00
frosch 8c4714ad90 (svn r25289) -Codechange: Store width of statusbar and main toolbar directly in the WindowDesc. 2013-05-26 19:24:37 +00:00
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 2013-05-26 19:23:42 +00:00
rubidium 50ae992b47 (svn r25263) -Add: legend for linkgraph overlay (fonsinchen) 2013-05-19 14:43:23 +00:00
frosch 3ce8d2ce70 (svn r24846) -Add: Advanced settings to disable certain sound effects. 2012-12-23 21:09:09 +00:00
frosch 647ee0de64 (svn r24842) -Remove: News settings window. 2012-12-23 21:06:37 +00:00
frosch 04a24969ea (svn r24806) -Feature [FS#3148]: Ask for confirmation before creating giant screenshots. 2012-12-09 16:53:21 +00:00
frosch ff6880f9dd (svn r24791) -Remove: Difficulty settings window. 2012-12-05 19:37:15 +00:00
alberth fb892f4b20 (svn r24763) -Feature: Add industry type and cargo dropdown selection for easier navigating in the industry chain window. 2012-11-25 15:24:02 +00:00
frosch 03736af2ae (svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default. 2012-11-11 16:10:43 +00:00
rubidium 927734e6ce (svn r24065) -Feature-ish [FS#5101]: debug option for showing the redrawn dirty blocks/rectangles 2012-03-25 19:06:59 +00:00
rubidium e3c665a3cb (svn r23985) -Fix [FS#5074]: inconsistent quit/abandon/exit game/scenario/editor strings 2012-02-25 13:58:06 +00:00
rubidium 2f49c9af85 (svn r23867) -Fix [FS#5020]: make the colour of the dropdown items for opening the vehicle list for which the company has no vehicles looking less horrid 2012-01-28 20:10:49 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
rubidium 167813aded (svn r23696) -Fix (r23695): 5 <-> 6... today is not my day 2011-12-31 15:02:14 +00:00
rubidium 8b223f0274 (svn r23695) -Fix/Feature [FS#4916]: make a distinction between fully zoomed in and default zoomed in screenshots 2011-12-31 14:56:39 +00:00
truebrain 3ada3b9cc5 (svn r23630) -Add: a Goal GUI to show your current goals 2011-12-19 21:03:17 +00:00