From 911584dc4991e50570e35a426e82c6a2da93f217 Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Wed, 2 Jul 2025 10:07:00 +0200 Subject: [PATCH] Minor Unique documentation improvements (#13559) * UniqueDocsWriter outputs UniqueFlag HiddenToUsers and NoConditionals * UniqueDocsWriter: Make other hints get their own line after mkdocs is done with them * Be honest about OneTimeGlobalAlert --- core/src/com/unciv/models/ruleset/unique/UniqueType.kt | 3 ++- desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index b97d786198..2965047286 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -863,7 +863,8 @@ enum class UniqueType( // Or just reword it without the 'up to', so it reads "Reveal [amount/'all'] [tileFilter] tiles within [amount] tiles" OneTimeRevealSpecificMapTiles("Reveal up to [positiveAmount/'all'] [tileFilter] within a [positiveAmount] tile radius", UniqueTarget.Triggerable), OneTimeRevealCrudeMap("From a randomly chosen tile [positiveAmount] tiles away from the ruins, reveal tiles up to [positiveAmount] tiles away with [positiveAmount]% chance", UniqueTarget.Ruins), - OneTimeGlobalAlert("Triggers the following global alert: [comment]", UniqueTarget.Triggerable), // used in Policy + OneTimeGlobalAlert("Triggers the following global alert: [comment]", UniqueTarget.Triggerable, + docDescription = "Only works on Policies at the moment.", flags = UniqueFlag.setOfNoConditionals), OneTimeGlobalSpiesWhenEnteringEra("Every major Civilization gains a spy once a civilization enters this era", UniqueTarget.Era), OneTimeSpiesLevelUp("Promotes all spies [positiveAmount] time(s)", UniqueTarget.Triggerable), // used in Policies, Buildings OneTimeGainSpy("Gain an extra spy", UniqueTarget.Triggerable), // used in Wonders diff --git a/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt b/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt index 3bde30a2ca..9bb2805613 100644 --- a/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt +++ b/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt @@ -131,12 +131,16 @@ class UniqueDocsWriter { lines += "\tExample: \"${uniqueText.fillPlaceholders(*paramExamples)}\"\n" } if (uniqueType.flags.contains(UniqueFlag.AcceptsSpeedModifier)) - lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameSpeed.text}>" + lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameSpeed.text}>\n" if (uniqueType.flags.contains(UniqueFlag.AcceptsGameProgressModifier)) - lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameProgress.text}>" + lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameProgress.text}>\n" if (uniqueType in MapUnitCache.UnitMovementUniques) { - lines += "\tDue to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work." + lines += "\tDue to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.\n" } + if (uniqueType.flags.contains(UniqueFlag.NoConditionals)) + lines += "\tThis unique does not support conditionals.\n" + if (uniqueType.flags.contains(UniqueFlag.HiddenToUsers)) + lines += "\tThis unique is automatically hidden from users.\n" lines += "\tApplicable to: " + uniqueType.allTargets().sorted().joinToString() lines += "" }