docs: update nwn-2-gui-scripting

This commit is contained in:
Thibaut CHARLES (Crom) 2020-01-10 23:05:35 +00:00 committed by WikiJS
parent 73c059e499
commit 5a86c84b06

View File

@ -2,24 +2,28 @@
title: Nwn 2 Gui Scripting title: Nwn 2 Gui Scripting
description: A quick summary of Nwn 2 Gui Scripting description: A quick summary of Nwn 2 Gui Scripting
published: 1 published: 1
date: 2020-01-10T15:53:14.197Z date: 2020-01-10T23:05:32.063Z
tags: tags:
--- ---
<!-- TITLE: Nwn 2 Gui Scripting -->
<!-- SUBTITLE: A quick summary of Nwn 2 Gui Scripting -->
# Resources # Resources
- [oeiprogrammer](https://oeiprogrammer.blogspot.fr) - [oeiprogrammer](https://oeiprogrammer.blogspot.fr)
# Language # Language
The GUI are written in a superset of the standard XML. The GUI are written in a non standard form of XML.
- The first line must be something like `<?xml version="1.0" encoding="utf-8"?>` - The first line must be something like `<?xml version="1.0" encoding="utf-8"?>`
- Attributes values can be delimited by `'`, `"` or if not delemited ends with a space - Attributes values can be delimited by `'`, `"` or if not delemited ends with a space
+ Example: this does not work: `OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_myscript","Hello World")` because OnLeftClick value has no delimiter and will end after `Hello` + Example: this does not work: `OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_myscript","Hello World")` because OnLeftClick value has no delimiter and will end after `Hello`
- Auto-closing tags are accepted `<UIText />` - Auto-closing tags are accepted `<UIText />`
- If you repeat an attribute twice inside the same XML tag, the GUI will not load - If you repeat an attribute twice inside the same XML tag, the GUI will not load
- The `UIScene` tag can be left unclosed - The `UIScene` tag must never be closed
# Rules # Rules
@ -331,14 +335,14 @@ Inherits from UIPane element.
UIButtons can contain multiple UIFrame children with the special `state` attribute, that controls when to display the UIFrame: UIButtons can contain multiple UIFrame children with the special `state` attribute, that controls when to display the UIFrame:
- `base`: Always displayed (ie: a background image) - `base`: Always displayed (ie: a background image)
- `disabled`: when the button is disabled (`disabled="true"`) - `disabled`: when the button is disabled (`disabled="true"`)
- `up`: When the button is not pressed/selected - `up`: When the button is not pressed/selected (`UICollapsable` was opened and has just been closed)
- `down`: when the button is pressed/selected - `down`: when the button is being pressed or is selected (`UICollapsable` is collapsed and will be opened)
- `focused`: When the player has the focus on the button - `focused`: When the player has the focus on the button (`UICollapsable` is collapsed)
- `hilited`: _need info_ - `hilited`: when the button is being hovered (`UICollapsable` is collapsed)
- `hifocus`: _need info_ - `hifocus`: when the button has the focus **and** is being hovered (`UICollapsable` is collapsed)
- `header`: _need info_ related to `UICollapsable` - `header`: Only usable when the `UIButton` is inside a `UICollapsable`: when the `UICollapsable` is open
- `hiheader`: _need info_ related to `UICollapsable` - `hiheader`: Only usable when the `UIButton` is inside a `UICollapsable`: when button is being hovered while the `UICollapsable` is open
- `downheader`: _need info_ related to `UICollapsable` - `downheader`: Only usable when the `UIButton` is inside a `UICollapsable`: when button is being pressed while the `UICollapsable` is close
You can find examples of this inside `stylesheet.xml`. You can find examples of this inside `stylesheet.xml`.
### Notes ### Notes