Commit graph

13498 commits

Author SHA1 Message Date
Robert Müller 8dfa0b2198 Rename UpdateFilteredPlayers, remove mutable variable 2023-09-17 21:37:32 +02:00
Dennis Felsing a598831361
Merge pull request #7190 from Robyt3/Browser-Layout-Overhaul
Overhaul server browser filter, details and friends tabs
2023-09-16 22:17:38 +00:00
furo 67e753bd6b Don't include .demo in demo slice input 2023-09-16 22:09:26 +02:00
Robert Müller 0b57d56f48 Overhaul server browser filter, details and friends tabs
Move the "Filter", "Info" and "Friends" tabs to the top, above the tab content. Use icons instead of text for the tabs. Use animator to animate the tabs on mouse-over. Closes #6613.

Make spacings, corners and font sizes used in the filter, details and friends tabs more consistent.

Remove some unnecessary dark UI rect backgrounds.

Improve alignment of the number of friends with the heart icon for entries in the server list.

Improve layout of countries and types filters. Make the filters scrollable when there are many entries.

Refactor most of the server browser in preparation for replacing the DDNet and KoG tabs with a community filter, which will work like the countries and types filters. Split rendering of different server browser sections into multiple functions to improve readability. Reduce duplicate code for the countries and types filters.
2023-09-16 13:45:52 +02:00
Robert Müller 673b7facbe Remove unnecessary return value of net_init
The return value is unused and always 0, as the function fails with an assertion instead of returning an error value.
2023-09-16 13:37:53 +02:00
Robert Müller 3e548f0f66 Make listbox scrollbar width and margin adjustable 2023-09-16 13:24:19 +02:00
heinrich5991 286104cf08
Merge pull request #7181 from furo321/color-vote
Color vote if you have voted f3 or f4.
2023-09-16 10:40:15 +00:00
heinrich5991 b22956e7c6
Merge pull request #7188 from Robyt3/Server-Missing-Testing-Commands
Add `unninja`, `solo` and `deep` testing commands
2023-09-16 10:25:53 +00:00
furo b423ee59af Color text if you have voted f3 or f4
Add Sv_YourVote packet
2023-09-16 12:17:11 +02:00
Robert Müller 643a23aad3 Add unninja, solo and deep testing commands
Closes #7161.
2023-09-16 11:59:21 +02:00
Robert Müller f42e39a9e2 Consistently name CScrollRegion and CListBox getters
Remove `Is` from the getter names for the same reason that removing `Get` from the name is preferred. The word `Is` was inconsistently used as a prefix in `CScrollRegion` but as an infix in `CListBox`.
2023-09-16 11:37:19 +02:00
Dennis Felsing 6b8997b64a
Merge pull request #7185 from furo321/editor-use-pack-functions
Use colour pack functions for editor
2023-09-15 22:37:03 +00:00
Dennis Felsing 15bdef32a1
Merge pull request #7136 from infclass/for-ddnet2
Refactor some core classes (step 1/xxx to shared CGameWorld)
2023-09-15 22:34:53 +00:00
furo 25c3e1616e Use colour pack functions for editor 2023-09-15 22:30:25 +02:00
Dennis Felsing 5e3d97f635
Merge pull request #7174 from Robyt3/Demo-Player-Skipping-Overhaul
Overhaul demo player skipping UI and UX
2023-09-15 20:12:44 +00:00
Robert Müller 350ba77a74 Minor refactoring of ingame server browser
- Remove unnecessary variable `Page`.
- Use `IGraphics::CORNER_NONE` instead of `0` and instead of the inconsistent-looking `CORNER_BR` for the KoG-button.
- Simplify UI rect layout.
2023-09-15 20:57:56 +02:00
Alexander Akulich 3fd4e10def World cleanup 2023-09-15 18:04:29 +03:00
Alexander Akulich f58eef45b9 Server: Use the tuning params via GameWorld (like in prediction)
The world tuning is a part of the world. This way the entities implementation
use the same API as available on the client side.

This change is a step toward unified/shared world logic for client and server.
2023-09-15 18:04:29 +03:00
Alexander Akulich 77fc14f251 Server: Move player (ID) mapping update to GameContext
This way the GameWorld does not deal with CPlayer.
2023-09-15 18:04:29 +03:00
Alexander Akulich a244e2ced9 prediction/gameworld.h: Drop unneeded friendship with CCharacter 2023-09-15 18:04:29 +03:00
Alexander Akulich a1b7e0c37c Move alloc.h to game/ and use it in client/prediction/entity.h 2023-09-15 18:04:29 +03:00
Alexander Akulich 7dab9e430d CCharacterCore: Break the friendship with CCharacter 2023-09-15 18:04:29 +03:00
Alexander Akulich 4c55e83d91 Character (cli and srv): Access WorldCore via GameWorld() 2023-09-15 18:04:29 +03:00
Alexander Akulich 9eb4cf7508 CCoreCharacter: Add and use HookedPlayer() 2023-09-15 18:04:23 +03:00
furo 321622b66b Prevent editor shortcuts when a dialog is open 2023-09-15 11:15:22 +02:00
Robert Müller 0ea4d6540a Overhaul demo player skipping UI and UX
Make the skipping duration adjustable with a dropdown menu. The dropdown menu includes the durations 1s, 5s, 10s, 30s, 1m, 5m and 10m. The default duration is 5s. Skipping durations longer than the current demo are not shown. The dropdown menu is only shown if two or more durations would be shown.

Add buttons for skipping the duration, which was previously only possible with the hotkeys.

Add Ctrl+Left/Right hotkeys for skipping to chapters.

Add Shift+Left/Right hotkeys for adjusting the skipping time.

The Left/Right arrow keys and the J/L keys work identically for all hotkeys now.

Ignore ctrl, shift and alt keys for demo speed changes with the mouse wheel, to better support actions like zooming being bound to alt+mousewheel etc.

Also handle keypad enter key for play/pause like the normal return key.

Use arrow up/down icon for speed adjustment buttons, so that the "backward/forward" icons can be used for duration skipping instead.

Closes #7064.
2023-09-13 21:03:04 +02:00
Robert Müller dcd86cb873 Use golden angle to generate unique, distinct DDTeam colors
The DDTeam colors were previously generated in HSL by taking the team index and multiplying it by 360/64° to calculate the hue, which results in team colors being evenly distributed over the entire color range like a rainbow. However, this causes colors of adjacent teams to be very similar and therefore hard to distinguish.

Now, the hue is calculated by multiplying the team index with the golden angle (~137.50776°) and taking the modulo 360° of that. Due to the properties of the golden angle, this can generate never repeating sequences of unique colors where the adjacent colors are very distinct.

Duplicate code is reduced by adding the `CGameClient::GetDDTeamColor` function.
2023-09-13 18:56:47 +02:00
heinrich5991 1bc250ba08
Merge pull request #7147 from infclass/for-ddnet
Server: Split the huge CGameContext::OnMessage()
2023-09-11 22:32:44 +00:00
Robert Müller 4ca86f1b05
Merge pull request #7166 from Jupeyy/pr_fix_skin_invalid
Make skin refind cleanup bit more aggressive
2023-09-11 15:22:48 +00:00
Dennis Felsing 2bac51fd33
Merge pull request #7164 from Robyt3/UI-Dropdown-Icon-Alignment
Improve dropdown menu button label alignment
2023-09-11 05:42:19 +00:00
Dennis Felsing 6ab04afd66
Merge pull request #7159 from Robyt3/CLineInput-Desync-Fix
Fix desynced lineinput cursor/selection on external buffer change
2023-09-11 05:38:04 +00:00
Jupeyy 47addc4175 Make skin refind bit more aggressive 2023-09-10 20:14:19 +02:00
Robert Müller 4fb44fc0e8 Improve dropdown menu button label alignment
Reduce the space reserved for the label by the space for the dropdown icon instead of rendering the label behind the icon.

This is more noticeable with smaller dropdown menu buttons, which will be used in the future.
2023-09-10 13:42:38 +02:00
Jupeyy 62c0d34129
Merge pull request #7163 from Robyt3/Editor-Vector-X
Render editor brush selection size with `⨯` instead of `,`
2023-09-10 10:22:17 +00:00
Robert Müller e19a96d0e5 Render editor brush selection size with instead of ,
For example, `20⨯10` instead of `20,10`.

This is the "vector" symbol, which makes the most sense in this context.
2023-09-10 11:59:27 +02:00
Robert Müller 36867df722
Merge pull request #7162 from Jupeyy/pr_fix_clipping_chat
Disable scissor for clearing the framebuffer
2023-09-10 08:44:27 +00:00
Robert Müller e8f17aade1
Merge pull request #7134 from infclass/for-ddnet3
Mod Support: Add NINJA_SKIN_FOR_FROZEN game info flag
2023-09-10 08:32:43 +00:00
Jupeyy ca2926335b Disable scissor for clearing the framebuffer 2023-09-10 09:44:32 +02:00
heinrich5991 96d7a9d0d9
Merge pull request #7158 from Robyt3/Friendlist-Conchain-Fix
Fix friendlist update conchain not working with optional argument
2023-09-09 12:03:30 +00:00
Alexander Akulich 41c83da699 CGameContext::OnMessage: Replace if-else with switch() 2023-09-09 14:49:52 +03:00
Alexander Akulich e6c7d0c96d GameContext: Extract all other messages 2023-09-09 14:49:10 +03:00
Alexander Akulich 3be79f568a GameContext: Extract OnStartInfoNetMessage() 2023-09-09 14:45:15 +03:00
Alexander Akulich 763541af5a GameContext: Extract OnEmoticonNetMessage() 2023-09-09 14:45:15 +03:00
Alexander Akulich 0a2cc3d84c GameContext: Extract OnChangeInfoNetMessage() 2023-09-09 14:45:15 +03:00
Alexander Akulich 9f668e20db GameContext::OnMessage: Move the check for World.Paused into OnSetTeam
1. Regardless of the pause the message is CL_SETTEAM and there is no
   reason to match it against other messages.
2. Another implementation can save the wanted team and apply it later.
2023-09-09 14:45:11 +03:00
Alexander Akulich ce5371b038 GameContext: Extract OnSetTeamNetMessage() 2023-09-09 14:45:04 +03:00
Alexander Akulich a1ec904596 GameContext: Extract OnSayNetMessage() 2023-09-09 14:45:02 +03:00
Robert Müller 84e3c081b4 Fix friendlist update conchain not working with optional argument
The clan argument is optional when using `add_friend` and `remove_friend`.
2023-09-09 13:31:27 +02:00
Robert Müller 21f7af59a0 Fix desynced lineinput cursor/selection on external buffer change
When the buffer of a lineinput is modified externally, the cursor offset and selection are not updated, which causes them to be rendered wrong and also causes the assertion error "Selection and cursor offset got desynchronized" when changing the selection of a lineinput.
2023-09-09 13:25:47 +02:00
Alexander Akulich 1074a5ff56 CMake: Use DDNet_VERSION to construct DDNET_VERSION_NUMBER 2023-09-08 23:13:00 +03:00