Ivan Fefer
23d733be95
Add: Basic autocompletion on tab for console commands ( #12163 )
3 months ago
Rubidium
86cb184eb4
Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc
3 months ago
frosch
b1718478c8
Codechange: Replace old non-standard attributes with C++17/20 standard attributes.
4 months ago
Rubidium
2d77cf9c80
Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with
5 months ago
Peter Nelson
7737aa6640
Codechange: Make all NWidgetPart arrays constexpr.
...
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
5 months ago
Peter Nelson
a0dfb76e34
Codechange: Replace mishmash of types for widget index with WidgetID.
...
Indices were stored as int, but often passed around as uint/uint8_t and casts.
Now they should all use WidgetID.
6 months ago
Peter Nelson
c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. ( #11481 )
...
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
7 months ago
Michael Lutz
071fdab236
Codechange: Replicate cursor screen backup to chat message display, removing explicit memory management.
...
Incidentally, this makes Blitter::GetBytesPerPixel unneeed.
7 months ago
Peter Nelson
18fb8e153f
Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
...
This is to allow unit-tests to produce more useful output.
7 months ago
Rubidium
37f84b7372
Codechange: replace x.size() != 0 with !x.empty()
8 months ago
Peter Nelson
f379b31e28
Add: data parameter in Window::Close method.
...
This allows passing data when closing a window, e.g. to indicate how it was closed.
8 months ago
frosch
b5885295f0
Codechange: Use parameters, which should be used.
9 months ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
9 months ago
Peter Nelson
e8015e497d
Codechange: Use begin/end of nwidget parts of begin/length.
...
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.
And this removes 160~ instances of the lengthof() macro.
9 months ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
11 months ago
Rubidium
a47de4b2ab
Cleanup: remove DRAW_STRING_BUFFER constant
1 year ago
Rubidium
c518293135
Codechange: replace printf with fmt::print
1 year ago
Peter Nelson
56085be9bd
Codechange: Move includes for common STL headers to stdafx.
1 year ago
Rubidium
a372c59483
Codechange: replace C-style (stredup) chat completion with std::string_view
1 year ago
Rubidium
4dd5f994be
Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith
1 year ago
Rubidium
3105d0b09e
Codechange: replace text-buf printf with fmt::format
1 year ago
Patric Stout
1ba4dcc924
Codechange: migrate all Window-related timers to the new framework
...
This means we also say goodbye to GUITimers.
1 year ago
Patric Stout
1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" ( #10306 )
...
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
1 year ago
PeterN
131b7f5127
Fix: Vertically centre chat prompt. ( #10250 )
2 years ago
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
2 years ago
Peter Nelson
296af146fb
Change: Default widget text colour to black.
...
TC_FROMSTRING really means blue, and we almost never actually use
blue text.
2 years ago
dP
31cf9e888b
Add: [Network] external chat messages for remote admins ( #9563 )
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
glx22
994bf19aef
Fix f6d5c01: Delay deletion when closing windows
3 years ago
rubidium42
4d246cda73
Codechange: [Network] Let NetworkClientInfo use std::string
3 years ago
rubidium42
fab120ee83
Codechange: [Network] Let chat communication use std::string
3 years ago
rubidium42
44ca7d9377
Change: Use gender-neutral pronouns
3 years ago
rubidium42
e2774354b4
Codechange: [Network] Change ChatMessage's message to std::string and simplify some code
3 years ago
Loïc Guilloux
356bbbb90a
Fix: [MinGW] Set minimum OS version to Windows XP ( #9135 )
3 years ago
Peter Nelson
9aa64b7885
Codechange: Use new widget features on chat message box.
3 years ago
Peter Nelson
cb9f56df0c
Feature: Show previous chat history when the chat message box is open
3 years ago
Peter Nelson
fbef63822c
Codechange: Use std::deque for chat history instead of fixed array
3 years ago
Patric Stout
53c28a8ec9
Codechange: [Network] replace _realtime_tick with std::chrono
3 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
3 years ago
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
4 years ago
glx
ee7a8eebca
Codechange: Replace FOR_ALL_TOWNS with range-based for loops
5 years ago
glx
41232f18c1
Codechange: Replace network related FOR_ALL with range-based for loops
5 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
5 years ago
peter1138
317f69c152
Codechange: Use override specifier in Window-derived classes.
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
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
7 years ago
peter1138
ed01e81c42
(svn r27794) -Fix [FS#6526]: Chat text background overflowed due to missing padding.
7 years ago
frosch
e113f5e4a1
(svn r27146) -Fix: Make statusbar and chat-entry window use the same width as the toolbar. Otherwise they lack a size definition.
9 years ago
frosch
2f7de4fd99
(svn r27144) -Change: The chatbox-width setting now uses percent of screen width instead of pixels.
9 years ago