UFO: Alien Invasion
|
#include "ui_main.h"
#include "ui_internal.h"
#include "ui_input.h"
#include "ui_node.h"
#include "ui_popup.h"
#include "node/ui_node_abstractnode.h"
#include "node/ui_node_window.h"
#include "node/ui_node_battlescape.h"
#include "../cl_video.h"
#include "../input/cl_input.h"
#include "../input/cl_keys.h"
Go to the source code of this file.
Macros | |
#define | WINDOWEXTRADATA(node) UI_EXTRADATA(node, windowExtraData_t) |
#define | WINDOWEXTRADATACONST(node) UI_EXTRADATACONST(node, windowExtraData_t) |
Functions | |
int | UI_GetLastFullScreenWindow (void) |
Returns the ID of the last fullscreen ID. Before this, window should be hidden. More... | |
void | UI_MoveWindowOnTop (uiNode_t *window) |
Move the window on top of compatible windows. "Compatible" mean non full screen windows, and windows with the same window parent. More... | |
static void | UI_DeleteWindowFromStack (uiNode_t *window) |
Remove the window from the window stack. More... | |
static int | UI_GetWindowPositionFromStackByName (const char *name) |
Searches the position in the current window stack for a given window id. More... | |
static void | UI_InsertWindowIntoStack (uiNode_t *window, int position) |
Insert a window at a position of the stack. More... | |
uiNode_t * | UI_PushWindow (const char *name, const char *parentName, linkedList_t *params) |
Push a window onto the window stack. More... | |
int | UI_CompleteWithWindow (const char *partial, const char **match) |
Complete function for ui_push. More... | |
static void | UI_PushChildWindow_f (void) |
Console function to push a child window onto the window stack. More... | |
static void | UI_PushWindow_f (void) |
Console function to push a window onto the window stack. More... | |
static void | UI_PushDropDownWindow_f (void) |
Console function to push a dropdown window at a position. It work like UI_PushWindow but move the window at the right position. More... | |
static void | UI_RemoveWindowAtPositionFromStack (int position) |
static void | UI_CloseAllWindow (void) |
void | UI_InitStack (const char *activeWindow, const char *mainWindow) |
Init the stack to start with a window, and have an alternative window with ESC. More... | |
bool | UI_IsWindowOnStack (const char *name) |
Check if a named window is on the stack if active windows. More... | |
static void | UI_CloseWindowByRef (uiNode_t *window) |
void | UI_CloseWindow (const char *name) |
void | UI_PopWindow (bool all) |
Pops a window from the window stack. More... | |
static void | UI_CloseWindow_f (void) |
Console function to close a named window. More... | |
void | UI_PopWindowWithEscKey (void) |
static void | UI_PopWindow_f (void) |
Console function to pop a window from the window stack. More... | |
uiNode_t * | UI_GetActiveWindow (void) |
Returns the current active window from the window stack or nullptr if there is none. More... | |
const char * | UI_GetActiveWindowName (void) |
Returns the name of the current window. More... | |
bool | UI_IsMouseOnWindow (void) |
Check if a point is over a window from the stack. More... | |
uiNode_t * | UI_GetWindow (const char *name) |
Searches all windows for the specified one. More... | |
void | UI_InvalidateStack (void) |
Invalidate all windows of the current stack. More... | |
void | UI_SetNewWindowPos (uiNode_t *window, int x, int y) |
Sets new x and y coordinates for a given window. More... | |
void | UI_InsertWindow (uiNode_t *window) |
Add a new window to the list of all windows. More... | |
void | UI_RemoveWindow (uiNode_t *window) |
Removes a window from the list of all windows. More... | |
void | UI_FinishWindowsInit (void) |
Finish windows initialization. More... | |
static void | UI_InitStack_f (void) |
static void | UI_DebugTree (const uiNode_t *node, int depth) |
Display in the conde the tree of nodes. More... | |
static void | UI_DebugTree_f (void) |
static void | UI_Popup_f (void) |
static void | UI_DebugListWindows_f (void) |
Debug function to list all UI windows. More... | |
void | UI_InitWindows (void) |
Variables | |
static cvar_t * | ui_sys_main |
Window name use as alternative for option. More... | |
static cvar_t * | ui_sys_active |
Main window of a stack. More... | |
#define WINDOWEXTRADATA | ( | node | ) | UI_EXTRADATA(node, windowExtraData_t) |
Definition at line 38 of file ui_windows.cpp.
Referenced by UI_CloseAllWindow(), UI_CloseWindowByRef(), UI_FinishWindowsInit(), UI_IsMouseOnWindow(), UI_MoveWindowOnTop(), UI_PopWindow(), and UI_PushWindow().
#define WINDOWEXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, windowExtraData_t) |
Definition at line 39 of file ui_windows.cpp.
Referenced by UI_PopWindowWithEscKey().
Definition at line 332 of file ui_windows.cpp.
References i, ui_global, UI_Node_WindowClosed(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_PopWindow().
void UI_CloseWindow | ( | const char * | name | ) |
Definition at line 435 of file ui_windows.cpp.
References Com_Printf(), UI_CloseWindowByRef(), and UI_GetWindow().
Referenced by CL_BattlescapeRadarClose_f(), CL_GetTipOfTheDay_f(), CL_HudRadarUp_f(), and UI_CloseWindow_f().
Console function to close a named window.
Definition at line 473 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and UI_CloseWindow().
Referenced by UI_InitWindows().
Definition at line 381 of file ui_windows.cpp.
References Com_Printf(), i, m, uiNode_t::name, Q_streq, cvar_s::string, UI_GetActiveWindow(), UI_GetWindowPositionFromStackByName(), ui_global, UI_InvalidateMouse(), UI_Node_WindowActivate(), UI_Node_WindowClosed(), UI_PushWindow(), UI_ReleaseInput(), UI_RemoveWindowAtPositionFromStack(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_CloseWindow(), and UI_PopWindow().
int UI_CompleteWithWindow | ( | const char * | partial, |
const char ** | match | ||
) |
Complete function for ui_push.
Definition at line 211 of file ui_windows.cpp.
References Cmd_GenericCompleteFunction(), Com_Printf(), i, name, uiGlobal_s::numWindows, ui_global, and uiGlobal_s::windows.
Referenced by UI_InitWindows(), and UI_RegisterEditorNode().
Debug function to list all UI windows.
Definition at line 739 of file ui_windows.cpp.
References Com_Printf(), i, uiNode_t::name, uiGlobal_s::numWindows, ui_global, and uiGlobal_s::windows.
Referenced by UI_InitWindows().
Display in the conde the tree of nodes.
Definition at line 693 of file ui_windows.cpp.
References Com_Printf(), uiNode_t::firstChild, i, uiNode_t::name, uiNode_t::next, and UI_Node_GetWidgetName().
Referenced by UI_DebugTree_f().
Definition at line 707 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), UI_DebugTree(), and UI_GetWindow().
Referenced by UI_InitWindows().
Remove the window from the window stack.
[in] | window | The window to remove from the stack |
Definition at line 110 of file ui_windows.cpp.
References i, ui_global, UI_InvalidateMouse(), uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_PushWindow().
Finish windows initialization.
Definition at line 665 of file ui_windows.cpp.
References i, uiGlobal_s::numWindows, UI_ExecuteEventActions(), ui_global, WINDOWEXTRADATA, and uiGlobal_s::windows.
Referenced by UI_FinishInit().
Returns the current active window from the window stack or nullptr if there is none.
Definition at line 516 of file ui_windows.cpp.
References ui_global, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by Irc_Client_CmdPrivmsg(), UI_CloseWindowByRef(), UI_DisplayNotice(), and UI_GetActiveWindowName().
const char* UI_GetActiveWindowName | ( | void | ) |
Returns the name of the current window.
Definition at line 526 of file ui_windows.cpp.
References uiNode_t::name, and UI_GetActiveWindow().
Referenced by GAME_GetImportData(), GAME_SetMode_f(), HUD_UpdateButtons(), Irc_AppendToBuffer(), and Irc_Client_CmdPrivmsg().
Returns the ID of the last fullscreen ID. Before this, window should be hidden.
Definition at line 55 of file ui_windows.cpp.
References ui_global, UI_WindowIsFullScreen(), uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_Draw(), UI_FocusNextActionNode(), and UI_KeyPressed().
uiNode_t* UI_GetWindow | ( | const char * | name | ) |
Searches all windows for the specified one.
[in] | name | Name of the window we search |
Definition at line 567 of file ui_windows.cpp.
References uiNode_t::name, uiGlobal_s::numWindows, ui_global, and uiGlobal_s::windows.
Referenced by _wrap_get_window(), HUD_CheckCLHud(), UFO_AnalyseTestWindow(), UI_CloseWindow(), UI_CreateWindow(), UI_DebugTree_f(), UI_DisplayNotice(), UI_EditorNodeExtract_f(), UI_ParseWindow(), UI_PopupButton(), UI_PopupList(), UI_PushWindow(), and UI_ReadNodePath().
|
inlinestatic |
Searches the position in the current window stack for a given window id.
Definition at line 133 of file ui_windows.cpp.
References i, uiNode_t::name, Q_streq, ui_global, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_CloseWindowByRef(), UI_IsWindowOnStack(), and UI_PushWindow().
void UI_InitStack | ( | const char * | activeWindow, |
const char * | mainWindow | ||
) |
Init the stack to start with a window, and have an alternative window with ESC.
[in] | activeWindow | The first active window of the stack, else nullptr |
[in] | mainWindow | The alternative window, else nullptr if nothing |
remove Cvar_Set we have direct access to the cvar
We should only call it a very few time. When we switch from/to this different par of the game: main-option-interface / geoscape-and-base / battlescape
Definition at line 354 of file ui_windows.cpp.
References Cvar_Set(), uiGlobal_s::numWindows, UI_FinishInit(), ui_global, UI_PopWindow(), and UI_PushWindow().
Referenced by GAME_Drop(), GAME_GetImportData(), GAME_SetMode(), HUD_InitUI(), and UI_InitStack_f().
Definition at line 674 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and UI_InitStack().
Referenced by UI_InitWindows().
Definition at line 747 of file ui_windows.cpp.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cvar_Get(), UI_CloseWindow_f(), UI_CompleteWithWindow(), UI_DebugListWindows_f(), UI_DebugTree_f(), UI_InitStack_f(), UI_Popup_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), and UI_PushWindow_f().
Referenced by UI_Init().
Add a new window to the list of all windows.
Definition at line 616 of file ui_windows.cpp.
References Com_Error(), ERR_FATAL, i, uiNode_t::name, uiGlobal_s::numWindows, ui_global, UI_MAX_WINDOWS, and uiGlobal_s::windows.
Referenced by UI_CreateWindow(), and UI_ParseWindow().
Insert a window at a position of the stack.
[in] | window | The window to insert |
[in] | position | Where we want to add the window (0 is the deeper element of the stack) |
Definition at line 147 of file ui_windows.cpp.
References i, ui_global, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_PushWindow().
Invalidate all windows of the current stack.
Definition at line 593 of file ui_windows.cpp.
References Cvar_SetValue(), ui_global, UI_Invalidate(), viddef, viddef_t::virtualHeight, viddef_t::virtualWidth, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by R_SetMode().
bool UI_IsMouseOnWindow | ( | void | ) |
Check if a point is over a window from the stack.
Definition at line 538 of file ui_windows.cpp.
References UI_GetHoveredNode(), UI_GetMouseCapture(), ui_global, UI_Node_IsBattleScape(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by IN_Parse().
bool UI_IsWindowOnStack | ( | const char * | name | ) |
Check if a named window is on the stack if active windows.
Definition at line 373 of file ui_windows.cpp.
References UI_GetWindowPositionFromStackByName().
Referenced by GAME_SetMode(), UI_Popup(), UI_PopupButton(), and UI_PopupList().
Move the window on top of compatible windows. "Compatible" mean non full screen windows, and windows with the same window parent.
window | Window we want to move |
Definition at line 74 of file ui_windows.cpp.
References i, ui_global, UI_WindowIsFullScreen(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_MouseDown().
Definition at line 724 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and UI_Popup().
Referenced by UI_InitWindows().
void UI_PopWindow | ( | bool | all | ) |
Pops a window from the window stack.
[in] | all | If true pop all windows from stack |
Definition at line 452 of file ui_windows.cpp.
References key_game, Key_SetDest(), UI_CloseAllWindow(), UI_CloseWindowByRef(), ui_global, WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by _wrap_pop_window(), GAME_GetImportData(), HUD_DisplayActions(), Irc_Input_Activate_f(), UI_InitStack(), UI_LeftClick(), UI_MaterialEditorStart_f(), UI_PopWindow_f(), UI_PopWindowWithEscKey(), and uiWindowNode_t_close().
Console function to pop a window from the window stack.
Definition at line 501 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and UI_PopWindow().
Referenced by UI_InitWindows().
Definition at line 483 of file ui_windows.cpp.
References ui_global, UI_PopWindow(), WINDOWEXTRADATACONST, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_KeyPressed().
Console function to push a child window onto the window stack.
Definition at line 228 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and UI_PushWindow().
Referenced by UI_InitWindows().
Console function to push a dropdown window at a position. It work like UI_PushWindow but move the window at the right position.
Definition at line 263 of file ui_windows.cpp.
References uiNode_t::box, Cmd_Argc(), Cmd_Argv(), Com_ParseValue(), Com_Printf(), mousePosX, mousePosY, uiNode_t::name, uiBox_t::pos, Q_streq, RESULT_OK, uiNode_t::root, UI_GetNodeByPath(), UI_NodeGetPoint(), UI_NodeRelativeToAbsolutePoint(), UI_PushWindow(), and V_INT.
Referenced by UI_InitWindows().
uiNode_t* UI_PushWindow | ( | const char * | name, |
const char * | parentName, | ||
linkedList_t * | params | ||
) |
Push a window onto the window stack.
[in] | name | Name of the window to push onto window stack |
[in] | parentName | Window name to link as parent-child (else nullptr) |
[in] | params | List of string parameters to send to the onWindowOpened method. It can be nullptr when there is no parameters, else this object must be freed by the caller. |
uiNode_t
Definition at line 170 of file ui_windows.cpp.
References Com_Printf(), key_game, Key_SetDest(), UI_DeleteWindowFromStack(), UI_GetWindow(), UI_GetWindowPositionFromStackByName(), ui_global, UI_InsertWindowIntoStack(), UI_InvalidateMouse(), UI_MAX_WINDOWSTACK, UI_Node_WindowOpened(), UI_ReleaseInput(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by _wrap_push_window(), CL_BattlescapeRadarOpen_f(), CL_ConnectionlessPacket(), CL_HudRadarDown_f(), GAME_InitMissionBriefing(), Irc_Client_CmdPrivmsg(), Irc_Client_Invite_f(), Irc_Input_Activate_f(), Irc_Proto_ProcessServerMsg(), UI_CloseWindowByRef(), UI_InitStack(), UI_Popup(), UI_PopupButton(), UI_PopupList(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushWindow_(), UI_PushWindow_f(), UI_Restart_f(), uiWindowNode_t_open(), and WEB_CheckAuth().
Console function to push a window onto the window stack.
Definition at line 240 of file ui_windows.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, LIST_AddString(), LIST_Delete(), and UI_PushWindow().
Referenced by UI_InitWindows().
Removes a window from the list of all windows.
[in] | window | Pointer to the window node to remove |
Definition at line 644 of file ui_windows.cpp.
References uiGlobal_s::numWindows, REMOVE_ELEM, ui_global, and uiGlobal_s::windows.
Referenced by uiWindowNode::deleteNode().
Definition at line 320 of file ui_windows.cpp.
References i, ui_global, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_CloseWindowByRef().
Sets new x and y coordinates for a given window.
Definition at line 606 of file ui_windows.cpp.
References uiNode_t::box, uiBox_t::pos, and Vector2Set.
Referenced by uiControlNode::onCapturedMouseMove().
|
static |
Main window of a stack.
Definition at line 49 of file ui_windows.cpp.
|
static |
Window name use as alternative for option.
Definition at line 44 of file ui_windows.cpp.