Only add assertion to prevent empty filename, as this causes Valgrind to crash.
Handle empty filename used for special null-image separately in gameclient.
Add `CMapBasedEnvelopePointAccess::SetPointsRange` function so the start point and number of points that should be considered when using this envelope point storage can be configured. In the editor, this range always includes all points, as each envelope directly stores only its own points, so animations were rendered correctly there. However, all points are stored in one array when loading them from the map file (i.e. when rendering the map ingame), so the start point and number of points specified for the envelopes have to be considered when accessing their envelope points.
Closes#6886.
Use `CLineInput::GetActiveInput` and `CLineInput::IsActive` instead for consistency.
The last active item pointer is now only tracked internally in `CUI` to deactivate the active line input when it's no longer used in the UI.
Write the map to a temporary file first. When the map was saved to the temporary file successfully, first delete the existing map file having the real filename, then rename the temporary file to the real filename.
If deleting or renaming fails, show an error message popup and log an error message to the console.
The implementation is consistent with the way temporary files are utilized by Microsoft Word, so this should work on Windows.
See: https://support.microsoft.com/en-us/topic/description-of-how-word-creates-temporary-files-66b112fb-d2c0-8f40-a0be-70a367cc4c85
Different from #4482, this first deletes the old map file before renaming the temporary file. Although it appears that renaming a file would also override the target file, it could be that this does not work on all systems. Additionally, this adds descriptive error messages in the cases of failure.
Closes#4476.
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
This map item version adds the `m_Format` field, which specifies the image format for embedded images. The default value is `CImageInfo::FORMAT_RGBA` for map items of the previous version.
Port map and editor support for `CURVETYPE_BEZIER` from upstream, i.e. support bezier curves with configurable in- and out-tangents for every envelope point.
The in- and out-tangents are represented by triangles and can be dragged in the envelope editor like the envelope points.
Support reading and writing the bezier information as a separate UUID-based map item. If the bezier information is not found, bezier will default to linear behavior. Old clients will still be able to read the new maps and ignore the unknown map item. The unknown curvetype will also be handled as linear by old clients.
Allow reading upstream maps that use `CMapItemEnvelope` version 3. On upstream, a different struct is used to store all envelope points including bezier information, which broke compatibility to old clients.
Fix holding Ctrl for slow envelope point editing not working for vertical movement.
Highlight the currently selected element (envelope point or bezier tangent marker) which is being used with the value/time edit boxes.
Hide the value/time edit boxes when no element is selected.
Previously it reported the internal file data size (compressed). This
made the `map_resave` tool do the wrong job.
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
To reduce duplicate code and to add validation for tile skip everywhere.
Add separate `CMapItemLayerTilemap::TILE_SKIP_MIN_VERSION` constant and change `CMapItemVersion::CURRENT_VERSION` back to the previous version, as maps with tile skip can be loaded but skip is not used when saving.
Delay showing the warning for ingame movement until the player has stopped moving while the editor is open, so the warning doesn't show immediately when the player performs an action (like jumping) and opens the editor shortly after.
Closes#6852.
Add optional `end` output parameter to `str_utf8_find_nocase` which is set to a pointer into the haystack after the matched string.
This is necessary because there are pairs of matching upper case and lower case Unicode characters with different byte length (e.g. both `I` and `İ` map to `i`), so the byte length of the string matched in the haystack may not be identical to the length of the needle string.
6824: Improve Multi-View UX r=Robyt3 a=Vy0x2
- [x] You can now see who you are spectating in the spectator menu and even add/remove people from it (left mouse button)
- [x] Teleports are now being processed slower (more smoothly)
- [x] Workaround for starting multi-view from free-view (chooses now the nearest player to be the focus)
- [x] Added two more important variables to be able to customize it for specific scenarios (youtubers)
before:
![screenshot_2023-07-09_18-34-29](https://github.com/ddnet/ddnet/assets/24738662/a2ff8b77-c626-4ac2-b200-1eea70f85213)
after:
![screenshot_2023-07-09_18-32-49](https://github.com/ddnet/ddnet/assets/24738662/a54f0b06-b228-43ac-a1fc-eab95e7d9c20)
Edit: Thats the feedback i got from people. Hope its okay.
## 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
- [ ] 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: devdenn <denispaul43@gmail.com>
keep a bit more care with who we choose to spectate when frozen
only show active team as clickable in the spec menu
enable switchting teams in Multi-View by closing the spec menu
make the whole spectator menu clickablefix naming
twerk symbols a bit
remove unused ui
add more multi-view variables
add slow acceleration when teleported, add indication in spec menu
make players clickable in spectator menu
change focus with the spectator menu
6840: Fix enter not working in server browser when no server selected, fix enter not working in editor save dialog when no map selected r=def- a=Robyt3
## 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>
To make input handling consistent with the gameclient. Also skip input events that are not valid, same as in the gameclient, as this otherwise causes input events to be handled multiple times.
Replace `CEditor::m_EditBoxActive` which only works with editboxes created from the editor with `CLineInput::GetActiveInput` which also works for editboxes which are created by generic UI functions, e.g. the value selector editboxes of color pickers.
When starting with `dbg_stress 1` the invalid texture was never actually getting loaded, which was causing the client to crash when using the Vulkan backend and starting with `dbg_stress 1`.
Additionally ensure that the invalid texture is 16x16 pixels large and loaded with the texture flags to support usage for tile rendering.
Closes#6504.
6834: Support showing multiple different error messages in editor r=def- a=Robyt3
Previously the same message popup context was used for all error messages. While multiple message popups could be opened at the same time, the message would always be the same for all, as the same buffer was used for all popups.
This is fixed by creating and destroying the message popup contexts dynamically, so there can be any number of message popups with different messages. Additionally, if a popup with an identical message is already open, it will first be closed and then reopened at the new position, to prevent duplicate message popups.
## 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>
Previously the same message popup context was used for all error messages. While multiple message popups could be opened at the same time, the message would always be the same for all, as the same buffer was used for all popups.
This is fixed by creating and destroying the message popup contexts dynamically, so there can be any number of message popups with different messages. Additionally, if a popup with an identical message is already open, it will first be closed and then reopened at the new position, to prevent duplicate message popups.
6833: Support deleting/renaming demo folders, improve demo popups r=def- a=Robyt3
Support deleting and renaming folders in the demo browser. Only empty folders can be deleted.
Ensure only files and folders in the save directory can be deleted and renamed.
Also check if a folder with a demo rename/render filename already exists.
Fix broken `m_DemolistSelectedIsDir` checks by using `m_vDemos[m_DemolistSelectedIndex].m_IsDir` instead.
Append `.mp4` file extension only internally instead of appending it to the render filename lineinput, as this causes the file extension to appear when rendering doesn't start due an error message.
Use more efficient `FileExists` instead of `FindFile` to check if rendered demo video file already exists.
Change popup preconditions to assertions.
## 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>
Support deleting and renaming folders in the demo browser. Only empty folders can be deleted.
Ensure only files and folders in the save directory can be deleted and renamed.
Also check if a folder with a demo rename/render filename already exists.
Fix broken `m_DemolistSelectedIsDir` checks by using `m_vDemos[m_DemolistSelectedIndex].m_IsDir` instead.
Append `.mp4` file extension only internally instead of appending it to the render filename lineinput, as this causes the file extension to appear when rendering doesn't start due an error message.
Use more efficient `FileExists` instead of `FindFile` to check if rendered demo video file already exists.
Change popup preconditions to assertions.
Show a short message below the existing chat mentions message that is shown in the top left area of the editor above the layers/images/sounds button when the player character is moved ingame while the editor is open. The messages are cleared when the editor is activated and when the client is disconnected.
Closes#1993.