#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. | |
struct uiNode_s * | UI_PushWindow (const char *name, const char *parentName) |
Push a window onto the window stack. | |
void | UI_InitStack (const char *activeWindow, const char *mainWindow, qboolean popAll, qboolean pushActive) |
Init the stack to start with a window, and have an alternative window with ESC. | |
void | UI_PopWindow (qboolean all) |
Pops a window from the window stack. | |
void | UI_PopWindowWithEscKey (void) |
void | UI_CloseWindow (const char *name) |
struct uiNode_s * | UI_GetActiveWindow (void) |
Returns the current active window from the window stack or NULL if there is none. | |
int | UI_CompleteWithWindow (const char *partial, const char **match) |
Complete function for mn_push. | |
qboolean | UI_IsWindowOnStack (const char *name) |
Check if a named window is on the stack if active windows. | |
qboolean | UI_IsPointOnWindow (void) |
Check if a point is over a window from the stack. | |
void | UI_InvalidateStack (void) |
Invalidate all windows of the current stack. | |
void | UI_InsertWindow (struct uiNode_s *window) |
Add a new window to the list of all windows. | |
void | UI_MoveWindowOnTop (struct uiNode_s *window) |
Move the window on top of compatible windows. "Compatible" mean non full screen windows, and windows with the same window parent. | |
const char * | UI_GetActiveWindowName (void) |
Returns the name of the current window. | |
void | UI_GetActiveRenderRect (int *x, int *y, int *width, int *height) |
Determine the position and size of render. | |
void | UI_SetNewWindowPos (struct uiNode_s *window, int x, int y) |
Sets new x and y coordinates for a given window. | |
struct uiNode_s * | UI_GetWindow (const char *name) |
Searches all windows for the specified one. |
Definition in file ui_windows.h.
void UI_CloseWindow | ( | const char * | name | ) |
Definition at line 463 of file ui_windows.c.
References Com_Printf(), UI_CloseWindowByRef(), and UI_GetWindow().
Referenced by CL_GetTipOfTheDay_f(), CL_HudRadarUp_f(), and UI_CloseWindow_f().
int UI_CompleteWithWindow | ( | const char * | partial, | |
const char ** | match | |||
) |
Complete function for mn_push.
Definition at line 214 of file ui_windows.c.
References Cmd_GenericCompleteFunction(), Com_Printf(), i, len, MAX_COMPLETE, uiNode_s::name, uiGlobal_s::numWindows, ui_global, and uiGlobal_s::windows.
Referenced by UI_InitWindows(), and UI_RegisterEditorNode().
void UI_GetActiveRenderRect | ( | int * | x, | |
int * | y, | |||
int * | width, | |||
int * | height | |||
) |
Determine the position and size of render.
Definition at line 572 of file ui_windows.c.
References mn_hud, pos, viddef_t::rx, viddef_t::ry, uiNode_s::size, cvar_s::string, UI_GetActiveWindow(), UI_GetNodeAbsPos(), UI_GetWindow(), UI_IsWindowOnStack(), UI_Validate(), viddef, and WINDOWEXTRADATA.
Referenced by SCR_UpdateScreen().
struct uiNode_s* UI_GetActiveWindow | ( | void | ) | [read] |
Returns the current active window from the window stack or NULL if there is none.
Definition at line 564 of file ui_windows.c.
References ui_global, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by Irc_Client_CmdPrivmsg(), UI_DisplayNotice(), UI_GetActiveRenderRect(), UI_GetActiveWindowName(), and UI_SetNewWindowPos_f().
const char* UI_GetActiveWindowName | ( | void | ) |
Returns the name of the current window.
Definition at line 605 of file ui_windows.c.
References uiNode_s::name, and UI_GetActiveWindow().
Referenced by CP_OnGeoscape(), GAME_SetMode_f(), HUD_RefreshButtons(), Irc_AppendToBuffer(), Irc_Client_CmdPrivmsg(), and MAP_CenterOnPoint_f().
int UI_GetLastFullScreenWindow | ( | void | ) |
Returns the ID of the last fullscreen ID. Before this, window should be hidden.
Definition at line 50 of file ui_windows.c.
References pos, ui_global, UI_WindowIsFullScreen(), uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_Draw(), UI_FocusNextActionNode(), and UI_KeyPressed().
struct uiNode_s* UI_GetWindow | ( | const char * | name | ) | [read] |
Searches all windows for the specified one.
[in] | name | Name of the window we search |
Definition at line 648 of file ui_windows.c.
References uiNode_s::name, uiGlobal_s::numWindows, ui_global, and uiGlobal_s::windows.
Referenced by UI_CloseWindow(), UI_DebugTree_f(), UI_DisplayNotice(), UI_EditorNodeExtract_f(), UI_GetActiveRenderRect(), UI_ParseWindow(), UI_PopupButton(), UI_PopupList(), UI_PushWindowDelete(), and UI_ReadNodePath().
void UI_InitStack | ( | const char * | activeWindow, | |
const char * | mainWindow, | |||
qboolean | popAll, | |||
qboolean | pushActive | |||
) |
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 NULL |
[in] | mainWindow | The alternative window, else NULL if nothing |
[in] | popAll | If true, clean up the stack first |
[in] | pushActive | If true, push the active window into the stack |
remove Cvar_Set we have direct access to the cvar
check why activeWindow can be NULL. It should never be NULL: a stack must not be empty
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
Update the code: popAll should be every time true
Update the code: pushActive should be every time true
Illustration about when/how we should use UI_InitStack http://ufoai.ninex.info/wiki/index.php/Image:UI_InitStack.jpg
Definition at line 400 of file ui_windows.c.
References Cvar_Set(), uiGlobal_s::numWindows, qtrue, ui_global, UI_PopWindow(), and UI_PushWindow().
Referenced by CL_Connect_f(), CL_Reset(), CP_CampaignInit(), CP_EndCampaign(), CP_StartMissionMap(), GAME_CP_Drop(), GAME_CP_Results(), GAME_CP_Spawn(), GAME_Drop(), GAME_MP_StartBattlescape(), GAME_MP_StartServer_f(), GAME_SetMode(), GAME_SK_Start_f(), GAME_StartBattlescape(), SAV_GameLoad(), and UI_InitStack_f().
void UI_InitWindows | ( | void | ) |
Definition at line 819 of file ui_windows.c.
References _, Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cvar_Get(), UI_CloseWindow_f(), UI_CompleteWithWindow(), UI_DebugTree_f(), UI_FireInit_f(), UI_InitStack_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushNoHud_f(), UI_PushWindow_f(), and UI_SetNewWindowPos_f().
Referenced by UI_Init().
void UI_InsertWindow | ( | uiNode_t * | window | ) |
Add a new window to the list of all windows.
Definition at line 698 of file ui_windows.c.
References Com_Error(), ERR_FATAL, i, uiNode_s::name, uiGlobal_s::numWindows, pos, ui_global, UI_MAX_WINDOWS, and uiGlobal_s::windows.
Referenced by UI_ParseWindow().
void UI_InvalidateStack | ( | void | ) |
Invalidate all windows of the current stack.
Definition at line 674 of file ui_windows.c.
References Cvar_SetValue(), pos, ui_global, UI_Invalidate(), viddef, viddef_t::virtualHeight, viddef_t::virtualWidth, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by R_SetMode().
qboolean UI_IsPointOnWindow | ( | void | ) |
Check if a point is over a window from the stack.
Definition at line 617 of file ui_windows.c.
References qfalse, qtrue, uiNode_s::root, UI_GetHoveredNode(), UI_GetMouseCapture(), ui_global, WINDOWEXTRADATA, WINDOWEXTRADATACONST, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by IN_Parse().
qboolean UI_IsWindowOnStack | ( | const char * | name | ) |
Check if a named window is on the stack if active windows.
Definition at line 420 of file ui_windows.c.
References UI_GetWindowPositionFromStackByName().
Referenced by CL_HudRadarDown_f(), CL_HudRadarUp_f(), GAME_SetMode(), UI_GetActiveRenderRect(), UI_Popup(), UI_PopupButton(), and UI_PopupList().
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.
window | Window we want to move |
Definition at line 69 of file ui_windows.c.
References i, uiNode_s::parent, ui_global, UI_WindowIsFullScreen(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_MouseDown().
void UI_PopWindow | ( | qboolean | all | ) |
Pops a window from the window stack.
[in] | all | If true pop all windows from stack |
Definition at line 480 of file ui_windows.c.
References key_game, Key_SetDest(), uiNode_s::name, uiNode_s::parent, cvar_s::string, UI_CloseAllWindow(), UI_CloseWindowByRef(), ui_global, UI_PushWindow(), WINDOWEXTRADATA, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by AIM_AircraftStart_f(), B_Destroy_AntimaterStorage_f(), B_SetBaseTitle_f(), CL_GameAutoGo(), CL_PopupAircraftClick_f(), CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_PopupInterceptGetAircraft_f(), CL_ResearchType_f(), CL_SequenceRender(), CL_UpdateEquipmentMenuParameters_f(), CL_UpdatePilotList_f(), CL_UpdateSoldierList_f(), HOS_Init_f(), Irc_Input_Activate_f(), MAP_MultiSelectExecuteAction_f(), SAV_GameContinue_f(), SAV_GameReadGameComments_f(), TR_TransferAlienAfterMissionStart(), TR_TransferStart_f(), UI_BaseMapNodeDraw(), UI_InitStack(), UI_LeftClick(), UI_MaterialEditorStart_f(), UI_PopWindow_f(), and UI_PopWindowWithEscKey().
void UI_PopWindowWithEscKey | ( | void | ) |
Definition at line 530 of file ui_windows.c.
References qfalse, ui_global, UI_PopWindow(), WINDOWEXTRADATACONST, uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_KeyPressed().
struct uiNode_s* UI_PushWindow | ( | const char * | name, | |
const char * | parentName | |||
) | [read] |
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 NULL) |
Definition at line 247 of file ui_windows.c.
References qtrue, and UI_PushWindowDelete().
Referenced by AC_ResearchAlien_f(), AIR_Move(), AIR_SendAircraftToMission(), B_BuildingOpenAfterClick(), B_MakeBaseMapShot_f(), B_SelectBase(), CL_CheckCvars_f(), CL_Connect_f(), CL_ConnectionlessPacket(), CL_DisplayPopupAircraft(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_GameAutoGo(), CL_HudRadarDown_f(), CL_ParseServerInfoMessage(), CL_PopupInterceptRClick_f(), CL_SequenceStart_f(), CP_BaseAttackStartMission(), CP_NationStatsClick_f(), GAME_CP_Results(), HOS_ListClick_f(), INS_SelectInstallation(), Irc_Client_CmdPrivmsg(), Irc_Client_Invite_f(), Irc_Input_Activate_f(), Irc_Proto_ProcessServerMsg(), MAP_MapClick(), SAV_GameQuickLoadInit_f(), TR_TransferAliensFromMission_f(), UI_InitStack(), UI_Popup(), UI_PopupButton(), UI_PopupList(), UI_PopWindow(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushNoHud_f(), UI_PushWindow_f(), UP_OpenEventMail(), UP_OpenMailWith(), and UP_OpenWith().
void UI_SetNewWindowPos | ( | uiNode_t * | window, | |
int | x, | |||
int | y | |||
) |
Sets new x and y coordinates for a given window.
Definition at line 688 of file ui_windows.c.
References uiNode_s::pos, and Vector2Set.
Referenced by UI_ControlsNodeCapturedMouseMove(), and UI_SetNewWindowPos_f().