Category:NUI Functions

From NWN Lexicon
Jump to navigationJump to search

Intro

Nwnee logo.jpg 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.

Neverwinter Nights Enhanced Edition offers several functions to create, manage, and interact with custom built user interface windows. This system is called the NUI, short for New User Interface. The documentation sometimes references it as "Nuklear User Interface"

Overview

Here are some high level overviews of NUI:

Name Type Link Brief Description
NUI at nwn.wiki wiki https://nwn.wiki/display/NWN1/NUI] Wiki overview of NUI for modders
Nui_tutorial_1_basics tutorial Nui_tutorial_1_basics A tutorial for beginners
Nui basic example example code Nui_basic_example A simple NUI example
Nui_tutorial_1_basics example code https://neverwintervault.org/project/nwnee/other/gui/nui-menus] A detailed NUI example that showcases most (all?) of the NUI widgets


Documentation

Name Type Defined Brief Description
NUI CHART TYPE_* Constants nw_inc_nui.nss
NUI_DIRECTION_* Constants nw_inc_nui.nss
NUI_MOUSE_BUTTON_* Constants nw_inc_nui.nss
NUI_SCROLLBARS_* Constants nw_inc_nui.nss
NUI_ASPECT_* Constants nw_inc_nui.nss
NUI_HALIGN_* Constants nw_inc_nui.nss
NUI_VALIGN_* Constants nw_inc_nui.nss
NUI_STYLE_* Constants nw_inc_nui.nss Style
NUI_DRAW_LIST_ITEM_TYPE_* Constants nw_inc_nui.nss Draw List
NUI_DRAW_LIST_ITEM_ORDER_* Constants nw_inc_nui.nss Draw List
NUI_DRAW_LIST_ITEM_RENDER_* Constants nw_inc_nui.nss Draw List
NuiWindow NUI_Window nw_inc_nui.nss Creates a new main window.
NuiBind Values nw_inc_nui.nss Create a dynamic bind. Unlike static values, these can change at runtime
NuiId Values nw_inc_nui.nss Tag the given element with a id.
NuiCol Layouts nw_inc_nui.nss A column will auto-space all elements inside of it and advise the parent about it's desired size.
NuiRow Layouts nw_inc_nui.nss A row will auto-space all elements inside of it and advise the parent about it's desired size.
NuiGroup Layouts nw_inc_nui.nss A group, usually with a border and some padding, holding a single element.
NuiWidth Values (Modifiers/Attributes) nw_inc_nui.nss Element width in pixels
NuiHeight Values (Modifiers/Attributes) nw_inc_nui.nss Height in pixels
NuiAspect Values (Modifiers/Attributes) nw_inc_nui.nss Ratio of x/y.
NuiMargin Values (Modifiers/Attributes) nw_inc_nui.nss Set a margin on the widget. The margin is the spacing outside of the widget.
NuiPadding Values (Modifiers/Attributes) nw_inc_nui.nss Set padding on the widget. The margin is the spacing inside of the widget.
NuiEnabled Values (Modifiers/Attributes) nw_inc_nui.nss Disabled elements are non-interactive and greyed out.
NuiVisible Values (Modifiers/Attributes) nw_inc_nui.nss Invisible elements do not render at all, but still take up layout space.
NuiTooltip Values (Modifiers/Attributes) nw_inc_nui.nss Tooltips show on mouse hover.
NuiVec Props & Style nw_inc_nui.nss Vec2
NuiRect Props & Style nw_inc_nui.nss Rect
NuiColor Props & Style nw_inc_nui.nss Color
NuiEncouraged Props & Style nw_inc_nui.nss Makes the element have a breathing glow visual effect (used to show the element/button is 'active' or currently selected).
NuiStyleForegroundColor Props & Style nw_inc_nui.nss Style the foreground color of the widget. This is dependent on the widget.
NuiSpacer Widgets nw_inc_nui.nss A special widget that just takes up layout space.
NuiLabel Widgets nw_inc_nui.nss Create a label field. Labels are single-line stylable non-editable text fields.
NuiText Widgets nw_inc_nui.nss Create a non-editable text field.
NuiButton Widgets nw_inc_nui.nss A clickable button with text as the label.
NuiButtonImage Widgets nw_inc_nui.nss A clickable button with an image as the label.
NuiButtonSelect Widgets nw_inc_nui.nss Same as the normal button, but this one is a toggle.
NuiCheck Widgets nw_inc_nui.nss A checkbox with a label to the right of it.
NuiImage Widgets nw_inc_nui.nss A image, with no border or padding.
NuiCombo Widgets nw_inc_nui.nss A combobox/dropdown.
NuiComboEntry Widgets nw_inc_nui.nss ComboEntry (used with NuiCombo)
NuiSliderFloat Widgets nw_inc_nui.nss A floating-point slider. A good step size for normal-sized sliders is 0.01.
NuiSlider Widgets nw_inc_nui.nss A integer/discrete slider.
NuiProgress Widgets nw_inc_nui.nss A progress bar. Progress is always from 0.0 to 1.0.
NuiTextEdit Widgets nw_inc_nui.nss A editable text field.
NuiList Widgets nw_inc_nui.nss Creates a list view of elements.
NuiListTemplateCell Widgets nw_inc_nui.nss NuiListTemplateCell
NuiColorPicker Widgets nw_inc_nui.nss A simple color picker, with no border or spacing.
NuiOptions Widgets nw_inc_nui.nss A list of options (radio buttons). Only one can be selected at a time.
NuiChart Widgets nw_inc_nui.nss Renders a chart.
NuiChartSlot Widgets nw_inc_nui.nss Renders a chart.
NuiDrawListPolyLine Draw List nw_inc_nui.nss PolyLine: Draw List are raw painting primitives on top of Widgets.
NuiDrawListCurve Draw List nw_inc_nui.nss Curve: Draw List are raw painting primitives on top of Widgets.
NuiDrawListCircle Draw List nw_inc_nui.nss Circle: Draw List are raw painting primitives on top of Widgets.
NuiDrawListArc Draw List nw_inc_nui.nss Arc: Draw List are raw painting primitives on top of Widgets.
NuiDrawListText Draw List nw_inc_nui.nss Text: Draw List are raw painting primitives on top of Widgets.
NuiDrawListImage Draw List nw_inc_nui.nss Image: Draw List are raw painting primitives on top of Widgets.
NuiDrawList Draw List nw_inc_nui.nss Element: Draw List are raw painting primitives on top of Widgets.
NuiCreateFromResRef NUI_Window nwscript.nss Create a NUI window from the given resref(.jui) for the given player.
NuiCreate NUI_Window nwscript.nss Create a NUI window inline for the given player.
NuiFindWindow NUI_Window nwscript.nss You can look up windows by ID, if you gave them one.
NuiGetWindowId NUI_Window nwscript.nss Returns the window ID of the window described by nUiToken.
NuiDestroy NUI_Window nwscript.nss Destroys the given window, by token, immediately closing it on the client.
NuiGetEventPlayer Events nwscript.nss Returns the originating player of the current event.
NuiGetEventWindow Events nwscript.nss Gets the window token of the current event (or 0 if not in a event).
NuiGetEventType Events nwscript.nss Returns the event type of the current event.
NuiGetEventElement Events nwscript.nss Returns the ID of the widget that triggered the event.
NuiGetEventArrayIndex Events nwscript.nss Get the array index of the current event.
NuiGetBind Values nwscript.nss Gets the json value for the given player, token and bind.
NuiSetBind Values nwscript.nss Sets a json value for the given player, token and bind.
NuiSetGroupLayout nwscript.nss Swaps out the given element (by id) with the given nui layout (partial).
NuiSetBindWatch Values nwscript.nss Mark the given bind name as watched.
NuiGetNthWindow NUI_Window nwscript.nss Returns the nNth window token of the player, or 0.
NuiGetNthBind Values nwscript.nss Return the nNth bind name of the given window, or "".
NuiGetEventPayload Events nwscript.nss Returns the event payload, specific to the event.
NuiGetUserData Values nwscript.nss Get the userdata of the given window token.
NuiSetUserData Values nwscript.nss Sets an arbitrary json value as userdata on the given window token.
OnNuiEvent Events . Sets up an Event handler to capture NUI interactions.

Related Functions

Name Type Defined Brief Description
JSON Functions json NUI uses a lot of Json functions.
GetPlayerDeviceProperty client information. Might be useful to get client's screen information.


Version

NUI was added in 1.85.8193.31 of NWN:EE

Fixes and Updates in Patches#1.86

More Updates in Patches#1.87 and toolset adds Module Properties for the OnNuiEvent