UIProgressBar info

This commit is contained in:
Crom (Thibaut CHARLES) 2020-01-13 22:28:33 +01:00
parent b454bbe44a
commit 6f3d3056db
Signed by: tcharles
GPG Key ID: 45A3D5F880B9E6D0
1 changed files with 62 additions and 6 deletions

View File

@ -464,8 +464,10 @@ A tree view can be built using multiple nested `UICollapsable`s with `indent` se
## Children ## Children
The UICollapsable can have any number of children, but requires at least a `UIButton` element with the `header` attribute set to `true` to be interacted with. The UICollapsable can have any number of children, but requires at least a `UIButton` element with the `header` attribute set to `true` to be interacted with.
When collapsed (closed), the UICollapsable's height will be the height of the header UIButton element. When expanded (opened), UICollapsable's height will be the height defined as the `height` attribute. When collapsed (closed), the UICollapsable's height will be the height of the header UIButton element. When expanded
The UICollapsable works particularly well inside a UIListbox, since content will be automatically rearranged when the UICollapsable changes its height. (opened), UICollapsable's height will be the height defined as the `height` attribute. The UICollapsable works
particularly well inside a UIListbox, since content will be automatically rearranged when the UICollapsable changes its
height.
Note: UICollapsable inside other UICollapsable will be be badly offset by the header height if they have `isexpanded=true`. The offset is corrected when collapsing/expanding it manually. Note: UICollapsable inside other UICollapsable will be be badly offset by the header height if they have `isexpanded=true`. The offset is corrected when collapsing/expanding it manually.
@ -483,10 +485,51 @@ Note: UICollapsable inside other UICollapsable will be be badly offset by the he
# UIProgressBar # UIProgressBar
A progress bar that can be controlled by NWScript.
The progress bar basically clips the image given as the `img` attribute depending on the progress value.
## Attributes
| Attribute | Usage | Possible values |
|------------------|----------------------------------------------------------------------|-----------------|
| `img` | Image to use as the progress bar foreground | Boolean |
| `vertical=false` | `true` to make the progress bar vertical | Boolean |
| `lerpincrease` | `true` make the progress indicator move more smoothly _need testing_ | Boolean |
| `lerpdecrease` | `true` make the progress indicator move more smoothly _need testing_ | Boolean |
## NWScript
##### SetGUIProgressBarPosition
```c
void SetGUIProgressBarPosition( object oPlayer, string sScreenName, string sUIObjectName, float fPosition );
```
Sets the progress of a UIProgressBar
- `oPlayer`: player object
- `sScreenName`: `UIScene` `name` attribute
- `sUIObjectName`: `UIProgressBar` `name` attribute
- `fPosition`: Percent of completeness of the `UIProgressBar`, between 0 and 1
##### SetScrollBarRanges
```c
void SetScrollBarRanges( object oPlayer, string sScreenName, string sScrollBarName, int nMinSize, int nMaxSize, int nMinValue, int nMaxValue );
```
TODO: does it work for progress bars?
##### SetScrollBarValue
```c
void SetScrollBarValue( object oPlayer, string sScreenName, string sScrollBarName, int nValue );
```
TODO: does it work for progress bars?
# Special files # Special files
## contextmenu.xml ## contextmenu.xml
Manage all in-game right click menus.
### UIScene ### UIScene
Using the `OnAdd` event to trigger `UIObject_Misc_ExecuteServerScript` will prevent the GUI from loading. Using the `OnAdd` event to trigger `UIObject_Misc_ExecuteServerScript` will prevent the GUI from loading.
@ -505,6 +548,23 @@ Each `UIRadialNode` has a `name` property that is referred to in `UISubNode`
### UISubNode ### UISubNode
The `node` property refers to an existing `UIRadialNode`'s `name` property. The `node` property refers to an existing `UIRadialNode`'s `name` property.
## stylesheet.xml
Defines styles for buttons and scrollbars
## fontfamily.xml
Defines font styles and variants.
```xml
<UIFontFamily name="Default" >
<UIFontNormal font="ui\\default\\fonts\\NWN2_Main.ttf" pointsize="12" dropshadows="false" outline="false" />
<UIFontBold font="ui\\default\\fonts\\NWN2_MainB.ttf" pointsize="12" dropshadows="false" outline="false" />
<UIFontItalic font="ui\\default\\fonts\\NWN2_MainI.ttf" pointsize="12" dropshadows="false" outline="false" />
<UIFontBoldItalic font="ui\\default\\fonts\\NWN2_MainBI.ttf" pointsize="12" dropshadows="false" outline="false" />
</UIFontFamily>
```
# Other XML elements # Other XML elements
- `UIFontFamily`: Used only in `fontfamily.xml`. Adding new font families can cause weird bugs - `UIFontFamily`: Used only in `fontfamily.xml`. Adding new font families can cause weird bugs
- `UI3DScene`: Used for inventory, character portraits, character creation preview, ... - `UI3DScene`: Used for inventory, character portraits, character creation preview, ...
@ -517,10 +577,6 @@ The `node` property refers to an existing `UIRadialNode`'s `name` property.
- `UIPortrait` - `UIPortrait`
- `UITextTree` - `UITextTree`
## stylesheet.xml
## fontfamily.xml
--- ---
# Generic callbacks # Generic callbacks