UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_editor.cpp File Reference

Editor is an invisible node used to create an edition mode. The edition mode allow user to move and resize all visible nodes. More...

#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_draw.h"
#include "../ui_input.h"
#include "../ui_nodes.h"
#include "../ui_windows.h"
#include "../ui_render.h"
#include "../ui_actions.h"
#include "ui_node_editor.h"
#include "ui_node_abstractnode.h"
#include "../../input/cl_keys.h"
#include "../../input/cl_input.h"
#include "../../../common/scripts_lua.h"
Include dependency graph for ui_node_editor.cpp:

Go to the source code of this file.

Enumerations

enum  zoneNode_t {
  ZONE_NONE = -1 , ZONE_TOPRIGHT_CORNER , ZONE_TOPLEFT_CORNER , ZONE_BOTTOMRIGHT_CORNER ,
  ZONE_BOTTOMLEFT_CORNER , ZONE_BODY
}

Functions

static void UI_EditorNodeHighlightNode (uiNode_t *node, const vec4_t color, bool displayAnchor)
static zoneNode_t UI_EditorNodeGetElementAtPosition (uiNode_t *node, int x, int y)
static void UI_EditorNodeSelectNode (uiNode_t *node, uiNode_t *selected)
static void UI_EditorNodeStart (uiNode_t *node, const uiCallContext_t *context)
static void UI_EditorNodeStop (uiNode_t *node, const uiCallContext_t *context)
static void UI_EditorNodeSelectNext (uiNode_t *node, const uiCallContext_t *context)
static void UI_EditorNodeSelectParent (uiNode_t *node, const uiCallContext_t *context)
static void UI_EditorNodeSelectFirstChild (uiNode_t *node, const uiCallContext_t *context)
static void UI_EditorNodeExtractNode (qFILE *file, uiNode_t *node, int depth)
static void UI_EditorNodeExtract_f (void)
void UI_RegisterEditorNode (uiBehaviour_t *behaviour)

Variables

static uiNode_tanchoredNode = nullptr
static const vec4_t red = {1.0, 0.0, 0.0, 1.0}
static const vec4_t grey = {0.8, 0.8, 0.8, 1.0}
static const int anchorSize = 10
static zoneNode_t dragStatus = ZONE_NONE
static int startX
static int startY

Detailed Description

Editor is an invisible node used to create an edition mode. The edition mode allow user to move and resize all visible nodes.

Note
type "ui_push editor" to use it, Escape button to close it, and "ui_extract" to extract a window to a script

Definition in file ui_node_editor.cpp.

Enumeration Type Documentation

◆ zoneNode_t

enum zoneNode_t
Enumerator
ZONE_NONE 
ZONE_TOPRIGHT_CORNER 
ZONE_TOPLEFT_CORNER 
ZONE_BOTTOMRIGHT_CORNER 
ZONE_BOTTOMLEFT_CORNER 
ZONE_BODY 

Definition at line 45 of file ui_node_editor.cpp.

Function Documentation

◆ UI_EditorNodeExtract_f()

void UI_EditorNodeExtract_f ( void )
static
Note
not moved into V_UI_NODEMETHOD because it is more a generic tool than a method of the node editor

Definition at line 330 of file ui_node_editor.cpp.

References Cmd_Argc(), Cmd_Argv(), Com_Printf(), FILE_WRITE, FS_OpenFile(), uiNode_t::name, UI_EditorNodeExtractNode(), UI_GetWindow(), and va().

Referenced by UI_RegisterEditorNode().

◆ UI_EditorNodeExtractNode()

◆ UI_EditorNodeGetElementAtPosition()

◆ UI_EditorNodeHighlightNode()

void UI_EditorNodeHighlightNode ( uiNode_t * node,
const vec4_t color,
bool displayAnchor )
static

◆ UI_EditorNodeSelectFirstChild()

void UI_EditorNodeSelectFirstChild ( uiNode_t * node,
const uiCallContext_t * context )
static

Definition at line 283 of file ui_node_editor.cpp.

References anchoredNode, dragStatus, UI_EditorNodeSelectNode(), and ZONE_NONE.

Referenced by UI_RegisterEditorNode().

◆ UI_EditorNodeSelectNext()

void UI_EditorNodeSelectNext ( uiNode_t * node,
const uiCallContext_t * context )
static

Definition at line 265 of file ui_node_editor.cpp.

References anchoredNode, dragStatus, UI_EditorNodeSelectNode(), and ZONE_NONE.

Referenced by UI_RegisterEditorNode().

◆ UI_EditorNodeSelectNode()

void UI_EditorNodeSelectNode ( uiNode_t * node,
uiNode_t * selected )
static

◆ UI_EditorNodeSelectParent()

void UI_EditorNodeSelectParent ( uiNode_t * node,
const uiCallContext_t * context )
static

Definition at line 274 of file ui_node_editor.cpp.

References anchoredNode, dragStatus, UI_EditorNodeSelectNode(), and ZONE_NONE.

Referenced by UI_RegisterEditorNode().

◆ UI_EditorNodeStart()

void UI_EditorNodeStart ( uiNode_t * node,
const uiCallContext_t * context )
static

Definition at line 255 of file ui_node_editor.cpp.

References UI_SetMouseCapture().

Referenced by UI_RegisterEditorNode().

◆ UI_EditorNodeStop()

void UI_EditorNodeStop ( uiNode_t * node,
const uiCallContext_t * context )
static

Definition at line 260 of file ui_node_editor.cpp.

References UI_MouseRelease().

Referenced by UI_RegisterEditorNode().

◆ UI_RegisterEditorNode()

Variable Documentation

◆ anchoredNode

◆ anchorSize

const int anchorSize = 10
static

◆ dragStatus

◆ grey

const vec4_t grey = {0.8, 0.8, 0.8, 1.0}
static

Definition at line 57 of file ui_node_editor.cpp.

Referenced by uiEditorNode::drawOverWindow().

◆ red

const vec4_t red = {1.0, 0.0, 0.0, 1.0}
static

Definition at line 56 of file ui_node_editor.cpp.

◆ startX

◆ startY