Skip to content

The engine's widget tree ​

Group widgets · 18 exports · from forks/gamexueren/scripthook.h (framework 1.0-beta7-wildm1, SH_API_VERSION 2)

Every widget the engine has, ours and the game's own, by its engine handle.

ExportSummary
ShGameSceneCountThe scenes drawn last frame, as handles.
ShGameSceneAtSee ShGameSceneCount.
ShGameSceneNameSee ShGameSceneCount.
ShSceneRootThe root widget of any scene, ours or the game's.
ShWidgetChildCountChildren in the engine's own draw order.
ShWidgetChildAtSee ShWidgetChildCount.
ShWidgetClassThe class name, "LabelWidget" and the like.
ShWidgetPropTypeAny property the class has, by the same ids the SH_P_ defines carry.
ShWidgetGetFSee ShWidgetPropType.
ShWidgetGetUSee ShWidgetPropType.
ShWidgetGetVSee ShWidgetPropType.
ShWidgetGetSSee ShWidgetPropType.
ShPropCountWhat a widget class actually exposes, instead of a guess at ids.
ShPropAtSee ShPropCount.
ShUiHandleThe handle behind one of our own ids, so a widget made with ShUiCreate reads back the same way.
ShWidgetSetFThe three properties it is safe to write, and the only ones these accept: SH_P_ALPHA (float), SH_P_VISIBLE (bool/uint), SH_P_SCALE (vec3).
ShWidgetSetUSee ShWidgetSetF.
ShWidgetSetVSee ShWidgetSetF.

ShGameSceneCount ​

c
SH_API int      ShGameSceneCount(void);

The scenes drawn last frame, as handles. Walk one with ShSceneRoot and the ShWidget calls below.

scripthook.h, line 3376

ShGameSceneAt ​

c
SH_API uint64_t ShGameSceneAt(int i);

Documented together with ShGameSceneCount just above.

scripthook.h, line 3377

ShGameSceneName ​

c
SH_API int      ShGameSceneName(uint64_t scene, char *buf, int n);

Documented together with ShGameSceneCount just above.

scripthook.h, line 3378

ShSceneRoot ​

c
SH_API uint64_t ShSceneRoot(uint64_t scene);

The root widget of any scene, ours or the game's.

scripthook.h, line 3381

ShWidgetChildCount ​

c
SH_API int      ShWidgetChildCount(uint64_t widget);

Children in the engine's own draw order.

scripthook.h, line 3384

ShWidgetChildAt ​

c
SH_API uint64_t ShWidgetChildAt(uint64_t widget, int i);

Documented together with ShWidgetChildCount just above.

scripthook.h, line 3385

ShWidgetClass ​

c
SH_API int      ShWidgetClass(uint64_t widget, char *out, int n);

The class name, "LabelWidget" and the like.

scripthook.h, line 3388

ShWidgetPropType ​

c
SH_API int      ShWidgetPropType(uint64_t widget, uint32_t prop);

Any property the class has, by the same ids the SH_P_ defines carry. 0 when the class lacks it.

scripthook.h, line 3392

ShWidgetGetF ​

c
SH_API int      ShWidgetGetF(uint64_t widget, uint32_t prop, float *out);

Documented together with ShWidgetPropType just above.

scripthook.h, line 3393

ShWidgetGetU ​

c
SH_API int      ShWidgetGetU(uint64_t widget, uint32_t prop,
                             uint32_t *out);

Documented together with ShWidgetPropType just above.

scripthook.h, line 3394

ShWidgetGetV ​

c
SH_API int      ShWidgetGetV(uint64_t widget, uint32_t prop, float *out,
                             int n);

Documented together with ShWidgetPropType just above.

scripthook.h, line 3396

ShWidgetGetS ​

c
SH_API int      ShWidgetGetS(uint64_t widget, uint32_t prop, char *out,
                             int n);

Documented together with ShWidgetPropType just above.

scripthook.h, line 3398

ShPropCount ​

c
SH_API int      ShPropCount(void);

What a widget class actually exposes, instead of a guess at ids.

The table is the engine's own: one record per (class, property id), with the value type and the accessor addresses. ShPropCount() is how many records there are; ShPropAt() reads one.

This is for finding a PRECISE discriminator: a plugin that needs to tell two widgets apart lists the properties of the class in front of it and picks the field that differs (an atlas rect, an author-set tint, a layout flag) rather than probing ids blindly or matching on colour.

cls receives the owning class name, id the property id - the same numbers the SH_P_* defines carry - type its value type, and set/get the accessor addresses (0 when absent, which is how a read-only property shows up). Reads go through ShWidgetGetF/U/V/S with that id.

Returns 0 for an index out of range, 1 on success.

scripthook.h, line 3418

ShPropAt ​

c
SH_API int      ShPropAt(int index, char *cls, int n, uint32_t *id,
                         int *type, uint64_t *set, uint64_t *get);

Documented together with ShPropCount just above.

scripthook.h, line 3419

ShUiHandle ​

c
SH_API uint64_t ShUiHandle(uint32_t id);

The handle behind one of our own ids, so a widget made with ShUiCreate reads back the same way.

scripthook.h, line 3424

ShWidgetSetF ​

c
SH_API int ShWidgetSetF(uint64_t widget, uint32_t prop, float v);

The three properties it is safe to write, and the only ones these accept: SH_P_ALPHA (float), SH_P_VISIBLE (bool/uint), SH_P_SCALE (vec3). Every write goes through the widget class's own setter - the same call the game animates these with - not through a field offset, so a scene cannot be left in a shape its own code does not expect. Structure (text, image, position, size) is refused.

Game thread only: call from ShRegisterFrameCallback or a menu callback. Returns 0 when the class has no setter for that property, which is also how a build where these are not exposed answers.

scripthook.h, line 3436

ShWidgetSetU ​

c
SH_API int ShWidgetSetU(uint64_t widget, uint32_t prop, uint32_t v);

Documented together with ShWidgetSetF just above.

scripthook.h, line 3437

ShWidgetSetV ​

c
SH_API int ShWidgetSetV(uint64_t widget, uint32_t prop, const float *v, int n);

Documented together with ShWidgetSetF just above.

scripthook.h, line 3438

WildM is an independent community project. It is not affiliated with or endorsed by Ubisoft. Ghost Recon Wildlands is a trademark of Ubisoft Entertainment.