00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CLIENT_UI_UI_DATA_H
00028 #define CLIENT_UI_UI_DATA_H
00029
00030 #include "../../shared/ufotypes.h"
00031 #include "../../shared/shared.h"
00032 #include "ui_nodes.h"
00033 #include "node/ui_node_option.h"
00034
00035
00036 struct linkedList_s;
00037 struct uiIcon_s;
00038
00040 typedef enum {
00041 TEXT_NULL,
00042 TEXT_STANDARD,
00043 TEXT_LIST,
00044 TEXT_LIST2,
00045 TEXT_UFOPEDIA,
00046 TEXT_UFOPEDIA_REQUIREMENT,
00047 TEXT_BUILDINGS,
00048 TEXT_BUILDING_INFO,
00049 TEXT_RESEARCH,
00050 TEXT_POPUP,
00051 TEXT_POPUP_INFO,
00052 TEXT_AIRCRAFT_LIST,
00053 TEXT_AIRCRAFT_INFO,
00054 TEXT_CAMPAIGN_LIST,
00055 TEXT_MULTISELECTION,
00056 TEXT_PRODUCTION_LIST,
00057 TEXT_PRODUCTION_AMOUNT,
00058 TEXT_PRODUCTION_INFO,
00059 TEXT_EMPLOYEE,
00060 TEXT_MOUSECURSOR_RIGHT,
00061 TEXT_PRODUCTION_QUEUED,
00062 TEXT_STATS_BASESUMMARY,
00063 TEXT_STATS_MISSION,
00064 TEXT_STATS_BASES,
00065 TEXT_STATS_NATIONS,
00066 TEXT_STATS_EMPLOYEES,
00067 TEXT_STATS_COSTS,
00068 TEXT_STATS_INSTALLATIONS,
00069 TEXT_STATS_7,
00070 TEXT_BASE_LIST,
00071 TEXT_BASE_INFO,
00072 TEXT_TRANSFER_LIST,
00073 TEXT_TRANSFER_LIST_AMOUNT,
00074 TEXT_TRANSFER_LIST_TRANSFERED,
00075 TEXT_MOUSECURSOR_PLAYERNAMES,
00076 TEXT_CARGO_LIST,
00077 TEXT_CARGO_LIST_AMOUNT,
00078 TEXT_UFOPEDIA_MAILHEADER,
00079 TEXT_UFOPEDIA_MAIL,
00080 TEXT_MARKET_NAMES,
00081 TEXT_MARKET_STORAGE,
00082 TEXT_MARKET_MARKET,
00083 TEXT_MARKET_PRICES,
00084 TEXT_CHAT_WINDOW,
00085 TEXT_AIREQUIP_1,
00086 TEXT_AIREQUIP_2,
00087 TEXT_BASEDEFENCE_LIST,
00088 TEXT_TIPOFTHEDAY,
00089 TEXT_GENERIC,
00090 TEXT_XVI,
00091 TEXT_MOUSECURSOR_TOP,
00092 TEXT_MOUSECURSOR_BOTTOM,
00093 TEXT_MOUSECURSOR_LEFT,
00094 TEXT_MESSAGEOPTIONS,
00095 TEXT_UFORECOVERY_NATIONS,
00096 TEXT_UFORECOVERY_UFOYARDS,
00097 TEXT_UFORECOVERY_CAPACITIES,
00098 TEXT_MATERIAL_STAGES,
00099 TEXT_IRCCONTENT,
00100 TEXT_IRCUSERS,
00101 TEXT_MULTIPLAYER_USERLIST,
00102 TEXT_MULTIPLAYER_USERTEAM,
00103 TEXT_ITEMDESCRIPTION,
00104
00105 OPTION_LANGUAGES,
00106 OPTION_JOYSTICKS,
00107 OPTION_VIDEO_RESOLUTIONS,
00108 OPTION_SINGLEPLAYER_SKINS,
00109 OPTION_MULTIPLAYER_SKINS,
00110 OPTION_UFOPEDIA,
00111 OPTION_UFOS,
00112 OPTION_DROPSHIPS,
00113 OPTION_BASELIST,
00114 OPTION_TEAMDEFS,
00115
00116 LINESTRIP_FUNDING,
00117 LINESTRIP_COLOR,
00118
00119 UI_MAX_DATAID
00120 } uiTextIDs_t;
00121
00122 typedef enum {
00123 UI_SHARED_NONE = 0,
00124 UI_SHARED_TEXT,
00125 UI_SHARED_LINKEDLISTTEXT,
00126 UI_SHARED_OPTION,
00127 UI_SHARED_LINESTRIP
00128 } uiSharedType_t;
00129
00130 typedef struct uiSharedData_s {
00131 uiSharedType_t type;
00132 union {
00134 const char *text;
00136 struct linkedList_s *linkedListText;
00138 struct uiNode_s *option;
00140 struct lineStrip_s *lineStrip;
00141 } data;
00142 int versionId;
00143 } uiSharedData_t;
00144
00145 #define MAX_DEPTH_OPTIONITERATORCACHE 8
00146
00147 typedef struct {
00148 uiNode_t* option;
00149 uiNode_t* depthCache[MAX_DEPTH_OPTIONITERATORCACHE];
00150 int depthPos;
00151 qboolean skipInvisible;
00152 qboolean skipCollapsed;
00153 } uiOptionIterator_t;
00154
00155
00156 int UI_GetDataVersion(int textId) __attribute__ ((warn_unused_result));
00157 void UI_ResetData(int dataId);
00158 int UI_GetDataIDByName(const char* name) __attribute__ ((warn_unused_result));
00159 void UI_InitData(void);
00160
00161
00162 void UI_RegisterText(int textId, const char *text);
00163 const char *UI_GetText(int textId) __attribute__ ((warn_unused_result));
00164
00165
00166 void UI_RegisterLinkedListText(int textId, struct linkedList_s *text);
00167
00168
00169 void UI_RegisterOption(int dataId, struct uiNode_s *option);
00170 struct uiNode_s *UI_GetOption(int dataId) __attribute__ ((warn_unused_result));
00171 void UI_SortOptions(struct uiNode_s **option);
00172 struct uiNode_s* UI_InitOptionIteratorAtIndex(int index, struct uiNode_s* option, uiOptionIterator_t* iterator);
00173 struct uiNode_s* UI_OptionIteratorNextOption(uiOptionIterator_t* iterator);
00174 void UI_UpdateInvisOptions(struct uiNode_s *option, const struct linkedList_s *stringList);
00175 struct uiNode_s* UI_FindOptionByValue(uiOptionIterator_t* iterator, const char* value);
00176 int UI_FindOptionPosition(uiOptionIterator_t* iterator, const struct uiNode_s* option);
00177 struct uiNode_s* UI_AddOption(struct uiNode_s**tree, const char* name, const char* label, const char* value);
00178
00179
00180 void UI_RegisterLineStrip(int dataId, struct lineStrip_s *text);
00181
00182 #endif