Commit graph

19275 commits

Author SHA1 Message Date
ChillerDragon 860a472d5c Cleanup editor object comments 2024-02-08 15:59:26 +08:00
Robert Müller e4ea04950a Use generic client warning for failed sound init
Simplify code by using generic warning system instead of hard-coding the warning.
2024-02-07 23:55:00 +01:00
Dennis Felsing 1e012af2fd
Merge pull request #7945 from Robyt3/Client-Config-Error-Popup
Show warnings after client close instead of preventing quitting
2024-02-07 22:23:53 +00:00
Robert Müller 272c8095d0 Show warnings after client close instead of preventing quitting
Instead of preventing the client from quitting/restarting while a warning is shown in the menus, add warnings that should be shown after quitting/restarting (i.e. the warning when the config could not be saved) to a separate list and show these warnings using an OS message box after the client has been closed. Otherwise, the client is prevented from closing if a warning is shown without being automatically hidden, which causes the client to hang indefinitely in the CI.

The message boxes for warnings must be shown after the client has already been completely shutdown, otherwise the regular shutdown with the Vulkan backend crashes because showing the message box has already partially deinitialized the backend.

The quitting/restarting client state is now checked after updating the FIFO component, so quitting/restarting initiated via FIFO is effective immediately, although this should have little effect in practice.

For completeness, a log message is added also for the case that the config was saved successfully.

The GitHub CI seems to automatically confirm/disable OS message boxes, so they should not block workflows.
2024-02-07 22:11:44 +01:00
Peakies d40038c679 remove unnecessary variables and loop 2024-02-07 02:31:06 +03:30
Dennis Felsing 38be4b5745
Merge pull request #7939 from bencie/fix-tpxy
Fix /tpxy parameter bug
2024-02-06 15:32:55 +00:00
bencie 4baaf4f410 style 2024-02-06 15:43:46 +01:00
bencie 68d559ea46 Change i[x] i[y] to f[x] f[y] 2024-02-06 15:35:23 +01:00
bencie 5b2c35dc36 Fixed a bug with /tpxy where the parameters didn't take floats or negative numbers 2024-02-06 15:28:33 +01:00
Peakies 6691e2affa exclude rust_version 2024-02-06 13:50:35 +03:30
heinrich5991 5186175f24
Merge pull request #7938 from Robyt3/Http-More-Cleanup
Ensure correct HTTP request state when getting result
2024-02-05 21:21:34 +00:00
Robert Müller 78997e55d9 Ensure correct HTTP request state when getting result
Add assertions to ensure that the HTTP request result data and SHA256 are available when getting them instead of returning `nullptr` and `SHA256_ZEROED` when they are not.

Rename `CHttpRequest::Sha256` function to `ResultSha256`.
2024-02-05 21:58:01 +01:00
Robert Müller c5c9e6c983
Merge pull request #7897 from bencie/editor-buttons
Added plus/minus buttons to numeric value selectors in editor
2024-02-05 18:58:58 +00:00
bencie bb7662c3dc Added plus/minus buttons to numeric value selectors in editor 2024-02-05 19:15:52 +01:00
Dennis Felsing 48a449d2f5
Merge pull request #7936 from Robyt3/Browser-Community-Tab-Max-Num-Fix
Fix and simplify check for maximum number of favorite communities
2024-02-05 17:59:43 +00:00
Peakies 6b7c8f1a28 fix switch screen and blackscreen on opengl + window borderless 2024-02-05 20:58:22 +03:30
Robert Müller bf3622e8f1 Fix and simplify check for maximum number of favorite communities
Because of incorrect index/size math, two favorite communities were removed when exceeding the maximum number of three favorite communities instead of only one. The check can be simplified because the maximum number of favorite communities can never be exceeded, so at most the first element needs to be removed from the vector.

Closes #7935.
2024-02-05 17:50:50 +01:00
Dennis Felsing 68ee8a758b
Merge pull request #7923 from Robyt3/Http-DDNet-Info-Sha-Check
Write DDNet info file only when it changed, initialize HTTP later on client launch, show message box on error, refactoring
2024-02-05 12:31:06 +00:00
Dennis Felsing d93615ed80
Merge pull request #7929 from ChillerDragon/pr_ed_view_tele
Add "View" button to tele drop down in editor
2024-02-05 12:29:48 +00:00
Dennis Felsing 8214e26132
Merge pull request #7924 from furo321/keep-scroll-during-selection
Keep console scrolling position during text selection
2024-02-05 12:16:34 +00:00
Dennis Felsing e2d16e6f78
Merge pull request #7925 from dobrykafe/pr-appearance-nameplate
Name plate appearance tab cleanup
2024-02-05 12:15:17 +00:00
ChillerDragon c9a3836a29 Add "View" button to tele drop down in editor
This allows mappers to find teles by number.

Partially fixed #2194
2024-02-05 18:35:42 +08:00
Dennis Felsing 5ddf6aefa1
Merge pull request #7926 from dobrykafe/pr-hud-teamlock
Add team-lock indicator to HUD
2024-02-05 10:22:50 +00:00
Dennis Felsing 8d46d61b47
Merge pull request #7927 from ChillerDragon/pr_ed_select_tile_para
Add parallax to layer selector (closed #7612)
2024-02-05 10:22:25 +00:00
Dennis Felsing 37b5040c43
Merge pull request #7928 from ChillerDragon/pr_doc_draw
Add doc comment for CUIRect::Draw()
2024-02-05 10:19:18 +00:00
ChillerDragon 0a82a2e759 Add doc comment for CUIRect::Draw() 2024-02-05 16:43:52 +08:00
ChillerDragon cdf69372d3 Add parallax to layer selector (closed #7612)
Also closed #5010

Offset was already supported but parallax was ignored.
Now it looks at offset and parallax when ctrl+right clicking a tile.
2024-02-05 14:22:16 +08:00
dobrykafe 01d87707ef add team-lock indicator to hud 2024-02-05 02:26:48 +01:00
dobrykafe 958bb7493e name plate appearance tab cleanup 2024-02-05 01:25:15 +01:00
furo b121734e6f Keep console scrolling position during text selection 2024-02-04 23:57:05 +01:00
Robert Müller f0deb129c0 Write DDNet info file only when it changed
Avoid many writes to disk each time the DDNet info is downloaded, i.e. each time the refresh button is pressed in the server browser, by first loading the DDNet info into memory and only writing it to disk when it differs from the current DDNet info based on the SHA256 hash.

The SHA256 is now also used to track whether the DDNet info was modified for the community filters and icons instead of using the current time for this purpose.

Closes #3941.
2024-02-04 23:29:11 +01:00
Robert Müller 535400d8a8 Initialize HTTP later on client launch, show message box on error
Initialize the HTTP client (start the HTTP thread) after initializing the network client instead of during the client interface construction. This ensures that config variables have been loaded already and the log output level is set correctly. This also means all library initialization log messages appear together in one block when starting the client.

Show an error message box and stop launching when the HTTP client could not be initialized, instead of launching but not being able to perform any HTTP requests, which causes bug reports about the serverlist being empty.
2024-02-04 23:29:05 +01:00
Robert Müller d6a20f271b Improve some variable names in CHttp 2024-02-04 23:29:05 +01:00
Robert Müller 987acfbba7 Use more specific log levels for HTTP requests 2024-02-04 23:27:40 +01:00
Robert Müller 6c6f058a8c Cleanup HTTP request cleanup
Ensure with assertion that file is closed when `CHttpRequest` is destructed.

Remove unnecessary assignments in destructor.
2024-02-04 23:25:56 +01:00
heinrich5991 c09f1e133f
Merge pull request #7919 from Robyt3/Client-No-Hard-Coded-Commands
Remove hard-coded commands from client-side
2024-02-04 21:56:28 +00:00
Robert Müller 48fad83681 Remove hard-coded commands from client-side
Both console and chat commands are sent to clients dynamically with respective messages, so the static lists of commands were only used for servers not making use of these messages. Instead of assuming potentially incorrect console and chat commands on those servers, the lists will now be empty for those servers.

Move the command registration from the `ddracecommands.h` and `ddracechat.h` header files to the `CGameContext::RegisterDDRaceCommands` and `CGameContext::RegisterChatCommands` functions and delete the header files. The `CHAT_COMMAND` and `CONSOLE_COMMAND` macros are removed, because they only add unnecessary indirection now. The strings `CHAT_COMMAND` and `CONSOLE_COMMAND` are simply replaced with `Console()->Register` and semicolons are added at the end of the lines.

Closes #7665.
2024-02-04 13:16:04 +01:00
Jupeyy bcd5aa3d85
Merge pull request #7918 from Myr-13/master
Update license year to 2024
2024-02-04 10:38:52 +00:00
Yaroslav Kotov 228f09f833
Update license.txt
Jupsti asked me to do this
2024-02-04 15:17:53 +05:00
Dennis Felsing f0da0aa4a0
Merge pull request #7915 from Robyt3/Browser-Community-Tabs
Add tabs for favorite communities, separate country/type filters
2024-02-03 23:08:24 +00:00
Dennis Felsing e41b57fe0f
Merge pull request #7916 from dobrykafe/pr-colorpicker-label
Allocate more space for `DoLine_ColorPicker` label
2024-02-03 23:06:31 +00:00
dobrykafe 71779385be allocate more space for DoLine_ColorPicker label 2024-02-03 22:47:29 +01:00
Robert Müller 7c9b1fbbb4 Add tabs for favorite communities, separate country/type filters
Support adding up to three communities as favorites in the server browser. Favorites can be changed with favorite buttons which are shown in the community filter on the Internet and Favorites tabs. The commands `add_favorite_community` and `remove_favorite_community` are added to change the favorite communities via the console and for saving the favorite communities to the config file. For the favorite communities, additional tabs using the communities' icons are shown in the server browser next to the Internet, LAN and Favorites tabs. Each community tab shows only the servers from the respective community, hence the community filters UI is not shown on the community tabs but only on the Internet and Favorites tabs. The country and type filters on community tabs cover only the countries and types from the respective community. Favorite communities are added from left to right. When more than three favorite communities are added, the oldest (leftmost) favorite community will be removed from the list.

When starting the client for the first time, i.e. with `cl_show_welcome 1`, the DDNet tab will be created as the only favorite community and selected initially. The community, country and type filters are unset when starting for the first time, so the Internet tab now shows all servers per default.

When starting with a `ui_page` for a favorite community that is not configured, the page is reset to the Internet tab. This also affects those who upgrade from versions with the old DDNet and KoG tabs. The server browser is now also correctly updated when changing `ui_page` via the console.

Track country and type filters for every community separately, to avoid filters resetting when switching between community tabs or changing the community filter. The commands `add_excluded_community`, `remove_excluded_community`, `add_excluded_country`, `remove_excluded_country`, `add_excluded_type` and `remove_excluded_type` are added to change the exclusion filters via the console and for saving the exclusion filters to the config file.

Render community filters above the toolbox (filter, info and friends) tabs when on the Internet and Favorites tab, so this setting is more visible and can be changed also when the other toolbox tabs are selected.

Add icon for the none community, based on the tee country flag color. This icon is hard-coded in the client, as the none community also is, so fetching the icon from the server would be inconvenient. Load community icons already when rendering the menu instead of only when rendering the server browser, so the icons are immediately available when using the start menu.

Find tutorial server by searching for community type "Tutorial" instead of searching for "(Tutorial)" in the server name.

Avoid cleaning favorite communities and filters when there are no communities, i.e. when the DDNet info failed to be loaded or does not contain any communities, to avoid losing all favorite communities and filters in this case.

Closes #7774.
2024-02-03 21:12:23 +01:00
Robert Müller a8f3b56850 Fix undefined behavior on loading empty PNG files
When empty PNG files are loaded, the `std::vector` for the file contents is resized to size 0, which results in undefined behavior when it is accessed with `front`.

When `io_tell` fails, i.e. returns `-1`, this was incorrectly cast to an `unsigned` and therefore caused a very large allocation and potentially crashes due to lack of memory.
2024-02-03 20:00:08 +01:00
Robert Müller 7d0e9e86c1 Extract CMenus::DoButton_Favorite function
To render star-icon favorite button like for favorite skins.
2024-02-03 20:00:03 +01:00
heinrich5991 78bd4970be
Merge pull request #7909 from furo321/set-correct-name-size
Set correct size of name column in SQL table
2024-02-03 16:19:29 +00:00
Dennis Felsing f7ceae5d29
Merge pull request #7910 from furo321/editor-sync-toggle
Use toggle button instead of checkbox for "Sync envelope button".
2024-02-03 07:55:06 +00:00
Dennis Felsing 739e104fbb
Merge pull request #7863 from furo321/hookcoll-inaccurate
Scale angles using MousePos with zoom
2024-02-03 07:45:31 +00:00
Dennis Felsing cd9cd97f38 Version 18.0.3 2024-02-03 08:53:27 +01:00
furo f6d093987f Use toggle button instead of checkbox for "Sync envelope button". 2024-02-03 01:10:54 +01:00