UFO: Alien Invasion
|
#include "../../common/common.h"
Go to the source code of this file.
Functions | |
void | UI_InitWindows (void) |
int | UI_GetLastFullScreenWindow (void) |
Returns the ID of the last fullscreen ID. Before this, window should be hidden. More... | |
uiNode_t * | UI_PushWindow (const char *name, const char *parentName=nullptr, linkedList_t *params=nullptr) |
Push a window onto the window stack. More... | |
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... | |
void | UI_PopWindow (bool all=false) |
Pops a window from the window stack. More... | |
void | UI_PopWindowWithEscKey (void) |
void | UI_CloseWindow (const char *name) |
uiNode_t * | UI_GetActiveWindow (void) |
Returns the current active window from the window stack or nullptr if there is none. More... | |
int | UI_CompleteWithWindow (const char *partial, const char **match) |
Complete function for ui_push. More... | |
bool | UI_IsWindowOnStack (const char *name) |
Check if a named window is on the stack if active windows. More... | |
bool | UI_IsMouseOnWindow (void) |
Check if a point is over a window from the stack. More... | |
void | UI_InvalidateStack (void) |
Invalidate all windows of the current stack. 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_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... | |
const char * | UI_GetActiveWindowName (void) |
Returns the name of the current window. More... | |
void | UI_SetNewWindowPos (uiNode_t *window, int x, int y) |
Sets new x and y coordinates for a given window. More... | |
uiNode_t * | UI_GetWindow (const char *name) |
Searches all windows for the specified one. More... | |
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().
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().
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().
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 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().
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().
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().
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().
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().
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().
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().