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.
error: failed to compile `twmap-tools v0.3.1 (/home/runner/work/ddnet/ddnet/twmap/twmap-tools)`, intermediate artifacts can be found at `/home/runner/work/ddnet/ddnet/twmap/target`
Caused by:
package `half v2.3.1` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.69.0
Either upgrade to rustc 1.70 or newer, or use
cargo update -p half@2.3.1 --precise ver
where `ver` is the latest version of `half` supporting rustc 1.69.0
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.