Simplify memory management of groups, layers, images, sounds and envelopes by using `std::shared_ptr` for all of them.
Clear brush when creating a new map to prevent crash due to unloaded textures being used in tile layer. Closes#6935.
Also fix crash when restoring a saved brush after removing an image that is being used by it.
Switch to using the Windows-specific `HANDLE` and Windows API functions instead of `FILE *` and standard library functions in all Windows IO function implementations.
Using `CreateFileW` instead of `_wfsopen` to open files is necessary, as only `CreateFileW` allows specifying all necessary sharing flags. The sharing flags `FILE_SHARE_READ` and `FILE_SHARE_WRITE` were previously already specified by using `_SH_DENYNO` with `_wfsopen`, but `FILE_SHARE_DELETE` can only be set when using `CreateFileW`. The flags are necessary so files which are in use by the game can still be opened by other processes. In particular, `FILE_SHARE_DELETE` allows deleting/renaming of open files, which was previously not possible. This was causing the smart editor saving process that renames files to fail if a map file is currently in use.
Because `CreateFileW` returns a `HANDLE` instead of a `FILE *` we have to use the `HANDLE`-based Windows IO functions everywhere.
See: https://devblogs.microsoft.com/oldnewthing/20211022-00/?p=105822Closes#6922.
Dont save the Multi-View variables
Multi-View can not longer be activated again after already active
Fix cl_multiview_use_freeview variable config
Players who killed will be removed from Multi-View even if the spec mode is not active
Multi-View personal zoom will be reseted when enabling Multi-View
Fix bug where a kill in a team will be taken into account
Improve the solo player experience in Multi-View
The old code looked pretty weird. It checked for `CFGFLAG_SERVER |
CFGFLAG_GAME` being set above, and then used the passed-in parameter to
find the command. I think it'd be better to just look for `CFGFLAG_GAME`
and then find the command using `CFGFLAG_GAME`.
implement tuning values for elasticity
add grounded check to movebox and give jump back when bouncing
fix styling issues
fix jumps being given back at ceilings
Check if datafile data cannot be read entirely (according to the data size specified in the header) and check for decompression errors. In case of errors, let `GetData` return `nullptr` and `GetDataSize` return `0` for the respective index.
Internally the decompressed size is set to `-1` for data which failed to load, so loading of those data will not be attempted again because it would only fail again and can cause additional log messages.
Rectangles with inverted round corners (`IGraphics::CORNER_I*`) are currently not used anywhere and also only supported when using `Draw4`.
They also feel clunky to use due to the inverted corners being drawn outside of the specified rectangle area.
Use icons for all server settings buttons. Rearrange and group buttons.
Show buttons in disabled state when they are not useable instead of hiding them.
Remove checker background from server settings list.
Overhaul hotkeys, also show hotkeys in the tooltips:
- Enter: add command
- Alt+Enter: update command (previously M)
- Alt+Up/Down: move command up/down (previously no hotkey)
- Delete: delete command
Don't activate command lineinput when selecting, moving or deleting elements, as this prevents the listbox from accepting the delete hotkey.
Fix server settings listbox being active while file dialog is open.
Ensure extra editor dragbar area matches the respective toolbar size.
Remove spacing on the left side of extra editors to improve alignment.
Increase status bar button sizes and make them consistent.
Use `enum` to track active extra editor instead of using multiple `bool`s.
Disable extra editor buttons when tile picker is shown, as the extra editors are not rendered in this case.
So that buttons in the status bar cannot be used while a popup or the file dialog is open.
The tooltip still has to be rendered after popup menus, as popup menus can set the tooltip, which would otherwise not be shown.
Port the `CJsonWriter` utility class from upstream, which makes outputting correct JSON easier.
Add `CJsonWriter` as an abstract class that can write to different outputs. Two implementations `CJsonFileWriter` (writes to a file) and `CJsonStringWriter` (writes to an `std::string`) are added. Upstream `CJsonWriter` can only write to files.
The same tests are added for both implementations. Duplicate code is avoided by using typed tests with two separate test fixtures.
Typed tests have test names like "TestName/0" and "TestName/1", which would result in invalid filenames. Replace the string after the first slash with the name of the typed test and use hyphen instead of slash.