Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/wizards/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Jun 7, 2024
2 parents 14607c1 + 2405502 commit f5911d8
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 13 deletions.
8 changes: 6 additions & 2 deletions Content.Client/Guidebook/Controls/GuidebookWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:fancyTree="clr-namespace:Content.Client.UserInterface.Controls.FancyTree"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
SetSize="750 700"
SetSize="850 700"
MinSize="100 200"
Resizable="True"
Title="{Loc 'guidebook-window-title'}">
Expand All @@ -21,9 +21,13 @@
Margin="0 5 10 5">
</LineEdit>
</BoxContainer>
<BoxContainer Access="Internal" Name="ReturnContainer" Orientation="Horizontal" HorizontalAlignment="Right" Visible="False">
<Button Name="HomeButton" Text="{Loc 'ui-rules-button-home'}" Margin="0 0 10 0"/>
</BoxContainer>
<ScrollContainer Name="Scroll" HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True">
<Control>
<BoxContainer Orientation="Vertical" Name="EntryContainer" Margin="5 5 5 5" Visible="False"/>
<BoxContainer Orientation="Vertical" Name="EntryContainer" Margin="5 5 5 5" Visible="False">
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="Placeholder" Margin="5 5 5 5">
<Label HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Loc 'guidebook-placeholder-text'}"/>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Loc 'guidebook-placeholder-text-2'}"/>
Expand Down
11 changes: 11 additions & 0 deletions Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Client.UserInterface.ControlExtensions;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Controls.FancyTree;
using Content.Client.UserInterface.Systems.Info;
using Content.Shared.Guidebook;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand Down Expand Up @@ -36,7 +37,13 @@ public GuidebookWindow()
private void OnSelectionChanged(TreeItem? item)
{
if (item != null && item.Metadata is GuideEntry entry)
{
ShowGuide(entry);

var isRulesEntry = entry.RuleEntry;
ReturnContainer.Visible = isRulesEntry;
HomeButton.OnPressed += _ => ShowGuide(entry);
}
else
ClearSelectedGuide();
}
Expand Down Expand Up @@ -153,6 +160,10 @@ private void RepopulateTree(List<ProtoId<GuideEntryPrototype>>? roots = null, Pr
return null;
}

var rulesProto = UserInterfaceManager.GetUIController<InfoUIController>().GetCoreRuleEntry();
if (entry.RuleEntry && entry.Id != rulesProto.Id)
return null;

var item = Tree.AddItem(parent);
item.Metadata = entry;
var name = Loc.GetString(entry.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ private void OnWindowClosed()
{
if (GuidebookButton != null)
GuidebookButton.Pressed = false;

if (_guideWindow != null)
_guideWindow.ReturnContainer.Visible = false;
}

private void OnWindowOpen()
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/Guidebook/GuideEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class GuideEntry
/// </summary>
[DataField] public bool FilterEnabled = default!;

[DataField] public bool RuleEntry;

/// <summary>
/// Priority for sorting top-level guides when shown in a tree / table of contents.
/// If the guide is the child of some other guide, the order simply determined by the order of children in <see cref="Children"/>.
Expand Down
14 changes: 7 additions & 7 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
Entries:
- author: Vermidia
changes:
- message: Made the Artifact Reports page up to date with current Xenoarchaeology
type: Tweak
id: 6195
time: '2024-03-19T03:22:21.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26252
- author: keronshb
changes:
- message: Fixed a bug where stores were enabling refunds after a purchase
Expand Down Expand Up @@ -3848,3 +3841,10 @@
id: 6694
time: '2024-06-07T01:24:08.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/28679
- author: AJCM-git
changes:
- message: Guidebook no longer lists every single rule
type: Fix
id: 6695
time: '2024-06-07T11:28:55.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/28680
Loading

0 comments on commit f5911d8

Please sign in to comment.