Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better roadmap ui #963

Merged
merged 5 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Content.Client/Stylesheets/StyleNano.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public sealed class StyleNano : StyleBase
public const string StyleClassCrossButtonRed = "CrossButtonRed";
public const string StyleClassButtonColorRed = "ButtonColorRed";
public const string StyleClassButtonColorGreen = "ButtonColorGreen";
public const string StyleClassNoStyle = "NoStyle"; // Sunrise-Edit

public static readonly Color ChatBackgroundColor = Color.FromHex("#25252ADD");

Expand Down Expand Up @@ -1722,7 +1723,19 @@ public StyleNano(IResourceCache resCache) : base(resCache)
new[]
{
new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/un_pinned.png"))
})
}),
// Sunrise-Edit

Element<Button>().Class(StyleClassNoStyle)
.Prop(Button.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = Color.Transparent,
ContentMarginLeftOverride = 15,
ContentMarginRightOverride = 15,
ContentMarginTopOverride = 12,
ContentMarginBottomOverride = 12
}),
// Sunrise-Edit
}).ToList());
}
}
Expand Down
111 changes: 106 additions & 5 deletions Content.Client/_Sunrise/Roadmap/Roadmap.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,109 @@
<Control xmlns="https://spacestation14.io">
<ScrollContainer>
<Control xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client">
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat
BackgroundColor="#1b1a1f"
ContentMarginLeftOverride="10"
ContentMarginRightOverride="10"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical">
<RichTextLabel Name="Header" Access="Public" Margin="0 15 0 10" />
<BoxContainer Name="Versions" Access="Public" Orientation="Horizontal"/>
<RichTextLabel Name="Header"
Access="Public"
StyleClasses="LabelBigger"
Margin="0 15 0 10" />
<PanelContainer MinHeight="1">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#ffffff"/>
</PanelContainer.PanelOverride>
</PanelContainer>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
VerticalExpand="True"
Margin="0 10 0 10"
SeparationOverride="0">
<!-- 2024 Column -->
<BoxContainer Name="Column2024"
Access="Public"
Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True"
Margin="0 0 10 0">
<Label Text="2024"
StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"
HorizontalExpand="True"
FontColorOverride="#ffffff"
Margin="0 0 0 10"/>
<ScrollContainer VerticalExpand="True"
HScrollEnabled="False"
MinHeight="400">
<BoxContainer Name="Items2024"
Access="Public"
Orientation="Vertical"
Margin="0 0 10 0"/>
</ScrollContainer>
</BoxContainer>

<PanelContainer MinWidth="1" Margin="0 0 10 0" VerticalExpand="True">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat
BackgroundColor="#2a292f"/>
</PanelContainer.PanelOverride>
</PanelContainer>

<!-- 2025 Column -->
<BoxContainer Name="Column2025"
Access="Public"
Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True"
Margin="0 0 10 0">
<Label Text="2025"
StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"
HorizontalExpand="True"
FontColorOverride="#ffffff"
Margin="0 0 0 10"/>
<ScrollContainer VerticalExpand="True"
HScrollEnabled="False"
MinHeight="400">
<BoxContainer Name="Items2025"
Access="Public"
Orientation="Vertical"
Margin="0 0 10 0"/>
</ScrollContainer>
</BoxContainer>

<PanelContainer MinWidth="1" Margin="0 0 10 0" VerticalExpand="True">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat
BackgroundColor="#2a292f"/>
</PanelContainer.PanelOverride>
</PanelContainer>

<!-- 2026 Column -->
<BoxContainer Name="Column2026"
Access="Public"
Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True">
<Label Text="2026"
StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"
HorizontalExpand="True"
FontColorOverride="#ffffff"
Margin="0 0 0 10"/>
<ScrollContainer VerticalExpand="True"
HScrollEnabled="False"
MinHeight="400">
<BoxContainer Name="Items2026"
Access="Public"
Orientation="Vertical"/>
</ScrollContainer>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</ScrollContainer>
</PanelContainer>
</Control>
30 changes: 13 additions & 17 deletions Content.Client/_Sunrise/Roadmap/Roadmap.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,24 @@ private void PopulateRoadmap(RoadmapVersionsPrototype roadmapVersions)
{
var msg = new FormattedMessage();
var headerLocale = Loc.GetString("ui-roadmap-header");
msg.AddMarkupOrThrow($"[font size=24]{headerLocale} [bold]{roadmapVersions.Fork}[/bold][/font]");
msg.AddMarkupOrThrow($"[font size=24][bold]{headerLocale} {roadmapVersions.Fork}[/bold][/font]");
Header.SetMessage(msg);

foreach (var roadmapVersion in roadmapVersions.Versions)
{
var version = new BoxContainer()
{
Orientation = BoxContainer.LayoutOrientation.Vertical,
Margin = new Thickness(0, 0, 20, 0),
HorizontalExpand = true,
};
Items2024.RemoveAllChildren();
Items2025.RemoveAllChildren();
Items2026.RemoveAllChildren();

var versionHeader = new RoadmapVersionHeader()
foreach (var version in roadmapVersions.Versions)
{
var targetColumn = version.Key switch
{
Text = roadmapVersion.Value.Name,
"2024" => Items2024,
"2025" => Items2025,
"2026" => Items2026,
_ => Items2024
};

version.AddChild(versionHeader);

foreach (var goal in roadmapVersion.Value.Goals)
foreach (var goal in version.Value.Goals)
{
var roadmapItem = new RoadmapItem()
{
Expand All @@ -60,10 +58,8 @@ private void PopulateRoadmap(RoadmapVersionsPrototype roadmapVersions)
ItemState = goal.Value.State,
};

version.AddChild(roadmapItem);
targetColumn.AddChild(roadmapItem);
}

Versions.AddChild(version);
}
}
}
Expand Down
64 changes: 50 additions & 14 deletions Content.Client/_Sunrise/Roadmap/RoadmapItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,56 @@
xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:roadmap="clr-namespace:Content.Client._Sunrise.Roadmap"
Margin="0 0 0 10"
MaxWidth="275">
<BoxContainer Orientation="Horizontal" SeparationOverride="0">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<Button Name="HeaderButton" Access="Public" StyleClasses="OpenBoth" />
<BoxContainer Name="ContentsContainer" Access="Public" Orientation="Vertical" Visible="False">
<RichTextLabel Name="Contents" Access="Public" RectClipContent="True" />
<Label Name="StateText" Access="Public" HorizontalAlignment="Right" Align="Right" Margin="0 0 5 0" />
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Margin="0 0 0 5">
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat
BackgroundColor="#232228"
BorderColor="#2a292f"
BorderThickness="1"
ContentMarginLeftOverride="10"
ContentMarginRightOverride="10"
ContentMarginTopOverride="5"
ContentMarginBottomOverride="5"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Horizontal" SeparationOverride="0">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<Button Name="HeaderButton"
Access="Public"
MinHeight="35"
StyleClasses="NoStyle">
<BoxContainer Orientation="Horizontal">
<Label Name="HeaderLabel"
StyleClasses="LabelSubText"
HorizontalExpand="True"/>
<Label Name="StateText"
Access="Public"
StyleClasses="LabelSubText"
Margin="10 0 0 0"/>
</BoxContainer>
</Button>
<BoxContainer Name="ContentsContainer"
Access="Public"
Orientation="Vertical"
Visible="False"
Margin="0 5 0 0">
<RichTextLabel Name="Contents"
Access="Public"
RectClipContent="True"
StyleClasses="LabelSubText"
Margin="0 5"/>
</BoxContainer>
</BoxContainer>
<PanelContainer Name="StateColor"
Access="Public"
VerticalExpand="True"
MinWidth="3"
MaxWidth="3">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat />
</PanelContainer.PanelOverride>
</PanelContainer>
</BoxContainer>
<PanelContainer Name="StateColor" Access="Public" VerticalExpand="True" MinWidth="5" MaxWidth="5">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat />
</PanelContainer.PanelOverride>
</PanelContainer>
</BoxContainer>
</PanelContainer>
</roadmap:RoadmapItem>
12 changes: 6 additions & 6 deletions Content.Client/_Sunrise/Roadmap/RoadmapItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public RoadmapItemState ItemState
var panel = (StyleBoxFlat) StateColor.PanelOverride!;
panel.BackgroundColor = _itemState switch
{
RoadmapItemState.Planned => Color.Red,
RoadmapItemState.InProgress => Color.FromHex("#20C9FF"),
RoadmapItemState.Partial => Color.Yellow,
RoadmapItemState.Complete => Color.Green,
RoadmapItemState.Planned => Color.FromHex("#e74c3c"),
RoadmapItemState.InProgress => Color.FromHex("#3498db"),
RoadmapItemState.Partial => Color.FromHex("#f1c40f"),
RoadmapItemState.Complete => Color.FromHex("#2ecc71"),
_ => Color.Transparent
};

Expand All @@ -42,8 +42,8 @@ public RoadmapItemState ItemState

public string? HeaderText
{
get => HeaderButton.Text;
set => HeaderButton.Text = value;
get => HeaderLabel.Text;
set => HeaderLabel.Text = value;
}

public string? Text
Expand Down
9 changes: 6 additions & 3 deletions Content.Client/_Sunrise/Roadmap/RoadmapVersionHeader.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
Orientation="Horizontal"
Margin="0 0 0 15">
<cc:HSeparator Color="#4972A1" HorizontalExpand="True" MaxHeight="2" />
<Label Name="Version" Access="Public" Margin="5 0" />
<cc:HSeparator Color="#4972A1" HorizontalExpand="True" MaxHeight="2" />
<Label Name="Version"
Access="Public"
StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"
HorizontalExpand="True"
Margin="0 10" />
</controls:RoadmapVersionHeader>
25 changes: 21 additions & 4 deletions Content.Client/_Sunrise/Roadmap/RoadmapWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
<roadmap:RoadmapWindow
xmlns="https://spacestation14.io"
xmlns:roadmap="clr-namespace:Content.Client._Sunrise.Roadmap"
MinSize="900 800"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
MinSize="1200 800"
MaxSize="1200 800"
SetSize="1200 800"
Resizable="False"
Title="{Loc ui-roadmap}">
<ScrollContainer VerticalExpand="True" HScrollEnabled="False" HorizontalExpand="True" MinWidth="300">
<roadmap:Roadmap Name="RoadmapBody" Access="Public" />
</ScrollContainer>
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat
BackgroundColor="#1a1a1f"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical">
<ScrollContainer VerticalExpand="True"
HScrollEnabled="False"
HorizontalExpand="True"
MinWidth="300"
Margin="10">
<roadmap:Roadmap Name="RoadmapBody" Access="Public" />
</ScrollContainer>
</BoxContainer>
</PanelContainer>
</roadmap:RoadmapWindow>
3 changes: 3 additions & 0 deletions Content.Shared/_Sunrise/Roadmap/RoadmapVersionsPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public sealed partial class RoadmapGroup
[DataField]
public string Name { get; set; } = string.Empty;

[DataField]
public int Year { get; set; } = 2024;

[DataField]
public Dictionary<string, RoadmapGoal> Goals = new();
}
Expand Down
Loading