#include "../client.h"
#include "ui_main.h"
#include "ui_internal.h"
#include "ui_nodes.h"
#include "node/ui_node_linechart.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) |
int | UI_GetDataVersion (int textId) |
static void | UI_InitOption (uiNode_t *option, const char *label, const char *value) |
Initializes an option with a very little set of values. | |
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 NULL. | |
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) |
void | UI_RegisterLineStrip (int dataId, lineStrip_t *lineStrip) |
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_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 [] |
Definition in file ui_data.c.
CASSERT | ( | lengthof(ui_sharedDataIDNames) | = =UI_MAX_DATAID |
) |
uiNode_t* UI_AddOption | ( | uiNode_t ** | tree, | |
const char * | name, | |||
const char * | label, | |||
const char * | value | |||
) | [read] |
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 197 of file ui_data.c.
References uiNode_s::next, qtrue, UI_AllocNode(), and UI_InitOption().
Referenced by AIM_UpdateAircraftItemList(), CL_InitSkin_f(), CL_LanguageInit(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_InitMenuOptions(), IN_JoystickInitMenu(), MSO_InitList(), TR_InitBaseList(), TR_TransferAliensFromMission_f(), UP_GenerateArticlesSummary(), and UP_GenerateSummary().
static void UI_DeleteOption | ( | uiNode_t * | tree | ) | [static] |
tree |
Definition at line 226 of file ui_data.c.
References uiNode_s::next, and UI_DeleteNode().
Referenced by UI_ResetData().
static uiNode_t* UI_FindOptionAtIndex | ( | int | index, | |
uiNode_t * | option, | |||
uiOptionIterator_t * | iterator | |||
) | [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 379 of file ui_data.c.
References uiNode_s::behaviour, uiOptionIterator_t::depthCache, uiOptionIterator_t::depthPos, uiNode_s::firstChild, uiNode_s::invis, MAX_DEPTH_OPTIONITERATORCACHE, uiNode_s::next, uiOptionIterator_t::option, OPTIONEXTRADATA, qfalse, and ui_optionBehaviour.
Referenced by UI_InitOptionIteratorAtIndex().
uiNode_t* UI_FindOptionByValue | ( | uiOptionIterator_t * | iterator, | |
const char * | value | |||
) | [read] |
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 486 of file ui_data.c.
References uiNode_s::behaviour, uiOptionIterator_t::option, OPTIONEXTRADATA, ui_optionBehaviour, and UI_OptionIteratorNextOption().
Referenced by UI_OptionTreeSetSelectedValue().
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 503 of file ui_data.c.
References i, uiOptionIterator_t::option, and UI_OptionIteratorNextOption().
Referenced by UI_OptionTreeSetSelectedValue().
int UI_GetDataIDByName | ( | const char * | name | ) |
Return a dataId by name.
Definition at line 120 of file ui_data.c.
References uiNode_s::num, UI_MAX_DATAID, and ui_sharedDataIDNames.
Referenced by UI_ParseProperty(), and UI_ResetData_f().
int UI_GetDataVersion | ( | int | textId | ) |
Definition at line 170 of file ui_data.c.
References uiGlobal_s::sharedData, ui_global, and uiSharedData_s::versionId.
Referenced by UI_AbstractOptionGetFirstOption(), UI_OptionTreeNodeGetFirstOption(), and UI_TextValidateCache().
uiNode_t* UI_GetOption | ( | int | dataId | ) | [read] |
Definition at line 365 of file ui_data.c.
References uiSharedData_s::data, uiSharedData_s::option, uiGlobal_s::sharedData, uiSharedData_s::type, ui_global, and UI_SHARED_OPTION.
Referenced by CL_InitSkin_f(), CL_SetRatioFilter_f(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_SK_HideDropships(), GAME_SK_HideUFOs(), MSO_InitList(), MSO_Toggle_f(), MSO_UpdateVisibleButtons(), UI_AbstractOptionGetFirstOption(), and UI_OptionTreeNodeGetFirstOption().
const char* UI_GetText | ( | int | textId | ) |
Definition at line 163 of file ui_data.c.
References uiSharedData_s::data, uiGlobal_s::sharedData, uiSharedData_s::text, uiSharedData_s::type, ui_global, and UI_SHARED_TEXT.
Referenced by HUD_DrawMouseCursorText(), HUD_UpdateCursor(), and UI_TextNodeGenerateLineSplit().
void UI_InitData | ( | void | ) |
Initialize console command about UI shared data.
Definition at line 540 of file ui_data.c.
References Cmd_AddCommand(), and UI_ResetData_f().
Referenced by UI_Init().
static void UI_InitOption | ( | uiNode_t * | option, | |
const char * | label, | |||
const char * | value | |||
) | [static] |
Initializes an option with a very little set of values.
[in] | option | Context option |
[in] | label | label displayed |
[in] | value | value used when this option is selected |
Definition at line 181 of file ui_data.c.
References uiNode_s::behaviour, OPTIONEXTRADATA, Q_strncpyz(), and ui_optionBehaviour.
Referenced by UI_AddOption().
uiNode_t* UI_InitOptionIteratorAtIndex | ( | int | index, | |
uiNode_t * | option, | |||
uiOptionIterator_t * | iterator | |||
) | [read] |
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 |
uiOptionIterator_t iterator; UI_InitOptionIteratorAtIndex(index, firstOption, &iterator); // also return the option while (iterator.option) { ... UI_OptionIteratorNextOption(&iterator); // also return the option }
Definition at line 435 of file ui_data.c.
References uiNode_s::behaviour, qtrue, uiOptionIterator_t::skipCollapsed, uiOptionIterator_t::skipInvisible, UI_FindOptionAtIndex(), and ui_optionBehaviour.
Referenced by MSO_Toggle_f(), MSO_UpdateVisibleButtons(), UI_OptionTreeNodeDraw(), UI_OptionTreeNodeGetOptionAtPosition(), and UI_OptionTreeSetSelectedValue().
uiNode_t* UI_OptionIteratorNextOption | ( | uiOptionIterator_t * | iterator | ) | [read] |
Find the next element from the iterator Iterator skipCollapsed and skipInvisible attribute can control the option flow.
Definition at line 448 of file ui_data.c.
References uiOptionIterator_t::depthCache, uiOptionIterator_t::depthPos, uiNode_s::firstChild, uiNode_s::invis, MAX_DEPTH_OPTIONITERATORCACHE, uiNode_s::next, uiOptionIterator_t::option, OPTIONEXTRADATA, qtrue, uiOptionIterator_t::skipCollapsed, and uiOptionIterator_t::skipInvisible.
Referenced by MSO_UpdateVisibleButtons(), UI_FindOptionByValue(), UI_FindOptionPosition(), and UI_OptionTreeNodeDraw().
Remove the higher element (in alphabet) from a list.
Definition at line 266 of file ui_data.c.
References _, uiNode_s::next, and OPTIONEXTRADATA.
Referenced by UI_SortOptions().
void UI_RegisterLineStrip | ( | int | dataId, | |
lineStrip_t * | lineStrip | |||
) |
Definition at line 357 of file ui_data.c.
References uiSharedData_s::data, uiSharedData_s::lineStrip, uiGlobal_s::sharedData, uiSharedData_s::type, ui_global, UI_ResetData(), UI_SHARED_LINESTRIP, and uiSharedData_s::versionId.
Referenced by CL_NationStatsUpdate_f().
void UI_RegisterLinkedListText | ( | int | dataId, | |
linkedList_t * | text | |||
) |
share a linked list of text with a data id
It is a hack to disable release memory, if we only want to update the same list
Definition at line 150 of file ui_data.c.
References uiSharedData_s::data, uiSharedData_s::linkedListText, uiGlobal_s::sharedData, uiSharedData_s::type, ui_global, UI_ResetData(), UI_SHARED_LINKEDLISTTEXT, and uiSharedData_s::versionId.
Referenced by AIM_UpdateAircraftItemList(), AIR_AircraftUpdateList_f(), B_BuildingInit(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_UpdateAircraftItemList(), BS_BuyType(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_ParseTeamInfoMessage(), CLMN_InitKeyList_f(), E_EmployeeList_f(), GAME_CP_GetCampaigns_f(), Irc_Client_Names_f(), MP_AddChatMessage(), PR_UpdateProductionList(), TR_CargoList(), TR_TransferSelect(), TUT_GetTutorials_f(), UI_MaterialEditorUpdate(), UI_PopupList(), UP_DisplayTechTree(), UR_DialogFillNations(), and UR_DialogInitStore_f().
void UI_RegisterOption | ( | int | dataId, | |
uiNode_t * | option | |||
) |
Hack to disable release option memory, if we only want to update the same option
Definition at line 344 of file ui_data.c.
References uiSharedData_s::data, uiSharedData_s::option, uiGlobal_s::sharedData, uiSharedData_s::type, ui_global, UI_ResetData(), UI_SHARED_OPTION, and uiSharedData_s::versionId.
Referenced by AIM_UpdateAircraftItemList(), CL_InitSkin_f(), CL_LanguageInit(), CL_SetRatioFilter_f(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), GAME_InitMenuOptions(), IN_JoystickInitMenu(), MSO_InitList(), TR_InitBaseList(), TR_TransferAliensFromMission_f(), and UP_GenerateSummary().
void UI_RegisterText | ( | int | dataId, | |
const char * | text | |||
) |
share a text with a data id
Definition at line 134 of file ui_data.c.
References uiSharedData_s::data, uiGlobal_s::sharedData, uiSharedData_s::text, uiSharedData_s::type, ui_global, UI_ResetData(), UI_SHARED_TEXT, and uiSharedData_s::versionId.
Referenced by AIM_AircraftEquipMenuUpdate(), AIR_AircraftSelect(), B_DrawBuilding(), BaseSummary_Init(), CL_AddTargetingBox(), CL_DisplayPopupAircraft(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_GetTipOfTheDay_f(), CL_ParseServerInfoMessage(), CL_PingServers_f(), CL_SelectTeam_Init_f(), CL_ServerListClick_f(), CL_StatsUpdate_f(), CL_TeamNum_f(), CP_BaseAttackStartMission(), CP_CheckLostCondition(), CP_EndGame_f(), CP_InitMissionResults(), GAME_CP_CampaignListClick_f(), GAME_CP_GetCampaigns_f(), HUD_MapDebugCursor(), HUD_Update(), HUD_UpdateActor(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), INS_SetInstallationTitle(), INV_ItemDescription(), Irc_AppendToBuffer(), Irc_Input_Activate_f(), MAP_DrawMap(), MAP_DrawMapMarkers(), MAP_MapClick(), PR_AircraftInfo(), PR_DisassemblyInfo(), PR_ItemProductionInfo(), PR_ProductionInfo(), TR_TransferBaseSelect(), UI_Popup(), UI_PopupButton(), UI_PopupList(), UP_AircraftDescription(), UP_AircraftItemDescription(), UP_Article(), UP_BuildingDescription(), UP_OpenMail_f(), UP_SetMailHeader(), and UP_UGVDescription().
void UI_ResetData | ( | int | dataId | ) |
Reset a shared data. Type became NONE and value became NULL.
Definition at line 238 of file ui_data.c.
References _Mem_AllocatedInPool(), com_genericPool, uiSharedData_s::data, uiSharedData_s::linkedListText, LIST_Delete(), uiSharedData_s::option, uiGlobal_s::sharedData, uiSharedData_s::text, uiSharedData_s::type, UI_DeleteOption(), ui_global, UI_MAX_DATAID, UI_SHARED_LINKEDLISTTEXT, UI_SHARED_NONE, UI_SHARED_OPTION, and uiSharedData_s::versionId.
Referenced by AIM_AircraftEquipMenuUpdate(), AIR_AircraftSelect(), BDEF_BaseDefenceMenuUpdate_f(), BS_BuyType(), CL_ParseTeamInfoMessage(), CL_ResearchSelect_f(), CL_SelectTeam_Init_f(), E_EmployeeList_f(), GAME_SK_Shutdown(), HOS_EmployeeInit_f(), HUD_PopupFiremodeReservation(), HUD_UpdateActorFireMode(), HUD_UpdateActorMove(), HUD_UpdateCursor(), INS_SetInstallationTitle(), INV_ItemDescription(), Irc_Input_Deactivate_f(), Irc_Logic_Disconnect(), MAP_DrawMap(), MAP_DrawMapMarkers(), MP_UpdateMenuParameters_f(), MSO_InitList(), MSO_ShutdownCallbacks(), RS_UpdateInfo(), TR_TransferSelect(), UI_PopupList(), UI_RegisterLineStrip(), UI_RegisterLinkedListText(), UI_RegisterOption(), UI_RegisterText(), UI_ResetData_f(), UI_TextListNodeDraw(), UP_AircraftItemDescription(), UP_Article(), UP_ChangeDisplay(), and UP_SetMailHeader().
static void UI_ResetData_f | ( | void | ) | [static] |
Resets the ui_global.sharedData pointers from a func node.
Definition at line 520 of file ui_data.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, UI_GetDataIDByName(), UI_MAX_DATAID, and UI_ResetData().
Referenced by UI_InitData().
void UI_SortOptions | ( | uiNode_t ** | first | ) |
Sort options by alphabet.
Definition at line 306 of file ui_data.c.
References uiNode_s::next, and UI_OptionNodeRemoveHigherOption().
Referenced by CL_LanguageInit(), UI_OptionNodeSortOptions(), and UP_GenerateArticlesSummary().
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 330 of file ui_data.c.
References uiNode_s::invis, LIST_ContainsString(), uiNode_s::name, uiNode_s::next, qfalse, and qtrue.
Referenced by GAME_SK_HideDropships(), and GAME_SK_HideUFOs().
const char* const ui_sharedDataIDNames[] [static] |
Definition at line 35 of file ui_data.c.
Referenced by UI_GetDataIDByName().