PeterN
d42a78f3e8
Codechange: Make DropDownListStringItem preformat and remove other implementations. ( #11063 )
...
Having to choose between DropDownListStringItem, DropDownListCharStringItem, and DropDownListParamStringItem depending on whether to draw a StringID, a raw string, or a StringID with extra parameters was needlessly complex.
Instead, allow passing a StringID or raw string to DropDownListStringItem. This will preformat the StringID into a raw string, and can therefore accept parameters via the normal SetDParam mechanism.
This also means that strings no longer need to be formatted on every draw.
2023-06-23 08:30:13 +00:00
Rubidium
7c37dcb8e3
Fix: do not use {STRING} when {STRING1} or {STRING2} is needed
2023-06-14 09:44:06 +02:00
PeterN
d086f288cd
Codechange: Remove duplicated includes. ( #10888 )
...
These are now included by stdafx.h so don't need to be included again.
2023-05-29 14:29:00 +01:00
Peter Nelson
61407840c6
Codechange: Remove STR_BLACK_RAW_STRING.
2023-05-05 07:07:54 +01:00
Rubidium
aac95eeaf5
Codechange: use std::string instead of stredup/free for stories
2023-05-01 16:23:24 +02:00
Patric Stout
7aa2b9ab0a
Codechange: move all date-related variables inside the timer ( #10706 )
2023-04-24 15:56:01 +00:00
Rubidium
f001e84e5e
Codechange: use RAII to automatically restore _cur_dpi after use
2023-01-28 20:33:02 +01:00
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
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
686204ff1c
Change: Simplify widget layout of story book window.
2022-10-11 08:36:59 +01:00
Michael Lutz
e6e69d5289
Codechange: Un-bitstuff goal and story page 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
Rubidium
bb9121dbd4
Fix: comparison of narrow type to wide type in loop (potential for infinite loops)
2021-05-15 10:16: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
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
Jonathan G Rennison
f11cd8f2d0
Fix: Compilation warnings in story_gui and script_story_page
...
See: #7896
2020-05-27 22:22:56 +02:00
Niels Martin Hansen
800ade7702
Feature: Push-buttons on storybook pages ( #7896 )
...
Allow more direct player-initiated interaction for Game Scripts, by letting the GS put push-buttons on storybook pages. These buttons can either trigger an immediate event, or require the player to first select a tile on the map, or a vehicle.
Additionally this reworks how the storybook pages are layouted and rendered, to allow for slightly more complex layouts, and maybe speeding drawing up a bit.
2020-05-22 22:22:55 +02:00
glx
847e5f33d4
Codechange: Replace story 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
JMcKiern
04f659e768
Fix: Some typos found using codespell
2019-09-29 21:27:32 +01:00
glx
2db88953e7
Codechange: use std::sort() in GUIList
2019-04-13 12:49:18 +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
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
2019-03-26 20:15:57 +00:00
Henry Wilson
9cba6f7193
Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit()
2019-03-26 20:15:57 +00:00
Henry Wilson
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
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
alberth
107bf32953
(svn r27086) -Codechange: Simplify opening of windows by always returning a valid window pointer.
2014-12-18 18:22:23 +00:00
rubidium
d534c80e94
(svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces)
2014-10-15 18:31:37 +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
zuu
9603014102
(svn r26307) -Add: [nogo] Allow GS to hide story page date
2014-02-06 19:50:34 +00:00
rubidium
83eeba28b7
(svn r26086) -Codechange: use AutoDeleteSmallVector instead std::list for dropdowns
2013-11-24 14:46:26 +00:00
rubidium
830a49692d
(svn r26048) -Fix: use delete instead of free when allocated by new
2013-11-22 21:42:20 +00:00
fonsinchen
29d0c68bb0
(svn r26040) -Fix: return 0 from unreached part of function to silence some compilers
2013-11-19 19:42:40 +00:00
frosch
7fbe7895ef
(svn r25920) -Fix: Story page content was clipped incorrectly and was drawn past the bottom end.
2013-10-28 10:40:52 +00:00
frosch
12ddbb7cb1
(svn r25864) -Fix: Use the actual sprite dimensions for sizing the dropdown arrow of dropdown widgets.
2013-10-13 19:18:30 +00:00
zuu
f8f9e30f80
(svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated
2013-09-14 12:18:36 +00:00
zuu
541fe1775a
(svn r25769) -Fix (r25344): Drawing of broken goal references was broken
2013-09-13 21:34:32 +00:00
zuu
e2c618eaba
(svn r25768) -Fix [FS#5617] (r25344): Story Book text elements that use font size modifiers (eg {BIG_FONT}) caused problem with content height calculation. Solution: switch to pixel based content height instead of computing all heights as multiples of line heights.
2013-09-13 21:01:19 +00:00
zuu
9e30dda720
(svn r25766) -Codechange: Use FONT_HEIGHT_NORMAL instead of checking the height of a dummy string in Story gui
2013-09-13 20:17:07 +00:00
zuu
24481998fa
(svn r25759) -Fix (r25369): Set the owner flag of the goal and story windows
2013-09-12 14:35:52 +00:00
zuu
789b4e320b
(svn r25624) -Fix (r25620, r25623): Silence warnings
2013-07-21 17:14:35 +00:00
rubidium
b860353a66
(svn r25387) -Fix: "typos" in @file filename
2013-06-09 18:58:36 +00:00
zuu
53d2e785f5
(svn r25381) -Fix: Silent story book compiler warnings
2013-06-09 14:13:59 +00:00
zuu
dda71a15d1
(svn r25380) -Fix (r25344): Vertically center images of page elements in the available vertical space
2013-06-09 14:11:55 +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