Data and interface to share data. More...
#include "../../shared/ufotypes.h"
#include "../../shared/shared.h"
#include "ui_nodes.h"
#include "node/ui_node_option.h"
Go to the source code of this file.
Data and interface to share data.
Definition in file ui_data.h.
#define MAX_DEPTH_OPTIONITERATORCACHE 8 |
Definition at line 145 of file ui_data.h.
Referenced by UI_FindOptionAtIndex(), and UI_OptionIteratorNextOption().
typedef struct uiSharedData_s uiSharedData_t |
enum uiSharedType_t |
enum uiTextIDs_t |
linked into ui_global.sharedData - defined in UI scripts via dataID property
struct uiNode_s* 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().
struct uiNode_s* 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 struct uiNode_s * | option | |||
) |
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().
struct uiNode_s* 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().
struct uiNode_s* 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().
struct uiNode_s* 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().
void UI_RegisterLineStrip | ( | int | dataId, | |
struct lineStrip_s * | text | |||
) |
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, | |
struct uiNode_s * | 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().
void UI_SortOptions | ( | struct uiNode_s ** | option | ) |
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 | ( | struct uiNode_s * | option, | |
const struct linkedList_s * | stringList | |||
) |