Commit graph

17232 commits

Author SHA1 Message Date
bors[bot] 06fe73619e
Merge #6752
6752: Ensure `ListDirectory/Info` entries are unique, support selecting storage location in demo browser and editor file browser r=def- a=Robyt3

Description in commits below. Screenshots/video:

- Storage location selection for demos:
![screenshot_2023-06-18_17-25-23](https://github.com/ddnet/ddnet/assets/23437060/bcc94977-50ba-494b-894d-7bd8fea7f91e)

- Storage location selection for maps:
![screenshot_2023-06-18_17-25-33](https://github.com/ddnet/ddnet/assets/23437060/2b8b7822-b4b9-409f-86eb-e44f5c072541)

- Link to "themes" folder:
![screenshot_2023-06-18_17-26-02](https://github.com/ddnet/ddnet/assets/23437060/eba661a6-0bee-4977-ab95-35e400b5b291)

- Video showing navigation between storages (`temp` is the save directory and `temp2`, `temp3` and `data` are other storages)

https://github.com/ddnet/ddnet/assets/23437060/5736d212-3848-44c2-aa81-7f2da9b98008

Closes #5496.

## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-07-03 19:05:42 +00:00
bors[bot] 00076713cc
Merge #6805
6805: Render editor pressed keys and saving message behind file dialog r=def- a=Robyt3

The messages were previously rendered on top of the file dialog and popup menus.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-07-03 18:44:27 +00:00
Robert Müller a4465ab8d6 Render editor pressed keys and saving message behind file dialog
The messages were previously rendered on top of the file dialog and popup menus.
2023-07-03 20:25:36 +02:00
bors[bot] 407c671be2
Merge #6804
6804: Update russian.txt r=def- a=gerdoe-jr

`Наблюдать` -> `Наблюдение за`
`*новых упоминаний` -> `*упоминаний`

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Vlad <gerdoexx@gmail.com>
2023-07-03 18:21:26 +00:00
Robert Müller f19d102f70 Support selecting storage location in editor file browser
Initially the file browser (maps, images, sound) shows the files from all storage locations combined like before when opening a file for reading. When saving a map, only the save storage location is shown and used like before.

The folder ".." is now also shown in the root folder, to navigate up to the storage location selection, if more than one storage location is present where a "maps"/"mapres" folder exists (whichever the dialog is currently showing). Only the locations where one of those folders exists are shown in the storage location selection. Additionally "All combined" can be selected to go back to the combined view.

The "Show directory" button behavior is adjusted so that the folder that contains the currently selected item is opened. When the storage location selection is shown, the button opens the selected storage location instead.

When navigating to the parent folder, the previous folder is now initially selected instead of resetting the selection.

Add a link to the "themes" folder same as the link to the "downloadedmaps" folder to allow easier access to the themes with the map editor.

The "folder tree" icon which is used for the ".." folder is now also used for the folder links in the storage location selection and for the links to the "downloadedmaps" and "themes" folders.

Always sort links above normal folders but below the ".." folder.

Fix alignment of font icons by using the correct flags.
2023-07-03 20:06:40 +02:00
Robert Müller e1035c3319 Support selecting storage location in demo browser
Initially the demo browser shows the demos from all storage locations combined like before.

The folder ".." is now also shown in the root folder, to navigate up to the storage location selection, if more than one storage location is present where a "demos" folder exists. Only the locations where one of those folders exists are shown in the storage location selection. Additionally "All combined" can be selected to go back to the combined view.

When navigating to the parent folder, the previous folder is now initially selected instead of resetting the selection.

The "Demos directory" button behavior is adjusted so that the folder that contains the currently selected item is opened. When the storage location selection is shown, the button opens the selected storage location instead.

The "folder tree" icon which is used for the ".." folder is now also for the folder links in the storage location selection.

Fix alignment of font icons by using the correct flags.

The config variable `ui_demo_selected` is removed and replaced with an internal buffer. The selected demo was always reset when restarting anyway and this would also not work with demos in subfolders either.
2023-07-03 20:06:40 +02:00
Robert Müller b5524d6c52 Ensure ListDirectory/Info entries are unique
When multiple files or folder have the same name in multiple storage locations, only pass the first entry (file or folder, whichever comes first) to the callback. To prevent files with the same name form being listed multiple times, e.g. in the demo browser, editor file browser, and asset lists.
2023-07-03 20:06:40 +02:00
Robert Müller 569753125e Add IStorage::NumPaths to get number of storage locations 2023-07-03 20:06:39 +02:00
Vlad 48af74f538 some fixes
`Наблюдать` -> `Наблюдение за`
`*новых упоминаний` -> `*упоминаний`
2023-07-03 20:51:44 +03:00
bors[bot] 35f8475eb2
Merge #6803
6803: Improve font scaling of long editor texts, improve ellipsis r=def- a=Robyt3

For long editor texts (group name, layer name, image name, sound name, file names, tooltips) make use of the font scaling and ellipsis functionality implemented in `DoLabel` instead of implementing it separately in the editor.

Screenshots:
- File dialog:
   - Before: 
![filedialog old](https://github.com/ddnet/ddnet/assets/23437060/1eb9f191-ceb3-491c-8f35-5058ed07c77e)
   - After: 
![filedialog new](https://github.com/ddnet/ddnet/assets/23437060/18b37439-db6f-49a6-ab42-a608dc9c87c6)
- Filename (top menu bar):
   - Before:
![filename old](https://github.com/ddnet/ddnet/assets/23437060/8735204d-f2b3-4443-887f-f9780f660768)
   - After: 
![filename new](https://github.com/ddnet/ddnet/assets/23437060/53ba21c7-dca3-40d9-85ad-f6adfe9b80a6)
- Image name:
   - Before: 
![imagename old](https://github.com/ddnet/ddnet/assets/23437060/2041beca-db09-474f-a265-fb4175404913)
   - After: 
![imagename new](https://github.com/ddnet/ddnet/assets/23437060/801c43d1-0c23-4235-aa40-b82a6df74df6)
- Layer name:
   - Before: 
![layername old](https://github.com/ddnet/ddnet/assets/23437060/b6207c2e-e029-4e36-8179-abccc317dbf3)
   - After: 
![layername new](https://github.com/ddnet/ddnet/assets/23437060/75ef8de1-f3b2-4743-b5a2-257718ef7102)
- Image selection:
   - Before:
![imageselection old](https://github.com/ddnet/ddnet/assets/23437060/c60f020a-faa9-40ba-8ece-f20fc7bf9bfc)
   - After: 
![imageselection new](https://github.com/ddnet/ddnet/assets/23437060/96b4f735-8ba1-4be7-8b81-1eac70c40ccd)

## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-07-02 22:29:34 +00:00
Robert Müller 2b64a66dc6 Improve font scaling of long editor texts, improve ellipsis
For long editor texts (group name, layer name, image name, sound name, file names, tooltips) make use of the font scaling and ellipsis functionality implemented in `DoLabel` instead of implementing it separately in the editor.
2023-07-02 23:34:58 +02:00
Robert Müller 0a7361090f Add ellipsis flag to DoLabel, support stop-at-end with max width
Add `SLabelProperties::m_EllipsisAtEnd` to render an ellipsis when using `DoLabel`.

Fix `m_StopAtEnd` and `m_EllipsisAtEnd` not working together with the automatic font scaling. Now the stop-at-end and ellipsis flags will only have an effect when the automatic font scaling has reached the minimum font size already.

Add `SLabelProperties` argument to `DoLabelStreamed` and adjust usages in server browser. Font scaling now has to be disabled explicitly for the server name, gametype and map, as these should use the stop-at-end flag without the font-scaling.
2023-07-02 23:34:58 +02:00
bors[bot] ac6ee58e08
Merge #6802
6802: Fix height of layer popup when automapper properties shown, fix incorrect popup being closed when gametile popup used r=def- a=Robyt3

Both are regressions in 17.1 and should be added to the release.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-07-02 18:25:28 +00:00
Robert Müller e2ef536e43 Fix incorrect popup being closed when gametile popup used
When selecting a gametile the layer popup was being closed instead of the top-most gametile popup.

Regression from #6503.
2023-07-02 12:43:30 +02:00
Robert Müller b252e7402b Fix height of layer popup when automapper properties shown
Regression from #6755.
2023-07-02 12:42:45 +02:00
bors[bot] c955905662
Merge #6796
6796: CSound: Initialize all members (fixes #6795) r=Robyt3 a=def-

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2023-07-02 09:23:09 +00:00
bors[bot] 793271c6da
Merge #6799
6799: Fix wrongly calculated reload timer for ninja in prediction r=def- a=trml

This fixes a bug where ninja didn't get predicted when you fired a weapon right before picking it up and then tried to use ninja immediately afterwards

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: trml <trml@users.noreply.github.com>
2023-07-02 07:45:05 +00:00
bors[bot] bd9748215f
Merge #6800
6800: Update spanish.txt r=def- a=n0Ketchp

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: noKetchup <93238471+n0Ketchp@users.noreply.github.com>
2023-07-02 07:27:47 +00:00
noKetchup 1801c43892
Update spanish.txt 2023-07-01 22:52:27 -04:00
trml 8335fdae79 Fix wrong predicted reload timer after ninja pickup 2023-07-02 02:22:12 +02:00
bors[bot] 97b31e1cc8
Merge #6798
6798: Update Belarusian translation r=def- a=AlehKushniarou

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Pavukoplov <arachnoplov@gmail.com>
2023-07-01 22:18:21 +00:00
Pavukoplov 4a6d21247a Update Belarusian translation 2023-07-02 00:58:20 +03:00
Dennis Felsing 69ba84e62c CSound: Initialize all members (fixes #6795) 2023-07-01 19:50:20 +02:00
bors[bot] 78f31ea5a5
Merge #6794
6794: Update russian.txt r=def- a=lolipodass

Add missing translation and rewrite old to match new

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: lolipodass <56706038+lolipodass@users.noreply.github.com>
2023-07-01 16:52:43 +00:00
bors[bot] 4bd14933b8
Merge #6790 #6793
6790: Prevent /swap with paused players r=def- a=Robyt3

Prevent swapping if either of the players is paused (i.e. their character is not in the gameworld), as this can cause them to be stuck in midair after swapping, which can be exploited to skip parts.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [X] Tested in combination with possibly related configuration options (servers with `sv_pauseable 0` were and are unaffected)
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


6793: Use `std::vector` and `std::deque` instead of most `std::list`s r=def- a=Robyt3

Use `std::vector` in cases where elements are only inserted at the end of the collection.

Use `std::deque` in cases where elements are only inserted/deleted at the beginning/end of the collection.

Use `std::list` in the remaining single case where elements are being removed from arbitrary positions and added at either the beginning or the end of the collection.

Adjust variables names. Don't use separate prefix for `std::deque`s and `std::list`s, as they are only used very rarely. Closes #6779.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-07-01 16:04:13 +00:00
lolipodass 05ef4c7e03
Update russian.txt
Add missing translation and rewrite old to match new
2023-07-01 18:51:29 +03:00
bors[bot] a2d2f32ded
Merge #6792
6792: Fix proximity radius of predicted pickups r=def- a=trml

Radius was set to 0 before this, so pickups were sometimes not predicted.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: trml <trml@users.noreply.github.com>
2023-07-01 15:44:57 +00:00
Dennis Felsing d56bd87e1c
Merge pull request #6791 from Robyt3/Client-Cleanup-GraphicsThread
Remove unused `GraphicsThread`/`GraphicsThreadProxy` declarations
2023-07-01 17:25:58 +02:00
Robert Müller bc73ea30c7 Use std::vector and std::deque instead of most std::lists
Use `std::vector` in cases where elements are only inserted at the end of the collection.

Use `std::deque` in cases where elements are only inserted/deleted at the beginning/end of the collection.

Use `std::list` in the remaining single case where elements are being removed from arbitrary positions and added at either the beginning or the end of the collection.

Adjust variables names. Don't use separate prefix for `std::deque`s and `std::list`s, as they are only used very rarely. Closes #6779.
2023-07-01 15:44:35 +02:00
trml 678e3cad0c Set physsize of predicted pickups 2023-07-01 14:07:03 +02:00
Robert Müller 8d890e6773 Remove unused GraphicsThread/GraphicsThreadProxy declarations 2023-07-01 13:41:49 +02:00
Robert Müller c6b4302b21 Prevent /swap with paused players
Prevent swapping if either of the players is paused (i.e. their character is not in the gameworld), as this can cause them to be stuck in midair after swapping, which can be exploited to skip parts.
2023-07-01 11:01:18 +02:00
bors[bot] ae685e84fc
Merge #6789
6789: Add new contributors for 17.1 r=Robyt3 a=def-

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2023-07-01 08:23:46 +00:00
Dennis Felsing 9ea16f660b Add new contributors for 17.1 2023-07-01 09:43:00 +02:00
bors[bot] 3d60334d10
Merge #6786
6786: Fix inconsistent size and corners of connect button r=def- a=Robyt3

The connect button had `5.0f` units less width, which was causing the corners of the refresh and connect buttons to look differently.

Screenshots:
- Before: 
![connect-button old](https://github.com/ddnet/ddnet/assets/23437060/1ed567b9-d108-4a7a-9141-c43fab89d4aa)
- After:
![connect-button new](https://github.com/ddnet/ddnet/assets/23437060/e054018d-cd2d-4257-96c4-e1d57e111c68)

## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-06-30 14:00:03 +00:00
Robert Müller 3159cc58fb Fix inconsistent size and corners of connect button
The connect button had `5.0f` units less width, which was causing the corners of the refresh and connect buttons to look differently.
2023-06-30 15:52:24 +02:00
bors[bot] 58a0d294c3
Merge #6784
6784: Update translations for upcoming 17.1 r=Robyt3 a=def-

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2023-06-30 13:20:30 +00:00
Dennis Felsing 1261cf6bb1 Update German translations 2023-06-30 10:47:58 +02:00
Dennis Felsing c8269bf6c3 Update translations for upcoming 17.1 2023-06-30 09:50:21 +02:00
bors[bot] b6eb2eb3eb
Merge #6776
6776: Allow 'bind x' to be used like 'binds x' r=def- a=ArijanJ

<!-- What is the motivation for the changes of this pull request? -->
This makes the 'bind' command optionally take only one argument, in which case it behaves like 'binds x'. This falls in line with how most popular games do it, and may prevent confusion in the future.

![image](https://github.com/ddnet/ddnet/assets/56356662/893508af-2b64-405f-be2c-da65387063aa)

This introduces a tiny bit of duplication though, because I just copied the if statement from 'binds', but it should be fine.

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ArijanJ <ajakshik@gmail.com>
2023-06-30 07:42:34 +00:00
bors[bot] 0e72dc331f
Merge #6781
6781: Continue sleeping, with `cl_refresh_rate` if packet waked client up r=def- a=Jupeyy

Notice i changed the check to > 0 microseconds.. The net wait cant handle nanos, busy waiting sounds bit overkill..
Notice also, i added a comment to the issue, which might be interesting before merging

fixes #6751

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2023-06-28 22:26:32 +00:00
Jupeyy 251edfd756 Continue sleeping, with cl_refresh_rate if packet waked client up 2023-06-28 21:02:41 +02:00
bors[bot] 05ddfba954
Merge #6755
6755: Remove individual RGBA sliders from editor color picker, add shift+rightclick/leftclick to copy/paste color in editor r=Jupeyy a=Robyt3

Remove the individual RGBA sliders for editor color pickers and only show one button that opens the color picker popup instead.

Decrease size of layer and point popups that previously had color properties which need less space now.

Support shift-rightclicking color picker buttons to copy the color to the clipboard in RRGGBBAA hex format.

Support shift-leftclicking color picker buttons to paste a color from the clipboard in RGB, RGBA, RRGGBB or RRGGBBAA format with optional leading `#` or `$`.

Screenshots:
- Before:
![screenshot_2023-06-20_20-39-43](https://github.com/ddnet/ddnet/assets/23437060/4a8b230c-a66b-4e2a-9744-cb5f80f6a799)
- After:
![screenshot_2023-06-20_20-40-00](https://github.com/ddnet/ddnet/assets/23437060/517f90cf-06a5-4332-9eb8-6a87cbc91b32)
- After (color picker open):
![screenshot_2023-06-25_17-35-55](https://github.com/ddnet/ddnet/assets/23437060/30320b56-e4cb-4e93-bf7b-8cfc8d96620b)


Suggested by `@HiRavie` in https://github.com/ddnet/ddnet/pull/6743#issuecomment-1593886873, though it was easier and also looks better to me when the color picker button has exactly the same size as the other value selectors.

## Checklist

- [X] Tested the change ingame
- [X] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-06-27 19:29:43 +00:00
bors[bot] 6f95eed669
Merge #6777
6777: Increase waiting times for client in valigrind (fixes #6773) r=Robyt3 a=def-

Seems like some CI workers don't have (virtual) sound cards

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2023-06-27 11:48:04 +00:00
Dennis Felsing 222e12a140 Increase waiting times for client in valigrind (fixes #6773) 2023-06-27 11:08:34 +02:00
Dennis Felsing b794c00a20 Disable sound in integration tests
Seems like the CI workers don't have (virtual) sound cards, puts out
useless errors
2023-06-27 11:08:13 +02:00
ArijanJ 7e3ad335be Allow 'bind x' to be used like 'binds x' 2023-06-27 09:46:32 +02:00
bors[bot] 67ddd93401
Merge #6772
6772: Various minor demo player usability improvements r=def- a=Robyt3

- Also skip to beginning and end when there are no demo markers. Previously the buttons to skip to the next/previous demo marker were skipping to the end/beginning respectively, if there is no next/previous marker, but only if there were any map markers. Now the button immediately skip to the beginning/end also when there are no demo markers at all.
- Fix demo seeking not working at beginning and end.
- Pause demo playback when skipping to end. It's otherwise inconvenient when the playback continues, as it will immediate rewind to the beginning when reaching the end.
- Allow right-clicking slice buttons to reset cut beginning/end.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-06-26 21:36:48 +00:00
bors[bot] 5d89b975be
Merge #6763
6763: Autosave copy of current editor map periodically to `auto` folder, use separate thread to finish saving maps, add saving indicator r=def- a=Robyt3

A copy of the map currently open in the editor is saved every 10 minutes to the `maps/auto` folder (interval configurable, see below). The automatically saved map uses the filename of the original map with an additional timestamp. Per map name 10 autosaves are kept in the `auto` folder before old autosaves will be deleted (number configurable, see below).

Add config variable `ed_autosave_interval` (0 - 240, default 10) to configure the interval in minutes at which a copy of the current editor map is automatically saved to the 'auto' folder.

Add config variable `ed_autosave_max` (0 - 1000, default 10) to configure the maximum number of autosaves that are kept per map name (0 = no limit).

Autosaving will not take place in the 5 seconds immediately after the map was last modified by the user, to avoid interrupting the user with the autosave.
This will only delay autosaving for up to 1 minute though, so autosaves are not prevented entirely, should the user continuously edit the map.

When the editor is reopened after being closed for more than 10 seconds, the autosave timer will be adjusted to compensate for the time that was not spent on editing in the editor.

When the map is saved manually by the user the autosave file is also updated, if it's outdated by at least half of the configured autosave interval. This ensures that autosaves are always available as a periodic backup of the map.

When a copy of the current map is saved, this does not update the autosave and will also no longer reset the modified state. The modified state should reflect whether changes have been made that are not saved to the current map file. As saving a copy does not update the current file, the modified state should not be reset in this case.

Closes #6693.

Compressing the data with zlib takes the majority of the time when saving a datafile. Therefore, compressing is now delayed until the `CDataFileWriter::Finish` function is called. This function is then off-loaded to another thread to make saving maps in the editor not block the rendering.

A message "Saving…" is shown in the bottom right of the editor view while a job to save a map is running in the background.

While a map is being finished in a background thread another save for the same filename cannot be initiated to prevent multiples accesses to the same file.

Closes #6762.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [X] Tested in combination with possibly related configuration options
- [X] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [X] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-06-26 21:13:01 +00:00
bors[bot] 66195d6eca
Merge #6771
6771: Fix images/sounds not being loaded with correct file extension r=Jupeyy a=Robyt3

Regression from #6764.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-06-26 20:50:05 +00:00