Commit graph

10329 commits

Author SHA1 Message Date
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
bencie f34a583a4e Remove redundant Show kill messages checkbox 2024-01-31 21:44:16 +01:00
Robert Müller df95ca74ec Extract CVoting::RemoveOption function 2024-01-31 21:06:11 +01:00
Robert Müller c1549635c6 Cleanup CVoting::RenderBars function
The functionality to draw text on the voting bars is never used, so the parameter `Text` is always `false`.

Remove unused variable `PassArea`. The remaining area of the voting bars is unused.
2024-01-31 21:05:03 +01:00
Dennis Felsing 984457a48e
Merge pull request #7887 from furo321/add-conchain-skin-cmds
Add console chain for refreshing skins
2024-01-31 09:00:45 +00:00
Dennis Felsing c3e3ac5732
Merge pull request #7885 from furo321/practice-improvements
Small improvements to practice
2024-01-31 09:00:18 +00:00
furo 5179850dbd Add console chain for refreshing skins 2024-01-31 01:57:55 +01:00
furo d149ab60e8 Remove unused ConAccept function 2024-01-31 00:51:50 +01:00
furo ec70556577 Don't print the team cannot finish anymore message when team is already in practice 2024-01-31 00:47:19 +01:00
furo c1fe1b49fa Allow joining started teams that have practice enabled 2024-01-31 00:39:00 +01:00
Teero888 e3dc26a81b fix msvc complaining 2024-01-30 22:28:55 +01:00
Teero888 fda6a6760c remove redundant get() call on smart pointer 2024-01-30 22:05:44 +01:00
Teero888 cef4358560 CMenus::RandomSkin() adjustments
+ Dont randomise colors if UseCustomColor is false
+ Use all instead of only vanilla skins when randomising
2024-01-30 21:46:04 +01:00
ChillerDragon 40633d800a Fix 0.7 armor being snapped as health
Closed https://github.com/ZillyInsta/ddnet-insta/issues/91
2024-01-30 19:47:04 +08:00
ChillerDragon f375f20ffc Fix clang warning and UB when there is no game layer
clang 14.0.6 shows this:

```
[ 98%] Building CXX object CMakeFiles/game-client.dir/src/game/generated/client_data7.cpp.o
In file included from /usr/include/c++/12/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/12/bits/stl_algo.h:61,
                 from /usr/include/c++/12/algorithm:61,
                 from /home/chiller/Desktop/git/ddnet/src/base/math.h:6,
                 from /home/chiller/Desktop/git/ddnet/src/base/color.h:5,
                 from /home/chiller/Desktop/git/ddnet/src/game/editor/popups.cpp:4:
In function ‘void std::_Construct(_Tp*, _Args&& ...) [with _Tp = CEditorActionTileChanges; _Args = {CEditor*&, int&, int&, const char (&)[20], map<int, map<int, STileStateChange, less<int>, allocator<pair<const int, STileStateChange> > >, less<int>, allocator<pair<const int, map<int, STileStateChange, less<int>, allocator<pair<const int, STileStateChange> > > > > >&}]’,
    inlined from ‘static void std::allocator_traits<std::allocator<void> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = CEditorActionTileChanges; _Args = {CEditor*&, int&, int&, const char (&)[20], std::map<int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > >, std::less<int>, std::allocator<std::pair<const int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > > > > >&}]’ at /usr/include/c++/12/bits/alloc_traits.h:635:19,
    inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {CEditor*&, int&, int&, const char (&)[20], std::map<int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > >, std::less<int>, std::allocator<std::pair<const int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > > > > >&}; _Tp = CEditorActionTileChanges; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at /usr/include/c++/12/bits/shared_ptr_base.h:604:39,
    inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = CEditorActionTileChanges; _Alloc = std::allocator<void>; _Args = {CEditor*&, int&, int&, const char (&)[20], std::map<int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > >, std::less<int>, std::allocator<std::pair<const int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > > > > >&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at /usr/include/c++/12/bits/shared_ptr_base.h:971:16,
    inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {CEditor*&, int&, int&, const char (&)[20], std::map<int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > >, std::less<int>, std::allocator<std::pair<const int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > > > > >&}; _Tp = CEditorActionTileChanges; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at /usr/include/c++/12/bits/shared_ptr_base.h:1712:14,
    inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {CEditor*&, int&, int&, const char (&)[20], std::map<int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > >, std::less<int>, std::allocator<std::pair<const int, std::map<int, STileStateChange, std::less<int>, std::allocator<std::pair<const int, STileStateChange> > > > > >&}; _Tp = CEditorActionTileChanges]’ at /usr/include/c++/12/bits/shared_ptr.h:464:59,
    inlined from ‘std::shared_ptr<typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), _Tp>::type> std::make_shared(_Args&& ...) [with _Tp = CEditorActionTileChanges; _Args = {CEditor*&, int&, int&, const char (&)[20], map<int, map<int, STileStateChange, less<int>, allocator<pair<const int, STileStateChange> > >, less<int>, allocator<pair<const int, map<int, STileStateChange, less<int>, allocator<pair<const int, STileStateChange> > > > > >&}]’ at /usr/include/c++/12/bits/shared_ptr.h:1010:39,
    inlined from ‘static CUI::EPopupMenuFunctionResult CEditor::PopupGroup(void*, CUIRect, bool)’ at /home/chiller/Desktop/git/ddnet/src/game/editor/popups.cpp:450:85:
/usr/include/c++/12/bits/stl_construct.h:119:7: warning: ‘GameLayerIndex’ may be used uninitialized [-Wmaybe-uninitialized]
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chiller/Desktop/git/ddnet/src/game/editor/popups.cpp: In static member function ‘static CUI::EPopupMenuFunctionResult CEditor::PopupGroup(void*, CUIRect, bool)’:
/home/chiller/Desktop/git/ddnet/src/game/editor/popups.cpp:408:29: note: ‘GameLayerIndex’ was declared here
  408 |                         int GameLayerIndex;
      |                             ^~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-nullability-completeness’ may have been intended to silence earlier diagnostics
```

Which makes sense. GameLayerIndex is only set in a loop if a condition is met.
And then its value is recorded for the undo feature.

The condition should never be false. Because a game layer is a strict requirement for a functional map.
But I still decided to avoid using an assert or silent ignore.
If this breaks logs would be nice.
If this breaks the editor should not crash.
The editor should never crash or quit to not lose unsaved changes.
2024-01-30 11:16:46 +08:00
Dennis Felsing 33ffd0f052 Version 18.0.2 2024-01-28 13:38:58 +01:00
heinrich5991 e3732928a9
Merge pull request #7862 from Robyt3/Menus-Refactoring-Various
Various minor refactoring of menus
2024-01-27 13:08:55 +00:00
Robert Müller 83942f9a50
Merge pull request #7866 from heinrich5991/pr_ddnet_redundant_utf8_checks
Remove redundant UTF-8 checks
2024-01-27 13:03:45 +00:00
heinrich5991 c16afc60ec
Merge pull request #7864 from infclass/kaffeine/teeinfo-kitties
TeeInfo: Fix blue and limekitty eyes and feet 0.6 -> 0.7 mapping
2024-01-27 12:49:06 +00:00
heinrich5991 4f06f3a797 Remove redundant UTF-8 checks
We already check for valid UTF-8 while unpacking strings.
2024-01-27 13:43:04 +01:00
Jupeyy 349eb38ebf
Merge pull request #7859 from Robyt3/Windows-ShellExecute-Fixes
Ensure client window is maximized and active after restarting, refactoring
2024-01-27 11:27:40 +00:00
Alexander Akulich e0e37d7f7b TeeInfo: Fix blue and limekitty eyes and feet 0.6 -> 0.7 mapping 2024-01-27 02:00:16 +03:00
furo e14123164b Scale angles using MousePos with zoom 2024-01-26 23:12:47 +01:00
Robert Müller 2b2d3b8dd2 Add enum EServerControlTab 2024-01-26 21:39:11 +01:00
Robert Müller 8982da4a32 Refactor usages of CMenus::DoButton_MenuTab
Use `IGraphics::CORNER_NONE` instead of `0`.

Use `nullptr` instead of `NULL`.

Remove arguments identical to defaults.

Use loops for tab bars with several tabs.
2024-01-26 21:39:11 +01:00
Robert Müller 7854a277c7 Use IGraphics::CORNER_NONE for CUIRect::Draw function 2024-01-26 21:39:11 +01:00
Robert Müller f13888b2cc Move variable declarations closer to usages 2024-01-26 21:39:11 +01:00
Robert Müller 53b5b3bc98 Remove unused m_Spacer variable 2024-01-26 21:39:11 +01:00
Robert Müller eb2aea22b8 Remove redundant condition
The function `CMenus::RenderInGameNetwork` is only called when the client has `STATE_ONLINE` so this condition is always `true`.
2024-01-26 21:39:11 +01:00
Robert Müller 350c1fc860 Remove temporary variable and rename parameter 2024-01-26 21:39:11 +01:00
Robert Müller a49ee14cb0 Remove unused return value of menus render functions 2024-01-26 21:39:11 +01:00
Robert Müller bd7ee904c0 Remove unused PAGE_SYSTEM enum literal 2024-01-26 21:39:11 +01:00
heinrich5991 70743331de
Merge pull request #7861 from furo321/toggle-infomessages
Store info messages even if they aren't enabled
2024-01-26 19:45:46 +00:00
furo d94c0384a6 Store infomessages even if they aren't enabled 2024-01-26 20:20:20 +01:00
Robert Müller d5c7488480 Ensure client window is maximized and active after restarting
Add parameter to `shell_execute` to either start the process in the foreground or background on Windows. Previously, all processes were started in the background, because this is desired when starting the server from the client. However, this causes the graphics initialization to fail when restarting the client after updating or with the `restart` command when using Vulkan with windowed and windowed fullscreen mode.

Closes #6578.
2024-01-25 20:52:17 +01:00
Robert Müller 725ebc929e Remove duplicate if branch 2024-01-25 20:23:53 +01:00
Robert Müller c4d512d86e
Merge pull request #7687 from archimede67/editor-better-map-settings
Editor: better map settings input (autocomplete, validation)
2024-01-24 18:17:19 +00:00
Robert Müller 1f8a60b8e1 Show extra "Reset filter" button when no servers match filter
Render an additional "Reset filter" button below the "No servers match your filter criteria" message to make it more obvious for new players how to restore the original view of servers, especially when the filter tab is not currently selected.
2024-01-23 20:20:32 +01:00
Corantin H 0cd002e08c Various fixes to map settings handling 2024-01-23 20:15:30 +01:00
Corantin H aca398f3c9 Added dialog to fix invalid map settings on load 2024-01-23 20:13:57 +01:00
Corantin H 9cc8a28305 Better map settings input (autocomplete, validation) 2024-01-23 20:13:56 +01:00
Robert Müller 6829cd6ef6
Merge pull request #7856 from archimede67/editor-undo-cleanup-game-times
Editor: made "Clean up game tiles" undoable
2024-01-23 18:34:14 +00:00
Corantin H af51fcccbb Editor: made "Clean up game tiles" undoable 2024-01-23 19:03:53 +01:00
Robert Müller 9c66a6a147 Remove unused parameter of SetWindowParams function
The `bool AllowResizing` parameter is only passed to other `SetWindowParams` functions but never used in the end, as whether or not resizing is allowed is separately determined based on the value of the `int FullscreenMode` parameter.
2024-01-23 17:49:55 +01:00
heinrich5991 a2c8869025
Merge pull request #7852 from Robyt3/Browser-Community-Filter-Fix
Fix countries/types filters excluding all servers
2024-01-23 08:56:34 +00:00
Dennis Felsing 4f18816b2b Version 18.0.1 2024-01-22 22:53:09 +01:00
Robert Müller 797db31aa1 Fix countries/types filters excluding all servers
Instead of cleaning the countries/types filters based on all available communities' countries/types, only consider the countries/types of currently selected communities. Ensure countries/types are always cleaned when updating the server browser filter in the UI. This fixes that countries/types which are not available for the selected communities were still affecting the server filtering, causing no servers to be shown in some cases.

Closes #7847.
2024-01-22 22:30:15 +01:00
Dennis Felsing de0bd3a78a Version 18.0 2024-01-22 09:29:47 +01:00
Dennis Felsing 50dc9de991
Merge pull request #7839 from infclass/kaffeine/fix-move-restrictions-incapsulation
Character: Fix m_MoveRestrictions and m_Core incapsulation
2024-01-21 22:40:22 +00:00
Dennis Felsing fca6e0abe3
Merge pull request #7837 from Robyt3/Demo-Recorder-Improvements
Refactor demo recorder usage
2024-01-21 22:39:46 +00:00
Alexander Akulich d0f5ced546 Make http states a enum class and use it across the codebase 2024-01-22 01:06:59 +03:00
Robert Müller 9150f48562 Refactor demo recorder usage
To simplify the usage of the demo recorder, parameters are added to the `IDemoRecorder::Stop` function to control whether the demo file is removed or renamed when stopping the recording.

Ensure demo files of the replay recorder are always removed (except on crashes). The temporary replay demos were previously not removed when being disconnected from a server.

Fix auto demos being stopped and restarted when enabling replays in the settings menu. Now only the replay recorder is stopped/started when necessary.

Fix replay recorder being restarted when setting `cl_replay` variable with console without changing the value.

Remove unnecessary `CClient::m_ButtonRender` variable. Demo rendering is already stopped correctly when reaching the end of the demo without this additional variable.

Remove unused `CDemoRecorder::m_pMapData` variable.
2024-01-21 22:21:56 +01:00
Alexander Akulich 386935f5cf Character: Incapsulate m_MoveRestrictions and m_Core
Instead of leaking the m_MoveRestrictions to all classes which needs to
adjust the Character velocity, add a setter which takes into account those
restrictions.

The shotgun bug replication requires an access to the Velocity without the
restrictions applied (so we have to have this dirty setter).

Expose only *const* CCharacterCore to force the setters usage and prevent
incorrect write.
2024-01-21 20:59:50 +03:00
Robert Müller b89e4e8770 Finish CHttpRequest::OnCompletion before updating State()
Ensure that the `CHttpRequest::OnCompletion` function has finished before updating the state which is visible to other threads. Otherwise, threads may try to access the result of a completed HTTP request, before the result has been initialized/updated in the `OnCompletion` function.

Fixes warning due to invalid texture width/height being shown for downloaded skins, because the texture was loaded before the image data was initialized. Closes #7818.

Regression from #7683. Before this, the `OnCompletion` function could also modify the HTTP request's state, which was used to check if loading the skin PNG failed. Instead of doing this, a separate check is added for the skin download task to check that the PNG was loaded successfully.
2024-01-21 14:53:33 +01:00
Robert Müller 93cbad485d
Merge pull request #7831 from BlaiZephyr/move-nameplate-button
moved nameplates from hud -> nameplates
2024-01-19 20:26:51 +00:00
melon 5361637a55 fixed placement & spacing 2024-01-19 21:09:56 +01:00
melon abe6c1c4b5 moved nameplates from hud -> nameplates 2024-01-19 20:44:31 +01:00
Robert Müller 6e4afd7c63 Remove unnecessary check for entities close to map border
When handling door and laser entities, all 8 adjacent tiles are checked for laser modifier tiles. When handling laser entities, the 8 tiles one further out are also checked for laser modifier tiles. If either of those 16 tiles is outside the map bounds, an error message was printed and the tiles are ignored. The error message is removed because it's unnecessary and misleading. Placing entities near or on the map border is not known to cause any issues.

Closes #7759.
2024-01-18 22:44:22 +01:00
Dennis Felsing 0bce368c77
Merge pull request #7824 from Robyt3/Client-FPS-Graph-Timebase
Add time scale to debug graphs for constant scrolling speed
2024-01-17 23:29:13 +00:00
Ravie 69a74963ce Allow finer editor grid 2024-01-17 23:36:09 +01:00
Robert Müller 4be76f0d08 Add time scale to debug graphs for constant scrolling speed
Store X value (time) for all graph entries in addition to the Y value (FPS, prediction margin etc.). The `CGraph::Add` function adds values to the graph at the current time. The `CGraph::InsertAt` function allows specifying arbitrary X values, as long as the values are inserted in increasing order.

The entries are kept in a ringbuffer and old entries are recycled when it's full. The size of the ringbuffer is configurable for each graph, as the FPS graph needs significantly more buffer because values are added more often.

The scrolling speed of the graphs is fixed by specifying the maximum size of the window of values which should be displayed. For this purpose, a parameter is added to the `CGraph::Scale` function to specify the size of the window which should be rendered in the `CGraph::Render` function. For the FPS graph only the last second is rendered, so small spikes are still noticeable. For prediction and gametime margin graphs the last five seconds are rendered, which should result in a similar scrolling speed as before this change. The debug tuning graph is a special case, where the X values set manually and fixed to 0-127, same as before, instead of being based on the current time.

The graph rendering is made much more efficient by precalculating when the vertex colors need to be updated, to avoid all unnecessary calls to `SetColorVertex`. Additionally, line items are bundled together in an array to avoid calling `LinesDraw` for every individual line item.
2024-01-17 20:43:19 +01:00
heinrich5991 626b7ca805
Merge pull request #7795 from Robyt3/Menus-Browser-Tab-Icons
Use icons for Internet, LAN and Favorites server browser tabs, use star icon for favorite servers
2024-01-17 13:56:59 +00:00
heinrich5991 9bbceab2c4
Merge pull request #7814 from gerdoe-jr/stop-annoying-superteam
Don't warn about unfinishable map for super team
2024-01-17 13:55:07 +00:00
Dennis Felsing 7c4bde43b1
Merge pull request #7813 from gerdoe-jr/separate-cmds
Divide `/tp` into `/tpxy` and `/tpto`
2024-01-17 00:12:50 +00:00
Dennis Felsing 28cd6ad2a5 Fix style 2024-01-17 00:49:32 +01:00
Dennis Felsing 79bdd1a3bb
Merge pull request #7816 from Robyt3/Editor-Resize-Cursor-Alignment
Improve alignment of editor resize cursors
2024-01-16 23:47:09 +00:00
gerdoe-jr 1840519609
Check for characters wtih DDRACE_CHEAT instead of TEAM_SUPER 2024-01-16 23:16:19 +03:00
Vladislav Gerasimov c53e0af6ef
/tpto -> /tp and /teleport 2024-01-16 22:17:59 +03:00
Corantin H 12514360b7 Add editor tooltips to recent features
Add tooltip when drawing tele brush (tele numbers adjust).
Add tooltips when dragging quad points (alignment)
2024-01-16 19:31:01 +01:00
Robert Müller b4ceffdc83 Improve alignment of editor resize cursors
Center the resize (V/H) cursors on the mouse position instead of aligning the top-left with the mouse position. This feels better to use and is consistent with the behavior for example on Windows.
2024-01-16 19:12:01 +01:00
gerdoe-jr 40ed4bb98f
Check for super character in team, don't annoy them more than expected 2024-01-16 20:28:40 +03:00
gerdoe-jr 7df3330c06
Divide /tp into /tpxy and /tpto 2024-01-16 20:04:39 +03:00
heinrich5991 bb3bd57c0e
Merge pull request #7683 from Learath2/dd_pr_curlmultifinal
Use curl-multi. Supersedes #5842
2024-01-15 21:54:24 +00:00
heinrich5991 0f653b9b76
Merge pull request #7794 from ChillerDragon/pr_master_team_change
Report team changes to master when teams are on
2024-01-15 15:36:46 +00:00
Corantin H d2ea9cbcf1 Fix multiple editor undo/redo issues
Fixed crash when runing tool 'Remove unused envelopes' and trying to undo the addition of an envelope (#7738)
Fixed issues where undo/redo would not work properly when changing a layer's order or group property
Added missing action for changing the position of a sound source
2024-01-14 19:45:20 +01:00
Corantin H a3115d76d2 Restore ability to move points of all selected quads 2024-01-14 11:09:12 +01:00
Dennis Felsing 8dee975d66
Merge pull request #7744 from Robyt3/Editor-Color-Palette-Pipette
Add color palette and pipette to editor
2024-01-13 22:55:16 +00:00
Robert Müller d897573acc Fix chat background width calculation when scoreboard is open
The chat background width was too small when the scoreboard is open and the message text begins on a different line than the player name.
2024-01-13 22:41:50 +01:00
Robert Müller 4fded18644 Calculate chat message height using text render function 2024-01-13 22:41:42 +01:00
Robert Müller df12d586f4 Remove unnecessary default argument for TextEx 2024-01-13 22:41:38 +01:00
Robert Müller 5b2ef36fc3 Remove unnecessary temporary variables 2024-01-13 22:41:36 +01:00
Robert Müller 9b24820fd9 Fix potentially incorrect chat background for censored messages
The censored message was not being considered when calculating the size of chat messages.
2024-01-13 22:40:57 +01:00
Robert Müller 3e61d0dadc Extract local variable Line 2024-01-13 22:40:41 +01:00