Commit graph

10415 commits

Author SHA1 Message Date
swarfeya a9b19ff2a7 Increment m_SentSnaps inside of FakeSnap() 2024-01-06 16:02:43 +01:00
Dennis Felsing c5d6389132
Merge pull request #7764 from heinrich5991/pr_ddnet_msg_groups
Group a couple of "list" messages
2024-01-05 18:34:39 +00:00
heinrich5991 ac041d7f34 Group CNetMsg_Sv_CommandInfo 2024-01-05 18:10:57 +01:00
heinrich5991 f81828e78e Group CNetMsg_Sv_VoteOptionListAdd 2024-01-05 18:10:57 +01:00
Robert Müller a55d49833e Use IStorage::FormatTmpPath function for editor map names 2024-01-05 17:46:26 +01:00
swarfeya d04cb7a36a actually fix happy ddnet message 2024-01-04 18:36:32 +01:00
Robert Müller 84f3bb5a4d Fix missing editor explanation for kill tile in front layer
The kill tile can also be used in the front layer and works as expected.
2024-01-04 17:42:53 +01:00
Robert Müller abc7b602b2 Avoid copying texture memory when possible
Add separate `IGraphics::LoadTextureRawMove` function with non-`const` `void *pData` argument in addition to existing `LoadTextureRaw` function with `const void *pData` argument. The former function takes ownership of the data and avoids copying the texture data into an additional buffer, if the texture data is already in RGBA format. Non-RGBA texture data always needs to be converted and therefore also copied.

The `LoadTextureRaw` function is split into smaller functions to share common code with the `LoadTextureRawMove` function. Alternatively to this, a flag `TEXLOAD_MOVE_DATA` could have been added to the existing `LoadTextureRaw` function, which would have required the use of `const_cast` to free the texture data.
2024-01-03 23:03:04 +01:00
Robert Müller c99d77ab84 Fix wrong selection in vote menu when selected player leaves
The selection in the kickvote/specvote menu was reset to the first player when the previously selected player leaves or if the filter string does not match it. Now the selection is cleared in these cases, to prevent players from accidentally starting kickvotes/specvotes on the wrong player.

Remove unnecessary `static` variable. Improve readability by not nesting post-increment in another statement.
2024-01-02 18:10:48 +01:00
ChillerDragon 81c43ded42 Explicitly set all 0.7 dmg event fields 2024-01-02 13:40:13 +01:00
Corantin H 454b4e4a1e Respect corners when doing edit box when rendering value selector 2023-12-31 12:07:21 +01:00
heinrich5991 04553d6798
Merge pull request #7706 from Robyt3/Menus-Player-Tee-Settings-Improvement
Improve player and tee settings menus
2023-12-30 22:51:44 +00:00
heinrich5991 fc825fb091
Merge pull request #7696 from ewancg/tp-coords
add x and y coords to /tp
2023-12-30 22:50:06 +00:00
Ewan Green 124bbc429a add x and y coords to /tp 2023-12-30 14:50:48 -07:00
Robert Müller f5e7fa24d6 Add color palette and pipette to editor
Add color palette with up to 8 colors to editor toolbar. The palette colors work like regular color picker buttons, so they open a color picker popup on click and the value can be copied and pasted with Ctrl+Right click and Ctrl+Left click respectively. Less palette colors are shown when not enough space is available (with 5:4 resolutions).

Add color pipette which allows selecting any color displayed on the screen. Selecting a color with the pipette adds the new color to the palette and shifts the other colors to the right. The selected color is also copied to the clipboard immediately. The hotkey Ctrl+Shift+C is added to toggle the color pipette, which allows using the color pipette in popups and dialogs.

The implement this, the function `IGraphics::ReadPixel` and the command `SCommand_TrySwapAndReadPixel` are added to read a specified pixel's color from the backbuffer. Like the screenshot command, this command also requires a swap operation to be performed before the correct pixel color can be read with the Vulkan backend. The `ReadPixel` function therefore accepts a pointer to a `ColorRGBA` that will be filled after the next swap operation.

Closes #7430.
2023-12-30 13:17:30 +01:00
Dennis Felsing 9c8a081692
Merge pull request #7743 from furo321/hookduration-07
Fix players on 0.7 becoming invisible when `m_HookTick` is negative.
2023-12-29 22:58:38 +00:00
furo a918c61de8 Fix players on 0.7 becoming invisible when m_HookTick is negative. 2023-12-29 22:39:42 +01:00
Dennis Felsing 0f1171a501
Merge pull request #7741 from furo321/translate-racefinish
Use 0.7 translation layer for `Sv_RaceFinish` netmessage.
2023-12-29 08:00:19 +00:00
furo 1a94aa6d8a Use 0.7 translation layer for Sv_RaceFinish netmessage. 2023-12-29 08:33:36 +01:00
Dennis Felsing ee2dd0ac1c
Merge pull request #7740 from Robyt3/UI-Mouse-Clamp
Fix mouse being outside of UI screen on right and bottom edges
2023-12-28 22:33:27 +00:00
dobrykafe 429b0c6fdb add restart button for restart warning label 2023-12-28 22:39:36 +01:00
Robert Müller 018529c683 Fix mouse being outside of UI screen on right and bottom edges
Ensure that the UI mouse position stays inside the UI screen rect. Previously, the mouse was not considered to be inside the UI screen when all the way at the right or bottom edge. This caused the map editor tooltip to not be shown when the mouse is all the way at the right side of the map editor view. This is a cleaner fix for #4553 which reverts the previous workaround from #6423.
2023-12-28 21:23:16 +01:00
Dennis Felsing 3820abaefb
Merge pull request #7739 from Robyt3/Editor-Toolbar-Anim-Grid-Icons
Improve editor toolbar anim and grid buttons, add dropdowns
2023-12-28 18:04:51 +00:00
Corantin H ffd7776147 Add cursor types and use resize cursor for dragbars 2023-12-28 18:35:23 +01:00
Corantin H c2ce2c9d1a Refactor editor dragbar, allow resize of layers panel 2023-12-28 18:35:22 +01:00
Robert Müller c9640459e4 Improve editor toolbar anim and grid buttons, add dropdowns
Add dropdown menus for changing animation and grid settings (i.e. animation speed and grid size) instead of conditionally showing more buttons for this directly in the menu bar. This frees up space in the menu bar, which is currently full on 5:4 resolutions.

The icons previously used for the default animation/grid buttons are now used for the main buttons that toggle animation/grid instead of using text.

Support setting lower animation speeds with the plus and minus buttons by adjusting the step size when the animation speed is low.

Support setting arbitrary animation speed by text input.
2023-12-28 17:43:09 +01:00
Dennis Felsing fedad1de6c
Merge pull request #7736 from archimede67/editor-fix-group-pos-props
Editor: fix group position properties not working correctly
2023-12-27 23:23:53 +00:00
Corantin H 3d606847fd Fix group position properties not working correctly 2023-12-28 00:03:28 +01:00
Corantin H 83540ade5c Fix duplicate layers in popup layer context
Clear layers from context before adding any layer, preventing layers from being kept in the vector until only a single layer is selected. Fixes #4978.
2023-12-27 23:11:52 +01:00
Dennis Felsing 15e6e5eeab
Merge pull request #7730 from archimede67/editor-fix-picker
Fix broken selection in editor
2023-12-27 17:38:57 +00:00
Dennis Felsing f93573c55a
Merge pull request #7732 from archimede67/editor-fix-append
Editor: improve append (fixes #7625)
2023-12-27 17:38:40 +00:00
Corantin H f3fc85cfbb Improve editor append (fixes #7625)
Fix broken editor append.
Check for image data when image names are identical. In such case, appended image is renamed until its name is unique.
2023-12-27 18:09:39 +01:00
Corantin H b949a7de21 Fix broken selection in editor 2023-12-27 17:41:19 +01:00
Dennis Felsing dfb6967a47
Merge pull request #7722 from archimede67/autocomplete-console-refactor
Refactor argument autocompletion in console
2023-12-27 15:01:06 +00:00
Dennis Felsing a149d28649
Merge pull request #7728 from archimede67/editor-differentiate-cp-tele
Editor: differentiate between normal and checkpoint teles
2023-12-27 14:45:37 +00:00
Corantin H 42771ac42f Refactor argument autocompletion in console
Allows autocompletion of specific argument instead of the first argument only
2023-12-27 15:43:56 +01:00
Corantin H 84c2168650 Differentiate between normal and checkpoint teles 2023-12-27 15:23:57 +01:00
Robert Müller 6cc42aa58c Fix slightly incorrect color components shown in color pickers
The individual color components were rounded down when being displayed on their own in color pickers, whereas the components are rounded to the nearest integer when packing the colors into the hex string. This was causing minor discrepancies between the color being displayed/saved as hex and the individual components. Rounding the components when packing is necessary to reduce the error when converting between color spaces.
2023-12-27 13:47:03 +01:00
Dennis Felsing 269f276fee
Merge pull request #7726 from archimede67/allow-panning-outside-container
Editor: allow panning outside initial container
2023-12-27 12:20:34 +00:00
Dennis Felsing e549e67c95
Merge pull request #7725 from archimede67/editor-automap-include-fix
Only include `layer_tiles.h` in `auto_map.cpp`
2023-12-27 12:05:32 +00:00
Corantin H 4e10d55b36 Allow panning outside initial container 2023-12-27 12:57:36 +01:00
Corantin H d3ff602f62 Only include layer_tiles.h in auto_map.cpp 2023-12-27 12:29:25 +01:00
Robert Müller 04f4305165 Improve player and tee settings menus
Add tabs to player and tee settings pages to switch between player (main) and dummy settings instead of using a checkbox for this, to improve the usability.

Improve layout of tee settings page, especially with 5:4 resolutions, where the eye selector previously overlapped with other UI elements. Decrease size of eye selector and make better use of empty space overall. Use more space for skin selector instead of showing empty space when "Use custom colors" is disabled.

Show favorite skin buttons also when hovering list items to make it easier to discover the feature. Add small highlight color to favorite skin buttons when hovering them.
2023-12-27 11:56:35 +01:00
Robert Müller 4c2dfa24db Improve performance when rendering map overlay texts
The text color was previously set and reset for every individual number being rendered for non-empty tele, speedup, switch and tune tiles. The color is the same for all tiles from each entities layer, so most of these `TextColor` calls are unnecessary. Now the text color is only set and reset once when rendering each entities layer.
2023-12-27 11:51:18 +01:00
Dennis Felsing 453bc0f66a
Merge pull request #7720 from MrBlubberBut/patch-2
Fix automatic hammer on release when cl_dummy_control is set to 1
2023-12-27 09:01:45 +00:00
Dennis Felsing 9828da6f3e Fix formatting 2023-12-27 09:45:10 +01:00
Dennis Felsing 751b2a4a93
Merge pull request #7721 from archimede67/editor-better-tele-text
Editor: improve text rendering inside tele tiles
2023-12-27 08:44:04 +00:00
Corantin H fcc095b675 Improve text rendering inside tele tiles in editor 2023-12-27 00:16:44 +01:00
Dennis Felsing 90596e51ee
Merge pull request #7719 from archimede67/editor-adjust-special-tiles-shortcut
Editor: add shortcut to adjust special tiles numbers
2023-12-26 22:13:02 +00:00
Corantin H 166b27fc27 Use ctrl+f when brush is not empty to replace tile numbers with next free 2023-12-26 20:42:42 +01:00
Corantin H 643cdf8717 Add shortcut to change tele, switch and tune number of current brush (#5400) 2023-12-26 20:17:36 +01:00
MrBlubberBut 32e187f18e
Fix automatic hammer on release when cl_dummy_control is set to 1
Let's say you have this bind:

```bind x +toggle cl_dummy_hammer 1 0```

and you set cl_dummy_control to 1.

When you press the bind i mentioned above, and then release, the dummy will hammer where he is looking (not at you). So, in total, there will be two hammers. One hammer when you press down the button and the dummy hammers towards you, and then another hammer when you release the button and the dummy hammers where he is looking.

This fixes it, and also makes sure it does not conflict with cl_dummy_copy_moves (as if it is enabled and cl_dummy_control is enabled, the dummy will not copy fire, hook, or jump) so I made sure it keeps this functionality as it's pretty cool.

This does not fix any other bugs yet, maybe I will fix those in the future but we'll see. Any bug you may encounter with this change is also probably present in the main branch, such as resetonswitch not working perfectly with dummy_control, but if you do find something different then let me know.
2023-12-26 13:59:06 -05:00
Dennis Felsing 8ce103f04f
Merge pull request #7717 from archimede67/editor-unused-tiles-popup
Show unused tiles warning popup for all entities layer
2023-12-26 18:29:35 +00:00
Dennis Felsing 53dba33c21
Merge pull request #7715 from infclass/kaffeine/pr
RenderTools: Add const/static method qualifiers
2023-12-26 18:24:25 +00:00
Corantin H e9958aca19 Show unused tiles warning popup for all entities layer 2023-12-26 19:11:36 +01:00
Alexander Akulich 43710fe541 Use CRenderTools::GetRenderTeeOffsetToRenderedTee via class name instead of instance
Fixes clang-tidy warning.
2023-12-26 21:08:50 +03:00
Corantin H 70d263a7d5 Remove ifs when drawing quads QoL buttons 2023-12-26 18:49:45 +01:00
Alexander Akulich 7e95d4be22 CGameClient::CClientData::Reset: Reset skin info 2023-12-26 19:37:21 +03:00
Alexander Akulich f396056425 CRenderTools: Mark some methods static and (some) const 2023-12-26 19:37:21 +03:00
Dennis Felsing f12f789c3a
Merge pull request #7709 from furo321/server-demos-fixes
A few fixes and improvements to server-side auto demos.
2023-12-26 07:58:30 +00:00
Dennis Felsing 03ce78f781
Merge pull request #7711 from Robyt3/Textrender-Selection-Fix
Improve text line spacing and console text selection
2023-12-26 07:58:14 +00:00
Dennis Felsing 0376f1cd2b
Merge pull request #7708 from furo321/ctrl-shift-z
Support `Ctrl + Shift + Z` as editor redo hotkey.
2023-12-26 07:55:15 +00:00
Robert Müller 4c223a0002 Improve text line spacing and console text selection
Consider line spacing to belong to the previous line when calculating and rendering text selection. Instead of handling spacing between entries separately in the console, also include line spacing for the last line in the height calculation. Pixel align the line spacing in addition to the font size, as previously some gaps between the entries were larger than others due to missing pixel alignment. This allows rendering the text selection in the console smoothly without any gaps between the console entries/lines.

Closes #7617.
2023-12-25 19:11:42 +01:00
Corantin H 5f6cec20c6 Fix infinite console scroll 2023-12-25 19:00:38 +01:00
furo f7c618d8b1 Start recording of server auto demo on init. 2023-12-25 14:58:18 +01:00
furo 1eada0a8ba Support Ctrl + Shift + Z as editor redo hotkey. 2023-12-25 12:02:18 +01:00
Robert Müller c9b2872459
Merge pull request #7707 from furo321/revert-highdetail
Revert removal of "Detail" from sound layers.
2023-12-25 09:51:51 +00:00
furo 76fa62d8fb Revert removal of "Detail" from sound layers. 2023-12-25 01:17:36 +01:00
Corantin H 5599de3153 Use CEditorComponent methods instead of only CMapView
Small changes to `CEditorObject`
2023-12-23 14:45:36 +01:00
Robert Müller fa0b218eed Use str_copy instead of mem_copy for skin names
The `mem_copy` function does not respect zero termination so it reads beyond the size of the source buffer, if it's smaller than the destination buffer.
2023-12-22 22:14:15 +01:00
Robert Müller 32b32d7052 Remove unnecessary checks for number of command arguments
The argument of `add_favorite_skin` and `remove_favorite_skin` is mandatory, so the callback will never be called without it.
2023-12-22 22:13:58 +01:00
Robert Müller 6fc3470a8d Check for valid favorite skin name, add CSkin::IsValidName
Favorite skin names were previously not escaped as intended when saving, as the variable `aNameEscaped` was unused so the original skin name was saved instead of the escaped one. Escaping is not really necessary, as skins should not contain `\` and `"` anyway and it was only possible to add such favorites through the console or config files. Instead of escaping the favorite skin names when saving, now favorite skin names are validated when they are added so no escaping is necessary. Skins names are considered valid when they have a length of 1-23 bytes and don't contain the characters `/`, `\` and `"`.
2023-12-22 22:13:33 +01:00
Corantin H 34a26daeba Fix wrong value type for some map settings in gamecontext.cpp
Fix some help texts starting with a lowercase character
2023-12-22 18:15:37 +01:00
Corantin H 949eea08df Do not adjust console selection when keeping scroll offset
Also decrease `m_NewLineCounter` by the entry line count.
2023-12-21 00:22:12 +01:00
Robert Müller d228064361 Fix console selection not adjusted anymore when entries added
The current mouse-based console selection was not being adjusted anymore when new lines are added to the console, as the `m_NewLineCounter` variable was decremented to `0` before the relevant check for `m_NewLineCounter > 0`.
2023-12-20 17:55:10 +01:00
heinrich5991 ddd10f2308
Merge pull request #7648 from dobrykafe/pr-master-info
report the ddrace team to master instead of the normal team
2023-12-20 15:27:32 +00:00
dobrykafe 40d56611ba report ddrace team to master 2023-12-20 16:09:10 +01:00
Edgar 95cd183e1e
Merge pull request #7681 from Robyt3/Mapitems-Sound-DataSize-Check
Use `GetDataSize` instead of `CMapItemSound::m_SoundDataSize`
2023-12-20 10:37:54 +00:00
furo 1c6e629a9b Add missing return statements to AttemptJoinTeam 2023-12-20 04:10:51 +01:00
Robert Müller 3e89bbb15e Clear console selection only when scroll position is changed
The selection is only cleared because it would be incorrect after scrolling, but it doesn't need to be cleared if the scroll position does not change, e.g. when pressing Home while already at the top of the backlog.
2023-12-19 20:31:22 +01: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
Robert Müller a1b603a424
Merge pull request #7682 from furo321/clamp-volume-env
Clamp volume envelopes between 0.0f and 1.0f
2023-12-18 18:47:57 +00:00
furo fd2582c267 Clamp volume envelopes between 0.0f and 1.0f 2023-12-18 18:35:13 +01:00
Robert Müller aa15d9b19b Use GetDataSize instead of CMapItemSound::m_SoundDataSize
Do not use the `CMapItemSound::m_SoundDataSize` value as it is redundant. This value could also be incorrect because it can be freely set by the map creator (tool).

Instead, use the map/datafile function `GetDataSize` to get the true size of the sound data in the file.

The `m_SoundDataSize` value is still written to map files for compatibility with old versions.
2023-12-18 17:58:42 +01:00
Dennis Felsing f298b28026
Merge pull request #7678 from eghwand/pr_showlocaltimealways_setting
add ui setting for cl_show_local_time_always
2023-12-18 07:56:01 +00:00
Dennis Felsing c0ed140a31 Version 17.4.2 2023-12-18 08:58:10 +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
heinrich5991 4af28fd2d8
Merge pull request #7672 from furo321/bitwise-instead-of-logical
Fix clang warning `-Wbitwise-instead-of-logical`
2023-12-17 00:11:06 +00:00
furo c984c6895a Fix clang warning -Wbitwise-instead-of-logical 2023-12-17 00:54:23 +01:00
Dennis Felsing 4429347f83
Merge pull request #7662 from furo321/more-team-commands
Add `/join [player]`
2023-12-16 23:45:16 +00:00
furo 67c101b43d Add /join [player]. 2023-12-16 17:33:10 +01:00
Dennis Felsing 5aa4b58d4e
Merge pull request #7661 from archimede67/editor-qol-quads
Editor: Add QoL features for quads
2023-12-16 11:09:16 +00: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
archimede67 5dbd5a1f49 Added quad alignment/snapping to other quads/points 2023-12-16 01:29:09 +01:00
archimede67 a41da8182b Preserve and show axis when dragging quad points while holding Shift 2023-12-16 00:29:10 +01: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
heinrich5991 1feee077ca Returning false commits you to setting a message 2023-12-15 13:00:43 +01:00
Dennis Felsing 12ed9f8d6b
Merge pull request #7651 from furo321/fix-teamjoin-error
Don't broadcast error if `CanJoinTeam` returned true
2023-12-14 23:48:20 +00: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
Dennis Felsing a333d723e5
Merge pull request #7653 from Robyt3/Clang-Tidy-Cleanup
Fix more clang-tidy errors: mark functions as `const` when possible
2023-12-14 23:46:19 +00:00
Dennis Felsing 7d37db6d6e Version 17.4.1 2023-12-15 00:58:09 +01:00
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
furo 035e7a1068 Add Sv_CommandInfo netmsg for autocompletion of chat commands. 2023-12-14 19:01:35 +01:00
furo a440e0e917 Don't broadcast error if CanJoinTeam returned true 2023-12-14 16:19:31 +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
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 a87db4f026 Move tele cursor behaviour to /tc and /telecursor 2023-11-30 22:34:36 +01: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
furo fd6c4ecbea Fix alignment of buttons in vote menu. 2023-11-26 19:33:42 +01:00
furo eff6361c38 Add settings for info messages 2023-11-26 17:30:49 +01:00
furo 2cb948a57b Add finish info messages. 2023-11-26 17:29:40 +01:00
furo cb53c45f8c Rename killmessages to infomessages 2023-11-26 17:29:40 +01:00
Dennis Felsing c90899cc29
Merge pull request #7549 from Robyt3/Memheap-Refactoring
Refactor `CHeap`
2023-11-26 13:36:30 +00:00
Robert Müller 41d2c80f21 Add templated CHeap::Allocate function
Add a templated `CHeap::Allocate` function to simplify memory allocation of objects using `CHeap`. The function uses perfect forwarding to construct objects with the specified arguments.
2023-11-26 13:09:23 +01:00
Corantin H fee9b986fb Added possibility to edit chat size and width. Refactored chat preview code. 2023-11-26 12:27:56 +01:00
Dennis Felsing 3e2f8f8a44
Merge pull request #7543 from Robyt3/Console-Interface-Cleanup
Minor refactoring of `IConsole`
2023-11-25 22:21:40 +00:00
Dennis Felsing 0601794801
Merge pull request #7547 from Robyt3/Server-Nameban-Clan
Also apply name bans to clans, trim space from clans, refactor name bans, move code to separate class `CNameBans`
2023-11-25 22:18:46 +00:00
Robert Müller 794e6b750b Also apply name bans to clans, trim space from clans
Apply the name bans system also to player clans, meaning players joining with banned clan names are kicked and changing the clan to a banned name while ingame has no effect.

Additionally, trim UTF-8 whitespace from beginning and end of clan. This was already done for player names but not for clans.

Closes #7516.
2023-11-25 23:00:57 +01:00
Robert Müller 42b952bc6c Move config variables to config_variables.h, remove variables.h
The contents of `variables.h` are moved to `config_variables.h` instead of being included with the preprocessor. The file `variables.h` is removed, so all config variables can be found in a single file instead of being spread over two files without any clear structure. The original declaration order of config variables is preserved. The unnecessary header guard `GAME_VARIABLES_H` from `variables.h` is removed, as the comment `// This file can be included several times.` already serves the same purpose of silencing the header guard check.

A comment is added at the end of `config_variables.h` to mark the location where modders should ideally declare all of their own config variables to avoid merge conflicts with us in the future.

Closes #7472.
2023-11-25 16:40:55 +01:00
Robert Müller e410dd85f8 Replace IConsole::m_Cheated variable with Cheated getter
Interfaces should not have member variables, so the variable is moved to `CConsole`. Only a getter `IConsole::Cheated` is added because the cheated state of the console is never reset.
2023-11-25 11:43:42 +01:00
Dennis Felsing edee3d5b9f
Merge pull request #7537 from furo321/allow-unused
Hide "Allow unused" button when not using "DDNet" entities.
2023-11-24 16:15:20 +00:00
furo daa0609252 Hide "Allow unused" button when not using "DDNet" entities. 2023-11-24 16:55:36 +01:00
heinrich5991 3fff2f9fc3
Merge pull request #7535 from furo321/quote-names
Quote names with spaces when auto completing names in commands.
2023-11-24 00:06:49 +00:00
heinrich5991 cb22fbf902
Merge pull request #7536 from jtbx/scrollback-history
Show previous commands in the console's scrollback buffer
2023-11-23 23:52:17 +00:00
furo 7ca10e2645 Quote names with spaces when auto completing. 2023-11-24 00:49:41 +01:00
Jeremy 00f2c8a89f Show previous commands in the console's scrollback buffer
After you issue a command in the client console or rcon, the command
will first be printed to the console prefixed with a '>' symbol.

Cherry-pick of https://github.com/teeworlds/teeworlds/pull/3185
2023-11-24 12:30:01 +13:00
Dennis Felsing 9f20636952
Merge pull request #7532 from furo321/magic-50
Replace `50` with `SERVER_TICK_SPEED` or `TickSpeed()`
2023-11-23 22:07:37 +00:00
Robert Müller f643da7ef5
Merge pull request #7529 from furo321/killteam-fixes
More fixes to `KILLMSGTEAM`
2023-11-23 18:13:23 +00:00
furo 36a029c622 Set correct race precision value for 0.7 2023-11-23 18:37:02 +01:00
furo 9627e7b3a8 Simplify TickSpeed getters 2023-11-23 15:33:30 +01:00
furo b9fd612ef5 Replace 50 with SERVER_TICK_SPEED or TickSpeed() 2023-11-23 14:42:30 +01:00
furo 04c5c6a5d6 More fixes to KILLMSGTEAM 2023-11-23 11:57:35 +01:00
Dennis Felsing 6fc27bea8c
Merge pull request #7528 from furo321/statboard-killmsgteam
Count deaths in statboard from `KILLMSGTEAM`
2023-11-23 07:26:56 +00:00
furo ad41069c20 Count deaths in statboard from KILLMSGTEAM 2023-11-23 07:54:02 +01:00
Learath b9f786c14f Revert the mess-chain #7247. Apply #7171
Co-authored-by: Valentin Bashkirov <valenteen3d@ya.ru>
2023-11-22 18:34:42 +01:00
Robert Müller 0d8a0d3b1d Dynamically connect/disconnect debug dummies, cleanup
Call expected server callback functions to simulate clients dynamically connecting and disconnecting when changing the `dbg_dummies` variable. This makes the debug dummies more useful for debugging. Previously, the debug dummies were considered invalid clients, whereas they are now considered to be ingame, so they should behave mostly like real clients being connected to the server. The debug dummies also have correct client names now, e.g. "Debug dummy 42".

The game server code is cleaned up by moving all special handling for debug dummies to the engine server function `CServer::UpdateDebugDummies`.

The left/right direction inputs for debug dummies are now properly added to the client input array, so their input handling should be consistent with normal clients, which fixes some inconsistent prediction with debug dummies.
2023-11-21 19:59:20 +01:00
Robert Müller 29a32b7acc Use const char * instead of char const * consistently
Both are equivalent. Seems to already be used consistently for all other types.
2023-11-20 22:26:19 +01:00
Dennis Felsing 375dd7da8b
Merge pull request #7511 from furo321/telecursor-fixes
Account for zoom when teleporting to cursor.
2023-11-20 12:25:54 +00:00
furo c2d02ad45c Account for zoom when teleporting to cursor. 2023-11-20 12:33:08 +01:00
Dennis Felsing 472c9f070b
Merge pull request #7507 from dobrykafe/pr-replace-sizeof
replace `sizeof x` with `sizeof(x)`
2023-11-19 21:56:15 +00:00
Dennis Felsing c15e9b17fa
Merge pull request #7505 from Chairn/pr_wastelefalse
Init vec2 members to 0 and small cleanup
2023-11-19 21:55:09 +00:00
dobrykafe 904abae6ac replace sizeof x with sizeof(x) 2023-11-19 22:36:47 +01:00
Chairn 2dcbaf605e Small cleanup: simplify member type and computation 2023-11-19 17:36:17 +01:00
Chairn 5b27062ded Remove unused members 2023-11-19 17:36:16 +01:00
Chairn d6c7bcdbdc Init vec2 members to 0 following #6256 2023-11-19 17:36:16 +01:00
heinrich5991 b4567d6e25
Merge pull request #7502 from Robyt3/Browser-CommunityFilter-Fixes
Prevent community filters excluding all elements, fix server browser update on community filter change via console
2023-11-19 16:24:52 +00:00
ChillerDragon 16c5a60b53 Move m_pLoadBestTimeResult to IGameController
Gets rid of more CGameControllerDDRace casts.
Those did not show up during compile time only during runtime
of another active controller when asan is active.
2023-11-19 16:23:17 +01:00
Robert Müller ccc470ecc9 Fix server browser update on community filter change via console
Also update server browser filtering/sorting when changing the community/country/type filter config variables with the console.

Clean the filter config variables when they are changed instead of only when the community filter is rendered.
2023-11-19 15:34:50 +01:00
heinrich5991 28b00892f6 Allow more complex interaction with the antibot via the console
Allows the antibot to receive arbitrary console commands.
2023-11-19 04:41:56 +01:00
heinrich5991 9b024fcf97
Merge pull request #7476 from ChillerDragon/pr_const_char
Overload GetCharacter with const version
2023-11-19 03:08:03 +00:00
heinrich5991 d4713cbfe2
Merge pull request #7475 from ChillerDragon/pr_gametype_mod
Add sv_gametype and sample mod
2023-11-19 03:07:24 +00:00
ChillerDragon becffb9377 Add sv_gametype and sample mod 2023-11-19 03:00:21 +01:00
ChillerDragon d42513e843 Overload GetCharacter() with const version
Allows to do this

```C++
for(const CPlayer *pPlayer : GameServer()->m_apPlayers)
{
	if(!pPlayer)
		continue;
	if(!pPlayer->GetCharacter())
		continue;

	// your code that does not change the character state
}
```
2023-11-19 02:00:28 +01:00
Dennis Felsing 6c935eee91 Version 17.4 2023-11-19 00:50:29 +01:00
heinrich5991 8e75998138
Merge pull request #7451 from apelsin21/master
Appending in editor checks for duplicate images
2023-11-18 23:24:32 +00:00
Axel Vestin 1b7cee3888 Fixes duplicate images when appending maps in the editor 2023-11-19 00:07:31 +01:00
Dennis Felsing 4d40106818
Merge pull request #7337 from dobrykafe/pr-multi-view-qol
multi-view: dont zoom below `cl_default_zoom`
2023-11-18 23:04:27 +00:00
Chairn 5cdae502b8 Fix code scanning && clang-tidy false positive? 2023-11-18 22:55:17 +01:00
Robert Müller ee04cd4dda
Merge pull request #7459 from heinrich5991/pr_ddnet_community_json
Add icon URL, remove `servers-key`/`ranks-key` from community JSON
2023-11-18 21:08:23 +00:00
heinrich5991 c7cd281aff Add icon URL, remove servers-key/ranks-key from community JSON
Previously:

```json
{
  "ddnet": {
    "name": "DDraceNetwork",
    "servers-key": "servers",
    "ranks-key": "maps",
    "icon-sha256": "162313eeb954e34495ad03066fee1418ed3c963e76cc83dff993e1c7856c742b"
  }
}
```

Now:
```json
[
  {
    "id": "ddnet",
    "name": "DDraceNetwork",
    "icon": {
      "sha256": "162313eeb954e34495ad03066fee1418ed3c963e76cc83dff993e1c7856c742b",
      "url": "https://info.ddnet.org/icons/ddnet.png"
    },
    "ranks": [
      …
    ],
    "servers": {
      …
    }
  }
]
```

Special case `ddnet` to look for the `servers`, `maps` in the top-level
and `kog` to look for `servers-kog` in the top-level.
2023-11-18 21:52:51 +01:00
Dennis Felsing ccd767aea4
Merge pull request #7474 from ChillerDragon/pr_mod_crash
Fix crash in mod controller
2023-11-18 19:59:22 +00:00
Robert Müller e05ec66043 Fix dead lock when printing log entry while rendering console line
Previously, the client would hang due to recursive usage of the console backlog lock when a log line is printed via the logger functions while already owning the backlog lock. This could happen when the text render causes log messages to be printed while the console backlog is rendered.

This is fixed by introducing a separate pending backlog to which new log lines are initially added and which is protected by a lock. The pending backlog entries are pumped into the normal backlog before the normal backlog is used, so accesses to the normal backlog do not need to be locked anymore. This means the console backlog lock is not owned when calling any functions that could print log messages, which should prevent the dead lock.
2023-11-18 16:28:29 +01:00
ChillerDragon f0aae73b1f Fix crash in mod controller
When creating a non ddrace controller and it uses `IGameController::GetMaskForPlayerWorldEvent`
it will crash:

 #0  0x00007ffff72ac83c in ?? () from /usr/lib/libc.so.6
 #1  0x00007ffff725c668 in raise () from /usr/lib/libc.so.6
 #2  0x00007ffff72444b8 in abort () from /usr/lib/libc.so.6
 #3  0x00007ffff749ca6f in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
 #4  0x00007ffff74b011c in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
 #5  0x00007ffff74b0189 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
 #6  0x00007ffff74b03ed in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff766c0e8 <typeinfo for std::out_of_range>, dest=0x7ffff74c85c0 <std::out_of_range::~out_of_range()>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
 #7  0x00007ffff74a025f in std::__throw_out_of_range_fmt (__fmt=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/functexcept.cc:101
 #8  0x00005555555bd4a3 in std::bitset<64ul>::_M_check (this=0x7fffffffbb90, __position=0xffffffffffffffff, __s=0x5555557a9881 "bitset::reset") at /usr/include/c++/13.2.1/bitset:823
 #9  0x00005555555f83e0 in std::bitset<64ul>::reset (this=0x7fffffffbb90, __position=0xffffffffffffffff) at /usr/include/c++/13.2.1/bitset:1196
 #10 0x000055555560262a in IGameController::GetMaskForPlayerWorldEvent (this=0x555555b113d0, Asker=0x0, ExceptID=0xffffffff) at /home/chiller/Desktop/git/ddnet/src/game/server/gamecontroller.cpp:728
 #11 0x000055555560be0f in CPlayer::TryRespawn (this=0x55555592e500 <gs_PoolDataCPlayer>) at /home/chiller/Desktop/git/ddnet/src/game/server/player.cpp:695
 #12 0x000055555560a1a6 in CPlayer::Tick (this=0x55555592e500 <gs_PoolDataCPlayer>) at /home/chiller/Desktop/git/ddnet/src/game/server/player.cpp:249
 #13 0x00005555555e174b in CGameContext::OnTick (this=0x7ffff477d010) at /home/chiller/Desktop/git/ddnet/src/game/server/gamecontext.cpp:964
 #14 0x00005555555a7e34 in CServer::Run (this=0x7ffff57d5010) at /home/chiller/Desktop/git/ddnet/src/engine/server/server.cpp:2893
 #15 0x0000555555592a2b in main (argc=0x1, argv=0x7fffffffd178) at /home/chiller/Desktop/git/ddnet/src/engine/server/main.cpp:197
2023-11-18 15:56:10 +01:00
heinrich5991 2dbfc72a4d
Merge pull request #7464 from ChillerDragon/pr_use_ddr_wrapper
Use GetDDRaceTeam() and move m_Teams to igamecontroller
2023-11-18 13:41:45 +00:00
ChillerDragon 83af6c0a36 Move m_Teams to IGameController
Also increase usage of the `GetDDRaceTeam()` method.
Instead of reimplementing it in place everywhere.

move `m_Teams` from the ddrace controller to `IGameController`
so the ddrace controller casts can go away

This will enable creating another controller instead of the ddrace
controller. Which is useful for community forks.

Also make `m_Teams` private and define a getter for it.
This makes future refactors smoother.
2023-11-18 13:55:48 +01:00
Dennis Felsing 8ab9e72240
Merge pull request #7491 from furo321/fix-lastkickvote
Fix some issues with `sv_vote_kick_delay`.
2023-11-18 12:31:35 +00:00
furo 045915eab5 Fix some issues with sv_vote_kick_delay. 2023-11-18 13:09:13 +01:00
Dennis Felsing 7495b23b24
Merge pull request #7490 from heinrich5991/pr_ddnet_tuning_noconsole
Make gamecore.h not depend on console
2023-11-18 03:09:10 +00:00
heinrich5991 da78cc0735
Merge pull request #7471 from ChillerDragon/pr_tele_controller
Move m_TeleOuts from ddr controller to game controller
2023-11-18 02:54:06 +00:00
ChillerDragon 60e6025e7a Move m_TeleOuts from ddr controller to game controller
#7127
2023-11-17 23:52:31 +01:00
heinrich5991 75f40ede45 Make gamecore.h not depend on console 2023-11-17 23:26:10 +01:00
Robert Müller dd907ab016 Fix map grid factor always being shown as 1 2023-11-17 21:52:39 +01:00
Dennis Felsing 4e27299657
Merge pull request #7470 from furo321/remove-map-setting-msg
Don't print "tunes"/unknown commands from maps.
2023-11-16 23:34:22 +00:00
Robert Müller 88829a5080
Merge pull request #7483 from heinrich5991/pr_ddnet_pred_margin
Don't allow too large of a prediction margin
2023-11-16 21:33:34 +00:00
heinrich5991 24a74e373e Don't allow too large of a prediction margin 2023-11-16 22:18:15 +01:00
Robert Müller 32bd6f6526 Fix leak of community icons when jobs not finished
The community icon data loaded in background jobs was previously not freed when the client is quit before the community icon data is processed.
2023-11-16 21:47:27 +01:00
furo e3402cbf85 Don't print "tunes"/unknown commands from maps. 2023-11-16 01:02:22 +01:00
Dennis Felsing 55098cd313
Merge pull request #7469 from archimede67/pr-save-chat-input
Save current chat input when pressing UP. Prevent input clearing when pressing DOWN
2023-11-15 23:20:13 +00:00
Corantin H 06674ebecf Save current input when using UP arrow. Prevent DOWN arrow from clearing current input. 2023-11-15 23:52:02 +01:00
Dennis Felsing fcd7f135f0
Merge pull request #7466 from Robyt3/Editor-Parent-Folder-Fix
Fix parent folder not being shown in editor file browser, fix typo
2023-11-15 22:37:47 +00:00
heinrich5991 162258af3d
Merge pull request #7467 from furo321/case-insenstive-keys
Make KEY argument case-insensitive
2023-11-15 22:09:40 +00:00
furo 0042aec086 Make KEY argument case-insensitive 2023-11-15 22:51:41 +01:00
Robert Müller f54fc2e441 Fix parent folder not being shown in editor file browser, fix typo
The check for multiple storage locations was using the base path from the previous invocation of the file dialog instead of using the new base path.

Closes #7463.
2023-11-15 22:28:50 +01:00
Jupeyy dfbff0eb57
Merge pull request #7462 from furo321/update_textsize
Set size of text when changing slider of `cl_text_entities_size`.
2023-11-15 20:18:29 +00:00
furo 740049a454 Set size of text when changing slider of cl_text_entities_size. 2023-11-15 20:54:27 +01:00
dobrykafe 08a00cff6b update m_FileDialogFileNameInput when deleting a file 2023-11-15 18:24:20 +01:00
Axel Vestin 7c15514696 Use Escape to cancel OP_SCALE envelope 2023-11-14 21:17:07 +01:00
Robert Müller b8d38f7f49 Fix server crash on DDTeam message with lower sv_max_clients
When the `CGameContext::SendChatTeam` function is used to send a chat message to all members of a DDTeam (e.g. on completed /swap chat command), it was not checked whether the target players are online but only whether they belong to the specified team according to the teams core. However, the default team for unconnected/cleared players is 0 in the teams core, which is the same for players in team 0, so chat messages were being sent to client IDs not corresponding to connected clients when chat messages where supposed to be sent to players in team 0. This was causing the server to crash with the assertion error "erroneous client id" specifically when the server is started with `sv_max_clients` being less than the default, maximum 64.

Closes #7450.
2023-11-13 23:16:21 +01:00
Dennis Felsing 32f3f9e03a
Merge pull request #7449 from furo321/lasttp-save
Save entire character with `/lasttp`.
2023-11-12 23:14:12 +00:00
furo f9b9480291 Save entire character with /lasttp. 2023-11-12 23:48:36 +01:00
Dennis Felsing 76d27e734a
Merge pull request #7444 from Chairn/demo_filename
Update string when cutting demo to indicate file name
2023-11-12 22:45:26 +00:00
Chairn c6f78ea3c3 Update string when cutting demo to indicate file name 2023-11-12 23:29:32 +01:00
Jupeyy 39b3249bf5 Increase max zoom limit
To a limit that fits to the biggest maps
2023-11-12 21:36:20 +01:00
Dennis Felsing 4f1fc71f95
Merge pull request #7440 from Robyt3/Server-Credits-Update
Add new contributors to credits
2023-11-12 11:36:26 +00:00
Robert Müller 188462ea27 Add new contributors to credits
Thanks everyone!
2023-11-12 12:20:10 +01:00
Dennis Felsing e74e6770c3
Merge pull request #7325 from Robyt3/Browser-Community-Filter
Add community server filter and icons, remove DDNet and KoG tabs
2023-11-12 00:00:05 +00:00
Dennis Felsing d716210e31
Merge pull request #7408 from Jupeyy/pr_tile_border_shader
Switch to a fragment shader solution for border tile rendering
2023-11-11 23:02:34 +00:00
Dennis Felsing 79e244f166
Merge pull request #7433 from Robyt3/Editor-Color-Picker-Refactoring
Show color picker button for color envelope points
2023-11-11 22:14:41 +00:00
Dennis Felsing aefa52c6b9
Merge pull request #7432 from Robyt3/Base-Standard-Mutex-Wrapper
Add `CLock` wrapper for `std::mutex` to replace `lock_*` functions, use `CLock` instead of `std::mutex`, add thread-safety annotations
2023-11-11 22:07:02 +00:00
Robert Müller bd4c138107 Show color picker button for color envelope points
Simplify selecting envelope point colors by showing a color picker button that opens a color picker popup to change the color of the selected envelope point. The existing editbox to change only the selected channel's value is kept, as the color picker popup does not support the same precision to specify the individual color channel values.

Closes #7317.
2023-11-11 20:45:22 +01:00
Robert Müller d8452ad02c Extract ShowPopupEnvPoint local function 2023-11-11 20:45:22 +01:00
Robert Müller c48623de8f Extract CEditor::DoColorPickerButton function
Fix color not being updated while shift key is pressed, due to use of `else if`.
2023-11-11 20:45:22 +01:00
Robert Müller 4a00332f59
Merge pull request #7434 from ChillerDragon/pr_ctrl_s_scale
Do not scale envelopes on ctrl+s
2023-11-11 18:22:56 +00:00
ChillerDragon e090d73784 Do not scale envelopes on ctrl+s
When using ctrl+s to test the current envelope it should not activate
the scale mode. This causes unexpected envelope changes on ctrl+s based
envelope fine tuning testing.
2023-11-11 18:56:09 +01:00
dobrykafe ca6b518383 remove ShowingRoot check 2023-11-11 14:08:41 +01:00
Robert Müller 10470046b7 Use CLock instead of std::mutex, add thread-safety annotations
Use `CLock` and `CLockScope` instead of `std::mutex` and add clang thread-safety analysis annotations everywhere except for usages in engine graphics and video, as those usages also involve `std::condition_variable`.

Fix lock not being unlocked on all code paths in `CFutureLogger::Log`, which is caught by the static analysis.
2023-11-11 00:09:17 +01:00
dobrykafe 73fac0c8d4 check StorageType instead of SelectedIndex 2023-11-10 21:45:45 +01:00
dobrykafe 41b63843ce hide "Show directory" when "All combined" selected 2023-11-09 22:16:07 +01:00
heinrich5991 962379d64d
Merge pull request #7428 from Robyt3/Editor-Entities-Explain-Assertion-Fix
Fix editor crash when showing explanation for custom entities
2023-11-09 18:41:53 +00:00
Robert Müller df664261bb Fix editor crash when showing explanation for custom entities
The failing assertion is removed because users can add custom entities images besides the predefined ones.

Reported by Mr.Gh0s7 on Discord.
2023-11-09 19:02:54 +01:00
Robert Müller fa8640bd35
Merge pull request #7425 from furo321/editor-correct-corners
Use correct corners for brush rotation buttons.
2023-11-08 19:13:34 +00:00
furo 3ebf0ef85d Use correct corners for brush rotation buttons. 2023-11-08 19:57:37 +01:00
furo 36bf22f1c4 Add button to rename images and sounds in editor. 2023-11-08 18:01:32 +01:00
Robert Müller 78217c44d7 Add mode selection to color picker popups (RGBA, HSVA, HSLA)
Add buttons for selecting the color mode (RGBA, HSVA, HSLA) in color picker popups in menu and editor. Previously, the color picker popups always showed the color components in HSVA. Now the mode can be switched so the components are shown in either RGBA or HSLA. The hex color code is always RGBA, same as before.

In the editor, the RGBA mode is used per default, to prevent any loss of information due to color conversions, as the map format stores RGBA values. In the menus, the HSVA mode is the default, same as before, although the config actually stores HSLA values.

The HSVA color picker controls (1D slider for hue, 2D picker for saturation and value) are still shown for all modes.

As many color conversions as possible are avoided by only converting between color formats when necessary. Switching between color modes should not change the selected color. Changing the RGBA hex value in the editor will set the exact value also when another color mode is selected. However, changing the color with the other controls in HSVA/HSLA mode will cause a conversion and possible loss of information. The conversion directly from RGBA to HSVA and vice versa is also explicitly avoided, as this internally converts to HSLA first, which is done separately already.

Closes #7409.
2023-11-05 13:46:01 +01:00
Robert Müller 91e6fca2a5 Add parameter Enabled to DoButton_PopupMenu 2023-11-05 12:56:07 +01:00
Robert Müller d39247f726 Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.

The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.

Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.

The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.

The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.

Closes #5654.
2023-11-04 15:32:27 +01:00
Jupeyy 639a8c3c8b Switch to a fragment shader solution for border tile rendering 2023-11-04 14:51:39 +01:00
Robert Müller 367c7ba4e7 Fix some textures being loaded without mipmaps
Some calls to `LoadTextureRaw` where passing the image format also in place of the texture load flags. Since the image format would be RGBA most of the time, this was interpreted as the flag `IGraphics::TEXLOAD_NOMIPMAPS` causing various textures (all sprites textures, assets when shown in menus, menu images, menu theme icons) to be loaded without mipmaps.

This is fixed by passing `0` as the texture load flags and by replacing uses of `LoadPNG` and `LoadTextureRaw` with `LoadTexture`.
2023-11-04 12:54:09 +01:00
Robert Müller e12f59b445 Remove unused argument pUser of LoadAsset function 2023-11-04 12:54:09 +01:00
Robert Müller 82ba8e0bb8 Add CTextureHandle::IsNullTexture, rename InvalidTexture
Rename `InvalidTexture` to `NullTexture` to avoid confusion because the null texture is not invalid. The function `CTextureHandle::IsNullTexture` is added to make it easier to check the result of using `IGraphics::LoadTexture`, which returns the null texture on error instead of an invalid texture handle. An assertion is added to ensure that `IsNullTexture` works correctly.
2023-11-04 12:54:08 +01:00
Robert Müller 07e336e0f4 Improve theme icon loading, fix flashing black screen
Load theme icons individually for all themes that have been loaded instead of doing a separate scan of the `themes` folder for the icons.

Fix screen occasionally flashing black when opening the general settings. This was caused by `UpdateAndSwap` randomly being called when theme loading takes longer than 1/60 seconds, which sometimes happens on the first start of the client after rebooting the machine. Now the loading popup is correctly rendered when theme loading takes longer than 500ms, which is consistent with the behavior when loading other files.

Minor improvements to log messages.
2023-11-04 12:54:06 +01:00
Robert Müller 77ba85732e Remove middle man in call chain
As `pSelf` is already a pointer to `CMenus` the additional access to the gameclient is unnecessary.
2023-11-04 12:53:04 +01:00
Alexander Akulich b886b93cf2 CPlayer: Remove unused variable 2023-11-03 21:36:33 +03:00
Alexander Akulich 17c90fc061 CCharacter::IsSnappingCharacterInView: Add missing const 2023-11-03 21:36:33 +03:00
Alexander Akulich cf754c4d60 CMenuBackground::GetThemes: Drop unused cast 2023-11-03 21:36:33 +03:00
furo 149e5b6864 Show AFK status in info tab 2023-11-02 13:18:00 +01:00
Dennis Felsing 80c4940b7f
Merge pull request #7403 from Robyt3/Datafile-Writer-Refactoring
Add more assertions to datafile writer, refactoring
2023-11-01 22:02:45 +00:00
Dennis Felsing 3ec5211866
Merge pull request #7404 from Robyt3/Server-Testing-Commands-Freeze-Unfreeze
Add `freeze`/`unfreeze` testing commands
2023-11-01 22:02:09 +00:00
Robert Müller ebe2ddea9f Add gameclient warnings to queue instead of overriding others
Using `CMenus::PopupWarning` will immediately set the popup and override the current warning, which can hide warnings when multiple are shown at the same time. Now all warnings are added to the queue with `IClient::AddWarning`.
2023-11-01 22:17:01 +01:00
Robert Müller 75debadd34 Add freeze/unfreeze testing commands
See #7370.
2023-11-01 17:26:29 +01:00
Robert Müller f7722eb016 Remove separate CDataFileWriter::Init/OpenFile functions
Simplify usage of datafile writer by removing duplicate functions for opening file.
2023-11-01 12:54:38 +01:00
Robert Müller 8482e9475c Show warning popup when map image/sound cannot be loaded
Show a warning popup when a map image or sound cannot be loaded for any reason. Only one generic warning popup is shown for images and sounds individually.
2023-10-31 21:21:09 +01:00
Robert Müller 525cc59927 Allow loading embedded images without valid image name
The image name is only required for external images. For embedded images it was only used in log messages. This fixes rendering with various maps that have embedded images with invalid names.
2023-10-31 21:19:49 +01:00
Dennis Felsing 7000b97425
Merge pull request #7396 from BurnyLlama/add-underline_top_five
Added back underline for `sv_regional_rankings 0`.
2023-10-30 23:10:50 +00:00
Dennis Felsing 2eff91083d
Merge pull request #7394 from furo321/fix-setafk
Fix afk timer not working.
2023-10-30 23:03:17 +00:00
BurnyLlama 817ef6eb58 Added back underline for sv_regional_rankings 0. 2023-10-30 22:40:04 +01:00
furo 0ecc50ae0f Fix afk timer not working. 2023-10-30 19:43:35 +01:00
Dennis Felsing 795a2699ef
Merge pull request #7391 from furo321/incorrect-ghost
Fix incorrect ghost being loaded with `cl_race_ghost_save_best`
2023-10-30 09:40:25 +00:00
Dennis Felsing 3235e3eac9
Merge pull request #7392 from furo321/fix-demo-ending-early
Delay server race demo ending by 1 second.
2023-10-30 09:40:00 +00:00
furo 7a7616773d Delay server race demo ending by 1 second. 2023-10-30 03:32:50 +01:00
furo 05e7c284ea Fix incorrect ghost being loaded with cl_race_ghost_save_best 2023-10-30 00:53:00 +01:00