Commit graph

10311 commits

Author SHA1 Message Date
Robert Müller 1683304acd Ensure skin info of finish messages is valid 2024-02-09 21:33:14 +01:00
Robert Müller 289b7b08c7 Ensure finish info messages are initialized
Closes #7913.
2024-02-09 21:33:04 +01:00
Robert Müller cb0af02eae Extract CTeeRenderInfo::Valid function 2024-02-09 21:32:56 +01:00
Robert Müller 4cb0bb2744 Split CInfoMessages::OnMessage into separate functions
Improve readability by splitting long `OnMessage` function into separate functions for each individual message.
2024-02-09 21:32:48 +01:00
Robert Müller e350ceeb16 Extract SSkinTextures::Unload function 2024-02-09 21:32:44 +01:00
Robert Müller fbc4181809
Merge pull request #7937 from Peakies/switch_screen_pr
fix switch screen and blackscreen on opengl + window borderless
2024-02-09 19:47:42 +00:00
Robert Müller 837ecb8708
Merge pull request #7946 from ChillerDragon/pr_ed_switch
Add "View" button to switch drop down in editor
2024-02-09 16:43:25 +00:00
ChillerDragon 3fc10d4a6c Add "View" button to switch drop down in editor
This allows mappers to find switchers by number.

see #7931
2024-02-09 16:28:24 +08:00
Dennis Felsing 9187c296a0
Merge pull request #7952 from Robyt3/Server-Sixup-Killmessages
Show kill messages also for sixup clients
2024-02-08 22:53:54 +00:00
bencie 177e8f07f1 Fix broken parameter in MoveCharacter 2024-02-08 22:34:38 +01:00
Robert Müller c0da15737d Show kill messages also for sixup clients
For consistency between 0.6 and 0.7 clients, also show kill messages for 0.7 clients, now that DDNet client also supports finish messages.

Closes #5623.
2024-02-08 20:30:31 +01:00
Dennis Felsing 7dc446e086
Merge pull request #7942 from Robyt3/Client-SoundInit-Warning
Use generic client warning for failed sound init
2024-02-08 14:00:16 +00:00
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
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
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
bencie bb7662c3dc Added plus/minus buttons to numeric value selectors in editor 2024-02-05 19:15:52 +01:00
Peakies 6b7c8f1a28 fix switch screen and blackscreen on opengl + window borderless 2024-02-05 20:58:22 +03:30
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
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 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
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
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 7d0e9e86c1 Extract CMenus::DoButton_Favorite function
To render star-icon favorite button like for favorite skins.
2024-02-03 20:00:03 +01: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
Corantin H d988b92b38 Check selected quad index when rendering quad popup (fixes #7904) 2024-02-02 22:15:05 +01:00
Robert Müller c40d809282 Refactor skin refreshing in gameclient, fix crash in skin settings
Add `CGameClient::RefreshSkins` function to refresh skins. This function reloads all skins by calling `CSkins::Refresh` and then notifies all gameclient components about the skins being refreshed by calling the new `CComponent::OnRefreshSkins` function, so the components can properly invalidate their current skin texture handles. The existing `RefindSkins` functions are changed to `OnRefreshSkins`.

Additionally, `OnRefreshSkins` is overridden in `CMenus` to set the flag so the skin list will be updated before it is rendered the next time, to fix the client crashing when changing skin related config variables via the console. Closes #7891.
2024-02-01 20:41:10 +01:00
Dennis Felsing 2ed899a259
Merge pull request #7890 from Robyt3/Voting-Hud-Improvement
Improve voting HUD, refactoring
2024-02-01 08:41:58 +00:00
Robert Müller 1955905a19 Improve voting HUD
Reduce height and empty space and make margins consistent. Slightly increase width for better round corner drawing and to support longer vote descriptions.

Auto-scale description and reason labels and show ellipsis if they don't fit.

Show circular progress indicator for remaining vote time.
2024-01-31 23:09:31 +01:00
Robert Müller fa62d3c360 Close voting HUD when remaining seconds are negative
Ensure voting HUD disappears when it should, in case the server does not announce that the vote has ended correctly.
2024-01-31 23:09:31 +01:00
Robert Müller dfc2e80701 Move voting rendering from CHud to CVoting 2024-01-31 23:09:31 +01:00
bencie 0972dc2bbe Move Show chat checkbox to Chat tab 2024-01-31 21:45:09 +01:00