UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_popup.cpp File Reference
#include "ui_main.h"
#include "ui_nodes.h"
#include "ui_node.h"
#include "ui_popup.h"
#include "ui_actions.h"
#include "node/ui_node_abstractnode.h"
Include dependency graph for ui_popup.cpp:

Go to the source code of this file.

Macros

#define POPUPBUTTON_WINDOW_NAME   "popup_button"
#define POPUPBUTTON_NODE_NAME   "popup_button_"
#define POPUP_WINDOW_NAME   "popup"

Functions

void UI_Popup (const char *title, const char *text)
 Popup on geoscape.
uiNode_tUI_PopupList (const char *title, const char *headline, linkedList_t *entries, const char *clickAction)
 Generates a popup that contains a list of selectable choices.
static void UI_SetOneButton (uiNode_t *window, const char *button, const char *clickAction)
 Set string and action button.
void UI_PopupButton (const char *title, const char *text, const char *clickAction1, const char *clickText1, const char *tooltip1, const char *clickAction2, const char *clickText2, const char *tooltip2, const char *clickAction3, const char *clickText3, const char *tooltip3)
 Generates a popup that contains up to 3 buttons.

Variables

char popupText [UI_MAX_SMALLTEXTLEN]
 strings to be used for popup when text is not static
static char popupAction1 [UI_MAX_SMALLTEXTLEN]
static char popupAction2 [UI_MAX_SMALLTEXTLEN]
static char popupAction3 [UI_MAX_SMALLTEXTLEN]

Macro Definition Documentation

◆ POPUP_WINDOW_NAME

#define POPUP_WINDOW_NAME   "popup"

Definition at line 34 of file ui_popup.cpp.

Referenced by UI_Popup().

◆ POPUPBUTTON_NODE_NAME

#define POPUPBUTTON_NODE_NAME   "popup_button_"

Definition at line 33 of file ui_popup.cpp.

Referenced by UI_PopupButton().

◆ POPUPBUTTON_WINDOW_NAME

#define POPUPBUTTON_WINDOW_NAME   "popup_button"

Definition at line 32 of file ui_popup.cpp.

Referenced by UI_PopupButton().

Function Documentation

◆ UI_Popup()

void UI_Popup ( const char * title,
const char * text )

◆ UI_PopupButton()

void UI_PopupButton ( const char * title,
const char * text,
const char * clickAction1,
const char * clickText1,
const char * tooltip1,
const char * clickAction2,
const char * clickText2,
const char * tooltip2,
const char * clickAction3,
const char * clickText3,
const char * tooltip3 )

Generates a popup that contains up to 3 buttons.

Parameters
[in]titleTitle of the popup.
[in]textText to display in the popup (use popupText if text is nullptr).
[in]clickAction1Action to perform when one clicked on the first button.
[in]clickText1String that will be written in first button.
[in]tooltip1Tooltip of first button.
[in]clickAction2Action to perform when one clicked on the second button.
[in]clickText2String that will be written in second button.
[in]tooltip2Tooltip of second button.
[in]clickAction3Action to perform when one clicked on the third button.
[in]clickText3String that will be written in third button.
[in]tooltip3Tooltip of third button.
Note
clickAction AND clickText must be nullptr if button should be invisible.

Definition at line 147 of file ui_popup.cpp.

References Com_Error(), Cvar_Set(), ERR_FATAL, uiNode_t::name, popupAction1, popupAction2, popupAction3, POPUPBUTTON_NODE_NAME, POPUPBUTTON_WINDOW_NAME, popupText, TEXT_POPUP_INFO, UI_GetWindow(), UI_IsWindowOnStack(), UI_PushWindow(), UI_RegisterText(), UI_SetOneButton(), and va().

Referenced by GAME_GetImportData().

◆ UI_PopupList()

uiNode_t * UI_PopupList ( const char * title,
const char * headline,
linkedList_t * entries,
const char * clickAction )

Generates a popup that contains a list of selectable choices.

Parameters
[in]titleTitle of the popup.
[in]headlineFirst line of text written in the popup.
[in]entriesList of the selectables choices.
[in]clickActionAction to perform when one clicked on the popup.

Definition at line 62 of file ui_popup.cpp.

References Com_Error(), Cvar_Set(), EA_CMD, ERR_FATAL, Mem_Free, uiNode_t::name, uiNode_t::onClick, POPUPLIST_NODE_NAME, POPUPLIST_WINDOW_NAME, TEXT_LIST, TEXT_POPUP_INFO, UI_GetNode(), UI_GetWindow(), UI_IsWindowOnStack(), UI_PoolAllocAction(), UI_PushWindow(), UI_RegisterLinkedListText(), UI_RegisterText(), and UI_ResetData().

Referenced by GAME_GetImportData(), and HUD_PopupFiremodeReservation().

◆ UI_SetOneButton()

void UI_SetOneButton ( uiNode_t * window,
const char * button,
const char * clickAction )
static

Set string and action button.

Parameters
[in]windowwindow where buttons are modified.
[in]buttonName of the node of the button.
[in]clickActionAction to perform when button is clicked.
Note
clickAction may be nullptr if button is not needed.

Definition at line 107 of file ui_popup.cpp.

References Com_Error(), EA_CMD, ERR_FATAL, uiNode_t::invis, Mem_Free, uiNode_t::name, uiNode_t::onClick, UI_GetNode(), and UI_PoolAllocAction().

Referenced by UI_PopupButton().

Variable Documentation

◆ popupAction1

char popupAction1[UI_MAX_SMALLTEXTLEN]
static

Definition at line 38 of file ui_popup.cpp.

Referenced by UI_PopupButton().

◆ popupAction2

char popupAction2[UI_MAX_SMALLTEXTLEN]
static

Definition at line 39 of file ui_popup.cpp.

Referenced by UI_PopupButton().

◆ popupAction3

char popupAction3[UI_MAX_SMALLTEXTLEN]
static

Definition at line 40 of file ui_popup.cpp.

Referenced by UI_PopupButton().

◆ popupText