frosch
f6d5c0136e
Codechange: make Window destruction not rely on undefined behavior.
3 years ago
frosch
f96f113951
Codechange: use IterateFromBack/Front only if the order is important.
...
Use Iterate if the order does not matter.
3 years ago
frosch
22567a1f43
Codechange: use iterators instead of 'subranges' when iterating from a specific window.
...
Using iterators makes it easier to include or exclude the start window in the iteration.
3 years ago
frosch
95abdfdef9
Cleanup: remove unneeded labels and gotos.
...
The window list supports deletion of arbitrary windows, while iterating over it.
3 years ago
Peter Nelson
d8e06e590a
Codechange: Make GetCurrentRect() conform to usual Rect bounds, and reuse it.
...
Similar code is already repeated in other locations.
3 years ago
Peter Nelson
52b16237ad
Codechange: Don't update window contents if scrollbar position has not moved.
3 years ago
Peter Nelson
8321ef0061
Codechange: Set specific widgets dirty instead of window.
3 years ago
Peter Nelson
4791ff2862
Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.
3 years ago
glx22
14e92bd8e2
Codechange: Replace window related FOR_ALL with range-based for loops
3 years ago
Didac Perez Parera
0cb99c5523
Codechange: nullptr deletion in DeleteWindowById ( #8941 )
3 years ago
Patric Stout
853bfc3562
Codechange: replace _realtime_tick with std::chrono for mouse events
3 years ago
Michael Lutz
8906e9e0fd
Codechange: Consistently use screen size and not driver resolution for determining window sizes.
3 years ago
glx
c0d7949d7c
Fix: Don't use a timer for hundredth tick determination
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Michael Lutz
dd138fc460
Codechange: Stringify config file paths.
4 years ago
Charles Pigott
cfa1b1e006
Fix: Compile warnings when asserts are disabled
4 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
ee570e1b6d
Cleanup: Fix typos in code comments.
4 years ago
TechGeekNZ
8652a4db76
Cleanup: Give `SetDirtyBlocks` a more descriptive name.
4 years ago
glx
341941af85
Fix #7952 : don't try to access destroyed QueryStrings
4 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Jonathan G Rennison
1dba06656d
Codechange: Add utility function for whether the focused window is a console
5 years ago
Jonathan G Rennison
81f159434d
Codechange: Add EditBoxGainedFocus method to VideoDriver base class
5 years ago
JMcKiern
04f659e768
Fix: Some typos found using codespell
5 years ago
peter1138
82989ef076
Fix: Clicking on scrollbar 'thumb' moved position up instantly.
5 years ago
glx
410b81537c
Fix 801cbea9c: operator< is not always the best idea
...
Also removes unused and anyway broken SmallMap::SortByKey() function.
5 years ago
glx
801cbea9cc
Codechange: use std::sort() for all std::vector types
5 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
5 years ago
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
5 years ago
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
5 years ago
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
5 years ago
Henry Wilson
81315939b9
Codechange: Replaced SmallVector::Find() non-const with std::find()
5 years ago
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
5 years ago
Henry Wilson
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
5 years ago
peter1138
f5f33da126
Codechange: Implement OnTooltip event for custom window tooltips.
...
This avoids windows from needing to know or care about tooltip delay settings.
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
56a6d7aec8
Fix #7227 : Don't apply mouse-hasn't-moved test to scrollbars.
5 years ago
Peter Nelson
de9f54ccc1
Codechange: Change scrolling_scrollbar to mouse_capture_widget, and dispatch OnClick() event if widget is not a scrollbar.
...
This allows any widget to support mouse capture.
5 years ago
Joan Josep
548ec05a48
Add: News menu entry and shortcut for deleting all messages. ( #7240 )
5 years ago
Peter Nelson
9dc36057eb
Fix #7058 , Fix #7161 : Network chat messages did not expire.
5 years ago
J0an Josep
9ce92521c1
Fix: If screen size changes, windows are relocated and dropdown may not fit the screen.
6 years ago
nikolas
d8ccad91f9
Fix: Some code and comment typos
...
Found with codespell
6 years ago
PeterN
89f0017a67
Fix #7050 : Missing guard around network chat message function for compiling with networking disabled. ( #7058 )
6 years ago
PeterN
5ff0c24993
Fix #6780 : Some windows didn't get updated from OnTick() ( #7048 )
6 years ago
Peter Nelson
c693463c29
Fix: Always draw dirty blocks, else fast-forward is super fast.
6 years ago
Peter Nelson
806e7d25dd
Change: Use GUITimer class instead of bare int/uints.
6 years ago
Peter Nelson
59fe4f28c8
Change: Animate text effects by real time instead of game ticks.
6 years ago
Peter Nelson
ead9c9eab5
Change: Switch various window timers to real time instead of game ticks.
6 years ago
Peter Nelson
2a8fa5fef9
Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks.
6 years ago
Juanjo
9e30054de9
Codechange: Use window class as expected.
6 years ago