Commit graph

15373 commits

Author SHA1 Message Date
ChillerDragon 2c77aeef2b Add quick action to pick image for selected layer 2024-08-31 21:57:32 +08:00
ChillerDragon f053a29463 Add ctrl+p editor prompt (quick actions) 2024-08-31 21:57:31 +08:00
ChillerDragon f8a4e7dbab Call TakeDamage on projectile and laser hit (gun, shotgun and laser)
The grenade and hammer already triggered TakeDamage
now all weapons hitting a tee call the method again
2024-08-31 19:59:05 +08:00
ChillerDragon f44def1cdd Only do armor progress hack in ddrace controller
Only mess with the characters armor in ddrace controllers.
This allows other game modes to use the armor as actual armor.
2024-08-31 18:57:42 +08:00
Dennis Felsing a83248b9ec
Merge pull request #8851 from ChillerDragon/pr_chr_get_tuning
Simplify character tuning code
2024-08-31 08:24:42 +00:00
Robert Müller f0449befa5
Merge pull request #8841 from ChillerDragon/pr_unhardcode_07_gameflags
Share gameflags for 0.6/0.7 instead of hardcoding it
2024-08-31 07:38:22 +00:00
ChillerDragon c02a2ed1d6 Simplify character tuning code
entities/character.cpp now has the same api as prediction/entities/character.cpp
2024-08-31 10:41:39 +08:00
KebsCS d452bcda8f
Add validation for chat and console command arguments 2024-08-31 02:15:33 +02:00
Robert Müller 05970178b2 Fix map downloading overriding more recent map change messages
Following sequence of events was possible:

1. HTTP map download for map X is started (e.g. client initially connects to server).
2. Map change message for map Y arrives while downloading (e.g. vote for another map has passed on the server).
3. Client already has map Y and loads it directly without starting or resetting the map download.
4. HTTP map download task for map X finishes.
5. Map X is loaded, overriding the map Y that should be loaded. This is one cause for #2804.

This could potentially also happen with the map download from the game-server, if the final map data chunk for a downloaded map is received directly after another map change message for a map which does not need to be downloaded, though this seems more unlikely.

This is fixed by resetting the current map download immediately after receiving a valid map change message instead of only when starting a new map download.

The relevant code to reset the map download is moved to `CClient::ResetMapDownload` to avoid duplicate code and ensure that the temporary map download file is always deleted and closed.
2024-08-30 17:54:38 +02:00
DynamoFox fe35322bb0 Workaround GLEW error code when calling glewInit() on Wayland
* Fixes OpenGL on Wayland when the GLX flavor of GLEW is linked
* Only if SDL2's video driver is "wayland" we also allow the
  GLEW_ERROR_NO_GLX_DISPLAY error code to be accepted as if glewInit()
  actually succeeded
* Hopefully this won't be needed anymore on future versions of GLEW when
  glewContextInit() is made part of the public API
2024-08-29 19:47:43 +02:00
Dennis Felsing 41cd82c2d3
Merge pull request #8653 from DynamoFox/force-sdl2-video-driver-selection-on-linux
Fix game launch on Wayland-only systems with SDL2.30+
2024-08-29 16:06:03 +00:00
Robert Müller edcc3245f4
Merge pull request #8821 from def-/pr-transl-18.5
Update translations for 18.5, remove 0.7-only translations
2024-08-29 08:11:18 +00:00
Dennis Felsing 88739c5345 Update translations for 18.5, remove 0.7-only translations
Fix some minor stuff
2024-08-29 09:53:28 +02:00
ChillerDragon 43dee5d4c5 Share gameflags for 0.6/0.7 instead of hardcoding it
5cf0e5e997/datasrc/network.py (L8)
5cf0e5e997/datasrc/seven/network.py (L10)

0.6 game flags:

```python
GameFlags = ["TEAMS", "FLAGS"]
```

0.7 game flags:

```python
GameFlags = Flags("GAMEFLAG", ["TEAMS", "FLAGS", "SURVIVAL", "RACE"])
```

The 0.7 protocol extended the game flags without changing the old 0.6 flags.
So flag teams and flag flags are the same in both versions and 0.7 just
has additional flags.

The server is now sending the same m_GameFlags from the gamemode
controller to 0.6 and 0.7 connections. It clamps away the unsupported
flags for 0.6.

Before this commit the ddnet server would always send the hardcodet race
flag to 0.7 connections while ignoring what the gamemode set as a game
flag.
2024-08-29 15:15:48 +08:00
Dennis Felsing 5cf0e5e997
Merge pull request #8839 from dobrykafe/pr-create-07-skin-folder
Create 0.7 skin folder
2024-08-28 23:00:58 +00:00
dobrykafe 218ce1f53f create 0.7 skin folder 2024-08-29 00:36:06 +02:00
dobrykafe 41fee0bb3f add 0.7 skins directory button 2024-08-28 23:57:12 +02:00
TsFreddie ecec1ff2a7 Resample to the device playback rate 2024-08-28 10:55:35 +08:00
Dennis Felsing 5a66dc05f4
Merge pull request #8828 from dobrykafe/pr-save-07-skins
Implement 0.7 skin save button
2024-08-27 21:50:23 +00:00
Dennis Felsing 7df1b24491
Merge pull request #8833 from furo321/vote-creator
Set `m_VoteCreator` when possible
2024-08-27 21:20:41 +00:00
dobrykafe 31ee6abe82 implement 0.7 skin save button 2024-08-27 23:18:43 +02:00
Dennis Felsing 3d6820ab68
Merge pull request #8831 from furo321/fix-crash-hotreload
Fix `double free or corruption` crash with `hot_reload`
2024-08-27 21:16:58 +00:00
Dennis Felsing 8b7e5dee4d
Merge pull request #8830 from dobrykafe/pr-conchain-07-tee
Add console chain for 0.7 tee
2024-08-27 21:16:37 +00:00
Dennis Felsing 76c44cfb40
Merge pull request #8829 from furo321/use-getmapname
Use `GetMapName()` when getting the map name
2024-08-27 21:16:12 +00:00
furo f407adc61c Set m_VoteCreator when using force_vote 2024-08-27 21:44:00 +02:00
furo 9fbbf5cde7 Fix using random_unfinished_map from rcon 2024-08-27 21:43:22 +02:00
furo 9a7bc70f76 Fix double free or corruption crash with hot_reload 2024-08-27 20:44:55 +02:00
furo 0e016f9732 Use GetMapName() when getting the map name 2024-08-27 20:41:43 +02:00
dobrykafe cb57aa82bf add console chain for 0.7 tee 2024-08-27 20:01:27 +02:00
Robert Müller 14f1b36dd1
Merge pull request #8825 from KebsCS/pr-ghost-sorting
Add ghost list sorting
2024-08-27 16:55:22 +00:00
KebsCS 906f75c13a
Add ghost list sorting 2024-08-27 18:34:26 +02:00
bencie c4ff37d9d9 Send result of random_unfinished_map to all clients 2024-08-27 16:37:15 +02:00
furo 358cd20183 Run editor auto-reload on any local address, and not just localhost 2024-08-27 13:05:52 +02:00
Dennis Felsing 9d920b3575
Merge pull request #8703 from sjrc6/pr_slider
Adjust slider handle size
2024-08-27 09:20:18 +00:00
Tater 5fb059ad92 Adjust slider handle size 2024-08-27 11:02:12 +02:00
Dennis Felsing 4b8dcc3315
Merge pull request #8811 from furo321/add-map-votes-directories
Add support for directories with `add_map_votes`
2024-08-27 08:59:25 +00:00
Dennis Felsing b30b493ab8
Merge pull request #8819 from Anime-pdf/master
speedup demo with mouse scroll only if menu is active
2024-08-27 07:15:38 +00:00
Dennis Felsing 29f3323735
Merge pull request #8813 from furo321/hot-reload-maps
Add `hot_reload` to reload map while preserving state
2024-08-27 07:03:05 +00:00
Paul 7c62b457b7 speedup demo with mouse scroll only if menu is active 2024-08-27 02:38:08 +03:00
furo 8b27a6e852 Add hot_reload to reload map while preserving state 2024-08-27 01:19:40 +02:00
Robert Müller 028bd148f3
Merge pull request #8806 from bencie/allow-reloading
Allow reloading current background entities map
2024-08-26 15:04:59 +00:00
Dennis Felsing 6e3b0910e1
Merge pull request #8800 from def-/pr-winarm
Add arm64 windows support
2024-08-26 12:08:22 +00:00
Dennis Felsing 9fd4adfb21
Merge pull request #8812 from dobrykafe/pr-popup-password
Show server info in password popup
2024-08-26 06:20:15 +00:00
dobrykafe d44c68a8a5 show server info in password popup 2024-08-26 01:32:47 +02:00
furo 8f6d5d453e Add support for directories with add_map_votes 2024-08-25 23:29:34 +02:00
Dennis Felsing 7ee1dac08b
Merge pull request #8809 from furo321/append-settings
Transfer server settings while using append
2024-08-25 21:13:50 +00:00
Dennis Felsing 2fc3f81725
Merge pull request #8808 from furo321/collapse-all-button-editor
Add button to collapse/expand all groups in editor
2024-08-25 21:13:27 +00:00
Dennis Felsing 8e16113428
Merge pull request #8807 from furo321/no-input-while-opening
Don't allow input in console while it is opening/closing
2024-08-25 20:59:00 +00:00
furo 7628783e95 Transfer server settings while using append 2024-08-25 20:20:13 +02:00
furo 59dd8735bf Add button to collapse/expand all groups in editor 2024-08-25 19:41:10 +02:00
furo 0b27a47553 Don't allow input in console while it is opening/closing 2024-08-25 19:09:09 +02:00
bencie d8e82bbb1d Allow reloading current background entities map 2024-08-25 18:23:25 +02:00
Robert Müller 77790f677e
Merge pull request #8803 from furo321/file-picker-entities
Add a popup for picking a map for background entities setting
2024-08-25 10:00:46 +00:00
Schrodinger ZHU Yifan 83c3b4ea89 Add arm64 windows support 2024-08-25 00:02:43 +02:00
furo 6c0e42987e Add a popup for picking a map for background entities setting 2024-08-24 22:32:13 +02:00
Dennis Felsing be2e49e1f6
Merge pull request #8801 from Robyt3/Client-Touch-Input-Emote-Spectate
Add touch support to emoticon selector and spectator menu, minor refactoring
2024-08-24 15:05:18 +00:00
Robert Müller ed9720f1be Minor refactoring of emoticon selector rendering
- Extract variable `ScreenCenter`.
- Rename variables `i` to `Emote`.
- Move variable declarations closer to their usages.
2024-08-24 13:23:23 +02:00
Robert Müller 3bda76ff1f Add touch support to emoticon selector and spectator menu
Support using emoticon selector and spectator menu with touch inputs. Touching in the emoticon selector activates the selected (eye) emote and closes the emoticon selector. The spectator menu is kept open when using it for more convenience. The emoticon selector and spectator menu can be closed by touching anywhere outside of them.

Additionally, the emoticon selector and specator menu can now be closed by pressing the Escape key (i.e. the back button on Android). This made it necessary to change the order of the components for input handling, so the ingame menu will handle the Escape key after the emoticon selector and spectator menu. This also means that the Escape key can now be used to close the selector/menu when they are stuck open, which was previously delayed until ingame menu or console were opened and closed.
2024-08-24 13:21:58 +02:00
Robert Müller 93675799e8 Fix inconsistent margin in ingame menu, minor refactoring
The additional margin left of the Spectate and Join game buttons is unnecessary.

Avoid reusing `s_SpectateButton` variable for different buttons.

Use `TEAM_RED` instead of `0` when joining game in non-team server.
2024-08-24 12:21:23 +02:00
Dennis Felsing 5dff5e9e81
Merge pull request #8795 from furo321/cjsonwriter-master
Use `CJsonWriter` for creating server info JSON
2024-08-23 18:25:44 +00:00
furo f897af8dbb Use CJsonWriter for creating server info JSON 2024-08-23 20:07:11 +02:00
Dennis Felsing 96beaf2eca
Merge pull request #8793 from furo321/proof-borders-desc
Improve "Proof borders" description
2024-08-23 17:52:11 +00:00
furo b9a794121a Don't keep m_DDRaceState and m_StartTime of teammate in team0mode after death 2024-08-23 18:40:15 +02:00
furo a01e5e7151 Improve "Proof borders" description 2024-08-23 17:06:59 +02:00
ChillerDragon 56b56ef2b9 Fix save code not being censored in streamer mode
Closed #8790
2024-08-23 19:20:15 +08:00
Robert Müller 4d09332b83 Add CUIRect::TopLeft and Size convenience functions 2024-08-22 21:52:27 +02:00
ChillerDragon 804a91ced0 Fix sounds being doubled in 0.6
Closed #8785
2024-08-22 19:41:14 +08:00
Dennis Felsing 5210d77f92
Merge pull request #8781 from def-/pr-fix
Disallow save with draggers
2024-08-22 09:38:46 +00:00
Dennis Felsing f796309cc8 Fix save/swap with draggers 2024-08-22 00:47:06 +02:00
Robert Müller 499ad48ee6 Revert "Quit if Android back-button is pressed 3 times within 1 second"
This reverts commit 91848f0be6.

This was prone to accidental usage. The user interface is now usable with touch input, so this additional method to quickly and cleanly quit the game is not necessary anymore.
2024-08-21 19:30:59 +02:00
Robert Müller 992f235f05 Use HSLA scrollbar color picker for 0.7 tee settings
Use the same HSLA scrollbar color picker for the 0.7 tee settings as for the 0.6 tee settings. Use the correct darkest lighting value for 0.7 skin color pickers instead of not clamping the lighting value in the color picker.
2024-08-21 18:05:51 +02:00
Robert Müller ce0e52851c Refactor CSkins7::GetColor function
Use existing color constructor to conditionally unpack the alpha component instead of doing this separately.

Make `DARKEST_COLOR_LGT` a `float` constant instead of using an `enum` to simplify the usage.
2024-08-21 17:57:56 +02:00
Robert Müller abf8fac568 Refactor HSLA scrollbar color picker rendering
Rename `CMenus::RenderHSLScrollbars` function to `RenderHslaScrollbars`.

Pass darkest light value as `float` to the `RenderHslaScrollbars` function to add support for different values, instead of enabling the clamping with a `bool` parameter. Previously, this parameter was always set to `true`, as this type of color picker is only used for skins.

Remove unnecessarily complicated code for rendering unclamped lighting scrollbar. The code can be simplified by considering the darkest lighting value as a variable.

Let the `RenderHslaScrollbars` function return `true` if the color was changed to simplify the usage. The function previously returned the color but this value was unused.

Use `IGraphics::SetColor4` function instead of `IGraphics::SetColorVertex` when possible. Rename variables `Array` to `aColorVertices`. Use `std::size` instead of hard-coding array sizes.
2024-08-21 17:57:56 +02:00
Robert Müller 01d2b3e3bc Highlight hovered and active color picker scrollbar handle
Add visual feedback to color picker scrollbar handle being hovered and active.
2024-08-21 17:57:56 +02:00
Dennis Felsing db9b5f5b61
Merge pull request #8782 from ChillerDragon/pr_fix_sixup_sounds
Fix sixup sounds
2024-08-21 15:07:33 +00:00
ChillerDragon dcd1fefa7e Never send sounds to sixup that are played on the client side
Closed #2523
2024-08-21 22:02:39 +08:00
ChillerDragon 00b9eab2ce Rename CHAT_SIX/SEVEN to more generic FLAG_SIX/SEVEN 2024-08-21 21:33:34 +08:00
ChillerDragon 99ae72c143 Fix editor properties not being clamped on + and - button click
Closed #8778
2024-08-21 19:48:10 +08:00
Robert Müller 839c511af4 Make macOS semaphore names more unique, improve assertion
On macOS, semaphore names are global and processes can open semaphores of other processes by using their name. It was possible that multiple client/server processes randomly tried to create semaphores with the same memory address, which would cause them to have the same name. In that case, `sem_open` would fail because `O_EXCL` prevents creating semaphores if the name is already used.

This is made more unlikely by also including the PID in the semaphore name. Additionally, the semaphore name is prefixed with `/` to more closely follow the construction rules for semaphore names. In particular, the behavior is implementation-defined if the name is not prefixed with a slash.

See https://pubs.opengroup.org/onlinepubs/9799919799/functions/sem_open.html

Closes #8773.

More details are added to the assertion error message in case this does not end up fixing the issue.
2024-08-20 20:25:56 +02:00
heinrich5991 87aa251d73 Don't show "you've been banned" for VPN bans
Players are supposed to turn of their VPN or complain to the admins if
they get banned for using a VPN. Calling this "banned" seems to be
confusing, as players ask for an unban even after they turned off the
VPN.
2024-08-20 16:51:37 +02:00
Robert Müller 30f49201e5
Merge pull request #8764 from ChillerDragon/pr_cfgcol_07_marking
Use color type for 0.7 marking configs
2024-08-20 05:53:33 +00:00
ChillerDragon ef2db30bef Make 0.7 skin color variables unsigned to get rid of the casts 2024-08-20 11:49:04 +08:00
ChillerDragon 15713d7859 Use color type for 0.7 marking configs 2024-08-20 11:23:26 +08:00
Robert Müller 40fbc2140b Use std::string for IInput::GetClipboardText
Simplify clipboard handling by returning an `std::string` and freeing the string returned by SDL immediately, so the clipboard data does not stay in memory unnecessarily after the clipboard has been used until the clipboard data is requested again.

Fix possible TOCTOU when pasting from the clipboard into a lineinput, due to the clipboard data being requested twice.
2024-08-19 19:03:49 +02:00
Dennis Felsing 89cc2d46a8
Merge pull request #8766 from Matodor/pr_inputs_missing_zoom_scale
Fixed missing TargetX/TargetY zoom scale apply in CControls::SnapInput
2024-08-19 06:55:54 +00:00
ChillerDragon 66e3f619c7 Add delete hotkey for 0.7 skins 2024-08-19 12:00:55 +08:00
Dennis Felsing 474dae5ead check 2024-08-18 23:55:08 +02:00
Matodor ddd13ba4fc fix: fixed missing TargetX/TargetY zoom scale apply in CControls::SnapInput 2024-08-19 00:52:36 +05:00
Dennis Felsing 8dd2b6e9e6
Merge pull request #8765 from Robyt3/Client-Menus7-Interactive-Tee-Fixes
Improve interactive tee in 0.7 tee settings
2024-08-18 10:33:27 +00:00
Robert Müller b9ab23405e
Merge pull request #8759 from Bamcane/client-sixup-fix
Fix client sixup translation context
2024-08-18 10:33:07 +00:00
Bamcane 5c2ab4cb92 Fix client sixup translation context
Co-authored-by: Robyt3 <robytemueller@gmail.com>
2024-08-18 18:14:27 +08:00
Robert Müller 2eff7ecb61 Improve interactive tee in 0.7 tee settings
- Fix value `0` being used for sound volume, so the tee sound was not audible.
- Use `DoButtonLogic` to trigger sound to ensure it does not play while other UI elements are active.
- Remove unnecessay `MousePosition` variable by using `MousePos` function instead.
2024-08-18 12:08:20 +02:00
Dennis Felsing ddfd4dbfb1
Merge pull request #8763 from ChillerDragon/pr_remove_ddnet_hotui
Remove ddnet_hotui hook
2024-08-18 07:22:22 +00:00
Dennis Felsing 21807c15bd
Merge pull request #8744 from ChillerDragon/pr_color_speed
Color speed in hud based on increase or decrease
2024-08-18 07:19:11 +00:00
ChillerDragon 789fee99df Remove ddnet_hotui hook 2024-08-18 15:02:33 +08:00
Dennis Felsing f569981eb5
Merge pull request #8755 from ChillerDragon/pr_delete_07_skins
Implement 0.7 delete skin button
2024-08-18 06:44:10 +00:00
Dennis Felsing 1758bfc7f9
Merge pull request #8730 from ChillerDragon/pr_07_separate_dummy_skins
Support different skin states for dummy and main in 0.7 connections
2024-08-18 06:42:24 +00:00
Dennis Felsing e008f40a19
Merge pull request #8761 from ChillerDragon/pr_race7_nullptr
Fix race 0.7 check null pointer dereference
2024-08-18 06:36:45 +00:00
Dennis Felsing b05ffeae3b
Merge pull request #8762 from ChillerDragon/pr_fix_dummy7_marking_alpha
Fix 0.7 dummy marking alpha being reset
2024-08-18 06:34:56 +00:00
Dennis Felsing 9fe2203a24
Merge pull request #8754 from ChillerDragon/pr_fix_06_demo_cutting
Fix cutting 0.6 demos
2024-08-18 06:29:33 +00:00