void UI_RegisterBaseLayoutNode (uiBehaviour_t* behaviour) { behaviour->name = "baselayout"; behaviour->extends = "abstractbase"; behaviour->manager = UINodePtr(new uiBaseLayoutNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiBaseLayoutNode_t *"); }
void UI_RegisterOptionNode (uiBehaviour_t* behaviour) { behaviour->name = "option"; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->manager = UINodePtr(new uiOptionNode()); /** * Displayed text */ UI_RegisterExtradataNodeProperty(behaviour, "label", V_STRING, EXTRADATA_TYPE, label); /** * Value of the option */ UI_RegisterExtradataNodeProperty(behaviour, "value", V_STRING, EXTRADATA_TYPE, value); /** * If true, child are not displayed */ propertyCollapsed = UI_RegisterExtradataNodeProperty(behaviour, "collapsed", V_BOOL, EXTRADATA_TYPE, collapsed); /* Icon used to display the node */ UI_RegisterExtradataNodeProperty(behaviour, "icon", V_UI_SPRITEREF, EXTRADATA_TYPE, icon); UI_RegisterExtradataNodeProperty(behaviour, "flipicon", V_BOOL, EXTRADATA_TYPE, flipIcon); ui_optionBehaviour = behaviour; }
void UI_RegisterSelectBoxNode (uiBehaviour_t* behaviour) { behaviour->name = "selectbox"; behaviour->extends = "abstractoption"; behaviour->manager = UINodePtr(new uiSelectBoxNode()); behaviour->drawItselfChild = true; }
void UI_RegisterFuncNode (uiBehaviour_t *behaviour) { behaviour->name = "func"; behaviour->isVirtual = true; behaviour->isFunction = true; behaviour->manager = UINodePtr(new uiFuncNode()); }
void UI_RegisterTextEntryNode (uiBehaviour_t* behaviour) { behaviour->name = "textentry"; behaviour->manager = UINodePtr(new uiTextEntryNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Call back event called when we click on the node. If the click select the node, * it called before we start the cvar edition. */ UI_RegisterOveridedNodeProperty(behaviour, "onClick"); /* Call back event (like click...) fired when the text is changed, after * validation. An abort of the edition dont fire this event. */ UI_RegisterOveridedNodeProperty(behaviour, "onChange"); /* Custom the draw behaviour by hiding each character of the text with a star (''*''). */ UI_RegisterExtradataNodeProperty(behaviour, "isPassword", V_BOOL, textEntryExtraData_t, isPassword); /* ustom the mouse event behaviour. When we are editing the text, if we click out of the node, the edition is aborted. Changes on * the text are canceled, and no change event are fired. */ UI_RegisterExtradataNodeProperty(behaviour, "clickOutAbort", V_BOOL, textEntryExtraData_t, clickOutAbort); /* Cursor position (offset of next UTF-8 char to the right) */ UI_RegisterExtradataNodeProperty(behaviour, "cursorPosition", V_INT, textEntryExtraData_t, cursorPosition); /* Call it when we abort the edition */ UI_RegisterExtradataNodeProperty(behaviour, "onAbort", V_UI_ACTION, textEntryExtraData_t, onAbort); /* Call it to force node edition */ UI_RegisterNodeMethod(behaviour, "edit", UI_TextEntryNodeFocus); /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }
void UI_RegisterTabNode (uiBehaviour_t *behaviour) { behaviour->name = "tab"; behaviour->extends = "abstractoption"; behaviour->manager = UINodePtr(new uiTabNode()); behaviour->drawItselfChild = true; }
void UI_RegisterAbstractOptionNode (uiBehaviour_t *behaviour) { behaviour->name = "abstractoption"; behaviour->isAbstract = true; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->drawItselfChild = true; behaviour->manager = UINodePtr(new uiAbstractOptionNode()); /** Optional. Data ID we want to use. It must be an option list. It substitute to the inline options */ UI_RegisterExtradataNodeProperty(behaviour, "dataid", V_UI_DATAID, EXTRADATA_TYPE, dataId); /** Optional. We can define the height of the block containing an option. */ UI_RegisterExtradataNodeProperty(behaviour, "lineheight", V_INT, EXTRADATA_TYPE, lineHeight); /* position of the vertical view (into the full number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "viewpos", V_INT, EXTRADATA_TYPE, scrollY.viewPos); /* size of the vertical view (proportional to the number of elements the node can display without moving) */ UI_RegisterExtradataNodeProperty(behaviour, "viewsize", V_INT, EXTRADATA_TYPE, scrollY.viewSize); /* full vertical size (proportional to the number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "fullsize", V_INT, EXTRADATA_TYPE, scrollY.fullSize); /* number of elements contain the node */ UI_RegisterExtradataNodeProperty(behaviour, "count", V_INT, EXTRADATA_TYPE, count); /* Define the cvar containing the value of the current selected option */ UI_RegisterExtradataNodeProperty(behaviour, "cvar", V_UI_CVAR, EXTRADATA_TYPE, cvar); /* Called when one of the properties viewpos/viewsize/fullsize change */ UI_RegisterExtradataNodeProperty(behaviour, "onviewchange", V_UI_ACTION, EXTRADATA_TYPE, onViewChange); }
void UI_RegisterAbstractScrollableNode (uiBehaviour_t *behaviour) { behaviour->name = "abstractscrollable"; behaviour->manager = UINodePtr(new uiAbstractScrollableNode()); behaviour->isAbstract = true; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* position of the vertical view (into the full number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "viewpos", V_INT, EXTRADATA_TYPE, scrollY.viewPos); /* size of the vertical view (proportional to the number of elements the node can display without moving) */ UI_RegisterExtradataNodeProperty(behaviour, "viewsize", V_INT, EXTRADATA_TYPE, scrollY.viewSize); /* full vertical size (proportional to the number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "fullsize", V_INT, EXTRADATA_TYPE, scrollY.fullSize); /* Called when one of the properties viewpos/viewsize/fullsize change */ UI_RegisterExtradataNodeProperty(behaviour, "onviewchange", V_UI_ACTION, EXTRADATA_TYPE, onViewChange); /* Call it to vertically scroll the document up */ UI_RegisterNodeMethod(behaviour, "pageup", UI_AbstractScrollableNodePageUp); /* Call it to vertically scroll the document down */ UI_RegisterNodeMethod(behaviour, "pagedown", UI_AbstractScrollableNodePageDown); /* Call it to vertically scroll the document up */ UI_RegisterNodeMethod(behaviour, "moveup", UI_AbstractScrollableNodeMoveUp); /* Call it to vertically scroll the document down */ UI_RegisterNodeMethod(behaviour, "movedown", UI_AbstractScrollableNodeMoveDown); /* Call it to vertically reset the scroll position to 0 */ UI_RegisterNodeMethod(behaviour, "movehome", UI_AbstractScrollableNodeMoveHome); /* Call it to vertically move the scroll to the end of the document */ UI_RegisterNodeMethod(behaviour, "moveend", UI_AbstractScrollableNodeMoveEnd); }
void UI_RegisterFuncNode (uiBehaviour_t* behaviour) { behaviour->name = "func"; behaviour->isVirtual = true; behaviour->isFunction = true; behaviour->manager = UINodePtr(new uiFuncNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiFuncNode_t *"); }
void UI_RegisterTabNode (uiBehaviour_t* behaviour) { behaviour->name = "tab"; behaviour->extends = "abstractoption"; behaviour->manager = UINodePtr(new uiTabNode()); behaviour->drawItselfChild = true; behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiTabNode_t *"); }
void UI_RegisterItemNode (uiBehaviour_t* behaviour) { behaviour->name = "item"; behaviour->extends = "model"; behaviour->manager = UINodePtr(new uiItemNode()); /* Display an item like a container node do it */ UI_RegisterExtradataNodeProperty(behaviour, "containerlike", V_BOOL, modelExtraData_t, containerLike); }
void UI_RegisterTextureNode (uiBehaviour_t* behaviour) { behaviour->name = "texture"; behaviour->manager = UINodePtr(new uiTextureNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Source of the texture */ UI_RegisterNodeProperty(behaviour, "src", V_CVAR_OR_STRING, uiNode_t, image); }
void UI_RegisterCvarFuncNode (uiBehaviour_t *behaviour) { behaviour->name = "cvarlistener"; behaviour->isVirtual = true; behaviour->isFunction = true; behaviour->manager = UINodePtr(new uiCvarNode()); /* Force to bind the node to the cvar */ UI_RegisterNodeMethod(behaviour, "forceBind", UI_CvarListenerNodeForceBind); }
void UI_RegisterOptionListNode (uiBehaviour_t* behaviour) { behaviour->name = "optionlist"; behaviour->extends = "abstractoption"; behaviour->manager = UINodePtr(new uiOptionListNode()); behaviour->drawItselfChild = true; /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }
void UI_RegisterAbstractBaseNode (uiBehaviour_t *behaviour) { behaviour->name = "abstractbase"; behaviour->isAbstract = true; behaviour->manager = UINodePtr(new uiAbstractBaseNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Identify the base, from a base ID, the node use. */ UI_RegisterExtradataNodeProperty(behaviour, "baseid", V_INT, baseExtraData_t, baseid); }
void UI_RegisterContainerNode (uiBehaviour_t* behaviour) { behaviour->name = "container"; behaviour->manager = UINodePtr(new uiContainerNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Callback value set before calling onSelect. It is used to know the item selected */ UI_RegisterExtradataNodeProperty(behaviour, "lastselectedid", V_INT, containerExtraData_t, lastSelectedId); /* Callback event called when the user select an item */ UI_RegisterExtradataNodeProperty(behaviour, "onselect", V_UI_ACTION, containerExtraData_t, onSelect); }
void UI_RegisterVScrollbarNode (uiBehaviour_t* behaviour) { behaviour->name = "vscrollbar"; behaviour->extends = "abstractscrollbar"; behaviour->manager = UINodePtr(new uiVScrollbarNode()); /* Image to use. Each behaviour use it like they want. * @todo use V_REF_OF_STRING when its possible ('image' is never a cvar) */ UI_RegisterNodeProperty(behaviour, "image", V_CVAR_OR_STRING, uiNode_t, image); }
void UI_RegisterOptionTreeNode (uiBehaviour_t *behaviour) { behaviour->name = "optiontree"; behaviour->extends = "abstractoption"; behaviour->manager = UINodePtr(new uiOptionTreeNode()); behaviour->drawItselfChild = true; /* Call this to toggle the node status. */ UI_RegisterNodeMethod(behaviour, "setselectedvalue", UI_OptionTreeSetSelectedValue); /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }
void UI_RegisterMaterialEditorNode (uiBehaviour_t* behaviour) { behaviour->name = "material_editor"; behaviour->extends = "abstractscrollable"; behaviour->manager = UINodePtr(new uiMaterialEditorNode()); /** @todo convert it to ui functions */ Cmd_AddCommand("ui_materialeditor_removestage", UI_MaterialEditorRemoveStage_f, "Removes the selected material stage"); Cmd_AddCommand("ui_materialeditor_newstage", UI_MaterialEditorNewStage_f, "Creates a new material stage for the current selected material"); Cmd_AddCommand("ui_materialeditor_selectstage", UI_MaterialEditorSelectStage_f, "Select a given material stage"); Cmd_AddCommand("ui_materialeditor_changevalue", UI_MaterialEditorChangeValue_f, "Initializes the material editor window"); Cmd_AddCommand("ui_materialeditor", UI_MaterialEditorStart_f, "Initializes the material editor window"); }
void UI_RegisterLineChartNode (uiBehaviour_t *behaviour) { behaviour->name = "linechart"; behaviour->manager = UINodePtr(new uiLineChartNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Identity the shared data the node use. It must be a LINESTRIP data. */ UI_RegisterExtradataNodeProperty(behaviour, "dataid", V_UI_DATAID, lineChartExtraData_t, dataId); /* If true, it display axes of the chart. */ UI_RegisterExtradataNodeProperty(behaviour, "displayaxes", V_BOOL, lineChartExtraData_t, displayAxes); /* Axe color. */ UI_RegisterExtradataNodeProperty(behaviour, "axescolor", V_COLOR, lineChartExtraData_t, axesColor); }
void UI_RegisterTextNode (uiBehaviour_t* behaviour) { behaviour->name = "text"; behaviour->extends = "abstractscrollable"; behaviour->manager = UINodePtr(new uiTextNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Current selected line */ UI_RegisterExtradataNodeProperty(behaviour, "lineselected", V_INT, textExtraData_t, textLineSelected); /* Text of the current selected line */ UI_RegisterExtradataNodeProperty(behaviour, "textselected", V_CVAR_OR_STRING, textExtraData_t, textSelected); /* One of the list TEXT_STANDARD, TEXT_LIST, TEXT_UFOPEDIA, TEXT_BUILDINGS, * TEXT_BUILDING_INFO, TEXT_RESEARCH, TEXT_RESEARCH_INFO, TEXT_POPUP, * TEXT_POPUP_INFO, TEXT_AIRCRAFT_LIST, TEXT_AIRCRAFT, TEXT_AIRCRAFT_INFO, * TEXT_MESSAGESYSTEM, TEXT_CAMPAIGN_LIST, TEXT_MULTISELECTION. * There are more IDs in use - see ui_data.h for an up-to-date list. * Display a shared content registered by the client code. */ UI_RegisterExtradataNodeProperty(behaviour, "dataid", V_UI_DATAID, textExtraData_t, dataID); /* Size between two lines. Default value is 0, in this case it use a line height according to the font size. */ UI_RegisterExtradataNodeProperty(behaviour, "lineheight", V_INT, textExtraData_t, lineHeight); /* Bigger size of the width replacing a tab character. */ UI_RegisterExtradataNodeProperty(behaviour, "tabwidth", V_INT, textExtraData_t, tabWidth); /* What to do with text lines longer than node width. Default is to wordwrap them to make multiple lines. * It can be LONGLINES_WRAP, LONGLINES_CHOP, LONGLINES_PRETTYCHOP */ UI_RegisterExtradataNodeProperty(behaviour, "longlines", V_INT, textExtraData_t, longlines); /* Number of visible line we can display into the node height. * Currently, it translate the scrollable property <code>viewSize</code> * @todo For a smooth scroll we should split that */ UI_RegisterExtradataNodeProperty(behaviour, "rows", V_INT, textExtraData_t, super.scrollY.viewSize); /* Number of lines contained into the node. * Currently, it translate the scrollable property <code>fullSize</code> * @todo For a smooth scroll we should split that */ UI_RegisterExtradataNodeProperty(behaviour, "lines", V_INT, textExtraData_t, super.scrollY.fullSize); /** Highlight each node elements when the mouse move over the node. * @todo delete it when its possible (need to create a textlist...) */ UI_RegisterExtradataNodeProperty(behaviour, "mousefx", V_BOOL, textExtraData_t, mousefx); Com_RegisterConstInt("LONGLINES_WRAP", LONGLINES_WRAP); Com_RegisterConstInt("LONGLINES_CHOP", LONGLINES_CHOP); Com_RegisterConstInt("LONGLINES_PRETTYCHOP", LONGLINES_PRETTYCHOP); }
void UI_RegisterSequenceNode (uiBehaviour_t* behaviour) { localBehaviour = behaviour; behaviour->name = "sequence"; behaviour->manager = UINodePtr(new uiSequenceNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /** sequence script id */ propertySource = UI_RegisterExtradataNodeProperty(behaviour, "src", V_CVAR_OR_STRING, EXTRADATA_TYPE, source); /** Called when the sequence end */ UI_RegisterExtradataNodeProperty(behaviour, "onEnd", V_UI_ACTION, EXTRADATA_TYPE, onEnd); }
void UI_RegisterVideoNode (uiBehaviour_t* behaviour) { behaviour->name = "video"; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->manager = UINodePtr(new uiVideoNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiVideoNode_t *"); /** Source of the video. File name without prefix ./base/videos and without extension */ UI_RegisterExtradataNodeProperty(behaviour, "src", V_CVAR_OR_STRING, EXTRADATA_TYPE, source); /** Use or not the music from the video. */ UI_RegisterExtradataNodeProperty(behaviour, "nosound", V_BOOL, EXTRADATA_TYPE, nosound); /** Invoked when video end. */ UI_RegisterExtradataNodeProperty(behaviour, "onEnd", V_UI_ACTION, EXTRADATA_TYPE, onEnd); }
void UI_RegisterRowsNode (uiBehaviour_t* behaviour) { behaviour->name = "rows"; behaviour->manager = UINodePtr(new uiRowsNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /* Background color for odd elements */ UI_RegisterNodeProperty(behaviour, "color1", V_COLOR, uiNode_t, color); /* Background color for even elements */ UI_RegisterNodeProperty(behaviour, "color2", V_COLOR, uiNode_t, selectedColor); /* Element height */ UI_RegisterExtradataNodeProperty(behaviour, "lineheight", V_INT, rowsExtraData_t, lineHeight); /* Element number on the top of the list. It is used to scroll the node content. */ UI_RegisterExtradataNodeProperty(behaviour, "current", V_INT, rowsExtraData_t, current); }
void UI_RegisterBaseInventoryNode (uiBehaviour_t* behaviour) { behaviour->name = "baseinventory"; behaviour->extends = "container"; behaviour->manager = UINodePtr(new uiBaseInventoryNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiBaseInventoryNode_t *"); /* Display/hide weapons. */ UI_RegisterExtradataNodeProperty(behaviour, "displayweapon", V_BOOL, baseInventoryExtraData_t, displayWeapon); /* Display/hide ammo. */ UI_RegisterExtradataNodeProperty(behaviour, "displayammo", V_BOOL, baseInventoryExtraData_t, displayAmmo); /* Display/hide implants. */ UI_RegisterExtradataNodeProperty(behaviour, "displayimplant", V_BOOL, baseInventoryExtraData_t, displayImplant); /* Display/hide out of stock items. */ UI_RegisterExtradataNodeProperty(behaviour, "displayunavailableitem", V_BOOL, baseInventoryExtraData_t, displayUnavailableItem); /* Sort the list to display in stock items on top of the list. */ UI_RegisterExtradataNodeProperty(behaviour, "displayavailableontop", V_BOOL, baseInventoryExtraData_t, displayAvailableOnTop); /* Display/hide ammo near weapons. */ UI_RegisterExtradataNodeProperty(behaviour, "displayammoofweapon", V_BOOL, baseInventoryExtraData_t, displayAmmoOfWeapon); /* Display/hide out of stock ammo near weapons. <code>displayammoofweapon</code> must be activated first. */ UI_RegisterExtradataNodeProperty(behaviour, "displayunavailableammoofweapon", V_BOOL, baseInventoryExtraData_t, displayUnavailableAmmoOfWeapon); /* Custom the number of column we must use to display items. */ UI_RegisterExtradataNodeProperty(behaviour, "columns", V_INT, baseInventoryExtraData_t, columns); /* Filter items by a category. */ UI_RegisterExtradataNodeProperty(behaviour, "filter", V_INT, baseInventoryExtraData_t, filterEquipType); /* Position of the vertical view (into the full number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "viewpos", V_INT, baseInventoryExtraData_t, scrollY.viewPos); /* Size of the vertical view (proportional to the number of elements the node can display without moving) */ UI_RegisterExtradataNodeProperty(behaviour, "viewsize", V_INT, baseInventoryExtraData_t, scrollY.viewSize); /* Full vertical size (proportional to the number of elements the node contain) */ UI_RegisterExtradataNodeProperty(behaviour, "fullsize", V_INT, baseInventoryExtraData_t, scrollY.fullSize); /* Called when one of the properties viewpos/viewsize/fullsize change */ UI_RegisterExtradataNodeProperty(behaviour, "onviewchange", V_UI_ACTION, baseInventoryExtraData_t, onViewChange); Com_RegisterConstInt("FILTER_S_PRIMARY", FILTER_S_PRIMARY); Com_RegisterConstInt("FILTER_S_SECONDARY", FILTER_S_SECONDARY); Com_RegisterConstInt("FILTER_S_HEAVY", FILTER_S_HEAVY); Com_RegisterConstInt("FILTER_S_IMPLANT", FILTER_S_IMPLANT); Com_RegisterConstInt("FILTER_S_MISC", FILTER_S_MISC); Com_RegisterConstInt("FILTER_S_ARMOUR", FILTER_S_ARMOUR); Com_RegisterConstInt("FILTER_CRAFTITEM", FILTER_CRAFTITEM); Com_RegisterConstInt("FILTER_UGVITEM", FILTER_UGVITEM); Com_RegisterConstInt("FILTER_AIRCRAFT", FILTER_AIRCRAFT); Com_RegisterConstInt("FILTER_DUMMY", FILTER_DUMMY); Com_RegisterConstInt("FILTER_DISASSEMBLY", FILTER_DISASSEMBLY); }
void UI_RegisterAbstractScrollbarNode (uiBehaviour_t* behaviour) { behaviour->name = "abstractscrollbar"; behaviour->isAbstract = true; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->manager = UINodePtr(new uiAbstractScrollbarNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiAbstractScrollbarNode_t *"); /* Current position of the scroll. Image of the <code>viewpos</code> from <code>abstractscrollable</code> node. */ UI_RegisterExtradataNodeProperty(behaviour, "current", V_INT, EXTRADATA_TYPE, pos); /* Image of the <code>viewsize</code> from <code>abstractscrollable</code> node. */ UI_RegisterExtradataNodeProperty(behaviour, "viewsize", V_INT, EXTRADATA_TYPE, viewsize); /* Image of the <code>fullsize</code> from <code>abstractscrollable</code> node. */ UI_RegisterExtradataNodeProperty(behaviour, "fullsize", V_INT, EXTRADATA_TYPE, fullsize); /* If true, hide the scroll when the position is 0 and can't change (when <code>viewsize</code> >= <code>fullsize</code>). */ UI_RegisterExtradataNodeProperty(behaviour, "hidewhenunused", V_BOOL, EXTRADATA_TYPE, hideWhenUnused); }
void UI_RegisterCheckBoxNode (uiBehaviour_t *behaviour) { behaviour->name = "checkbox"; behaviour->extends = "abstractvalue"; behaviour->manager = UINodePtr(new uiCheckBoxNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); /** Sprite used as an icon for checked state */ UI_RegisterExtradataNodeProperty(behaviour, "iconChecked", V_UI_SPRITEREF, EXTRADATA_TYPE, iconChecked); /** Sprite used as an icon for unchecked state */ UI_RegisterExtradataNodeProperty(behaviour, "iconUnchecked", V_UI_SPRITEREF, EXTRADATA_TYPE, iconUnchecked); /** Sprite used as an icon for indeterminate state */ UI_RegisterExtradataNodeProperty(behaviour, "iconIndeterminate", V_UI_SPRITEREF, EXTRADATA_TYPE, iconIndeterminate); /** Sprite used as a background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); /* Call it to toggle the node status. */ UI_RegisterNodeMethod(behaviour, "toggle", UI_CheckBoxNodeCallActivate); }
void UI_RegisterDataNode (uiBehaviour_t* behaviour) { behaviour->name = "data"; behaviour->isVirtual = true; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->manager = UINodePtr(new uiDataNode()); /* Store a string into the node. * @note you should note store a cvar ref * @todo use a REF_STRING when it is possible */ UI_RegisterOveridedNodeProperty(behaviour, "string"); /* Store a float number into the node. */ UI_RegisterExtradataNodeProperty(behaviour, "number", V_FLOAT, EXTRADATA_TYPE, number); /* Store a integer number into the node. */ UI_RegisterExtradataNodeProperty(behaviour, "integer", V_INT, EXTRADATA_TYPE, number); }
void UI_RegisterEditorNode (uiBehaviour_t* behaviour) { behaviour->name = "editor"; behaviour->manager = UINodePtr(new uiEditorNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiEditorNode_t *"); /* start edition mode */ UI_RegisterNodeMethod(behaviour, "start", UI_EditorNodeStart); /* stop edition mode */ UI_RegisterNodeMethod(behaviour, "stop", UI_EditorNodeStop); /* select the next node (according to the current one) */ UI_RegisterNodeMethod(behaviour, "selectnext", UI_EditorNodeSelectNext); /* select the parent node (according to the current one) */ UI_RegisterNodeMethod(behaviour, "selectparent", UI_EditorNodeSelectParent); /* select first child node (according to the current one) */ UI_RegisterNodeMethod(behaviour, "selectfirstchild", UI_EditorNodeSelectFirstChild); Cmd_AddCommand("ui_extract", UI_EditorNodeExtract_f, "Extract position and size of nodes into a file"); Cmd_AddParamCompleteFunction("ui_extract", UI_CompleteWithWindow); }
void UI_RegisterRadioButtonNode (uiBehaviour_t* behaviour) { behaviour->name = "radiobutton"; behaviour->manager = UINodePtr(new uiRadioButtonNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiRadioButtonNode_t *"); /* Numerical value defining the radiobutton. Cvar is updated with this value when the radio button is selected. */ UI_RegisterExtradataNodeProperty(behaviour, "value", V_FLOAT, EXTRADATA_TYPE, value); /* String Value defining the radiobutton. Cvar is updated with this value when the radio button is selected. */ UI_RegisterExtradataNodeProperty(behaviour, "stringValue", V_CVAR_OR_STRING, EXTRADATA_TYPE, string); /* Cvar name shared with the radio button group to identify when a radio button is selected. */ UI_RegisterExtradataNodeProperty(behaviour, "cvar", V_UI_CVAR, EXTRADATA_TYPE, cvar); /* Icon used to display the node */ UI_RegisterExtradataNodeProperty(behaviour, "icon", V_UI_SPRITEREF, EXTRADATA_TYPE, icon); UI_RegisterExtradataNodeProperty(behaviour, "flipicon", V_BOOL, EXTRADATA_TYPE, flipIcon); /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }