From accf8adf972ec28da489c4dfc5cfa89453d88f03 Mon Sep 17 00:00:00 2001
From: AJCM-git <60196617+AJCM-git@users.noreply.github.com>
Date: Fri, 7 Jun 2024 07:28:55 -0400
Subject: [PATCH 1/2] Fixed the guidebook listing every single rule (#28680)
* Well i tried this way
* New approach (start)
* Did it
* makes spacelaw available, put it under sec
---
.../Guidebook/Controls/GuidebookWindow.xaml | 8 ++-
.../Controls/GuidebookWindow.xaml.cs | 11 ++++
.../Guidebook/GuidebookUIController.cs | 3 ++
Content.Shared/Guidebook/GuideEntry.cs | 2 +
Resources/Prototypes/Guidebook/rules.yml | 51 ++++++++++++++++++-
Resources/Prototypes/Guidebook/security.yml | 1 +
Resources/Prototypes/Guidebook/ss14.yml | 3 --
7 files changed, 73 insertions(+), 6 deletions(-)
diff --git a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml
index cc6cc6e82b0..b52eacfa722 100644
--- a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml
+++ b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml
@@ -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'}">
@@ -21,9 +21,13 @@
Margin="0 5 10 5">
+
+
+
-
+
+
diff --git a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs
index 3a67dca89da..f5ee1200cc6 100644
--- a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs
+++ b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs
@@ -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;
@@ -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();
}
@@ -153,6 +160,10 @@ private void RepopulateTree(List>? roots = null, Pr
return null;
}
+ var rulesProto = UserInterfaceManager.GetUIController().GetCoreRuleEntry();
+ if (entry.RuleEntry && entry.Id != rulesProto.Id)
+ return null;
+
var item = Tree.AddItem(parent);
item.Metadata = entry;
var name = Loc.GetString(entry.Name);
diff --git a/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs b/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs
index e30a6b3a215..61195f3a9a7 100644
--- a/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs
+++ b/Content.Client/UserInterface/Systems/Guidebook/GuidebookUIController.cs
@@ -124,6 +124,9 @@ private void OnWindowClosed()
{
if (GuidebookButton != null)
GuidebookButton.Pressed = false;
+
+ if (_guideWindow != null)
+ _guideWindow.ReturnContainer.Visible = false;
}
private void OnWindowOpen()
diff --git a/Content.Shared/Guidebook/GuideEntry.cs b/Content.Shared/Guidebook/GuideEntry.cs
index 0e0e166cd55..c6079aab08b 100644
--- a/Content.Shared/Guidebook/GuideEntry.cs
+++ b/Content.Shared/Guidebook/GuideEntry.cs
@@ -39,6 +39,8 @@ public class GuideEntry
///
[DataField] public bool FilterEnabled = default!;
+ [DataField] public bool RuleEntry;
+
///
/// 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 .
diff --git a/Resources/Prototypes/Guidebook/rules.yml b/Resources/Prototypes/Guidebook/rules.yml
index 4aad4494855..72dd4764955 100644
--- a/Resources/Prototypes/Guidebook/rules.yml
+++ b/Resources/Prototypes/Guidebook/rules.yml
@@ -1,35 +1,41 @@
- type: guideEntry # Default for forks and stuff. Should not be listed anywhere if the server is using a custom ruleset.
id: DefaultRuleset
name: guide-entry-rules
+ ruleEntry: true
text: "/ServerInfo/Guidebook/ServerRules/DefaultRules.xml"
- type: guideEntry
id: CoreRuleset
name: guide-entry-rules-core-only
+ ruleEntry: true
priority: 0
text: "/ServerInfo/Guidebook/ServerRules/WizDenCoreOnlyRules.xml"
- type: guideEntry
id: StandardRuleset
name: guide-entry-rules-lrp
+ ruleEntry: true
priority: 5
text: "/ServerInfo/Guidebook/ServerRules/WizDenLRPRules.xml"
- type: guideEntry
id: MRPRuleset
name: guide-entry-rules-mrp
+ ruleEntry: true
priority: 10
text: "/ServerInfo/Guidebook/ServerRules/WizDenMRPRules.xml"
- type: guideEntry
id: RoleTypes
name: guide-entry-rules-role-types
+ ruleEntry: true
priority: 20
text: "/ServerInfo/Guidebook/ServerRules/RoleTypes.xml"
- type: guideEntry
id: CoreRules
name: guide-entry-rules-core
+ ruleEntry: true
priority: 30
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC0.xml"
children:
@@ -51,90 +57,105 @@
- type: guideEntry
id: RuleC1
name: guide-entry-rules-c1
+ ruleEntry: true
priority: 1
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC1Admins.xml"
- type: guideEntry
id: RuleC2
name: guide-entry-rules-c2
+ ruleEntry: true
priority: 2
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC2DBAD.xml"
- type: guideEntry
id: RuleC3
name: guide-entry-rules-c3
+ ruleEntry: true
priority: 3
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC3NoHate.xml"
- type: guideEntry
id: RuleC4
name: guide-entry-rules-c4
+ ruleEntry: true
priority: 4
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC4NoERP.xml"
- type: guideEntry
id: RuleC5
name: guide-entry-rules-c5
+ ruleEntry: true
priority: 5
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC5Metacomms.xml"
- type: guideEntry
id: RuleC6
name: guide-entry-rules-c6
+ ruleEntry: true
priority: 6
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC6BanEvasion.xml"
- type: guideEntry
id: RuleC7
name: guide-entry-rules-c7
+ ruleEntry: true
priority: 7
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC7EnglishOnly.xml"
- type: guideEntry
id: RuleC8
name: guide-entry-rules-c8
+ ruleEntry: true
priority: 8
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC8Exploits.xml"
- type: guideEntry
id: RuleC9
name: guide-entry-rules-c9
+ ruleEntry: true
priority: 9
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC9Multikey.xml"
- type: guideEntry
id: RuleC10
name: guide-entry-rules-c10
+ ruleEntry: true
priority: 10
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC10AHelp.xml"
- type: guideEntry
id: RuleC11
name: guide-entry-rules-c11
+ ruleEntry: true
priority: 11
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC11AhelpThreats.xml"
- type: guideEntry
id: RuleC12
name: guide-entry-rules-c12
+ ruleEntry: true
priority: 12
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC12MinAge.xml"
- type: guideEntry
id: RuleC13
name: guide-entry-rules-c13
+ ruleEntry: true
priority: 13
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC13CharacterNames.xml"
- type: guideEntry
id: RuleC14
name: guide-entry-rules-c14
+ ruleEntry: true
priority: 14
text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC14ICinOOC.xml"
- type: guideEntry
id: RoleplayRules
name: guide-entry-rules-roleplay
+ ruleEntry: true
priority: 40
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR0.xml"
children:
@@ -157,96 +178,112 @@
- type: guideEntry
id: RuleR1
name: guide-entry-rules-r1
+ ruleEntry: true
priority: 1
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR1Silicons.xml"
- type: guideEntry
id: RuleR2
name: guide-entry-rules-r2
+ ruleEntry: true
priority: 2
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR2Familiars.xml"
- type: guideEntry
id: RuleR3
name: guide-entry-rules-r3
+ ruleEntry: true
priority: 3
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR3NormalRP.xml"
- type: guideEntry
id: RuleR4
name: guide-entry-rules-r4
+ ruleEntry: true
priority: 4
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR4Metashield.xml"
- type: guideEntry
id: RuleR5
name: guide-entry-rules-r5
+ ruleEntry: true
priority: 5
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR5Arrivals.xml"
- type: guideEntry
id: RuleR6
name: guide-entry-rules-r6
+ ruleEntry: true
priority: 6
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR6SelfAntag.xml"
- type: guideEntry
id: RuleR7
name: guide-entry-rules-r7
+ ruleEntry: true
priority: 7
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR7RoundStalling.xml"
- type: guideEntry
id: RuleR8
name: guide-entry-rules-r8
+ ruleEntry: true
priority: 8
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR8NoFriendlyAntag.xml"
- type: guideEntry
id: RuleR9
name: guide-entry-rules-r9
+ ruleEntry: true
priority: 9
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR9MassSabotage.xml"
- type: guideEntry
id: RuleR10
name: guide-entry-rules-r10
+ ruleEntry: true
priority: 10
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR10Subordination.xml"
- type: guideEntry
id: RuleR11
name: guide-entry-rules-r11
+ ruleEntry: true
priority: 11
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11Escalation.xml"
- type: guideEntry
id: RuleR12
name: guide-entry-rules-r12
+ ruleEntry: true
priority: 12
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR12RoleAbandonment.xml"
- type: guideEntry
id: RuleR13
name: guide-entry-rules-r13
+ ruleEntry: true
priority: 13
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR13PerformRole.xml"
- type: guideEntry
id: RuleR14
name: guide-entry-rules-r14
+ ruleEntry: true
priority: 14
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR14SecComStandard.xml"
- type: guideEntry
id: RuleR15
name: guide-entry-rules-r15
+ ruleEntry: true
priority: 15
text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR15SpaceLaw.xml"
- type: guideEntry
id: SiliconRules
name: guide-entry-rules-silicon
+ ruleEntry: true
priority: 50
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS0.xml"
children:
@@ -264,67 +301,77 @@
- type: guideEntry
id: RuleS1
name: guide-entry-rules-s1
+ ruleEntry: true
priority: 1
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS1Laws.xml"
- type: guideEntry
id: RuleS2
name: guide-entry-rules-s2
+ ruleEntry: true
priority: 2
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS2LawPriority.xml"
- type: guideEntry
id: RuleS3
name: guide-entry-rules-s3
+ ruleEntry: true
priority: 3
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS3LawRedefinition.xml"
- type: guideEntry
id: RuleS4
name: guide-entry-rules-s4
+ ruleEntry: true
priority: 4
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS4RequestChanges.xml"
- type: guideEntry
id: RuleS5
name: guide-entry-rules-s5
+ ruleEntry: true
priority: 5
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS5FreeSilicon.xml"
- type: guideEntry
id: RuleS6
name: guide-entry-rules-s6
+ ruleEntry: true
priority: 6
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS6UnreasonableOrders.xml"
- type: guideEntry
id: RuleS7
name: guide-entry-rules-s7
+ ruleEntry: true
priority: 7
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS7Consistency.xml"
- type: guideEntry
id: RuleS8
name: guide-entry-rules-s8
+ ruleEntry: true
priority: 8
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS8DefaultCrewDefinition.xml"
- type: guideEntry
id: RuleS9
name: guide-entry-rules-s9
+ ruleEntry: true
priority: 9
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS9DefaultHarmDefinition.xml"
- type: guideEntry
id: RuleS10
name: guide-entry-rules-s10
+ ruleEntry: true
priority: 10
text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS10OrderConflicts.xml"
- type: guideEntry
id: SpaceLaw
name: guide-entry-rules-space-law
- priority: 60
+ priority: 1
text: "/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml"
children:
- SpaceLawCrimeList
@@ -359,11 +406,13 @@
- type: guideEntry
id: BanTypes
name: guide-entry-rules-ban-types
+ ruleEntry: true
priority: 90
text: "/ServerInfo/Guidebook/ServerRules/BanTypes.xml"
- type: guideEntry
id: BanDurations
name: guide-entry-rules-ban-durations
+ ruleEntry: true
priority: 100
text: "/ServerInfo/Guidebook/ServerRules/BanDurations.xml"
diff --git a/Resources/Prototypes/Guidebook/security.yml b/Resources/Prototypes/Guidebook/security.yml
index f5e34708283..17edb030065 100644
--- a/Resources/Prototypes/Guidebook/security.yml
+++ b/Resources/Prototypes/Guidebook/security.yml
@@ -6,6 +6,7 @@
- Forensics
- Defusal
- CriminalRecords
+ - SpaceLaw
- type: guideEntry
id: Forensics
diff --git a/Resources/Prototypes/Guidebook/ss14.yml b/Resources/Prototypes/Guidebook/ss14.yml
index 5b1f1dd8f97..f0b72b90b43 100644
--- a/Resources/Prototypes/Guidebook/ss14.yml
+++ b/Resources/Prototypes/Guidebook/ss14.yml
@@ -3,7 +3,6 @@
name: guide-entry-ss14
text: "/ServerInfo/Guidebook/SpaceStation14.xml"
children:
- - SpaceLaw
- Controls
- Jobs
- Survival
@@ -22,5 +21,3 @@
id: Glossary
name: guide-entry-glossary
text: "/ServerInfo/Guidebook/Glossary.xml"
-
-
From 24055021776c814bd14d3abac5256aaa6fbd66cc Mon Sep 17 00:00:00 2001
From: PJBot
Date: Fri, 7 Jun 2024 11:30:02 +0000
Subject: [PATCH 2/2] Automatic changelog update
---
Resources/Changelog/Changelog.yml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml
index 31999b221c2..3865ceee627 100644
--- a/Resources/Changelog/Changelog.yml
+++ b/Resources/Changelog/Changelog.yml
@@ -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
@@ -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