Support composite binds with `+` commands, fix handling of composite binds with F1-F24 keys, fix incorrect key names with multiple modifiers, refactoring
Previously, binding `+` commands like `+hook` to composite keys like `shift+x` or `ctrl+alt+mouse1` was not possible, as it would lead to stuck inputs when one of the modifiers is released first before the primary key. When binding `+` commands to composite binds the modifier was instead ignored to prevent this.
Now, binding `+` commands to composite keys is also possible. Active binds (key, modifier) are stored and when a modifier key is released all binds using that modifier are also released.
Closes#8314.
The handling of F1-F24 keys in `CBindsSpecial` was not correct for composite binds, leading to stuck inputs if modifier keys are released first. Now, the `CBindsSpecial::OnInput` function simply delegates to `CBinds::OnInput` for F-key presses/releases so the behavior is consistent with regular binds.
- Use `UnbindAll` function in destructor to reduce duplicate code.
- Use appropriate constants instead of magic number `0`.
- Remove redundant comments.
- Remove redundant `else if` condition.
- Rename generic loop variables `i` and `j` to `Modifier` and `Key` for clarity.
This was only affecting the key names displayed in the voting HUD, e.g. with `bind "ctrl+alt+f3" "vote yes"` the voting HUD previously showed `+f3` as the key name.
The `OnInput` function should return `true` exactly for events that were handled. In case of line inputs, the function returned `true` when then line input was changed instead. For the consoles, the function did not return `true` for some events that were handled.
The flag `TEXLOAD_NO_COMPRESSION` is entirely unused.
The flag `TEXLOAD_NOMIPMAPS` is unused and only the respective `CCommandBuffer::TEXFLAG_NOMIPMAPS` is used internally, so the former flag does not need to be exposed to users of `IGraphics`.
The `IGraphics::LoadTextureRawSub` function and the respective `CMD_TEXTURE_UPDATE` command are unused. Only text textures are updated after having been uploaded, but there is a separate `CMD_TEXT_TEXTURE_UPDATE` for that.
It should not be necessary to access the null-texture directly. The `CTextureHandle::IsNullTexture` function can be used to check if a texture handle is the null-texture.
Assume that this branch should apply to all team modes except `SV_TEAM_FORCED_SOLO` also when new team modes would get added after `SV_TEAM_FORCED_SOLO` in the future, as the values will never be changed and there is no relation between the order of the numeric values and the behavior.
Previously, swapping on forced solo servers was already impossible, as this would require two players to join the same team, so it would always fail with the error `Player is on a different team` (or earlier). The check `g_Config.m_SvTeam != 3` was never reached. Also, this check was not using the constant `SV_TEAM_FORCED_SOLO`. Now, an earlier check is added to show a more specific error message when trying to use `/swap` on a forced solo server.
The additional indirection with the `CEffects::ResetDamageIndicator` and `CDamageInd::Reset` functions to reset damage indicators is confusing and unnecessary. Always reset the damage indicators when disconnecting (in `OnReset`) instead of when entering the next game.
Rename `IGraphics::IsImageFormatRGBA` function to `IsImageFormatRgba`.
Rename parameter `pFileName` to `pContextName`, as this name does not necessarily describe a file.
Remove unnecessary check for parameter `pFileName` (now `pContextName`) being unset, which is and should never be the case.
Rename parameter `Img` to `Image` for consistency.
Put the context name in quotation marks in the warning message.
Rename parameter `pFileName` to `pContextName`, as this name does not necessarily describe a file.
Rename parameter `Img` to `Image` for consistency.
The function is unused and because the message is not flushed it would also not have worked correctly. The `NETMSG_INPUT` message is already packed and flushed in the `CClient::SendInput` function.
Closes#8408.
The maximum width and height were swapped as the loop bounds, so the menu checker background did not have the correct width on very wide resolutions.
This was not noticed on common resolutions because twice as many quads as necessary were also being rendered for each row of the background. The bounds of the inner loop are adjusted and only every second x-value is iterated, which reduced the total number of quads for the checker background rendering by more than half.
Track whether the dummy is currently connecting separately so the dummy being disconnected due to errors can be detected. Show an error message as echo in the chat when the dummy could not be connected, e.g. when the server is full.
Use the global time for limiting the dummy connecting delay instead of using game ticks, so the delay also works correctly when having connection problems (i.e., when ticks do not advance). Handle the dummy connecting being delayed separately from the dummy currently connecting.
Add tooltips for the "Connect dummy"-button when it's disable due to dummy not being allow on the server or when connecting is delayed.
Add console error messages for `dummy_connect` command.
The image data was not being freed when `IGraphics::LoadTextureRawMove` is used with images that are not in RGBA format as this falls back to using `IGraphics::LoadTextureRaw` which requires manually freeing the image data.
Also consistently clear all image info in `LoadTextureRawMove`. This makes it necessary to store the size of the preview image in the editor separately, as previously the width and height of the unloaded image info were being used to render the preview image.