]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixed Guidebook Sorting / Ordering (#34960)
authorGrownSamoyedDog <61863648+GrownSamoyedDog@users.noreply.github.com>
Sun, 23 Feb 2025 01:00:10 +0000 (18:00 -0700)
committerGitHub <noreply@github.com>
Sun, 23 Feb 2025 01:00:10 +0000 (02:00 +0100)
* fixed all yml and cs

* Subjective Rearranging

* fixed my accidentally removed xml endline

* Accidentally included for a different PR

* Added .ThenBy and cleaned up newplayer.yml

Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs
Resources/Prototypes/Guidebook/antagonist.yml
Resources/Prototypes/Guidebook/engineering.yml
Resources/Prototypes/Guidebook/newplayer.yml
Resources/Prototypes/Guidebook/references.yml
Resources/Prototypes/Guidebook/rules.yml
Resources/Prototypes/Guidebook/security.yml
Resources/Prototypes/Guidebook/shiftandcrew.yml
Resources/Prototypes/Guidebook/station.yml
Resources/ServerInfo/Guidebook/Antagonist/Antagonists.xml
Resources/ServerInfo/Guidebook/Jobs.xml

index de06d85bb04cabd40b8d246e189501369f82b5cb..5d2d227b3d022697920fee3c770195ff4b26056e 100644 (file)
@@ -133,24 +133,14 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler
             HashSet<ProtoId<GuideEntryPrototype>> entries = new(_entries.Keys);
             foreach (var entry in _entries.Values)
             {
-                if (entry.Children.Count > 0)
-                {
-                    var sortedChildren = entry.Children
-                        .Select(childId => _entries[childId])
-                        .OrderBy(childEntry => childEntry.Priority)
-                        .ThenBy(childEntry => Loc.GetString(childEntry.Name))
-                        .Select(childEntry => new ProtoId<GuideEntryPrototype>(childEntry.Id))
-                        .ToList();
-
-                    entry.Children = sortedChildren;
-                }
-
                 entries.ExceptWith(entry.Children);
             }
-
             rootEntries = entries.ToList();
         }
 
+        // Only roots need to be sorted.
+        // As defined in the SS14 Dev Wiki, children are already sorted based on their child field order within their parent's prototype definition.
+        // Roots are sorted by priority. If there is no defined priority for a root then it is by definition sorted undefined.
         return rootEntries
             .Select(rootEntryId => _entries[rootEntryId])
             .OrderBy(rootEntry => rootEntry.Priority)
index ea28a68bc336a6515288a3fa826d978545eb4903..3f42287c47977dfe4ae86a16e302dd721de57728 100644 (file)
@@ -4,12 +4,12 @@
   text: "/ServerInfo/Guidebook/Antagonist/Antagonists.xml"
   children:
   - Traitors
+  - Thieves
+  - Revolutionaries
   - NuclearOperatives
+  - SpaceNinja
   - Zombies
-  - Revolutionaries
   - MinorAntagonists
-  - SpaceNinja
-  - Thieves
 
 - type: guideEntry
   id: Traitors
index 07a377e00564d3e2b1000c24e9d225ad7baa2602..e0803044dc741c920ddf8fa1310e479b8a8d4ac0 100644 (file)
@@ -3,9 +3,9 @@
   name: guide-entry-engineering
   text: "/ServerInfo/Guidebook/Engineering/Engineering.xml"
   children:
-  - Atmospherics
   - Construction
   - Power
+  - Atmospherics
   - ShuttleCraft
   - Networking
 
index c4d38ab28a7feea97dabaf5ecfeab77ca4d424e1..9b1430cb15e4cd312c129eb6ca27af64bb86e652 100644 (file)
@@ -1,6 +1,7 @@
 - type: guideEntry
   id: NewPlayer
   name: guide-entry-newplayer
+  priority: 0
   text: "/ServerInfo/Guidebook/NewPlayer/NewPlayer.xml"
   children:
   - Controls
@@ -16,7 +17,7 @@
 - type: guideEntry
   id: Radio
   name: guide-entry-radio
-  text: "/ServerInfo/Guidebook/NewPlayer/Controls/Radio.xml" 
+  text: "/ServerInfo/Guidebook/NewPlayer/Controls/Radio.xml"
 
 - type: guideEntry
   id: CharacterCreation
@@ -24,7 +25,7 @@
   text: "/ServerInfo/Guidebook/NewPlayer/CharacterCreation.xml"
   children:
   - YourFirstCharacter
-  - Species 
+  - Species
 
 - type: guideEntry
   id: YourFirstCharacter
index 502961fb2e65a09bce920305aabfdb4b62f3e8b2..7118bf3bc082a6c1ffb29c7f4b78c2af46f1c270 100644 (file)
@@ -1,6 +1,7 @@
 - type: guideEntry
   id: References
   name: guide-entry-references
+  priority: 30
   text: "/ServerInfo/Guidebook/References.xml"
   children:
   - Chemicals
index 88af0ca505cdb9550409d4c4dcb7fb372df645c3..6bbfbf91741b5c4603f3708b584d593d4cfb4c57 100644 (file)
@@ -1,21 +1,25 @@
-- type: guideEntry # Default for forks and stuff. Should not be listed anywhere if the server is using a custom ruleset.
+# Only one of those rulesets will appear on the server at any given time.
+# They all have a priority of 10 so they appear 2nd by default (after priority 0 and before priority 20)
+
+- 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
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/DefaultRules.xml"
 
 - type: guideEntry
   id: CoreRuleset
   name: guide-entry-rules-core-only
   ruleEntry: true
-  priority: 0
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/WizDenCoreOnlyRules.xml"
 
 - type: guideEntry
   id: StandardRuleset
   name: guide-entry-rules-lrp
   ruleEntry: true
-  priority: 5
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/WizDenLRPRules.xml"
 
 - type: guideEntry
   id: RoleTypes
   name: guide-entry-rules-role-types
   ruleEntry: true
-  priority: 20
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/RoleTypes.xml"
 
 - type: guideEntry
   id: CoreRules
   name: guide-entry-rules-core
   ruleEntry: true
-  priority: 30
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC0.xml"
   children:
   - RuleC1
   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
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR0.xml"
   children:
   - RuleR1
   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"
   children:
   - RuleR11-1
   id: RuleR11-1
   name: guide-entry-rules-r11-1
   ruleEntry: true
-  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11-1AnimalEscalation.xml"
 
 - type: guideEntry
   id: RuleR11-2
   name: guide-entry-rules-r11-2
   ruleEntry: true
-  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11-2ConflictTypes.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
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS0.xml"
   children:
   - RuleS1
   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"
 
 
   id: MRPRules
   name: guide-entry-rules-mrp-m0
   ruleEntry: true
-  priority: 60
+  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/MRPRules/RuleM0.xml"
   children:
   - RuleM1
   id: RuleM1
   name: guide-entry-rules-m1
   ruleEntry: true
-  priority: 10
   text: "/ServerInfo/Guidebook/ServerRules/MRPRules/RuleM1DoNotPowergame.xml"
 
-- type: guideEntry
-  id: SpaceLaw
-  name: guide-entry-rules-space-law
-  priority: 1
-  text: "/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml"
-  children:
-  - SpaceLawCrimeList
-
-- type: guideEntry
-  id: SpaceLawCrimeList
-  name: guide-entry-rules-sl-crime-list
-  priority: 5
-  text: "/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLCrimeList.xml"
+# Ban-Related Guide Entries are used as hyperlinks in certain Ruleset Guide Entry explanations.
 
 - 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"
index 17edb030065895e3d240eead73b47485430c0b49..f9fcd6693162216a031b6900cb83ca85ecf5fbcd 100644 (file)
   id: CriminalRecords
   name: guide-entry-criminal-records
   text: "/ServerInfo/Guidebook/Security/CriminalRecords.xml"
+
+- type: guideEntry
+  id: SpaceLaw
+  name: guide-entry-rules-space-law
+  text: "/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml"
+  children:
+  - SpaceLawCrimeList
+
+- type: guideEntry
+  id: SpaceLawCrimeList
+  name: guide-entry-rules-sl-crime-list
+  text: "/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLCrimeList.xml"
index 0707e23b1092dbaa15303b9d8546ec8b7e82e921..a335882cf52eea0bf3391239dce25e18266c9e78 100644 (file)
@@ -3,10 +3,10 @@
   name: guide-entry-jobs
   text: "/ServerInfo/Guidebook/Jobs.xml"
   children:
+  - Service
   - Cargo
-  - Command
-  - Engineering
   - Medical
   - Science
+  - Engineering
   - Security
-  - Service
+  - Command
index d868a6b58fc05c7b149092614322248241bcfaa7..4dee5967006d5465f9a8e8711ea88d2d84373caa 100644 (file)
@@ -1,6 +1,7 @@
 - type: guideEntry
   id: SS14
   name: guide-entry-ss14
+  priority: 20
   text: "/ServerInfo/Guidebook/SpaceStation14.xml"
   children:
   - Jobs
index 7f47f1e490b1c04461c72b7d5c99e46b21d9746e..2572c906b0129cdcf68eb8cda01700df609046c2 100644 (file)
@@ -8,11 +8,11 @@
 
   ## Various Antagonists
   Antagonists can take many forms, like:
-  - [textlink="Nuclear operatives" link="Nuclear Operatives"], with the goal of infiltrating and destroying the station.
   - [textlink="Traitors" link="Traitors"] amongst the crew who must assassinate, steal and decieve.
+  - [textlink="Thieves" link="Thieves"] driven by kleptomania, determined to get their fix using their special gloves.
   - [textlink="Revolutionaries" link="Revolutionaries"] who are intent on taking control of the station from the inside.
-  - [textlink="Zombies" link="Zombies"] that crave the flesh of every crew member and creature on board.
+  - [textlink="Nuclear operatives" link="Nuclear Operatives"], with the goal of infiltrating and destroying the station.
   - [textlink="Space Ninjas" link="SpaceNinja"], masters of espionage and sabotage with special gear.
-  - [textlink="Thieves" link="Thieves"] driven by kleptomania, determined to get their fix using their special gloves.
+  - [textlink="Zombies" link="Zombies"] that crave the flesh of every crew member and creature on board.
   - [textlink="Various non-humanoid creatures" link="MinorAntagonists"] that generally attack anything that moves.
 </Document>
index 1bfd88c8f4bf0a349156ae32719b28d2d53124e8..cf7f67c83ed88dd2935005c899473ed30ce3ec60 100644 (file)
@@ -13,11 +13,6 @@ It primarily functions as folks who entertain, clean, and serve the rest of the
 
 For the most part, this means they scrounge around the station and assorted wrecks to find materials to sell and redistribute, and purchase materials other departments request.
 
-## Security
-[color=#cb0000]Security[/color] consists of the security cadets, lawyers, detective, security officers, warden, and the head of security. As a department it is responsible for dealing with troublemakers and non-humanoid threats like giant rats and carp.
-
-As a result of this, and the need to walk a fine line, security sometimes is overwhelmed by angry crew (don't kill the clown), and it is important for its members to try and stay on their best behavior.
-
 ## Medical
 [color=#5b97bc]Medical[/color] consists of the medical interns, chemists, medical doctors, and the chief medical officer. As a department it is responsible for taking care of the crew, treat and/or clone the wounded and dead, treat disease, and prevent everyone from dying a horrible, bloody death in a closet somewhere.
 
@@ -33,6 +28,11 @@ Scientists should seek out new artifacts to study, as well as solicit department
 
 Engineering is readily equipped to go safely into space, and as such they should always attempt to repair uninhabitable parts of the station.
 
+## Security
+[color=#cb0000]Security[/color] consists of the security cadets, lawyers, detective, security officers, warden, and the head of security. As a department it is responsible for dealing with troublemakers and non-humanoid threats like giant rats and carp.
+
+As a result of this, and the need to walk a fine line, security sometimes is overwhelmed by angry crew (don't kill the clown), and it is important for its members to try and stay on their best behavior.
+
 ## Command
 [color=#1b67a5]Command[/color] consists of every department head. It is responsible for keeping the station and its departments running efficiently.