Commit graph

4896 commits

Author SHA1 Message Date
Learath2 6eb51239c9 Fix some clang-tidy issues and UB 2024-01-12 23:27:49 +03:00
Learath 1f224344ec Format and bump fake curl 2023-12-18 23:02:00 +01:00
Learath 1dc8496470 Use curl-multi 2023-12-18 20:06:43 +01:00
Egehan 87063d048c
add ui setting for cl_show_local_time_always 2023-12-17 19:28:35 +03:00
Robert Müller 4ddf1dfdd5
Merge pull request #7674 from furo321/history-login-prompt
Disable cycling through command history when logging in to rcon.
2023-12-17 15:55:04 +00:00
furo 2f89297395 Disable cycling through command history when logging in to rcon. 2023-12-17 15:32:18 +01:00
furo c984c6895a Fix clang warning -Wbitwise-instead-of-logical 2023-12-17 00:54:23 +01:00
Dennis Felsing 2993d3ad11 Fix style 2023-12-16 11:10:02 +01:00
Egehan 5da5eb79bb
Add ui setting cl_same_clan_color 2023-12-16 11:06:29 +03:00
Dennis Felsing 5b5253c4ec
Merge pull request #7659 from furo321/render-spectated-last
Render the tee being spectated after everyone else.
2023-12-15 22:09:49 +00:00
furo 25ffc421cc Render the tee being spectated after everyone else. 2023-12-15 21:34:33 +01:00
Robert Müller 184ada3c95 Fix various lineinput issues/regressions
Fix Ctrl+C not working to copy text in console when the command input already contains text, as the changed flag was never reset properly.

Fix scroll position of UI editboxes not being updated when moving cursor without changing text.

Fix lineinput selection change being detected as content change, causing the editor modified state to be set incorrectly.

Fix cursor blinking not being disabled correctly after changing text without changing cursor position.
2023-12-15 17:49:06 +01:00
Dennis Felsing 514e528be7
Merge pull request #7649 from furo321/chat-command-netmsg
Add `Sv_CommandInfo` netmsg for autocompletion of chat commands.
2023-12-14 23:46:52 +00:00
Robert Müller aacd37b412 Fix readability-static-accessed-through-instance 2023-12-14 23:38:05 +01:00
Robert Müller 6a12e209b6 Fix readability-make-member-function-const 2023-12-14 23:38:03 +01:00
Corantin H af77ebac54 Added console search function 2023-12-14 21:58:27 +01:00
furo 035e7a1068 Add Sv_CommandInfo netmsg for autocompletion of chat commands. 2023-12-14 19:01:35 +01:00
Robert Müller 68508e1b81 Add small margin to callvote label 2023-12-13 17:47:10 +01:00
furo 09e222c39f Set correct colour for authed colour reset button 2023-12-13 13:23:33 +01:00
Edgar 082c44889a
Merge pull request #7635 from archimede67/fix-escape-key-lineinput
Fix escape key not working when lineinput is focused
2023-12-12 08:14:51 +00:00
heinrich5991 e4c97e5583
Merge pull request #7574 from furo321/remove-telecursor
Don't scale TargetXY by zoom when in spectator.
2023-12-11 23:50:21 +00:00
Dennis Felsing 7813cfed6c
Merge pull request #7618 from heinrich5991/pr_ddnet_less_system_h
Make less headers depend on `<base/system.h>`
2023-12-11 23:08:59 +00:00
heinrich5991 05af24a052 Make less headers depend on <base/system.h>
Move a couple of trivial type definitions to `<base/types.h>` instead.
2023-12-11 23:52:23 +01:00
archimede67 0aca09093f Use WasCursorChanged() when rendering lineinput in CUI::DoEditBox 2023-12-11 22:26:19 +01:00
ChillerDragon ab5a7b88bd Add ui setting for cl_authed_player_color 2023-12-11 20:21:01 +01:00
furo 466dca87a6 Support F5 and Modifer + R for refresh where possible. 2023-12-11 16:52:21 +01:00
Corantin H 7b20bf71e6 Fix modified state being set when lineinput is selected.
Differentiate between text and cursor changes by adding an additional `m_WasCursorChanged`.
2023-12-11 00:05:13 +01:00
Robert Müller 733b46da87
Merge pull request #7613 from archimede67/fix-chat-input-history
Reset history entry along with chat input when using Escape
2023-12-10 18:34:28 +00:00
Corantin H 5b7c064ea2 Reset history entry along with chat input when using Escape 2023-12-10 17:39:41 +01:00
Robert Müller 83af5e47f3 Improve key reader button
Show localized text "Press a key…" instead of "???" while waiting for a key to be pressed.

Render button with green background while waiting for a key to be pressed.

Inline unnecessary `DoButton_KeySelect` function.

Fix names of static variables.
2023-12-10 16:07:27 +01:00
Robert Müller 1b03637436 Remove unused color argument, use ColorRGBA instead of vec4 2023-12-10 16:05:59 +01:00
Robert Müller 7ae7877248
Merge pull request #7593 from archimede67/console-scrolling
Add ability to scroll in console. Remove pages.
2023-12-09 18:26:32 +00:00
Robert Müller d3cc932a9b
Merge pull request #7393 from archimede67/editor-undo-redo-v2
Editor undo/redo v2
2023-12-09 18:17:38 +00:00
furo e0b51c2aec Add ability to scroll in console. Remove pages. 2023-12-09 12:20:43 +01:00
furo bac3670296 Don't scale TargetXY when in spectator 2023-12-09 01:44:00 +01:00
Robert Müller 48805a6db4
Merge pull request #7596 from archimede67/fix-chat-preview-update
Fix chat preview update
2023-12-07 19:44:46 +00:00
Corantin H 2dd917f4c0 Update preview lines instead of initializing them only once 2023-12-07 19:20:24 +01:00
heinrich5991 20a636d0d4
Merge pull request #7590 from Robyt3/UI-Popup-Open-Close-Fix
Fix heap-use-after-free when popup opens another popup
2023-12-06 11:18:38 +00:00
Corantin H 96e4c5f7cd Add editor undo/redo feature 2023-12-04 22:44:20 +01:00
Robert Müller d8ec6a0a35 Fix heap-use-after-free when popup opens another popup
The popup menu render function can open/close other popups, which may resize the vector of popup menus and thus invalidate the current popup menu variable before the popup is closed. We therefore store the popup UI element ID in a separate variable to avoid the access to the potentially invalidated popup menu variable after the popup menu is rendered.

Also prevent invalidated popup menu from being rendered for one frame after it is closed by clicking outside.

Closes #7565.
2023-12-04 22:12:20 +01:00
ChillerDragon a0736e4f24 Make intersect TeleNr arg optional
gets rid of the need to define a unused variable
2023-12-03 21:36:45 +01:00
furo 732b213c09 Fix bug when using favourites in combination with prefixes. 2023-12-02 18:49:15 +01:00
Emir Marincic eba86204db
Merge pull request #7552 from Robyt3/Config-Refactoring
Refactor config manager, move config variable handling
2023-12-01 19:34:44 +00:00
Robert Müller 44aac623fa
Merge pull request #7512 from furo321/telecursor-fixes2
Scale `TargetX` and `TargetY` by zoom level.
2023-12-01 16:36:30 +00:00
heinrich5991 21cfb01ec3
Merge pull request #7515 from furo321/racefinish-message
Add finish info messages from 0.7
2023-12-01 16:13:06 +00:00
furo 7a6e368b7f Scale TargetX and TargetY with camera zoom 2023-11-30 22:34:36 +01:00
Robert Müller 1d7c0fad49 Check SHA256 of downloaded maps and community icons
Add `CHttpRequest::ExpectSha256` function to specify expected SHA256 for HTTP downloads. If the download completes with a different SHA256 hash than expected, then the download fails and the file is deleted.

Closes #7485.
2023-11-30 21:31:48 +01:00
Robert Müller 159ddf5534 Refactor config manager, move config variable handling
Move all code for handling of config variables from console to config manager. The console no longer depends on the config manager, instead the config manager now depends on the console.

Add `struct`s to manage config variables of different types (int, color and string). The config manager now keeps a list of all config variables, so usage of the preprocessor can be avoided except for code to initially create all config variables. Additionally, a separate list of just the game config variables (config variables with `CFGFLAG_GAME`) is kept to optimize the `ResetGameSettings` function, as this function is called whenever connecting to a server and should be fast. Previously, this function was even less efficient because it preformed a linear search for every individual game config variable to find the respective command data.

Move console commands that opperate only on config variables (`reset`, `toggle` and `+toggle`) to config manager. Ensure that these commands only opperate on the desired config variables (client or server, respectively) by checking `IConsole::FlagMask`.

Add `IConfigManager::SetReadOnly` function to set/unset config variables as read-only instead of manually overriding the command handlers for the `sv_rescue` and `sv_test_cmds` config variables. This also fixes that read-only config variables could still be changed by using the `reset` command. A console message is now printed when trying to change a read-only config variable. Removing the special handling for these two config variables is additionally useful so the console does not need to keep a pointer to config values and manager.

Use a `CHeap` for the config variables, their help texts and the previous values of string config variables to avoid many separate allocations as well usage of static variables. Also use the heap to store the unknown commands instead of using `std::string`s.

Properly trigger command chain when resetting config variables with the `reset` command and when resetting game settings on map loading. Closes #7461.

Format default value for color variables as RGB/RGBA hex with dollar sign prefix. Closes #5523.

Add log message when using `reset` with a variable that does not exist. Use `log_error` instead of `dbg_msg` when saving config file fails.

Support unlimited number of config save callbacks instead of at most 16. The code also becomes more readable by using an `std::vector` instead of a fixed-size array and a separate num variable.

Consistently name `MACRO_CONFIG_*` parameters when declaring the macros.

Add `IConsole::CMDLINE_LENGTH` constant to represent the maximum length of the console input and thereby reduce usage of magic numbers for buffer sizes.
2023-11-30 20:26:00 +01:00
Robert Müller a1eb0ddd4c Also print command in console when identical to previous
The command currently being executed was not being printed to the console if it's identical to the previous history entry.
2023-11-29 20:42:23 +01:00
Robert Müller 5aa9003180 Remove unused ver parameter of MACRO_INTERFACE 2023-11-28 21:46:03 +01:00