]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Collapsible ghost roles menu (#32717)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Mon, 4 Nov 2024 00:49:42 +0000 (03:49 +0300)
committerGitHub <noreply@github.com>
Mon, 4 Nov 2024 00:49:42 +0000 (01:49 +0100)
commitcc3a19c212e96eda25236060c7809a66a69d7bdd
tree06123d3c55fb597e0860a8073213d0ab5cad5d1e
parenta0ef431255f122c360e4f1734e26e092ddce9705
Collapsible ghost roles menu (#32717)

* Make ghost roles collapsible

* Save `BodyVisible` state of each `Collapsible` box

* Make ghost role collapsible only when group has more than 1 role

* Make it a little prettier

* Make only ghost role buttons collapsible

* Apply requested changes

* Typo

* Small cleanup

* Store in list, instead of iterating

* Make unique ids more unique

* Move it out of the cycle

* Make _collapsibleBoxes into dictionary and use key instead of Collapsible boxes names

Added TODO. So after the problem will be fixed in `GhostRolesEui`, it should be mirrored and fixed here too.

* Put TODO in GhostRolesEui. I guess Issue must be made for this

* Use HashSet instead of Dictionary as suggested. Invert the HashSet, so being present means it uncollapsed

I decided to invert HashSet to _uncollapsedStates, because players surely will have more collapsed buttons than opened, so we optimise memory usage a little bit.

* Remove extra space from ghost roles window

* Add buttons stretching. Size 3:1
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml [new file with mode: 0644]
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs [moved from Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs with 86% similarity]
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml [new file with mode: 0644]
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml.cs [new file with mode: 0644]
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml [deleted file]
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEui.cs
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs
Resources/Locale/en-US/ghost/ghost-gui.ftl