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()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiAbstractOptionNode_t *"); /** 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_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_RegisterTextEntryNode (uiBehaviour_t* behaviour) { behaviour->name = "textentry"; behaviour->manager = UINodePtr(new uiTextEntryNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiTextEntryNode_t *"); /* 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_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_RegisterTextureNode (uiBehaviour_t* behaviour) { behaviour->name = "texture"; behaviour->manager = UINodePtr(new uiTextureNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiTextureNode_t *"); /* Source of the texture */ UI_RegisterNodeProperty(behaviour, "src", V_CVAR_OR_STRING, uiNode_t, image); }
void UI_RegisterAbstractBaseNode (uiBehaviour_t* behaviour) { behaviour->name = "abstractbase"; behaviour->isAbstract = true; behaviour->manager = UINodePtr(new uiAbstractBaseNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiAbstractBaseNode_t *"); /* Identify the base, from a base ID, the node use. */ UI_RegisterExtradataNodeProperty(behaviour, "baseid", V_INT, baseExtraData_t, baseid); }
void UI_RegisterCvarFuncNode (uiBehaviour_t* behaviour) { behaviour->name = "cvarlistener"; behaviour->isVirtual = true; behaviour->isFunction = true; behaviour->manager = UINodePtr(new uiCvarNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiCvarListenerNode_t *"); /* 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; behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiOptionListNode_t *"); /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }
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_RegisterSequenceNode (uiBehaviour_t* behaviour) { localBehaviour = behaviour; behaviour->name = "sequence"; behaviour->manager = UINodePtr(new uiSequenceNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiSequenceNode_t *"); /** 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_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_RegisterRowsNode (uiBehaviour_t* behaviour) { behaviour->name = "rows"; behaviour->manager = UINodePtr(new uiRowsNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiRowsNode_t *"); /* 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_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_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); }
void UI_RegisterDataNode (uiBehaviour_t* behaviour) { behaviour->name = "data"; behaviour->isVirtual = true; behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->manager = UINodePtr(new uiDataNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiDataNode_t *"); /* 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_RegisterBarNode (uiBehaviour_t* behaviour) { behaviour->name = "bar"; behaviour->extends = "abstractvalue"; behaviour->manager = UINodePtr(new uiBarNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiBarNode_t *"); /** * Orientation of the bar. Default value "cr". Other available values are "uc", "lc", "cr", "cl" */ UI_RegisterExtradataNodeProperty(behaviour, "direction", V_ALIGN, EXTRADATA_TYPE, orientation); /** * if true, the user can't edit the content */ UI_RegisterExtradataNodeProperty(behaviour, "readonly", V_BOOL, EXTRADATA_TYPE, readOnly); /** * there is no hover effect if this is true */ UI_RegisterExtradataNodeProperty(behaviour, "nohover", V_BOOL, EXTRADATA_TYPE, noHover); }
void UI_RegisterWindowNode (uiBehaviour_t* behaviour) { behaviour->name = "window"; behaviour->manager = UINodePtr(new uiWindowNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiWindowNode_t *"); /* In windows where notify messages appear (like e.g. the video options window when you have to restart the game until * the settings take effects) you can define the position of those messages with this option. */ UI_RegisterExtradataNodeProperty(behaviour, "noticepos", V_POS, windowExtraData_t, noticePos); /* Create subnode allowing to move the window when we click on the header. Updating this attribute at runtime will change nothing. */ UI_RegisterExtradataNodeProperty(behaviour, "dragbutton", V_BOOL, windowExtraData_t, dragButton); /* Add a button on the top right the window to close it. Updating this attribute at runtime will change nothing. */ UI_RegisterExtradataNodeProperty(behaviour, "closebutton", V_BOOL, windowExtraData_t, closeButton); /* If true, the user can't select something outside the modal window. He must first close the window. */ UI_RegisterExtradataNodeProperty(behaviour, "modal", V_BOOL, windowExtraData_t, modal); /* If true, the window will be closed if the user clicks outside of the window. */ UI_RegisterExtradataNodeProperty(behaviour, "dropdown", V_BOOL, windowExtraData_t, dropdown); /* If true, the user can't use ''ESC'' key to close the window. */ UI_RegisterExtradataNodeProperty(behaviour, "preventtypingescape", V_BOOL, windowExtraData_t, preventTypingEscape); /* If true, the window is filled according to the widescreen. */ UI_RegisterExtradataNodeProperty(behaviour, "fill", V_BOOL, windowExtraData_t, fill); /* If true, the window content position is updated according to the "star" layout when the window size change. * @todo Need more documentation. */ UI_RegisterExtradataNodeProperty(behaviour, "starlayout", V_BOOL, windowExtraData_t, starLayout); /* Invoked when the window is added to the rendering stack. */ UI_RegisterExtradataNodeProperty(behaviour, "onWindowOpened", V_UI_ACTION, windowExtraData_t, onWindowOpened); /* Invoked when the window is removed from the rendering stack. */ UI_RegisterExtradataNodeProperty(behaviour, "onWindowClosed", V_UI_ACTION, windowExtraData_t, onWindowClosed); /* Called when a windows gets active again after some other window was popped from the stack. */ UI_RegisterExtradataNodeProperty(behaviour, "onWindowActivate", V_UI_ACTION, windowExtraData_t, onWindowActivate); /* Invoked after all UI scripts are loaded. */ UI_RegisterExtradataNodeProperty(behaviour, "onScriptLoaded", V_UI_ACTION, windowExtraData_t, onScriptLoaded); /* Sprite used to display the background */ UI_RegisterExtradataNodeProperty(behaviour, "background", V_UI_SPRITEREF, EXTRADATA_TYPE, background); }
void UI_RegisterGeoscapeNode (uiBehaviour_t* behaviour) { behaviour->name = "geoscape"; behaviour->manager = UINodePtr(new uiGeoscapeNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiGeoscapeNode_t *"); /* Use a right padding. */ UI_RegisterExtradataNodeProperty(behaviour, "padding-right", V_FLOAT, EXTRADATA_TYPE, paddingRight); /* Call it to zoom out of the map */ UI_RegisterNodeMethod(behaviour, "zoomin", UI_GeoscapeNodeZoomIn); /* Call it to zoom into the map */ UI_RegisterNodeMethod(behaviour, "zoomout", UI_GeoscapeNodeZoomOut); Cmd_AddCommand("map_zoom", UI_GeoscapeNodeZoom_f); Cmd_AddCommand("map_scroll", UI_GeoscapeNodeScroll_f); cl_3dmap = Cvar_Get("cl_3dmap", "1", CVAR_ARCHIVE, "3D geoscape or flat geoscape"); cl_3dmapAmbient = Cvar_Get("cl_3dmapAmbient", "0", CVAR_ARCHIVE, "3D geoscape ambient lighting factor"); cl_mapzoommax = Cvar_Get("cl_mapzoommax", "6.0", CVAR_ARCHIVE, "Maximum geoscape zooming value"); cl_mapzoommin = Cvar_Get("cl_mapzoommin", "1.0", CVAR_ARCHIVE, "Minimum geoscape zooming value"); }
void UI_RegisterImageNode (uiBehaviour_t* behaviour) { /** @todo rename it according to the function name when its possible */ behaviour->name = "image"; behaviour->manager = UINodePtr(new uiImageNode()); behaviour->extraDataSize = sizeof(EXTRADATA_TYPE); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiImageNode_t *"); /* Do not change the image ratio. The image will be proportionally stretched. */ UI_RegisterExtradataNodeProperty(behaviour, "preventratio", V_BOOL, EXTRADATA_TYPE, preventRatio); /* Now this property do nothing. But we use it like a tag, to remember nodes we should convert into button... * @todo delete it when its possible (use more button instead of image) */ UI_RegisterExtradataNodeProperty(behaviour, "mousefx", V_BOOL, EXTRADATA_TYPE, mousefx); /* Texture high. Optional. Define the higher corner of the texture we want to display. Used with texl to crop the image. */ UI_RegisterExtradataNodeProperty(behaviour, "texh", V_POS, EXTRADATA_TYPE, texh); /* Texture low. Optional. Define the lower corner of the texture we want to display. Used with texh to crop the image. */ UI_RegisterExtradataNodeProperty(behaviour, "texl", V_POS, EXTRADATA_TYPE, texl); /* Source of the image */ //UI_RegisterExtradataNodeProperty(behaviour, "src", V_CVAR_OR_STRING, EXTRADATA_TYPE, image); UI_RegisterNodeProperty(behaviour, "src", V_CVAR_OR_STRING, uiNode_t, image); }
void UI_RegisterAbstractNode (uiBehaviour_t* behaviour) { behaviour->name = "abstractnode"; behaviour->isAbstract = true; behaviour->manager = UINodePtr(new uiLocatedNode()); behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiNode_t *"); /* Top-left position of the node */ UI_RegisterNodeProperty(behaviour, "pos", V_POS, uiNode_t, box.pos); /* Size of the node */ propertySize = UI_RegisterNodeProperty(behaviour, "size", V_POS, uiNode_t, box.size); /* Width of the node (see also <code>size</code>) */ propertyWidth = UI_RegisterNodeProperty(behaviour, "width", V_FLOAT, uiNode_t, box.size[0]); /* Height of the node (see also <code>size</code>) */ propertyHeight = UI_RegisterNodeProperty(behaviour, "height", V_FLOAT, uiNode_t, box.size[1]); /* Left position of the node (see also <code>pos</code>) */ UI_RegisterNodeProperty(behaviour, "left", V_FLOAT, uiNode_t, box.pos[0]); /* Top position of the node (see also <code>pos</code>) */ UI_RegisterNodeProperty(behaviour, "top", V_FLOAT, uiNode_t, box.pos[1]); /* If true, the node name is indexed into the window. We can access to the node with * the path "windowName#nodeName" */ UI_RegisterNodeProperty(behaviour, "indexed", V_BOOL, uiNode_t, indexed); /* If true, the node is not displayed nor or activatable. */ propertyInvis = UI_RegisterNodeProperty(behaviour, "invis", V_BOOL, uiNode_t, invis); /* If true, the node is disabled. Few nodes support it, fell free to request an update. */ UI_RegisterNodeProperty(behaviour, "disabled", V_BOOL, uiNode_t, disabled); /* Text color the node will use when something is disabled. */ UI_RegisterNodeProperty(behaviour, "disabledcolor", V_COLOR, uiNode_t, disabledColor); /* If true, the node is not ''tangible''. We click through it, then it will not receive mouse event. */ UI_RegisterNodeProperty(behaviour, "ghost", V_BOOL, uiNode_t, ghost); /* Flashing effect. */ UI_RegisterNodeProperty(behaviour, "flash", V_BOOL, uiNode_t, flash); /* Speed of the flashing effect */ UI_RegisterNodeProperty(behaviour, "flashspeed", V_FLOAT, uiNode_t, flashSpeed); /* Border size we want to display. */ UI_RegisterNodeProperty(behaviour, "border", V_INT, uiNode_t, border); /* Padding size we want to use. Few node support it. */ UI_RegisterNodeProperty(behaviour, "padding", V_INT, uiNode_t, padding); /* Background color we want to display. */ UI_RegisterNodeProperty(behaviour, "bgcolor", V_COLOR, uiNode_t, bgcolor); /* Border color we want to display. */ UI_RegisterNodeProperty(behaviour, "bordercolor", V_COLOR, uiNode_t, bordercolor); /* * Used to set the position of the node when the parent use a layout manager. * Else it do nothing. * Available values are: LAYOUTALIGN_TOPLEFT, LAYOUTALIGN_TOP, LAYOUTALIGN_TOPRIGHT, * LAYOUTALIGN_LEFT, LAYOUTALIGN_MIDDLE, LAYOUTALIGN_RIGHT, LAYOUTALIGN_BOTTOMLEFT, * LAYOUTALIGN_BOTTOM, LAYOUTALIGN_BOTTOMRIGHT, LAYOUTALIGN_FILL. * Allowed value depend the layout manager used. The update to date list is into * ui_node_panel.c * @image html http://ufoai.org/wiki/images/Layout.png */ UI_RegisterNodeProperty(behaviour, "align", V_INT, uiNode_t, align); /* * Used share an int, only used by 1 behaviour * @todo move it to the right behaviour, delete it */ UI_RegisterNodeProperty(behaviour, "num", V_INT, uiNode_t, num); /* Tooltip we want to use. */ UI_RegisterNodeProperty(behaviour, "tooltip", V_CVAR_OR_LONGSTRING, uiNode_t, tooltip); /* Text the node will display. */ UI_RegisterNodeProperty(behaviour, "string", V_CVAR_OR_LONGSTRING, uiNode_t, text); /* Text font the node will use. * @todo use V_REF_OF_STRING when its possible ('font' is never a cvar). */ UI_RegisterNodeProperty(behaviour, "font", V_CVAR_OR_STRING, uiNode_t, font); /* Text color the node will use. */ UI_RegisterNodeProperty(behaviour, "color", V_COLOR, uiNode_t, color); /* Text color the node will use when something is selected. */ UI_RegisterNodeProperty(behaviour, "selectcolor", V_COLOR, uiNode_t, selectedColor); /* Flashing color */ UI_RegisterNodeProperty(behaviour, "flashcolor", V_COLOR, uiNode_t, flashColor); /* Alignement of the text into the node, or elements into blocks. */ UI_RegisterNodeProperty(behaviour, "contentalign", V_UI_ALIGN, uiNode_t, contentAlign); /* When <code>invis</code> property is false (default value); * this condition say if the node is visible or not. It use a script expression. */ UI_RegisterNodeProperty(behaviour, "visiblewhen", V_UI_IF, uiNode_t, visibilityCondition); /* Called when the user click with left button into the node. */ UI_RegisterNodeProperty(behaviour, "onclick", V_UI_ACTION, uiNode_t, onClick); /* Called when the user click with right button into the node. */ UI_RegisterNodeProperty(behaviour, "onrclick", V_UI_ACTION, uiNode_t, onRightClick); /* Called when the user click with middle button into the node. */ UI_RegisterNodeProperty(behaviour, "onmclick", V_UI_ACTION, uiNode_t, onMiddleClick); /* Called when the user use the mouse wheel over the node. */ UI_RegisterNodeProperty(behaviour, "onwheel", V_UI_ACTION, uiNode_t, onWheel); /* Called when the user use the mouse wheel up over the node. */ UI_RegisterNodeProperty(behaviour, "onwheelup", V_UI_ACTION, uiNode_t, onWheelUp); /* Called when the user use the mouse wheel down over the node. */ UI_RegisterNodeProperty(behaviour, "onwheeldown", V_UI_ACTION, uiNode_t, onWheelDown); /* Called when the mouse enter over the node. */ UI_RegisterNodeProperty(behaviour, "onmouseenter", V_UI_ACTION, uiNode_t, onMouseEnter); /* Called when the mouse go out of the node. */ UI_RegisterNodeProperty(behaviour, "onmouseleave", V_UI_ACTION, uiNode_t, onMouseLeave); /* Called when the internal content of the nde change. Each behaviour use it how they need it. * @todo Move it where it is need. */ UI_RegisterNodeProperty(behaviour, "onchange", V_UI_ACTION, uiNode_t, onChange); /* Special attribute only use into the node description to exclude part of the node * (see also <code>ghost</code>). Rectangle position is relative to the node. */ UI_RegisterNodeProperty(behaviour, "excluderect", V_UI_EXCLUDERECT, uiNode_t, firstExcludeRect); /* Remove all child from the node (only dynamic allocated nodes). */ UI_RegisterNodeMethod(behaviour, "removeallchild", UI_AbstractNodeCallRemovaAllChild); /* Create a new child with name and type. */ UI_RegisterNodeMethod(behaviour, "createchild", UI_AbstractNodeCallCreateChild); /* Delete the node and remove it from his parent. */ UI_RegisterNodeMethod(behaviour, "delete", UI_AbstractNodeCallDelete); /* Delete the node in x ms and remove it from his parent. */ UI_RegisterNodeMethod(behaviour, "deletetimed", UI_AbstractNodeCallDeleteTimed); /** @todo move it into common? */ Com_RegisterConstInt("ALIGN_UL", ALIGN_UL); Com_RegisterConstInt("ALIGN_UC", ALIGN_UC); Com_RegisterConstInt("ALIGN_UR", ALIGN_UR); Com_RegisterConstInt("ALIGN_CL", ALIGN_CL); Com_RegisterConstInt("ALIGN_CC", ALIGN_CC); Com_RegisterConstInt("ALIGN_CR", ALIGN_CR); Com_RegisterConstInt("ALIGN_LL", ALIGN_LL); Com_RegisterConstInt("ALIGN_LC", ALIGN_LC); Com_RegisterConstInt("ALIGN_LR", ALIGN_LR); /* some commands */ #ifdef DEBUG Cmd_AddCommand("debug_mnsetnodeproperty", UI_NodeSetProperty_f, "Set a node property"); Cmd_AddCommand("debug_mngetnodeproperty", UI_NodeGetProperty_f, "Get a node property"); #endif }
void UI_RegisterNullNode (uiBehaviour_t* behaviour) { behaviour->name = ""; behaviour->isVirtual = true; behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiNullNode_t *"); }