Commit graph

9151 commits

Author SHA1 Message Date
Robert Müller 9be72db36a Remove unnecessary margin on left side of server filter
To improve layout. The "Filter connecting players" checkbox can now use the original font size without being resized.
2023-05-22 20:31:02 +02:00
Robert Müller 0d0f9ed232 Remove dead code 2023-05-22 20:31:02 +02:00
Robert Müller 59fafdbf4e Only activate server browser list box when no popup is open
To support popup menus over the server browser.
2023-05-22 20:30:06 +02:00
Robert Müller e175c0a79f Remove duplicate enter hotkey used for connecting to server
The list box already takes care of the enter hotkey for connecting. Furthermore, the list box can be inactive, whereas the now removed hotkey was always active.

Minor refactoring of `DoButtonMenu` usage.
2023-05-22 20:09:33 +02:00
Robert Müller 808d604579 Propagate list box active state to underlying scroll region
Fix inactive list box still consuming mouse scroll events.
2023-05-22 20:09:32 +02:00
bors[bot] b2eacf7f09
Merge #6648
6648: Fix filling switch layer not setting switch number 0, clear unused switch/tele properties when filling selection r=def- a=Robyt3

Closes #5464.

## 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-05-22 17:25:35 +00:00
Robert Müller 6ca74ec39e Clear unused switch/tele properties when filling selection
Set switch number/delay/flags to 0 when unused for a specific tile.

Set tele number to 255 when unused for a specific tile.
2023-05-22 17:46:50 +02:00
Robert Müller d5e4597012 Fix filling switch layer not setting switch number 0
Closes #5464.
2023-05-22 17:46:50 +02:00
Robert Müller a068034e61 Extract duplicate expressions into variables 2023-05-22 17:46:50 +02:00
Edgar a4abc1fdd9
factor out scorekind backwards compat gametype check 2023-05-22 17:22:52 +02:00
Edgar 1d30462e50
clean time score handling, with positive time values 2023-05-22 16:36:46 +02:00
Edgar 8a3d8fc53f
fix time score info on server detail 2023-05-22 13:53:23 +02:00
Robert Müller 1b6be5e10b Use different color for offline clanmates in friends list
Closes #6643.
2023-05-21 22:06:56 +02:00
Robert Müller 68d2d466d5 Fix use of invalid text container index for finish message HUD 2023-05-20 19:20:48 +02:00
bors[bot] 4ab55bd722
Merge #6626 #6629
6626: Remove popup for unofficial servers r=Robyt3 a=def-

Via https://github.com/ddnet/ddnet/pull/6618/files#r1199072246

Thoughts?

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


6629: Remove unused `CMenus::DoToolTip` declaration r=def- a=Robyt3



## 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>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2023-05-19 18:55:32 +00:00
Dennis Felsing 3593cce9b4 Revert "Add popup to confirm connecting to friend on non-official server"
This reverts commit 2e46460302.
2023-05-19 20:31:59 +02:00
Robert Müller 3d9d18c511 Remove unused CMenus::DoToolTip declaration 2023-05-19 19:40:46 +02:00
Robert Müller 56d1c8e560 Slightly increase font size of friend name 2023-05-19 19:22:11 +02:00
Dennis Felsing cca040274f Remove popup for unofficial servers
Via https://github.com/ddnet/ddnet/pull/6618/files#r1199072246

Thoughts?
2023-05-19 17:09:01 +02:00
bors[bot] d4582fb08e
Merge #6618
6618: Render tees for online friends in friends list, change friend info text to `Map | Mode | Country/Ping`, show official server icon, show confirmation popup r=edg-l a=Robyt3

Closes #6614.

![friends](https://github.com/ddnet/ddnet/assets/23437060/946cd095-a1f3-420c-b158-2e66687e7806)

Show race disconnect confirmation when joining friend. Closes #6622.

Add popup to confirm connecting to friend on non-official server:

![popup](https://github.com/ddnet/ddnet/assets/23437060/cb702277-93a5-4d90-9369-0f3dbff7cca3)


## 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-05-19 14:03:37 +00:00
Robert Müller 2e46460302 Add popup to confirm connecting to friend on non-official server 2023-05-19 15:51:05 +02:00
Robert Müller 1bea7a2cd5 Show race disconnect confirmation when joining friend
Closes #6622.
2023-05-19 15:16:32 +02:00
Robert Müller fc3583a18e Show official server icon in friends list
Show the official server icon for online friends who are currently on official servers.
2023-05-19 15:15:44 +02:00
Robert Müller 637f7fd736 Reduce duplicate UI spacing code 2023-05-19 15:14:46 +02:00
bors[bot] dcb67cb17a
Merge #6617
6617: Add /unsolo and /undeep practice commands r=def- a=hus3h

Related: https://github.com/ddnet/ddnet/issues/6318#issuecomment-1498626132 and #2391

Unsolo is often needed especially in maps with death tiles and solo part spawns, undeep can also be useful for some parts.

Some notes:

- didn't use `CFGFLAG_SERVER` for the commands as it resulted in a conflict with the registered `unsolo` and `undeep` super team console commands, not entirely sure if that's okay
- `/help unsolo` and `/help undeep` will print the help text of the super team commands, not the new chat commands. The texts are currently the same, but it's still a sign of possible conflicts
- prevented `/unsolo` on solo servers by checking for `SV_TEAM_FORBIDDEN` and `SV_TEAM_FORCED_SOLO`, let me know if that's not enough (Tutorial map?)
- no server message is sent on `/unsolo` (as opposed to going through unsolo tiles), didn't seem like it's needed here even if it feels different at first

 If the conflicts are problematic enough, the easiest fix might be using new unique commands instead of `unsolo` and `undeep`, I couldn't think of something that would fit as well though.

## Checklist

- [x] Tested the change ingame
- [ ] 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
- [ ] 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: hus3h <39054982+hus3h@users.noreply.github.com>
2023-05-19 12:25:53 +00:00
Robert Müller b33ce0f37d Change friend info text to Map | Mode | Country/Ping 2023-05-18 23:06:29 +02:00
Robert Müller a2cbc7fb24 Render tees for online friends in friends list
Closes #6614.
2023-05-18 22:03:43 +02:00
bors[bot] 7790937fa8
Merge #6616
6616: fix timescore r=Robyt3 a=edg-l

Fixes the time displayed, this time i tested it quite thoroughly, i could reproduce the wrong ordering in scoreboard and the time not updating before, and fixed it now.

The previous way also had a issue with times that ended up with a value of -1, which is fixed now too

## 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
- [ ] 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: Edgar Luque <git@edgarluque.com>
2023-05-18 19:36:06 +00:00
hus3h 939f2f7d50 Add /unsolo and /undeep practice commands 2023-05-18 22:08:58 +03:00
Edgar 654ee03b67
fix timescore 2023-05-18 20:49:22 +02:00
Robert Müller 15f839960a Port friends list UI from 0.7
Separate friends list into three groups, which can be expanded and collapsed: online players, online clanmates and offline friends.

Friends with the same name/clan are no longer grouped together. Instead, each individual player that is online and has name/clan matching a friend is shown in either the online players or online clanmates group. Friends for which no matching players are found are shown in the offline group.

Friends in the friend list can no longer be selected. Instead, left-clicking a friend selects the server that the friend is on. Double-clicking a friend joins the server that they are playing on.

Render small X button in top-right corner of every friend list entry to remove the respective friend instead of using one button that removes the selected friend.

Change "Add Friend" button to "Add Clan" when only clan is entered.

Remove excess empty space from layout.

Closes #6326.
2023-05-18 16:46:26 +02:00
bors[bot] 373595dec8
Merge #6608
6608: Support rendering tooltips with multiple lines of text, support overlapping tooltip activation rects, add alpha fade-in for tooltips  r=edg-l 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-05-18 11:24:25 +00:00
Robert Müller 47fca7683d Add alpha fade-in for tooltips
After 0.75 seconds of hovering the tooltip rect without rendering the tooltip, start fading in the tooltip for the remaining 0.25 seconds.
2023-05-18 13:22:52 +02:00
bors[bot] ac820ce62d
Merge #6607
6607: Minor refactoring of `CMenus::RenderLoading` r=Learath2 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-05-18 10:52:23 +00:00
Robert Müller 13ed0e386a Use const when possible 2023-05-18 12:21:34 +02:00
Robert Müller fe359e2909 Combine Margin function calls
Both calls put a margin around the same rect but the intermediate result is never used, so both margins can be combined.

The variable `Screen` is also not necessary.
2023-05-18 12:20:53 +02:00
Robert Müller f60dd0d3c2 Fix name of static variable s_LastLoadRender 2023-05-18 12:19:10 +02:00
Robert Müller af67130dbd Use nullptr for unused UI rect splitting parameters 2023-05-18 12:18:22 +02:00
Robert Müller 05f2b19391 Remove unused SLabelProperties Props variable 2023-05-18 12:17:15 +02:00
Robert Müller 31304c4573 Support overlapping tooltip activation rects
When the activation rects for two tooltips overlap, this always causes the first tooltip to be rendered.

This is changed so the last active tooltip is rendered instead, to simplify the usage of the tooltip function.
2023-05-18 12:12:44 +02:00
Robert Müller ed09bba45a Support rendering tooltips with multiple lines of text
Render tooltip text correctly with multiple lines when the maximum tooltip width is limited.

Add missing padding when rendering multi-line tooltip.

Update doxygen documentation.
2023-05-18 12:12:26 +02:00
VoxelDoesCode 2222612412 Only run KillTeam() when team has more than 1 tee
Clang format #6606
2023-05-17 16:12:10 -04:00
bors[bot] 20032b5a24
Merge #6546
6546: move some editor buttons into menus r=Robyt3 a=Marmare314

The entities and unused buttons are now in a new "Settings" menu.
![menu_settings](https://user-images.githubusercontent.com/49279081/235301689-a1375024-9233-432b-9ab3-4545f982711f.png)

The border and goto buttons got moved to the "Tools" menu.
![tools_menu](https://user-images.githubusercontent.com/49279081/235301690-6883e6a7-0afe-4b2f-826c-3fb48694f7f4.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
- [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-05-17 15:59:42 +00:00
marmare314 76eac08783 fix padding of buttons in settings 2023-05-17 17:25:21 +02:00
marmare314 37791ada99 enable brush coloring -> brush coloring 2023-05-16 22:24:26 +02:00
Edgar 8c298413bd try to fix broken score 2023-05-16 16:42:08 +02:00
Robert Müller dd7cf38be5 Fix uninitialized field causing assertion error with MSVC
The modified time was uninitialized for the editor file browser entry corresponding to the downloadedmaps-link. The time is never rendered for links, but the uninitialized time value was still passed to `str_timestamp_ex`, which results in an assertion error due to an incorrect time value being used when compiling with MSVC.

This is fixed by properly initializing the field and also by only calling `str_timestamp_ex` when the time value will be rendered.

Closes #6579.
2023-05-15 22:07:37 +02:00
bors[bot] a38dea4454
Merge #6590
6590: Make text containers bit safer r=Robyt3 a=Jupeyy

From reading the code I couldn't understand how https://github.com/ddnet/ddnet/issues/5143#issuecomment-1546735484 could happen

either (checked = not the case):
 - [x] teini used an outdated client
 - [ ] i am blind
 - [ ] it was a name/clan -plate, scoreboard entry
 - [ ] it leaked somewhere in text.cpp or similar impl
 - [ ] it happened because of an outside write.

We don't really come further with this, so we should probably at least try it out?
`@Robyt3` your opinion? We can still always remove it again

## 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: Jupeyy <jupjopjap@gmail.com>
2023-05-14 19:16:16 +00:00
bors[bot] cca6d867cb
Merge #6588 #6589
6588: Add default argument to `CDataFileReader/IMap::GetItem` r=def- a=Robyt3

Add default value `nullptr` for `int *pType` and `int *pID` output parameters of `GetItem` functions.

Use `nullptr` instead of `0`.

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


6589: Fix heap-use-after-free when quitting/restarting r=def- a=Robyt3

Items and particles were also rendered in the client states quitting and restarting, which was causing accesses to the already freed map data.

Closes #6387 until further notice.

## 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-05-14 18:58:08 +00:00
Jupeyy 370d37b8fd Add shared ptr to track usage 2023-05-14 20:21:59 +02:00