NuiEncouraged( json, json )

From NWN Lexicon
Jump to navigationJump to search
Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

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:

NUI Functions NuiStyleForegroundColor