Commit graph

12742 commits

Author SHA1 Message Date
Robert Müller 09462cff67 Use KEY_FIRST and KEY_UNKNOWN instead of 0 2023-04-21 18:47:44 +02:00
Robert Müller c959665226 Use nullptr instead of 0, 0x0 and NULL 2023-04-21 18:44:49 +02:00
Robert Müller adc813493a Remove unused FLAG_REPEAT 2023-04-21 18:44:49 +02:00
Robert Müller ecc49a699f Use size_t for number of input events 2023-04-21 18:44:49 +02:00
Robert Müller 2b7f054590 Use const reference to pass CEvent objects
The size of the `CEvent` class is 140 bytes, so it's more efficient to pass objects by reference.
2023-04-21 18:44:48 +02:00
Robert Müller 8b26fa0bc3 Assert instead of returning empty event on invalid index 2023-04-21 18:44:48 +02:00
bors[bot] cdd19beee4
Merge #6437
6437: Make team kills condensed in killfeed r=heinrich5991 a=VoxelDoesCode

For those who still have the killfeed on, I wanted to modernize it, by having team kills become one line instead of a bunch!

![image](https://user-images.githubusercontent.com/95713843/226060109-ed74c2f6-1289-4247-81dc-1725428ddf59.png)
## Checklist

- [x] Tested the change ingame
- [x] 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
- [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: VoxelDoesCode <dante_n_cedroni@hotmail.com>
2023-04-21 10:37:40 +00:00
VoxelDoesCode 049d89ca41 Simplify NetMsg even more, with help from Fokko
Quick changes

Add m_First

one more thing

fokko pointed this out at 3 am

Final push
2023-04-18 07:51:44 -04:00
bors[bot] 391c127cb3
Merge #6515
6515: Add OnNewSnapshot to component hooks r=heinrich5991 a=ChillerDragon

Waste some clock cycles on zero lines code removed :D
Downstream client maintainers will love it tho 

## 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
- [x] 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: ChillerDragon <ChillerDragon@gmail.com>
2023-04-18 11:33:14 +00:00
Robert Müller 928d278d0c Rename DefaultSelectionColor for consistency
The other methods also start with `Text`.
2023-04-15 16:58:33 +02:00
Robert Müller ea058d9d2e Replace CharacterCounter with existing pCursor->m_GlyphCount
The separate `CharacterCounter` variable is not necessary, as the same value is already tracked by `pCursor->m_GlyphCount`.
2023-04-15 16:58:05 +02:00
Robert Müller 680de35cab Add STextBoundingBox::MoveBy convenience function 2023-04-15 16:49:53 +02:00
Robert Müller 49a1896389 Add STextBoundingBox::Size convenience function 2023-04-15 16:49:53 +02:00
Robert Müller a160364b77 Add default parameters to Text and TextEx 2023-04-15 16:49:53 +02:00
Robert Müller f0c295b2d3 Add length check in AppendTextContainer
Allow `Length` parameter to be longer than maximum string length.
2023-04-15 16:49:53 +02:00
Robert Müller fe40048ca8 Remove unnecessary SetRenderFlags calls
Setting the render flags here is unnecessary, as the render flags are already set identically inside `TextEx`.
2023-04-15 16:49:27 +02:00
Robert Müller a2c9b752e0 Remove unused CListBox::FilterMatches 2023-04-15 13:07:40 +02:00
ChillerDragon 7c2c5aeee7 Add OnNewSnapshot to component hooks 2023-04-15 12:47:33 +02:00
Robert Müller c7cea0a37f Fix incorrect chat background rect width calculation
The calculation of `m_LongestLineWidth` was adjusted in bf1e757581 so it's really the width of the line and not the X position of the end of the line. This caused the background rects of chat messages to be rendered incorrectly.
2023-04-15 12:17:49 +02:00
bors[bot] b1f2862cff
Merge #6511
6511: Refactor vertical alignment of UI labels, add more text render convenience functions r=def- a=Robyt3

Should change layout only very little.

### Notes if you are porting this downstream

`SLabelProperties::m_AlignVertically` is removed. The usage was previously confusing and inconvenient, as the `SLabelProperties` parameter object was necessary to change the vertical alignment. If `m_AlignVertically == 1` (which is the default value) then the text is vertically centered and this works correctly also for multi-line text, assuming that the correct rect height is specified and the previous fixes have been applied (#6507). If `m_AlignVertically == 0` then the text is somehow more correctly aligned for some UI elements that span only one line in cases where the previous option doesn't work correctly. Other `m_AlignVertically` values besides `0` and `1` are not used.

With this PR most text is centered vertically by setting `TEXTALIGN_MIDDLE`. The UI code always uses shorthand constants for combinations of horizontal and vertical alignment, e.g. `TEXTALIGN_MC` for `TEXTALIGN_MIDDLE | TEXTALIGN_CENTER`. To port your own code, I'd recommend replacing all of your usages of `TEXTALIGN_LEFT`, `TEXTALIGN_CENTER` and `TEXTALIGN_RIGHT` with `TEXTALIGN_ML`, `TEXTALIGN_MC` and `TEXTALIGN_MR` respectively. Remove all usages of `m_AlignVertically` and also the `SLabelProperties` variables for which only `m_AlignVertically` was changed. This means all text will be vertically centered and have the same horizontal alignment as before. For some labels the vertical centering does not work correctly though, so you'll have to visually check if any of the texts are misaligned and then manually adjust the alignment or the UI rect position and/or size.

## 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>
2023-04-10 17:29:23 +00:00
bors[bot] 4d697c7be3
Merge #6509
6509: Fix client crash when spectating on server with missing game info 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>
2023-04-10 17:08:19 +00:00
Robert Müller 301567507f Fix client crash when spectating on server with missing game info 2023-04-10 17:27:21 +02:00
Robert Müller 8f5708a882 Use TextBoundingBox for tooltip rendering
Calculate correct height for tooltip and apply consistent padding.

Ensure tooltip width and height do not exceed size of screen.
2023-04-10 17:22:10 +02:00
Robert Müller a6f9fdd6d5 Add function to get caret position to ITextRender
Add `CaretPosition` function to get position of text caret. Replace some existing usages of `TextWidth`, which would no longer work correctly for multi-line text.

Having this function is also useful when porting the upstream UI lineinput.
2023-04-10 17:22:10 +02:00
Robert Müller 9ad2f9f4df Add functions to get text bounding box to ITextRender
Add separate `STextBoundingBox` to describe text bounding box (same as on upstream). Add `GetBoundingBoxTextContainer` to get bounding box for a text container. Add `TextBoundingBox` function to get bounding box with old text render interface.

Using this function to get the bounding box width and height is cleaner than using `TextWidth`. This function additionally can get the bounding box X and Y position for convenience.

Some usages of `TextWidth` are replaced with `TextBoundingBox` to improve readability.

It will be useful to have these functions when porting the upstream UI lineinput.
2023-04-10 17:22:10 +02:00
Robert Müller 8507a651d1 Refactor vertical alignment in UI
Add separate constants `TEXTALIGN_TOP`, `TEXTALIGN_MIDDLE` and `TEXTALIGN_BOTTOM` for vertical alignment.

Add shorthand constants for all possible combinations of horizontal and vertical alignment, e.g. `TEXTALIGN_MC` for `TEXTALIGN_MIDDLE | TEXTALIGN_CENTER`.

Replace usage of `SLabelProperties::m_AlignVertically` with these constants in all menu and editor code for more convenient and versatile alignment of text. Use combined horizontal-vertical alignment constants for all existing labels. Manually adjust layout for some elements which were initially misaligned with the new implementation.

Refactoring:

- Use `CORNER_NONE` instead of `0`.
- Improve some `CUIRect` variables names and usage.
2023-04-10 17:22:09 +02:00
Robert Müller 76ad9e2e3b Use Localizable instead of comment with Localize 2023-04-10 16:43:53 +02:00
Robert Müller bf1e757581 Fix incorrect text width calculation when cursor not starting at X=0
Previously when calculating `m_LongestLineWidth` for a `CTextCursor` the position `m_StartX` of the cursor was always zero, because `m_LongestLineWidth` was only used to calculate the text width with a non-rendered cursor aligned at (0, 0).

To ensure that the calculation is correct also when the text cursor is not positioned at X=0, the width calculation must be offset by the start position.
2023-04-10 16:06:17 +02:00
Robert Müller 430e96346f Fix inconsistent text wrapping of popup labels
Round up the calculated text width to prevent inconsistent text wrapping in the popups in cases where the current text width is very close to the maximum line width.
2023-04-09 20:10:44 +02:00
Robert Müller 6decf14137 Use Text instead of TextEx for popup labels
To reduce duplicate code and ensure that the same flags are used with `TextWidth` and when actually rendering the text.
2023-04-09 20:10:44 +02:00
Robert Müller 9bb9c7ce6b Replace usages of TextLineCount with TextWidth
Calculate text height for popups with `TextWidth` instead of using `TextLineCount`, which can be incorrect if the aligned font size differs from the normal one.
2023-04-09 20:10:44 +02:00
Robert Müller 9693d4beac Fix vertical centering of multi-line UI labels
Also calculate text height in `TextWidth`.

Use calculated text height to verically center UI labels.

The text cursor flags (in particular, the `TEXTFLAG_STOP_AT_END` flag) must also be passed to `TextWidth`. Otherwise, for example, when `TEXTFLAG_STOP_AT_END` is missing, the wrong text height is calculated, as text is rendered over multiple lines instead of stopping at the end of the first line.

Closes #5396.
2023-04-09 20:10:09 +02:00
Robert Müller 07c59d130b Minor refactoring of DoLabel functions 2023-04-09 20:10:09 +02:00
Robert Müller 0ca6d06fba Fix incorrect text width calculation of multi-line text
For text spanning multiple lines `TextWidth` only returned the length of the last line instead of the length of the longest line.
2023-04-09 20:10:09 +02:00
Robert Müller ad69d62015 Fix long words being printed over maximum line width
When the text render encounters long words which must be broken up, ensure that the words do not exceed the maximum line width.

Closes #6354.
2023-04-09 20:09:52 +02:00
Robert Müller ede3e5631f Move generic popup handling to UI (port from editor and upstream)
Support using editor popup rendering in game client.

Support unlimited number of popup menus instead of maximum of 8.

Fix non-active popups handling key events. Add `Active` parameter to popup function, so key events are only processed by the active (top-most) popup. Previously the "New folder" popup could be confirmed with enter while an error message is shown, which causes multiple error messages to stack.

Allow popups to close without closing their child popups. Previously a popup could not open another popup and close itself immediately afterwards, as this was causing the newly opened popup to be closed instead.

Support using return/enter keys to confirm binary choice popups and to close message popups for more convenient usage.
2023-04-07 17:16:16 +02:00
bors[bot] fdcb2668e8
Merge #6502
6502: Improve editor file browser button layout when screen width is low r=def- a=Robyt3

Move "Map details" button from editor file browser to file menu.

Decrease button spacing in editor file browser when screen width is low (4:3 and 5:4 resolutions).

Screenshots:
- File menu:
   - Before: 
![file-menu old](https://user-images.githubusercontent.com/23437060/230586902-079a042d-0223-4a97-b228-ec8a4fae43d1.png)
   - After:
![file-menu new](https://user-images.githubusercontent.com/23437060/230589757-ef18d6d8-f8f0-4a2b-bc35-219349d6a7e7.png)
- File browser (800x600):
   - Before:
![save 800x600 old](https://user-images.githubusercontent.com/23437060/230591373-11b3e0c8-ce3f-4e8e-9fd1-297f8276de28.png)
   - After:
![save 800x600 new](https://user-images.githubusercontent.com/23437060/230591387-162de3fc-95e9-41ea-94a8-9b7b46ac97cb.png)
- File browser (1280x1024):
   - Before:
![save 1280x1024 old](https://user-images.githubusercontent.com/23437060/230591411-5dddd9de-4773-4dc9-a77b-61d5d4de4dc6.png)
   - After:
![save 1280x1024 new](https://user-images.githubusercontent.com/23437060/230591422-1ee8c941-9eb2-4e13-9268-de591b5b72f5.png)
- File browser (1920x1080):
   - Before:
![save 1920x1080 old](https://user-images.githubusercontent.com/23437060/230591437-146e961a-3e55-463f-988e-0d7eef92b439.png)
   - After:
![save 1920x1080 new](https://user-images.githubusercontent.com/23437060/230591445-931718f4-81fb-4c87-a018-f377a5c473df.png)

## Checklist

- [X] Tested the change ingame
- [X] 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>
2023-04-07 11:12:40 +00:00
Robert Müller 5fb9f5db5b Decrease button spacing in editor file browser when screen width low
To prevent the buttons from overlapping in 4:3 and 5:4 resolutions.
2023-04-07 12:00:09 +02:00
Robert Müller b7e8168e4b Move "Map details" button from editor file browser to file menu
There is not enought space for the button in the file browser on 4:3 and 5:4 resolutions.

The button fits in the file menu, as it allows to adjust the map details which are specific to the current map file.
2023-04-07 12:00:09 +02:00
Robert Müller 72775f236b Let CUI::Screen return a const pointer
Callers should never modify the UI screen.
2023-04-07 11:50:48 +02:00
Robert Müller eaa4e19188 Fix image/sound readding broken by error messages
When an image/sound is readded, this reuses the `ReplaceImage/Sound` callback functions. The added error handling to prevent duplicate images/sounds was causing this to not work, as the image/sound being readded was already present. The implementation is separated from the callback functions and an additional parameter is added to toggle the duplicate name check.

Previously this was hard to notice, as the error message popup was not shown due to the top-most popup being closed immediately. This will be fixed separately by a larger refactoring, so a popup can close itself immediately after opening another popup without closing the child popup instead.

Closes #6500.
2023-04-07 10:58:57 +02:00
bors[bot] b4c114450c
Merge #6492
6492: Refactor editor popups, improve layout of new folder, map details and event popups r=def- a=Robyt3

- New folder popup:
   - Before: 
![new_folder old](https://user-images.githubusercontent.com/23437060/229349012-66aa4156-7f2c-4132-9cf3-da7451f93b09.png)
   - After:
![new_folder new](https://user-images.githubusercontent.com/23437060/229349015-d53a07f8-baa4-46f6-af7d-50d302e5d784.png)
- Map details popup:
   - Before: 
![map_details old](https://user-images.githubusercontent.com/23437060/229349023-0febb078-0948-4820-bda5-98a8e560ffb8.png)
   - After:
![map_details new](https://user-images.githubusercontent.com/23437060/229349027-8cdcc47d-e71b-43f2-9f7c-533993772afd.png)
- New map event popup:
   - Before: 
![new_map old](https://user-images.githubusercontent.com/23437060/229349034-dea63fb4-0f2c-4a93-8235-ab06224d0a89.png)
   - After:
![new_map new](https://user-images.githubusercontent.com/23437060/229349039-863451ba-8154-427f-a30b-7c7e542aa0b5.png)
- Load current map popup:
   - Before: 
![load_map_current old](https://user-images.githubusercontent.com/23437060/229349045-fe8eabed-2a64-46cf-b0d7-e71c2297e0ac.png)
   - After:
![load_map_current new](https://user-images.githubusercontent.com/23437060/229349051-1877c1ec-713e-41da-b52e-19ba004b467e.png)
- Large layer popup:
   - Before: 
![large_layer old](https://user-images.githubusercontent.com/23437060/229349053-93301856-5f96-4c42-b7e1-d79afeaa9281.png)
   - After:
![large_layer new](https://user-images.githubusercontent.com/23437060/229349369-5c42c3ae-619c-4ff8-9b78-515415703bf4.png)

## Checklist

- [X] Tested the change ingame
- [X] 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>
2023-04-06 21:47:11 +00:00
Valentin Bashkirov 85485d23ce highlight game type 2023-04-05 20:02:25 +02:00
Robert Müller aa08cfabc2 Fix swapping with dragger beams and plasmas
The client ID referenced by dragger beams and plasmas must also be swapped when two clients are swapped, as those entities should refer to the same character entity as before the swap.

For dragger beams, swapping previously caused the active beams to switch target to another character.

For plasmas, swapping previously caused already shot plasmas to not have an effect on their original target character.

Closes #5865.
2023-04-04 20:07:17 +02:00
Dennis Felsing 90861d9dda Get rid of unused warning 2023-04-04 09:08:38 +02:00
VoxelDoesCode df48c44e78 Bring every Font Icon unicode into a namespace
Fix namespace hopefully
2023-04-03 20:25:28 -04:00
VoxelDoesCode 0dfced4ca4 Bring Team logic into teams.cpp
MsgPlus -> Msg
2023-04-02 21:40:39 -04:00
Robert Müller 3c841f7ad8 Refactor CEditor::PopupEntities 2023-04-02 13:16:15 +02:00
Robert Müller 9391155360 Refactor CEditor::PopupColorPicker 2023-04-02 13:16:14 +02:00
Robert Müller 8bdf2cf7a9 Refactor CEditor::PopupGoto 2023-04-02 13:16:14 +02:00
Robert Müller d5a24d718b Refactor CEditor::PopupTune 2023-04-02 13:16:14 +02:00
Robert Müller c4b2531bb1 Refactor CEditor::PopupSwitch 2023-04-02 13:16:14 +02:00
Robert Müller b839c68350 Refactor CEditor::PopupSpeedup 2023-04-02 13:16:13 +02:00
Robert Müller 04c1e06e71 Refactor CEditor::PopupSelectConfigAutoMap 2023-04-02 13:16:13 +02:00
Robert Müller 03e7cfc9e4 Refactor CEditor::PopupSelectGametileOp 2023-04-02 13:16:13 +02:00
Robert Müller c730cd490a Refactor CEditor::PopupSelectSound 2023-04-02 13:16:12 +02:00
Robert Müller f3f44ca6b2 Refactor CEditor::PopupSelectImage 2023-04-02 13:16:12 +02:00
Robert Müller b20cf7865c Refactor CEditor::PopupEvent and improve layout
Swap buttons so confirm button is on the right and cancel button is on the left consistently.

Decrease empty space and popup size.

Add missing title for `POPEVENT_LOADCURRENT` (caught by the added assertion).

Improve messages by adding additional empty line for existing line breaks.
2023-04-02 13:16:12 +02:00
Robert Müller 91ce99b65b Refactor CEditor::PopupSound 2023-04-02 12:54:36 +02:00
Robert Müller 7289f7d504 Refactor CEditor::PopupImage 2023-04-02 12:54:36 +02:00
Robert Müller e09a771937 Refactor CEditor::PopupPoint 2023-04-02 12:54:36 +02:00
Robert Müller 04d9e2b54a Refactor CEditor::PopupMapInfo and improve layout
Swap buttons so confirm button is on the right and cancel button is on the left consistently.

Decrease empty space and popup size.
2023-04-02 12:54:36 +02:00
Robert Müller 141571cc55 Refactor CEditor::PopupNewFolder and improve layout
Swap buttons so confirm button is on the right and cancel button is on the left consistently.

Decrease empty space and popup size.
2023-04-02 12:54:35 +02:00
Robert Müller 5cfecdb42f Refactor CEditor::PopupSource 2023-04-02 12:54:35 +02:00
Robert Müller 2146d7bd92 Refactor CEditor::PopupQuad 2023-04-02 12:54:35 +02:00
Robert Müller 9f5de0c884 Refactor CEditor::PopupLayer 2023-04-02 12:54:35 +02:00
Robert Müller eda808e385 Refactor CEditor::PopupGroup 2023-04-02 12:54:35 +02:00
Robert Müller c1ffc8bf12 Refactor CEditor::PopupMenuFile 2023-04-02 12:54:34 +02:00
Robert Müller df91bb9b43 Refactor layer properties functions 2023-04-02 12:54:34 +02:00
Robert Müller c6d14e5fa1 Move all editor popup function definitions to popups.cpp
Editor code for the popups should be located in `popups.cpp`.
2023-04-02 12:52:37 +02:00
Robert Müller caac7b06e2 Fix static usage of POPEVENT_* enum literals
The `POPEVENT_*` enum literals should be used in a static manner.
2023-04-02 12:52:37 +02:00
Robert Müller 3d343c8758 Remove unnecessary popup debug message 2023-04-02 12:52:37 +02:00
Robert Müller f4c3fee617 Use ShowFileDialogError instead of ShowPopupMessage
To reduce duplicate code.
2023-04-02 12:52:37 +02:00
Dennis Felsing 1b1f2a0621 Version 16.9 2023-04-02 12:03:41 +02:00
bors[bot] 3bd24f322f
Merge #6490
6490: Improve collision entity access error message r=Chairn a=Robyt3

See #6489.

## 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>
2023-04-01 22:29:29 +00:00
Robert Müller ed26be0917 Improve collision entity access error message
See #6489.
2023-04-02 00:03:30 +02:00
Robert Müller ab73cc718f Refactor entity bounds check 2023-04-02 00:01:17 +02:00
ChillerDragon fd437e0f76 Apache RequestHeader needs the headers module 2023-04-01 16:35:09 +02:00
Dennis Felsing 5fa2fefd35 Remove unused DoFilter
Thanks to cheeser0613
2023-04-01 13:39:20 +02:00
bors[bot] 02086e4023
Merge #6268
6268: Quit when configured bindaddr cannot be resolved, quit client when failing to open network client for 25 times  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>
2023-03-31 15:44:26 +00:00
Jupeyy ffe3d26e59 fix start size of freezing flakes particles & vel of player death 2023-03-28 21:33:48 +02:00
bors[bot] a27dbb1219
Merge #6435
6435: add proof mode for menu backgrounds closes #3009 r=def- a=Marmare314


![backgroundproof](https://user-images.githubusercontent.com/49279081/225979288-3fb43d41-79f7-477e-8479-6b3d106fbd5b.gif)

## Checklist

- [x] Tested the change ingame
- [x] 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
- [x] 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: marmare314 <49279081+Marmare314@users.noreply.github.com>
2023-03-27 14:48:18 +00:00
marmare314 927c80167f update selected layer correctly after dragging 2023-03-27 09:13:39 +02:00
marmare314 93d204f0ca show duplicate positions in tooltip 2023-03-27 08:51:02 +02:00
VoxelDoesCode 5b1a716aa2 Simplify KillMsgTeams NetMsg, fixing bugs
Clang format before squash

Split apart OnMessage() before squash

forgot something
2023-03-26 23:32:34 -04:00
bors[bot] e3575b1ae8
Merge #6469
6469: Add new contributor r=Robyt3 a=def-

<!-- What is the motivation for the changes of this pull request? -->

<!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. -->

## Checklist

- [ ] 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: Dennis Felsing <dennis@felsin9.de>
2023-03-26 16:14:00 +00:00
bors[bot] b207826df1
Merge #6470
6470: Fix ninja not getting predicted r=heinrich5991 a=Zwelf

Fixes #6464

This was regressed by #6246 by the wrong transformation of `if(!m_FreezeTime)` to `if(m_FreezeTime != 0)` instead of the correct `if(m_FreezeTime == 0)`.

And take additional measure to never set m_FreezeTime to a negative number in client prediction code.

## 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: Zwelf <zwelf@strct.cc>
2023-03-26 14:50:25 +00:00
Zwelf d40ff12d9a Fix ninja dash not getting predicted correctly
Fixes #6464

This was regressed by #6246 by the wrong transformation of `if(!m_FreezeTime)`
to `if(m_FreezeTime != 0)` instead of the correct `if(m_FreezeTime == 0)`.

And take additional measure to never set m_FreezeTime to a negative
number in client prediction code.
2023-03-26 16:42:31 +02:00
Dennis Felsing 6b0656ff85 Add new contributor 2023-03-26 16:28:06 +02:00
bors[bot] a9674afb02
Merge #6451 #6466
6451: Fix `console_enable_colors` not being used, save `console_output_level` and `console_enable_colors` variables r=def- a=Robyt3

Closes #6447.

## 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)


6466: Fix rcon login when disconnecting dummy and when username used r=def- a=Robyt3

When connecting a dummy and then logging into rcon only the dummy is logged in. When disconnecting the dummy, the main client was not automatically logged in. When logging in with the main client and then connecting the dummy, the dummy was already authenticated automatically. Now the main client is also authenticated automatically when disconnecting an authenticated dummy.

This automatic authentication was also not working correctly if the login used a username, as only the password was stored. Now both username and password are stored to correctly authenticate the main or dummy client.

The stored username and password are completely cleared when disconnecting, so they are not stored in memory longer than necessary.

Closes #5586.

## 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>
2023-03-26 12:59:00 +00:00
bors[bot] 0cf6f15590
Merge #6461
6461: Check if HTTP request task is aborted in completion callback r=def- a=Robyt3

It's possible for the HTTP request task to be aborted after the curl request has finished, so the returned `State` will be `HTTP_DONE` but `m_Abort` is `true`. The `State` never changes to `HTTP_ABORTED`, because the progress callback is not called after the HTTP request has completed.

This causes the client to crash when a skin download is aborted after the HTTP request finished but before the completion callback is called.

This is fixed by checking if `m_Abort` is `true` and setting the `State` to `HTTP_ABORTED` at the beginning of the completion callback.

Closes #3567.

## 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>
2023-03-26 12:40:47 +00:00
Robert Müller 7bc17b2bd8 Fix rcon login when disconnecting dummy and when username used
When connecting a dummy and then logging into rcon only the dummy is logged in. When disconnecting the dummy, the main client was not automatically logged in. When logging in with the main client and then connecting the dummy, the dummy was already authenticated automatically. Now the main client is also authenticated automatically when disconnecting an authenticated dummy.

This automatic authentication was also not working correctly if the login used a username, as only the password was stored. Now both username and password are stored to correctly authenticate the main or dummy client.

The stored username and password are completely cleared when disconnecting, so they are not stored in memory longer than necessary.

Closes #5586.
2023-03-26 14:00:50 +02:00
Robert Müller 1b19895204 Ensure texture is cleared when rendering MOTD background
Seems like there are cases where the texture is not cleared when the MOTD background is rendered, so part of the font texture is used for the round rect.
2023-03-26 13:15:36 +02:00
bors[bot] 214053ec9a
Merge #6459
6459: Add random skin button r=def- a=HiRavie

Adds a button for generating a random skin in tee settings. The logic generates handsome tees more often than not.
Intentionally didn't add a console command so it's not possible to make annoying skin change binds with this.
![random_skin](https://user-images.githubusercontent.com/65019210/227658839-5e8f3a4b-4e7c-4561-90c9-21a267d61a3a.png)

## 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
- [x] 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: Ravie <65019210+HiRavie@users.noreply.github.com>
2023-03-25 23:08:15 +00:00
Robert Müller fda8507d03 Add "Delete" button to editor file browser
To delete files and empty folders from the user's save directory.

Only files and folders from the user's save directory can be deleted. Only empty folders can be deleted.

Error message popups are shown when the deletion fails.

Closes #6272.
2023-03-25 16:59:02 +01:00
Robert Müller 6f1533ee18 Group UI code of right and left editor file dialog buttons
Move UI code for "New folder" button close to the code the "Map details" button.
2023-03-25 16:58:51 +01:00
Robert Müller fd98ed0295 Add IStorage::RemoveFolder
Wrapper for `fs_removedir`.
2023-03-25 16:58:51 +01:00
bors[bot] f2df34847b
Merge #6460
6460: Replace usage of `fmodf` with `std::fmod` r=heinrich5991 a=Robyt3

Leftover from #6372.

## Checklist

- [ ] 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>
2023-03-25 15:24:59 +00:00
Ravie 20ac914e0e Tooltip ID 2023-03-25 16:13:29 +01:00
Ravie eb41ecf3d7 Icon button, tooltip and various fixes 2023-03-25 15:43:25 +01:00