Commit graph

10210 commits

Author SHA1 Message Date
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