mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 20:59:18 +07:00
docs: Better event documentation for presentation
This commit is contained in:
@ -13,7 +13,7 @@ import com.unciv.ui.screens.civilopediascreen.ICivilopediaText
|
|||||||
|
|
||||||
|
|
||||||
class Event : RulesetObject() {
|
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
|
val presentation = Presentation.Alert
|
||||||
var text = ""
|
var text = ""
|
||||||
|
|
||||||
|
@ -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.
|
Events allow users to choose between options of triggers to activate.
|
||||||
|
|
||||||
| Attribute | Type | Default | Notes |
|
| Attribute | Type | Default | Notes |
|
||||||
|-----------------|----------------------|----------|-------------------------------------------------------------------------------|
|
|-----------------|-------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------|
|
||||||
| name | String | Required | Used for triggering via "Triggers a [event] event" unique |
|
| name | String | Required | Used for triggering via "Triggers a [event] event" unique |
|
||||||
| text | String | None | Flavor text displayed to user |
|
| text | String | None | Flavor text displayed to user |
|
||||||
| civilopediaText | List | Optional | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
|
| 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 |
|
||||||
| choices | List of EventChoices | | User can choose to trigger one of the viable choices |
|
| 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?)
|
You can use text and/or civilopediaText, if both are present both are shown (but why would you?)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"name": { "type": "string" },
|
"name": { "type": "string" },
|
||||||
"text": { "type": "string" },
|
"text": { "type": "string" },
|
||||||
|
"presentation": { "enum": ["None", "Alert", "Floating"] },
|
||||||
"choices": {
|
"choices": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
Reference in New Issue
Block a user