Peter Nelson
941dbadf9e
Codechange: Add and use GetScrolledItemFromWidget to get a list item.
...
This function returns an iterator, either to the selected item or the
container's end.
This makes handling the result more robust as indices are not used.
1 year ago
Peter Nelson
d2034d9c38
Codechange: Scrollbar methods now accept size_t.
...
This clears up a lot of casts from size_t to int.
1 year ago
Rubidium
877349c13d
Codechange: use std::string for text file name resolution
1 year ago
Rubidium
a312a6c1b2
Codechange: make md5sumToString std::string compatible
1 year ago
Tyler Trahan
ba3de0383a
Codechange: Pass more std::string to StringFilter::AddLine() ( #10743 )
1 year ago
Rubidium
c829930440
Codechange: replace strnatcmp with C++ string capable version
1 year ago
Rubidium
b221fa3c5a
Codechange: use fmt::format_to instead of seprintf to create the search URL
1 year ago
Jonathan G Rennison
ae7c86c49d
Merge branch 'master' into jgrpp
...
# Conflicts:
# .github/workflows/release-linux.yml
# .github/workflows/release-macos.yml
# src/industry_cmd.cpp
# src/industry_cmd.h
# src/network/core/http_curl.cpp
# src/network/core/tcp_http.cpp
# src/network/core/tcp_http.h
# src/network/network_content.h
# src/script/api/script_goal.cpp
# src/script/api/script_industry.cpp
# src/script/api/script_league.cpp
# src/script/api/script_story_page.cpp
# src/script/api/script_town.cpp
# src/train.h
# src/train_cmd.cpp
2 years ago
Patric Stout
dea2dea881
Fix: reset content download progress to zero if falling back to TCP
...
Otherwise this chain of events can happen:
- You already have a (partial) file downloaded
- You start the download, and HTTP fails
- This resets the download progress to the current size of the file
- The TCP download starts at a very large value (UINT32_MAX - filesize)
It now resets to 0% done when any negative value is being given.
As added bonus, we no longer have to query how much was already
downloaded.
2 years ago
Jonathan G Rennison
ae9b416684
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/ai/ai_core.cpp
# src/ai/ai_gui.cpp
# src/ai/ai_instance.cpp
# src/console_cmds.cpp
# src/engine_type.h
# src/game/game_gui.cpp
# src/game/game_instance.cpp
# src/goal.cpp
# src/goal_cmd.h
# src/lang/english.txt
# src/lang/estonian.txt
# src/network/network_client.cpp
# src/newgrf.cpp
# src/newgrf_generic.h
# src/openttd.cpp
# src/saveload/saveload.h
# src/script/api/script_log.cpp
# src/script/api/script_town.cpp
# src/settings_table.cpp
# src/station_cmd.cpp
# src/station_cmd.h
# src/station_map.h
# src/strings.cpp
# src/table/settings/difficulty_settings.ini
# src/table/settings/gui_settings.ini
# src/tbtr_template_gui_main.h
# src/timetable_cmd.cpp
# src/timetable_cmd.h
# src/timetable_gui.cpp
# src/town_gui.cpp
# src/train_gui.cpp
# src/water_cmd.cpp
2 years ago
Rubidium
4e65ec1dc4
Codechange: do not declare functions in blocks
2 years ago
Jonathan G Rennison
6d4474b84e
Merge tag '13.0-beta2' into jgrpp
...
# Conflicts:
# src/cheat_gui.cpp
# src/company_gui.cpp
# src/console_gui.cpp
# src/depot_gui.cpp
# src/error_gui.cpp
# src/gfx.cpp
# src/graph_gui.cpp
# src/group_gui.cpp
# src/lang/english.txt
# src/lang/korean.txt
# src/lang/polish.txt
# src/misc_gui.cpp
# src/network/network_content_gui.h
# src/newgrf_debug_gui.cpp
# src/order_gui.cpp
# src/rail_gui.cpp
# src/road_gui.cpp
# src/settings_gui.cpp
# src/settings_type.h
# src/station_gui.cpp
# src/subsidy_gui.cpp
# src/table/settings/gui_settings.ini
# src/timetable_gui.cpp
# src/town_gui.cpp
# src/train_cmd.cpp
# src/vehicle_gui.cpp
# src/viewport.cpp
# src/water_cmd.cpp
# src/widgets/dropdown.cpp
# src/window_gui.h
2 years ago
Jonathan G Rennison
02e19521bc
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/build_vehicle_gui.cpp
# src/cheat_gui.cpp
# src/company_gui.cpp
# src/error_gui.cpp
# src/fios_gui.cpp
# src/gfx_func.h
# src/graph_gui.cpp
# src/group_gui.cpp
# src/misc_gui.cpp
# src/newgrf_debug_gui.cpp
# src/order_gui.cpp
# src/road_gui.cpp
# src/roadveh_gui.cpp
# src/settings_gui.cpp
# src/ship_gui.cpp
# src/station_gui.cpp
# src/statusbar_gui.cpp
# src/subsidy_gui.cpp
# src/timetable_gui.cpp
# src/town_gui.cpp
# src/train_gui.cpp
# src/tree_gui.cpp
# src/vehicle_gui.cpp
# src/widget.cpp
# src/widgets/dropdown.cpp
# src/window_gui.h
2 years ago
Jonathan G Rennison
728b902e9f
No longer use CDECL for GUIList::FilterFunction
2 years ago
Peter Nelson
ecb5393c55
Change: Standardize progress bar layout.
...
Progress bars are drawn differently depending on when it was added, with
different layouts and sizes.
This change adds a standard padding size to use, and makes all progress
bars visually similar, with scaled padding.
2 years ago
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
2 years ago
Peter Nelson
b6ed595176
Codechange: Prefer suggested widget 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
Jonathan G Rennison
0a9c44d1a2
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/airport_gui.cpp
# src/blitter/32bpp_anim_sse4.cpp
# src/console_cmds.cpp
# src/linkgraph/linkgraph_gui.cpp
# src/newgrf_object.h
# src/road_gui.cpp
# src/widgets/road_widget.h
# src/window.cpp
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
Jonathan G Rennison
24c6dfe872
Merge branch 'master' into jgrpp-beta
3 years ago
Jonathan G Rennison
81290df946
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/lang/spanish.txt
# src/network/core/tcp_content_type.h
# src/network/network_content.cpp
# src/saveload/cheat_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/station_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/settings.cpp
# src/settings_internal.h
# src/table/settings.h.preamble
# src/table/settings/company_settings.ini
# src/table/settings/currency_settings.ini
# src/table/settings/gameopt_settings.ini
# src/table/settings/misc_settings.ini
# src/table/settings/settings.ini
# src/table/settings/win32_settings.ini
# src/table/settings/window_settings.ini
3 years ago
rubidium42
05005dcdfa
Codechange: [Network] Use std::string instead of char[] for the name of the file that is downloading
3 years ago
rubidium42
e3717ae903
Codechange: [ContentInfo] Use std::string instead of string buffers
3 years ago
rubidium42
df181bb641
Codechange: [ContentInfo] Use a vector for dependencies instead of custom allocation
3 years ago
rubidium42
9c424ab741
Codechange: [ContentInfo] Use StringList for tags instead of custom allocations
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
Patric Stout
a403653805
Codechange: [Network] split CloseSocket and CloseConnection more clearly ( #9261 )
...
* Codechange: [Network] split CloseSocket and CloseConnection more clearly
- CloseSocket now closes the actual OS socket.
- CloseConnection frees up the resources to just before CloseSocket.
- dtors call CloseSocket / CloseConnection where needed.
3 years ago
Rubidium
bf4fe19a66
Codechange: merge duplicated logic to scroll in lists by key into a single function
3 years ago
Patric Stout
970fedd78c
Add: make modal windows update more smooth
...
Basically, modal windows had their own thread-locking for what
drawing was possible. This is a bit nonsense now we have a
game-thread. And it makes much more sense to do things like
NewGRFScan and GenerateWorld in the game-thread, and not in a
thread next to the game-thread.
This commit changes that: it removes the threads for NewGRFScan
and GenerateWorld, and just runs the code in the game-thread.
On regular intervals it allows the draw-thread to do a tick,
which gives a much smoother look and feel.
It does slow down NewGRFScan and GenerateWorld ever so slightly
as it spends more time on drawing. But the slowdown is not
measureable on my machines (with 700+ NewGRFs / 4kx4k map and
a Debug build).
Running without a game-thread means NewGRFScan and GenerateWorld
are now blocking.
4 years ago
Patric Stout
ac2b5e57cf
Fix: mention our websites with https:// (instead of http://) ( #8657 )
...
It is 2021. Nobody should advertise http anymore. Not even us.
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Yexo
a9b3312d1a
Fix #8024 : make online content gui more responsive while loading
...
Previously the internal content list was invalidated and sorted for
every new item added. Now the sorting is delayed until the GUI is
drawn, which means we only sort once per GUI tick.
Since the amount of incoming items per GUI tick is not controlled by
the GUI but rather by network speed, we were previously doing a lot
of duplicate work per tick, causing the mouse cursor to lag while
the list was initialized.
4 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
JMcKiern
04f659e768
Fix: Some typos found using codespell
5 years ago
glx
2db88953e7
Codechange: use std::sort() in GUIList
6 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago
PeterN
9244dad3f1
Fix #7434 : Incorrect use of vector iterator. ( #7437 )
6 years ago
glx22
66dd7c3879
Fix: MSVC warnings ( #7423 )
6 years ago
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
6 years ago
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
6 years ago
Henry Wilson
297fd3dda3
Codechange: Replaced SmallVector::Include() with include()
6 years ago
Henry Wilson
2bc2de9034
Codechange: Replaced SmallVector::Find() with std::find()
6 years ago
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
6 years ago
Henry Wilson
097328c3d7
Codechange: Replaced SmallVector::Get() const with std alternatives
6 years ago
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
6 years ago
Henry Wilson
9cba6f7193
Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit()
6 years ago
Henry Wilson
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
6 years ago
peter1138
07de9d6c3f
Codechange: Use override keyword in networking classes.
6 years ago
peter1138
317f69c152
Codechange: Use override specifier in Window-derived classes.
6 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.
6 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.
6 years ago
glx
b22fbfbe3d
Add: allow opening of one TextfileWindow per type
6 years ago
Charles Pigott
f5b1115039
Doc: Lots and lots of doxymentation fixes
6 years ago
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
7 years ago
zuu
b22d6715cd
(svn r27469) -Fix (r27468): Don't fetch all content info from content server when showing a online content window with exactly one type of content.
9 years ago
zuu
aabc46712a
(svn r27468) -Fix (r27444): Game Scripts were not displayed in the content download window when opened from the AI/GS settings window.
9 years ago
zuu
c9f1d82345
(svn r27444) -Add: When viewing online content of a particular type, hide content of other types unless they have been (auto)selected for download.
9 years ago
zuu
4fcaee1fee
(svn r27443) -Fix: Negoation in comment was wrong.
9 years ago
michi_cc
95cb7c8692
(svn r27288) -Fix: Slow network content GUI in MSVC Debug builds due to repeated string resolving.
10 years ago
peter1138
d9179d518e
(svn r26921) -Codechange: Adjust content window listing to fit icon size.
10 years ago
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
11 years ago
frosch
62c0d42f92
(svn r26167) -Fix [FS#5834]: Certain hotkeys crashed the content GUI when the list was empty.
11 years ago
michi_cc
b911f4a452
(svn r25668) -Codechange: Pass proper Unicode UCS-4 characters instead of just UCS-2 to the window key press handlers.
11 years ago
frosch
43ec0bf0c1
(svn r25537) -Codechange: Optionally make WWT_MATRIX compute the number of rows and columns from the resize step size.
11 years ago
frosch
98fdd20f84
(svn r25531) -Codechange: Use separate function to set data of WWT_MATRIX widgets.
11 years ago
frosch
4e4e635916
(svn r25294) -Feature: Add another button to window title bars to resize the window to its default size.
12 years ago
frosch
8157a8afd8
(svn r25290) -Add: Assign string names to notable windows.
12 years ago
frosch
56e4a8c4d6
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
12 years ago
frosch
579ee7a592
(svn r25089) -Codechange: Move CharSetFilter from QueryString to Textbuf.
12 years ago
frosch
1b10910af6
(svn r25024) -Feature: Searching of (missing) content via GrfCrawler.
12 years ago
frosch
41cc06a83c
(svn r25023) -Change: Regroup buttons in content download GUI to put item-specifc stuff next to each other.
12 years ago
frosch
3e02890b73
(svn r24983) -Change: Apply the same name sorting rules to content and NewGRF list as for the server list.
12 years ago
frosch
c283a41248
(svn r24743) -Change: Unify the behaviour of ESC in filter editboxes.
12 years ago
frosch
f5d8ba5d7f
(svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead.
12 years ago
frosch
6e6d94a2d1
(svn r24740) -Codechange: Remove duplicate members from QueryStringBaseWindow and directly use QueryString.
12 years ago
frosch
f6d4200f86
(svn r24738) -Codechange: Remove Textbuf::Initialize in favour of a constructor.
12 years ago
frosch
f2221e8b89
(svn r24736) -Cleanup: The third parameter of Textbuf::Initialize only makes sense if it is smaller than the second one, also its unit is not pixels.
12 years ago
frosch
2c22fe98dd
(svn r24734) -Codechange: Move QueryStringBaseWindow::OnOSKInput to Window::OnEditboxChanged.
12 years ago
frosch
c4d7c8dd42
(svn r24733) -Codechange: Move handling of editbox keys to window class.
12 years ago
frosch
6d1fe626f5
(svn r24729) -Codechange: Unify the handling of HEBR_EDITING.
12 years ago
frosch
336fcbc50e
(svn r24728) -Codechange: Unify usage of OnOSKInput.
12 years ago
frosch
137adb3496
(svn r24726) -Codechange: Move editbox mouseloop handling to Window class.
12 years ago
frosch
17025fa6ea
(svn r24724) -Codechange: Move drawing of editboxes to the widget drawing code.
12 years ago
frosch
03736af2ae
(svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default.
12 years ago
yexo
053770d4a6
(svn r24488) -Feature [FS#5236]: add buttons to view textfiles from the online content window (LordAro)
12 years ago
frosch
03046f614f
(svn r24337) -Feature: Allow filtering for multiple words (separated by whitespace resp. quoted) in the sign list, content- and NewGRF-guis.
12 years ago
frosch
d58eee1e79
(svn r24324) -Codechange: Turn functions dealing with Textbufs into member functions.
13 years ago
rubidium
6d6be50ae0
(svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files
13 years ago
truebrain
da8777d4e5
(svn r23646) -Fix [FS#4901]: rescan the Game Scripts when done downloading one.
13 years ago
truebrain
561b25d031
(svn r23601) -Fix: fix the conflict in window number
13 years ago
truebrain
e2d8abeec5
(svn r23544) -Codechange: document and rename widgets to be consistent and understandable
13 years ago
truebrain
2aa774e831
(svn r23528) -Codechange: move widget enums to widgets/NNN_type.h
13 years ago
yexo
e0e5e51e2a
(svn r23492) -Feature: add 'view website' button to the online content window
13 years ago
rubidium
58423b26d1
(svn r23474) -Codechange: move the declaration error related functions to error.h
13 years ago
yexo
1db365d0e2
(svn r23469) -Fix (r23468): gcc warning about initialization order
13 years ago
yexo
e2a9dd1b0a
(svn r23468) -Feature [FS#4827]: when looking for missing content, automatically select it so you can easily start the download
13 years ago
yexo
e31ed7db25
(svn r23467) -Feature [FS#4827]: automatically close the online content window after confirming the download with 'ok'
13 years ago
rubidium
0759649478
(svn r23285) -Fix: scanning of content after download didn't work
13 years ago