Commit graph

10056 commits

Author SHA1 Message Date
Robert Müller f50eeab690 Fix performance-inefficient-vector-operation 2023-12-14 23:38:05 +01:00
Robert Müller bab382f4cc Fix modernize-use-emplace 2023-12-14 23:38:05 +01: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
heinrich5991 efe593c7b0
Merge pull request #7602 from ChillerDragon/pr_create_switcherscontroller
Move switcher snapping code to own method
2023-12-13 22:10:49 +00:00
Robert Müller 68508e1b81 Add small margin to callvote label 2023-12-13 17:47:10 +01:00
ChillerDragon 1723554288 Move switcher snapping code to own method 2023-12-13 17:29:02 +01:00
heinrich5991 b458890f08
Merge pull request #7639 from ChillerDragon/pr_canjoinmsg
Move chat message into CanJoinTeam()
2023-12-13 15:27:25 +00:00
ChillerDragon 157e8b7302 Pass error message as buffer to CanJoinTeam()
Now `CGameContext` no longer assumes the `IGameController`
declined the team join due to slots.

This enables custom gametypes to disallow joining the game if the player
died, an active tournament is running or the player is not logged in
yet. And then the controller can print the correct error message
accordingly.
2023-12-13 14:46:37 +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
Edgar 3cb510a2e6
Merge pull request #7637 from heinrich5991/pr_ddnet_even_less_system_h
Remove `#include <system.h>` from one more header
2023-12-12 08:14:32 +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
heinrich5991 be53d83019 Remove #include <system.h> from one more header 2023-12-12 00:44:46 +01: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
Robert Müller 990bb8bb5d
Merge pull request #7632 from furo321/input-envelope-scaling
Fix envelope scaling being triggered in name input.
2023-12-11 20:36:03 +00:00
furo b42f43ce99 Fix envelope scaling being triggered in name input. 2023-12-11 21:17:24 +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 8c5b8a88c8 Ensure white color for entities layers when loading map layers 2023-12-11 13:37:23 +01:00
Corantin H 0c69378fcd Prevent editing the color of entities layers 2023-12-11 13:36:42 +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
Corantin H 51220b1dfc Fix editor modified state not being updated properly 2023-12-11 00:03:46 +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 20d9920d00 Consistent rounding of editor value/color picker buttons
Fix too large rounding for some editor color picker buttons.
2023-12-10 11:41:18 +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
Dennis Felsing 63710e91e8
Merge pull request #7601 from ChillerDragon/pr_fix_authstate_id
Use real ClientID to lookup authed state
2023-12-09 17:26:48 +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
ChillerDragon f8ca16c50e Use real ClientID to lookup authed state and score
The variable `Id` is translated for old clients and is not guranteed to
be the real id. While `m_ClientID` is the real ID. That can also be used
to index the CServer::m_aClients[] array to get the authed state.

closed #7599

Fixes

```
valgrind ./DDNet-Server "dbg_dummies 1"
[..]
2023-12-07 18:01:33 I chat: *** 'Debug dummy 1' entered and joined the
game
==75634== Conditional jump or move depends on uninitialised value(s)
==75634==    at 0x2DAA83: CVariableInt::Pack(unsigned char*, int, int)
(compression.cpp:17)
==75634==    by 0x2DAD79: CVariableInt::Compress(void const*, int,
void*, int) (compression.cpp:98)
==75634==    by 0x23EC50: CServer::DoSnapshot() (server.cpp:1046)
==75634==    by 0x247D2D: CServer::Run() (server.cpp:2994)
==75634==    by 0x230173: main (main.cpp:193)
==75634==
==75634== Conditional jump or move depends on uninitialised value(s)
==75634==    at 0x2DAAF7: CVariableInt::Pack(unsigned char*, int, int)
(compression.cpp:25)
==75634==    by 0x2DAD79: CVariableInt::Compress(void const*, int,
void*, int) (compression.cpp:98)
==75634==    by 0x23EC50: CServer::DoSnapshot() (server.cpp:1046)
==75634==    by 0x247D2D: CServer::Run() (server.cpp:2994)
==75634==    by 0x230173: main (main.cpp:193)
==75634==
==75634== Conditional jump or move depends on uninitialised value(s)
==75634==    at 0x2DAA83: CVariableInt::Pack(unsigned char*, int, int)
(compression.cpp:17)
==75634==    by 0x32E812: CPacker::AddInt(int) (packer.cpp:20)
==75634==    by 0x23ED51: CServer::DoSnapshot() (server.cpp:1059)
==75634==    by 0x247D2D: CServer::Run() (server.cpp:2994)
==75634==    by 0x230173: main (main.cpp:193)
==75634==
==75634== Conditional jump or move depends on uninitialised value(s)
==75634==    at 0x2DAAF7: CVariableInt::Pack(unsigned char*, int, int)
(compression.cpp:25)
==75634==    by 0x32E812: CPacker::AddInt(int) (packer.cpp:20)
==75634==    by 0x23ED51: CServer::DoSnapshot() (server.cpp:1059)
==75634==    by 0x247D2D: CServer::Run() (server.cpp:2994)
==75634==    by 0x230173: main (main.cpp:193)
==75634==
```

Which is using ID 0 as index in the m_aClients array but only ID 63 was
ever initialized.
2023-12-07 18:40:16 +01:00
heinrich5991 65641763c1
Merge pull request #7591 from Robyt3/Editor-Sound-Invalid-Index
Fix incorrect sound index usage for editor sound preview
2023-12-06 11:22:00 +00: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 7e8c2aa4be Fix incorrect sound index usage for editor sound preview
The invalid sound index is `-1` but the check in the editor for the sound preview assumed it was `0`. We should use a type-safe wrapper to avoid this in the future, like for texture handles.
2023-12-04 22:21:53 +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
Dennis Felsing 07fd8c1a48
Merge pull request #7576 from furo321/favourite-with-prefix
Fix bug when using favourites in combination with prefixes.
2023-12-02 22:35:30 +00:00
furo 732b213c09 Fix bug when using favourites in combination with prefixes. 2023-12-02 18:49:15 +01:00
furo d9a726eb48 Stop all recording of server demos on shutdown. 2023-12-02 11:10:20 +01:00
ChillerDragon cd9fc2964d Use SetEmote() 2023-12-01 22:50:00 +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