|
UFO: Alien Invasion
|
#include "../cl_shared.h"#include "../cl_language.h"#include "ui_main.h"#include "ui_internal.h"#include "ui_nodes.h"#include "node/ui_node_option.h"
Go to the source code of this file.
Functions | |
| CASSERT (lengthof(ui_sharedDataIDNames)==UI_MAX_DATAID) | |
| int | UI_GetDataIDByName (const char *name) |
| Return a dataId by name. | |
| void | UI_RegisterText (int dataId, const char *text) |
| share a text with a data id | |
| void | UI_RegisterLinkedListText (int dataId, linkedList_t *text) |
| share a linked list of text with a data id | |
| const char * | UI_GetText (int textId) |
| const char * | UI_GetTextFromList (int textId, int line) |
| int | UI_GetDataVersion (int textId) |
| uiNode_t * | UI_AddOption (uiNode_t **tree, const char *name, const char *label, const char *value) |
| Append an option to an option list. | |
| static void | UI_DeleteOption (uiNode_t *tree) |
| void | UI_ResetData (int dataId) |
| Reset a shared data. Type became NONE and value became nullptr. | |
| static uiNode_t * | UI_OptionNodeRemoveHigherOption (uiNode_t **option) |
| Remove the higher element (in alphabet) from a list. | |
| void | UI_SortOptions (uiNode_t **first) |
| Sort options by alphabet. | |
| void | UI_UpdateInvisOptions (uiNode_t *option, const linkedList_t *stringList) |
| Unhide those options that are stored in the linked list and hide the others. | |
| void | UI_RegisterOption (int dataId, uiNode_t *option) |
| uiNode_t * | UI_GetOption (int dataId) |
| static uiNode_t * | UI_FindOptionAtIndex (int index, uiNode_t *option, uiOptionIterator_t *iterator) |
| find an option why index (0 is the first option) | |
| uiNode_t * | UI_InitOptionIteratorAtIndex (int index, uiNode_t *option, uiOptionIterator_t *iterator) |
| Init an option iterator at an index. | |
| uiNode_t * | UI_InitOptionIteratorAtIndex (int index, uiNode_t *option, uiOptionIterator_t *iterator, bool skipCollapsed, bool skipInvisible) |
| Init an option iterator at an index. | |
| uiNode_t * | UI_OptionIteratorNextOption (uiOptionIterator_t *iterator) |
| Find the next element from the iterator Iterator skipCollapsed and skipInvisible attribute can control the option flow. | |
| uiNode_t * | UI_FindOptionByValue (uiOptionIterator_t *iterator, const char *value) |
| Find an option (and all his parents) by is value. | |
| int | UI_FindOptionPosition (uiOptionIterator_t *iterator, const uiNode_t *option) |
| Find an option position from an option iterator. | |
| static void | UI_ResetData_f (void) |
| Resets the ui_global.sharedData pointers from a func node. | |
| void | UI_InitData (void) |
| Initialize console command about UI shared data. | |
Variables | |
| static const char *const | ui_sharedDataIDNames [] |
| CASSERT | ( | lengthof(ui_sharedDataIDNames) | = =UI_MAX_DATAID | ) |
References UI_MAX_DATAID, and ui_sharedDataIDNames.
| uiNode_t * UI_AddOption | ( | uiNode_t ** | tree, |
| const char * | name, | ||
| const char * | label, | ||
| const char * | value ) |
Append an option to an option list.
| [in,out] | tree | first option of the list/tree of options |
| [in] | name | name of the option (should be unique in the option list) |
| [in] | label | label displayed |
| [in] | value | value used when this option is selected |
Definition at line 172 of file ui_data.cpp.
References name, uiNode_t::next, and UI_AllocOptionNode().
Referenced by CL_InitSkin_f(), CL_LanguageInitMenu(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_GetImportData(), and IN_JoystickInitMenu().
| tree | Root of nodes we want to delete |
Definition at line 200 of file ui_data.cpp.
References uiNode_t::next, and UI_DeleteNode().
Referenced by UI_ResetData().
|
static |
find an option why index (0 is the first option)
| [in] | index | Requested index (0 is the first option) |
| [in] | option | First element of options (it can be a tree) |
| [in,out] | iterator | need an initialised iterator, and update it into the write index |
Definition at line 338 of file ui_data.cpp.
References uiNode_t::behaviour, uiOptionIterator_t::depthCache, uiOptionIterator_t::depthPos, uiNode_t::firstChild, index, uiNode_t::invis, MAX_DEPTH_OPTIONITERATORCACHE, uiNode_t::next, uiOptionIterator_t::option, OPTIONEXTRADATA, UI_FindOptionAtIndex(), and ui_optionBehaviour.
Referenced by UI_FindOptionAtIndex(), and UI_InitOptionIteratorAtIndex().
| uiNode_t * UI_FindOptionByValue | ( | uiOptionIterator_t * | iterator, |
| const char * | value ) |
Find an option (and all his parents) by is value.
| [in,out] | iterator | If it found an option, the iterator contain all option parent |
| [in] | value | The value we search |
Definition at line 468 of file ui_data.cpp.
References uiNode_t::behaviour, uiOptionIterator_t::option, OPTIONEXTRADATA, Q_streq, ui_optionBehaviour, and UI_OptionIteratorNextOption().
Referenced by UI_OptionTree_SelectValue().
| int UI_FindOptionPosition | ( | uiOptionIterator_t * | iterator, |
| const uiNode_t * | option ) |
Find an option position from an option iterator.
| [in,out] | iterator | Context of the iteration. If it found an option, the iterator contain all option parent |
| [in] | option | The value we search |
Definition at line 485 of file ui_data.cpp.
References i, uiOptionIterator_t::option, and UI_OptionIteratorNextOption().
Referenced by UI_OptionTree_SelectValue().
| int UI_GetDataIDByName | ( | const char * | name | ) |
Return a dataId by name.
Definition at line 102 of file ui_data.cpp.
References name, Q_streq, UI_MAX_DATAID, and ui_sharedDataIDNames.
Referenced by UI_AbstractOption_SetDataIdByName(), UI_ParseProperty(), and UI_ResetData_f().
Definition at line 159 of file ui_data.cpp.
References ui_global.
Referenced by UI_AbstractOption_GetFirstOption(), UI_OptionTreeNodeGetFirstOption(), and uiTextNode::validateCache().
Definition at line 324 of file ui_data.cpp.
References ui_global, and UI_SHARED_OPTION.
Referenced by CL_InitSkin_f(), CL_SetRatioFilter_f(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_GetImportData(), UI_AbstractOption_GetFirstOption(), and UI_OptionTreeNodeGetFirstOption().
| const char * UI_GetText | ( | int | textId | ) |
Definition at line 144 of file ui_data.cpp.
References CL_Translate(), ui_global, and UI_SHARED_TEXT.
Referenced by HUD_DrawMouseCursorText(), HUD_UpdateCursor(), and UI_TextNodeGenerateLineSplit().
Definition at line 151 of file ui_data.cpp.
References LIST_GetByIdx(), ui_global, and UI_SHARED_LINKEDLISTTEXT.
Referenced by UI_TextNodeGetSelectedText().
Initialize console command about UI shared data.
Definition at line 521 of file ui_data.cpp.
References Cmd_AddCommand(), and UI_ResetData_f().
Referenced by UI_Init().
| uiNode_t * UI_InitOptionIteratorAtIndex | ( | int | index, |
| uiNode_t * | option, | ||
| uiOptionIterator_t * | iterator ) |
Init an option iterator at an index.
| [in] | index | Requested index (0 is the first option) |
| [in] | option | First element of options (it can be a tree) |
| [out] | iterator | Initialised iterator |
Definition at line 394 of file ui_data.cpp.
References index, and UI_InitOptionIteratorAtIndex().
Referenced by uiOptionTreeNode::draw(), GAME_GetImportData(), UI_InitOptionIteratorAtIndex(), UI_OptionTree_SelectValue(), and UI_OptionTreeNodeGetOptionAtPosition().
| uiNode_t * UI_InitOptionIteratorAtIndex | ( | int | index, |
| uiNode_t * | option, | ||
| uiOptionIterator_t * | iterator, | ||
| bool | skipCollapsed, | ||
| bool | skipInvisible ) |
Init an option iterator at an index.
| [in] | index | Requested index (0 is the first option) |
| [in] | option | First element of options (it can be a tree) |
| [in] | skipCollapsed | Set to true to skip collapsed nodes in the iteration. |
| [in] | skipInvisible | Set to true to skip invisible nodes in the iteration. |
| [out] | iterator | Initialised iterator |
Definition at line 417 of file ui_data.cpp.
References uiNode_t::behaviour, index, OBJZERO, uiOptionIterator_t::skipCollapsed, uiOptionIterator_t::skipInvisible, UI_FindOptionAtIndex(), and ui_optionBehaviour.
| uiNode_t * UI_OptionIteratorNextOption | ( | uiOptionIterator_t * | iterator | ) |
Find the next element from the iterator Iterator skipCollapsed and skipInvisible attribute can control the option flow.
Definition at line 430 of file ui_data.cpp.
References uiOptionIterator_t::depthCache, uiOptionIterator_t::depthPos, uiNode_t::firstChild, uiNode_t::invis, MAX_DEPTH_OPTIONITERATORCACHE, uiNode_t::next, uiOptionIterator_t::option, OPTIONEXTRADATA, uiOptionIterator_t::skipCollapsed, and uiOptionIterator_t::skipInvisible.
Referenced by uiOptionTreeNode::draw(), GAME_GetImportData(), UI_FindOptionByValue(), and UI_FindOptionPosition().
Remove the higher element (in alphabet) from a list.
Definition at line 240 of file ui_data.cpp.
References CL_Translate(), uiNode_t::next, and OPTIONEXTRADATA.
Referenced by UI_SortOptions().
| void UI_RegisterLinkedListText | ( | int | dataId, |
| linkedList_t * | text ) |
share a linked list of text with a data id
Definition at line 131 of file ui_data.cpp.
References ui_global, UI_ResetData(), and UI_SHARED_LINKEDLISTTEXT.
Referenced by GAME_GetImportData(), GAME_InitMissionBriefing(), Irc_Client_Names_f(), UI_MaterialEditorUpdate(), and UI_PopupList().
Hack to disable release option memory, if we only want to update the same option
Definition at line 311 of file ui_data.cpp.
References ui_global, UI_ResetData(), and UI_SHARED_OPTION.
Referenced by CL_InitSkin_f(), CL_LanguageInitMenu(), CL_SetRatioFilter_f(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_GetImportData(), and IN_JoystickInitMenu().
share a text with a data id
Definition at line 115 of file ui_data.cpp.
References ui_global, UI_ResetData(), and UI_SHARED_TEXT.
Referenced by CL_AddTargetingBox(), CL_GetTipOfTheDay_f(), GAME_GetImportData(), GAME_InitMissionBriefing(), HUD_MapDebugCursor(), HUD_UpdateActor(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), INV_ItemDescription(), Irc_AppendToBuffer(), Irc_Input_Activate_f(), UI_Popup(), UI_PopupButton(), and UI_PopupList().
Reset a shared data. Type became NONE and value became nullptr.
Definition at line 212 of file ui_data.cpp.
References _Mem_AllocatedInPool(), com_genericPool, LIST_Delete(), UI_DeleteOption(), ui_global, UI_MAX_DATAID, UI_SHARED_LINKEDLISTTEXT, UI_SHARED_NONE, and UI_SHARED_OPTION.
Referenced by uiTextListNode::draw(), GAME_GetImportData(), GAME_UpdateTeamMenuParameters_f(), HUD_PopupFiremodeReservation(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), HUD_UpdateCursor(), INV_ItemDescription(), Irc_Input_Deactivate_f(), Irc_Logic_Disconnect(), UI_PopupList(), UI_RegisterLinkedListText(), UI_RegisterOption(), UI_RegisterText(), UI_ResetData_f(), and cgame_import_t::void().
Resets the ui_global.sharedData pointers from a func node.
Definition at line 502 of file ui_data.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, UI_GetDataIDByName(), UI_MAX_DATAID, and UI_ResetData().
Referenced by UI_InitData().
Sort options by alphabet.
Definition at line 273 of file ui_data.cpp.
References uiNode_t::next, and UI_OptionNodeRemoveHigherOption().
Referenced by CL_LanguageInitMenu(), GAME_GetImportData(), UI_AbstractOption_SortOptions(), and cgame_import_t::void().
| void UI_UpdateInvisOptions | ( | uiNode_t * | option, |
| const linkedList_t * | stringList ) |
Unhide those options that are stored in the linked list and hide the others.
| [in,out] | option | Option list we want to update |
| [in] | stringList | List of option name (ID) we want to display |
Definition at line 297 of file ui_data.cpp.
References uiNode_t::invis, LIST_ContainsString(), uiNode_t::name, and uiNode_t::next.
Referenced by GAME_GetImportData().
|
static |
Definition at line 37 of file ui_data.cpp.
Referenced by CASSERT(), and UI_GetDataIDByName().