From 0b48d30451bfe47d4f8ae6378e2e743706820d80 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sun, 25 Aug 2024 02:04:00 +0300 Subject: [PATCH] docs: Better event documentation for presentation --- core/src/com/unciv/models/ruleset/Event.kt | 2 +- .../5-Miscellaneous-JSON-files.md | 14 ++++++++------ docs/Modders/schemas/events.json | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Event.kt b/core/src/com/unciv/models/ruleset/Event.kt index 23347d11f4..034c90486b 100644 --- a/core/src/com/unciv/models/ruleset/Event.kt +++ b/core/src/com/unciv/models/ruleset/Event.kt @@ -13,7 +13,7 @@ import com.unciv.ui.screens.civilopediascreen.ICivilopediaText class Event : RulesetObject() { - enum class Presentation { None, Alert, Floating } + enum class Presentation { /** Does not display a popup, choice chosen randomly */ None, Alert, Floating } val presentation = Presentation.Alert var text = "" diff --git a/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md b/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md index 105add2107..78fcfa3930 100644 --- a/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md +++ b/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md @@ -118,12 +118,14 @@ The code below is an example of a valid "turns" definition and it specifies that Events allow users to choose between options of triggers to activate. -| Attribute | Type | Default | Notes | -|-----------------|----------------------|----------|-------------------------------------------------------------------------------| -| name | String | Required | Used for triggering via "Triggers a [event] event" unique | -| text | String | None | Flavor text displayed to user | -| civilopediaText | List | Optional | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) | -| choices | List of EventChoices | | User can choose to trigger one of the viable choices | +| Attribute | Type | Default | Notes | +|-----------------|-------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------| +| name | String | Required | Used for triggering via "Triggers a [event] event" unique | +| text | String | None | Flavor text displayed to user | +| presentation | One of: "None", "Alert", "Floating" | Alert | "Alert" indicates a regular popup, "None" means the choice is made randomly, "Floating" is for tutorial-style indicators | +| civilopediaText | List | Optional | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) | +| choices | List of EventChoices | | User can choose to trigger one of the viable choices | + You can use text and/or civilopediaText, if both are present both are shown (but why would you?) diff --git a/docs/Modders/schemas/events.json b/docs/Modders/schemas/events.json index 6745545a23..726caf6081 100644 --- a/docs/Modders/schemas/events.json +++ b/docs/Modders/schemas/events.json @@ -6,6 +6,7 @@ "properties": { "name": { "type": "string" }, "text": { "type": "string" }, + "presentation": { "enum": ["None", "Alert", "Floating"] }, "choices": { "type": "array", "items": {