NuiEncouraged( json, json )
From NWN Lexicon
Jump to navigationJump to search
Encouraged elements have a breathing animated glow inside of it.
json // Element
NuiEncouraged(
json jElem, // Element
json jEncouraged // Bind:Bool
);
Return
- json element
Parameters
- json jElem
- This is the element to "encourage"
- json jEncouraged
- Note this is a JsonBool, not an nwn int
- For most use cases you would likely use an NuiBind so can dynamically toggle it.
Description
Encouraged elements have a breathing animated glow inside of it.
Remarks
- Author of wiki article has only tested it with the NuiButton and NuiButtonSelect elements. It's unclear if it'll work with others non-button elements.
Version
unknown, but NWN:EE
Example
void main()
{
object oPC = GetFirstPC();
// Setup a normal button.
json jButton = NuiId(NuiButton(JsonString("Test Button")), "testbuttonid");
// Wrap it in NuiEncouraged and use NuiBind on jEncouraged
jButton = NuiEncouraged(jButton, NuiBind("testbutton_encouraged"));
// This is just generic boilerplate code to setup window.
json jCol = JsonArray();
jCol = JsonArrayInsert(jCol, jButton);
json jLayout = NuiCol(jCol);
json jWindow = NuiWindow(jLayout, JsonString("Test Example"), NuiRect(-1.0, -1.0, 400.0, 300.0), JsonBool(TRUE), JsonBool(FALSE), JsonBool(TRUE), JsonBool(FALSE), JsonBool(TRUE));
int nToken = NuiCreate(oPC, jWindow, "window_id_test");
// Here we can dynamically toggle if button is "encouraged" or not.
NuiSetBind(oPC, nToken, "testbutton_encouraged", JsonBool(TRUE));
}
See Also
| functions: |
