TorqueScript Reference
GuiProfileTheme Class Reference

#include <guiProfileTheme_ScriptBinding.h>

Inherits SimObject.

Public Member Functions

String adjustValue (color, percent)
Integer createBorder (name)
Integer createCursor (category, [name])
Integer createProfile (category, [name])
Integer getBorder (category)
String getBorderCategoryNames ()
String getCategoryNames ()
Integer getCursor (category)
String getCursorCanonicalName (category)
String getCursorCategoryNames ()
String getCursors (category)
String getCursorStockFile (category)
Integer getProfile (category)
Integer getProfileCount ()
String getProfiles (category)
Boolean isFieldOverridden (member, fieldName)
Boolean removeBorder (border)
Boolean removeCursor (cursor)
Boolean removeProfile (profile)
Boolean renameTheme (newName)
void resetField (member, fieldName)
void resetProfile (member)
void restamp ()
String setAlpha (color, alpha)
Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
Integer clone ([copyDynamicFields=false]?)
Integer deepClone ()
void delete ()
Integer getId ()
void setName (newName)
String getName ()
String getClassNamespace ()
String getSuperClassNamespace ()
void setClassNamespace (nameSpace)
void setSuperClassNamespace ()
Boolean isMethod (string methodName)
String call (methodName, [args] *)
void dumpClassHierarchy ()
void dump ()
Boolean isMemberOfClass (string classname)
String getClassName ()
String getFieldValue (fieldName)
Boolean setFieldValue (fieldName, value)
Boolean setEditFieldValue (fieldName, value)
Integer getDynamicFieldCount ()
String getDynamicField (index)
Integer getFieldCount ()
String getField (int index)
void setProgenitorFile (file)
String getProgenitorFile ()
Integer getType ()
String getFieldType (fieldName)
void setInternalName (string InternalName)
String getInternalName ()
Boolean isChildOfGroup (groupID)
Integer getGroup ()
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
void stopTimer ()
Boolean isTimerActive ()
Integer schedule (time, command, [arg] *)
void startListening (SimObject)
void stopListening (SimObject)
void addListener (SimObject)
void removeListener (SimObject)
void removeAllListeners ()
void postEvent (String eventName, String data)
Boolean save (fileName, [selectedOnly]?)
void addFieldFilter (fieldName)
void removeFieldFilter (fieldName)

Member Function Documentation

◆ adjustValue()

String adjustValue ( color ,
percent  )

Shifts a color's brightness by a percentage, preserving hue and alpha. Positive percentages brighten, negative darken.

Parameters
colorThe color as "red green blue alpha".
percentThe brightness shift in percentage points.
Returns
The adjusted color as "red green blue alpha".

◆ createBorder()

Integer createBorder ( name )

Creates a single-use custom border owned by the theme. A custom border is not a category member: it keeps its own field values and never appears in getBorderCategoryNames. Used by the Profile Editor's per-side "Custom..." flow, named e.g. <ProfileName><Slot>CustomBorder.

Parameters
nameThe object name for the new border.
Returns
The new GuiBorderProfile id, or 0 on failure.

◆ createCursor()

Integer createCursor ( category )

Creates an extra member cursor in a category, alongside the default. A category holding more than one cursor is what makes the Gui Editor offer a choice on a control's cursor slot.

Parameters
categoryThe cursor category name (see getCursorCategoryNames).
nameOptional object name; defaults to <ThemeName><Suffix><N>.
Returns
The new GuiCursor id, or 0 on failure.

◆ createProfile()

Integer createProfile ( category )

Creates an extra member profile in a category, alongside the default.

Parameters
categoryThe category name (see getCategoryNames).
nameOptional object name; defaults to <ThemeName><Suffix><N>.
Returns
The new GuiControlProfile id, or 0 on failure.

◆ getBorder()

Integer getBorder ( category )

Gets the member border profile for a border category.

Parameters
categoryThe border category name (see getBorderCategoryNames).
Returns
The GuiBorderProfile id, or 0 if the category is unknown.

◆ getBorderCategoryNames()

String getBorderCategoryNames ( )

Gets the engine-defined border category names.

Returns
A space-separated list of border category names.

◆ getCategoryNames()

String getCategoryNames ( )

Gets the engine-defined profile category names.

Returns
A space-separated list of category names.

◆ getCursor()

Integer getCursor ( category )

Gets the default member cursor for a cursor category.

Parameters
categoryThe cursor category name (see getCursorCategoryNames).
Returns
The GuiCursor id, or 0 if the category is unknown.

◆ getCursorCanonicalName()

String getCursorCanonicalName ( category )

Gets the name the engine falls back to for a cursor category ("EditCursor"). Installing a theme's cursors means registering copies of them under these names; see AppCore::installThemeCursors.

Parameters
categoryThe cursor category name (see getCursorCategoryNames).
Returns
The canonical cursor name, or "" if the category is unknown.

◆ getCursorCategoryNames()

String getCursorCategoryNames ( )

Gets the engine-defined cursor category names. The suffixes these produce are also the canonical cursor names the engine falls back to when a control names no cursor of its own.

Returns
A space-separated list of cursor category names.

◆ getCursors()

String getCursors ( category )

Gets all member cursors for a category: the default first, then extras. This is how a game picks between several cursors a theme offers for the same job - Canvas.setCursor(getWord(theme.getCursors("Default"), 1)).

Parameters
categoryThe cursor category name (see getCursorCategoryNames).
Returns
A space-separated list of GuiCursor ids.

◆ getCursorStockFile()

String getCursorStockFile ( category )

Gets the stock art file name a cursor category starts from ("defaultCursor.png"). The editor asks so it can seed a theme's own cursor folder; a theme never copies files itself.

Parameters
categoryThe cursor category name (see getCursorCategoryNames).
Returns
The stock file name, or "" if the category is unknown.

◆ getProfile()

Integer getProfile ( category )

Gets the default member profile for a category.

Parameters
categoryThe category name (see getCategoryNames).
Returns
The GuiControlProfile id, or 0 if the category is unknown.

◆ getProfileCount()

Integer getProfileCount ( )

Gets the number of member profiles in the theme (defaults plus extras).

Returns
The member profile count.

◆ getProfiles()

String getProfiles ( category )

Gets all member profiles for a category: the default first, then extras.

Parameters
categoryThe category name (see getCategoryNames).
Returns
A space-separated list of GuiControlProfile ids.

◆ isFieldOverridden()

Boolean isFieldOverridden ( member ,
fieldName  )

Checks whether a member has overridden a field away from the theme.

Parameters
memberThe member profile or border profile.
fieldNameThe field to check.
Returns
True if the field is overridden.

◆ removeBorder()

Boolean removeBorder ( border )

Removes a custom border created with createBorder.

Parameters
borderThe custom border to remove.
Returns
True if the border was a custom border owned by this theme and was removed.

◆ removeCursor()

Boolean removeCursor ( cursor )

Removes an extra member cursor. Default members are refused: a theme always provides one cursor per category.

Parameters
cursorThe extra cursor to remove.
Returns
True if the cursor was an extra and was removed.

◆ removeProfile()

Boolean removeProfile ( profile )

Removes an extra member profile. Default members are refused: a theme always provides one profile per category.

Parameters
profileThe extra profile to remove.
Returns
True if the profile was an extra and was removed.

◆ renameTheme()

Boolean renameTheme ( newName )

Renames the theme and every member following the theme-name pattern, updating overridden border references that point at this theme's borders. All-or-nothing: any name collision refuses the whole rename.

Parameters
newNameThe new theme name.
Returns
True if the rename was applied.

◆ resetField()

void resetField ( member ,
fieldName  )

Clears a member's override on one field, so the field re-derives from the theme. Accepts a member profile, border profile or cursor.

Parameters
memberThe member profile or border profile.
fieldNameThe field to reset.
Returns
No return value.

◆ resetProfile()

void resetProfile ( member )

Clears all of a member's overrides, so every field re-derives from the theme. Accepts a member profile or border profile.

Parameters
memberThe member profile or border profile.
Returns
No return value.

◆ restamp()

void restamp ( )

Recreates any missing default members and re-derives every non-overridden member field from the current theme values.

Returns
No return value.

◆ setAlpha()

String setAlpha ( color ,
alpha  )

Replaces a color's alpha, clamping to 0..255.

Parameters
colorThe color as "red green blue alpha".
alphaThe new alpha value.
Returns
The color with the new alpha as "red green blue alpha".