-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
9 changed files
with
136 additions
and
40 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<BoxContainer xmlns="https://spacestation14.io" | ||
Orientation="Vertical" | ||
Margin="8 0 8 0"> | ||
<BoxContainer Name="Buttons" | ||
Orientation="Vertical" | ||
SeparationOverride="5"> | ||
<!-- Buttons are added here by code --> | ||
</BoxContainer> | ||
</BoxContainer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<BoxContainer xmlns="https://spacestation14.io" | ||
Orientation="Horizontal"> | ||
Orientation="Horizontal" | ||
HorizontalAlignment="Stretch"> | ||
<Button Name="RequestButton" | ||
Access="Public" | ||
Text="{Loc 'ghost-roles-window-request-role-button'}" | ||
StyleClasses="OpenRight" | ||
HorizontalAlignment="Left" | ||
SetWidth="300"/> | ||
HorizontalExpand="True" | ||
SizeFlagsStretchRatio="3"/> | ||
<Button Name="FollowButton" | ||
Access="Public" | ||
Text="{Loc 'ghost-roles-window-follow-role-button'}" | ||
StyleClasses="OpenLeft" | ||
HorizontalAlignment="Right" | ||
SetWidth="150"/> | ||
HorizontalExpand="True"/> | ||
</BoxContainer> |
8 changes: 8 additions & 0 deletions
8
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<BoxContainer xmlns="https://spacestation14.io" | ||
Orientation="Vertical"> | ||
<Label Name="Title" | ||
StyleClasses="LabelKeyText"/> | ||
<PanelContainer StyleClasses="HighDivider" /> | ||
<RichTextLabel Name="Description" | ||
Margin="0 4"/> | ||
</BoxContainer> |
18 changes: 18 additions & 0 deletions
18
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class GhostRoleInfoBox : BoxContainer | ||
{ | ||
public GhostRoleInfoBox(string name, string description) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
Title.Text = name; | ||
Description.SetMessage(description); | ||
} | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters