| 1 | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ |
| 2 | /* If you are missing that file, acquire a complete release at teeworlds.com. */ |
| 3 | #ifndef GAME_CLIENT_COMPONENTS_MENUS_H |
| 4 | #define |
| 5 | |
| 6 | #include <base/types.h> |
| 7 | #include <base/vmath.h> |
| 8 | |
| 9 | #include <engine/console.h> |
| 10 | #include <engine/demo.h> |
| 11 | #include <engine/friends.h> |
| 12 | #include <engine/serverbrowser.h> |
| 13 | #include <engine/shared/config.h> |
| 14 | #include <engine/textrender.h> |
| 15 | |
| 16 | #include <game/client/component.h> |
| 17 | #include <game/client/components/community_icons.h> |
| 18 | #include <game/client/components/mapimages.h> |
| 19 | #include <game/client/components/menus_ingame_touch_controls.h> |
| 20 | #include <game/client/components/menus_settings_controls.h> |
| 21 | #include <game/client/components/menus_start.h> |
| 22 | #include <game/client/components/skins7.h> |
| 23 | #include <game/client/lineinput.h> |
| 24 | #include <game/client/ui.h> |
| 25 | #include <game/voting.h> |
| 26 | |
| 27 | #include <chrono> |
| 28 | #include <deque> |
| 29 | #include <optional> |
| 30 | #include <vector> |
| 31 | |
| 32 | class : public CComponent |
| 33 | { |
| 34 | static ColorRGBA ; |
| 35 | static ColorRGBA ; |
| 36 | static ColorRGBA ; |
| 37 | static ColorRGBA ; |
| 38 | static ColorRGBA ; |
| 39 | static ColorRGBA ; |
| 40 | static ColorRGBA ; |
| 41 | static ColorRGBA ; |
| 42 | static ColorRGBA ; |
| 43 | static ColorRGBA ; |
| 44 | |
| 45 | public: |
| 46 | int (const void *pId, int Checked, const CUIRect *pRect, bool Active, unsigned Flags = BUTTONFLAG_LEFT); |
| 47 | int (CButtonContainer *pButtonContainer, const char *pText, int Checked, const CUIRect *pRect, unsigned Flags = BUTTONFLAG_LEFT, const char *pImageName = nullptr, int Corners = IGraphics::CORNER_ALL, float Rounding = 5.0f, float FontFactor = 0.0f, ColorRGBA Color = ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f)); |
| 48 | int (CButtonContainer *pButtonContainer, const char *pText, int Checked, const CUIRect *pRect, int Corners, SUIAnimator *pAnimator = nullptr, const ColorRGBA *pDefaultColor = nullptr, const ColorRGBA *pActiveColor = nullptr, const ColorRGBA *pHoverColor = nullptr, float EdgeRounding = 10.0f, const CCommunityIcon * = nullptr); |
| 49 | |
| 50 | int (const void *pId, const char *pText, const char *pBoxText, const CUIRect *pRect, unsigned Flags); |
| 51 | int (const void *pId, const char *pText, int Checked, const CUIRect *pRect); |
| 52 | int DoButton_CheckBoxAutoVMarginAndSet(const void *pId, const char *pText, int *pValue, CUIRect *pRect, float VMargin); |
| 53 | int (const void *pId, const char *pText, int Checked, const CUIRect *pRect); |
| 54 | |
| 55 | bool (CUIRect &View, const char *pLabel, std::vector<CButtonContainer> &vButtonContainers, const std::vector<const char *> &vLabels, const std::vector<int> &vValues, int &Value); |
| 56 | |
| 57 | private: |
| 58 | CUi::SColorPickerPopupContext ; |
| 59 | ColorHSLA (CButtonContainer *pResetId, float LineSize, float LabelSize, float BottomMargin, CUIRect *pMainRect, const char *pText, unsigned int *pColorValue, ColorRGBA DefaultColor, bool CheckBoxSpacing = true, int *pCheckBoxValue = nullptr, bool Alpha = false); |
| 60 | ColorHSLA (const CUIRect *pRect, unsigned int *pHslaColor, bool Alpha); |
| 61 | |
| 62 | void (const CUIRect *pRect, ColorHSLA OutlineColor, ColorHSLA InnerColor, int LaserType); |
| 63 | int (const void *pId, const char *pText, int Checked, const CUIRect *pRect, int Align = TEXTALIGN_ML); |
| 64 | int (const void *pButtonId, const void *pParentId, bool Checked, const CUIRect *pRect); |
| 65 | |
| 66 | bool = false; |
| 67 | std::optional<std::chrono::nanoseconds> ; |
| 68 | std::optional<std::chrono::nanoseconds> ; |
| 69 | |
| 70 | int ; |
| 71 | |
| 72 | // menus_settings_assets.cpp |
| 73 | public: |
| 74 | struct |
| 75 | { |
| 76 | IGraphics::CTextureHandle ; |
| 77 | |
| 78 | char [50]; |
| 79 | |
| 80 | bool (const SCustomItem &Other) const { return str_comp(a: m_aName, b: Other.m_aName) < 0; } |
| 81 | }; |
| 82 | |
| 83 | struct : public SCustomItem |
| 84 | { |
| 85 | struct |
| 86 | { |
| 87 | IGraphics::CTextureHandle ; |
| 88 | }; |
| 89 | SEntitiesImage [MAP_IMAGE_MOD_TYPE_COUNT]; |
| 90 | }; |
| 91 | |
| 92 | struct : public SCustomItem |
| 93 | { |
| 94 | }; |
| 95 | |
| 96 | struct : public SCustomItem |
| 97 | { |
| 98 | }; |
| 99 | |
| 100 | struct SCustomParticle : public SCustomItem |
| 101 | { |
| 102 | }; |
| 103 | |
| 104 | struct : public SCustomItem |
| 105 | { |
| 106 | }; |
| 107 | |
| 108 | struct : public SCustomItem |
| 109 | { |
| 110 | }; |
| 111 | |
| 112 | protected: |
| 113 | std::vector<SCustomEntities> ; |
| 114 | std::vector<SCustomGame> ; |
| 115 | std::vector<SCustomEmoticon> ; |
| 116 | std::vector<SCustomParticle> m_vParticlesList; |
| 117 | std::vector<SCustomHud> ; |
| 118 | std::vector<SCustomExtras> ; |
| 119 | |
| 120 | bool = false; |
| 121 | |
| 122 | static void (struct SCustomEntities *pEntitiesItem, void *pUser); |
| 123 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 124 | |
| 125 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 126 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 127 | static int ParticlesScan(const char *pName, int IsDir, int DirType, void *pUser); |
| 128 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 129 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 130 | |
| 131 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 132 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 133 | static void ConchainAssetParticles(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 134 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 135 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 136 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 137 | |
| 138 | void (int CurTab); |
| 139 | |
| 140 | int ; |
| 141 | int ; |
| 142 | int ; |
| 143 | bool ; |
| 144 | bool ; |
| 145 | |
| 146 | bool = false; |
| 147 | |
| 148 | bool = false; |
| 149 | bool = false; |
| 150 | bool = false; |
| 151 | |
| 152 | char [256]; |
| 153 | |
| 154 | // images |
| 155 | struct |
| 156 | { |
| 157 | char [64]; |
| 158 | IGraphics::CTextureHandle ; |
| 159 | IGraphics::CTextureHandle ; |
| 160 | }; |
| 161 | std::vector<CMenuImage> ; |
| 162 | static int (const char *pName, int IsDir, int DirType, void *pUser); |
| 163 | const CMenuImage *(const char *pName); |
| 164 | |
| 165 | // loading |
| 166 | class |
| 167 | { |
| 168 | public: |
| 169 | std::chrono::nanoseconds {0}; |
| 170 | int ; |
| 171 | int ; |
| 172 | }; |
| 173 | CLoadingState ; |
| 174 | |
| 175 | // |
| 176 | char [512]; |
| 177 | char m_aMessageBody[512]; |
| 178 | char [512]; |
| 179 | |
| 180 | CUIElement ; |
| 181 | CUIElement ; |
| 182 | |
| 183 | // generic popups |
| 184 | typedef void (CMenus::*)(); |
| 185 | void () |
| 186 | { |
| 187 | // do nothing |
| 188 | } |
| 189 | enum |
| 190 | { |
| 191 | = 0, // confirm / yes / close / ok |
| 192 | , // cancel / no |
| 193 | |
| 194 | }; |
| 195 | char [128]; |
| 196 | char [IO_MAX_PATH_LENGTH + 256]; |
| 197 | struct |
| 198 | { |
| 199 | char [64]; |
| 200 | int ; |
| 201 | FPopupButtonCallback ; |
| 202 | } [NUM_BUTTONS]; |
| 203 | |
| 204 | void (const char *pTitle, const char *pMessage, |
| 205 | const char *pButtonLabel, int = POPUP_NONE, FPopupButtonCallback pfnButtonCallback = &CMenus::DefaultButtonCallback); |
| 206 | void (const char *pTitle, const char *pMessage, |
| 207 | const char *pConfirmButtonLabel, const char *pCancelButtonLabel, |
| 208 | FPopupButtonCallback pfnConfirmButtonCallback = &CMenus::DefaultButtonCallback, int = POPUP_NONE, |
| 209 | FPopupButtonCallback pfnCancelButtonCallback = &CMenus::DefaultButtonCallback, int = POPUP_NONE); |
| 210 | |
| 211 | // some settings |
| 212 | static float ; |
| 213 | static float ; |
| 214 | static float ; |
| 215 | |
| 216 | // for settings |
| 217 | bool ; |
| 218 | bool ; |
| 219 | bool ; |
| 220 | bool ; |
| 221 | bool ; |
| 222 | int ; |
| 223 | |
| 224 | // 0.7 skins |
| 225 | bool = false; |
| 226 | int = protocol7::SKINPART_BODY; |
| 227 | const CSkins7::CSkin * = nullptr; |
| 228 | CLineInputBuffered<protocol7::MAX_SKIN_ARRAY_SIZE, protocol7::MAX_SKIN_LENGTH> ; |
| 229 | bool = false; |
| 230 | void (); |
| 231 | |
| 232 | // for map download popup |
| 233 | int64_t ; |
| 234 | int ; |
| 235 | float ; |
| 236 | |
| 237 | // for password popup |
| 238 | CLineInput ; |
| 239 | |
| 240 | // for call vote |
| 241 | int ; |
| 242 | int ; |
| 243 | CLineInputBuffered<VOTE_REASON_LENGTH> ; |
| 244 | CLineInputBuffered<64> ; |
| 245 | bool ; |
| 246 | |
| 247 | // demo |
| 248 | enum |
| 249 | { |
| 250 | = 0, |
| 251 | , |
| 252 | , |
| 253 | , |
| 254 | }; |
| 255 | |
| 256 | class |
| 257 | { |
| 258 | public: |
| 259 | char [IO_MAX_PATH_LENGTH]; |
| 260 | char [IO_MAX_PATH_LENGTH]; |
| 261 | bool ; |
| 262 | bool ; |
| 263 | int ; |
| 264 | time_t ; |
| 265 | int64_t ; |
| 266 | |
| 267 | bool ; |
| 268 | bool ; |
| 269 | CDemoHeader ; |
| 270 | CTimelineMarkers ; |
| 271 | CMapInfo ; |
| 272 | |
| 273 | int () const |
| 274 | { |
| 275 | return std::clamp<int>(val: bytes_be_to_uint(bytes: m_TimelineMarkers.m_aNumTimelineMarkers), lo: 0, hi: MAX_TIMELINE_MARKERS); |
| 276 | } |
| 277 | |
| 278 | int () const |
| 279 | { |
| 280 | return bytes_be_to_uint(bytes: m_Info.m_aLength); |
| 281 | } |
| 282 | |
| 283 | unsigned () const |
| 284 | { |
| 285 | return bytes_be_to_uint(bytes: m_Info.m_aMapSize); |
| 286 | } |
| 287 | |
| 288 | bool (const CDemoItem &Other) const |
| 289 | { |
| 290 | if(!str_comp(a: m_aFilename, b: ".." )) |
| 291 | return true; |
| 292 | if(!str_comp(a: Other.m_aFilename, b: ".." )) |
| 293 | return false; |
| 294 | if(m_IsDir && !Other.m_IsDir) |
| 295 | return true; |
| 296 | if(!m_IsDir && Other.m_IsDir) |
| 297 | return false; |
| 298 | |
| 299 | const CDemoItem &Left = g_Config.m_BrDemoSortOrder ? Other : *this; |
| 300 | const CDemoItem &Right = g_Config.m_BrDemoSortOrder ? *this : Other; |
| 301 | |
| 302 | if(g_Config.m_BrDemoSort == SORT_DEMONAME) |
| 303 | return str_comp_filenames(a: Left.m_aFilename, b: Right.m_aFilename) < 0; |
| 304 | if(g_Config.m_BrDemoSort == SORT_DATE) |
| 305 | return Left.m_Date < Right.m_Date; |
| 306 | |
| 307 | if(!Other.m_InfosLoaded) |
| 308 | return m_InfosLoaded; |
| 309 | if(!m_InfosLoaded) |
| 310 | return !Other.m_InfosLoaded; |
| 311 | |
| 312 | if(g_Config.m_BrDemoSort == SORT_MARKERS) |
| 313 | return Left.NumMarkers() < Right.NumMarkers(); |
| 314 | if(g_Config.m_BrDemoSort == SORT_LENGTH) |
| 315 | return Left.Length() < Right.Length(); |
| 316 | |
| 317 | // Unknown sort |
| 318 | return true; |
| 319 | } |
| 320 | }; |
| 321 | |
| 322 | char [IO_MAX_PATH_LENGTH]; |
| 323 | char [IO_MAX_PATH_LENGTH]; |
| 324 | CLineInputBuffered<IO_MAX_PATH_LENGTH> ; |
| 325 | CLineInputBuffered<IO_MAX_PATH_LENGTH> ; |
| 326 | CLineInputBuffered<IO_MAX_PATH_LENGTH> ; |
| 327 | #if defined(CONF_VIDEORECORDER) |
| 328 | CLineInputBuffered<IO_MAX_PATH_LENGTH> ; |
| 329 | #endif |
| 330 | int ; |
| 331 | bool = false; |
| 332 | int ; |
| 333 | bool = false; |
| 334 | int = 4; |
| 335 | bool = false; |
| 336 | |
| 337 | std::chrono::nanoseconds {0}; |
| 338 | |
| 339 | void (bool Reset); |
| 340 | static int (const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser); |
| 341 | |
| 342 | // friends |
| 343 | class |
| 344 | { |
| 345 | char [MAX_NAME_LENGTH]; |
| 346 | char [MAX_CLAN_LENGTH]; |
| 347 | const CServerInfo *; |
| 348 | int ; |
| 349 | bool ; |
| 350 | bool ; |
| 351 | // skin info 0.6 |
| 352 | char [MAX_SKIN_LENGTH]; |
| 353 | bool ; |
| 354 | int m_CustomSkinColorBody; |
| 355 | int ; |
| 356 | // skin info 0.7 |
| 357 | char [protocol7::NUM_SKINPARTS][protocol7::MAX_SKIN_LENGTH]; |
| 358 | bool [protocol7::NUM_SKINPARTS]; |
| 359 | int [protocol7::NUM_SKINPARTS]; |
| 360 | |
| 361 | public: |
| 362 | (const CFriendInfo *pFriendInfo) : |
| 363 | m_pServerInfo(nullptr), |
| 364 | m_IsPlayer(false), |
| 365 | m_IsAfk(false), |
| 366 | m_CustomSkinColors(false), |
| 367 | m_CustomSkinColorBody(0), |
| 368 | m_CustomSkinColorFeet(0) |
| 369 | { |
| 370 | str_copy(dst&: m_aName, src: pFriendInfo->m_aName); |
| 371 | str_copy(dst&: m_aClan, src: pFriendInfo->m_aClan); |
| 372 | m_FriendState = m_aName[0] == '\0' ? IFriends::FRIEND_CLAN : IFriends::FRIEND_PLAYER; |
| 373 | m_aSkin[0] = '\0'; |
| 374 | for(int Part = 0; Part < protocol7::NUM_SKINPARTS; Part++) |
| 375 | { |
| 376 | m_aaSkin7[Part][0] = '\0'; |
| 377 | m_aUseCustomSkinColor7[Part] = false; |
| 378 | m_aCustomSkinColor7[Part] = 0; |
| 379 | } |
| 380 | } |
| 381 | (const CServerInfo::CClient &CurrentClient, const CServerInfo *pServerInfo) : |
| 382 | m_pServerInfo(pServerInfo), |
| 383 | m_FriendState(CurrentClient.m_FriendState), |
| 384 | m_IsPlayer(CurrentClient.m_Player), |
| 385 | m_IsAfk(CurrentClient.m_Afk), |
| 386 | m_CustomSkinColors(CurrentClient.m_CustomSkinColors), |
| 387 | m_CustomSkinColorBody(CurrentClient.m_CustomSkinColorBody), |
| 388 | m_CustomSkinColorFeet(CurrentClient.m_CustomSkinColorFeet) |
| 389 | { |
| 390 | str_copy(dst&: m_aName, src: CurrentClient.m_aName); |
| 391 | str_copy(dst&: m_aClan, src: CurrentClient.m_aClan); |
| 392 | str_copy(dst&: m_aSkin, src: CurrentClient.m_aSkin); |
| 393 | for(int Part = 0; Part < protocol7::NUM_SKINPARTS; Part++) |
| 394 | { |
| 395 | str_copy(dst&: m_aaSkin7[Part], src: CurrentClient.m_aaSkin7[Part]); |
| 396 | m_aUseCustomSkinColor7[Part] = CurrentClient.m_aUseCustomSkinColor7[Part]; |
| 397 | m_aCustomSkinColor7[Part] = CurrentClient.m_aCustomSkinColor7[Part]; |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | const char *() const { return m_aName; } |
| 402 | const char *() const { return m_aClan; } |
| 403 | const CServerInfo *() const { return m_pServerInfo; } |
| 404 | int () const { return m_FriendState; } |
| 405 | bool () const { return m_IsPlayer; } |
| 406 | bool () const { return m_IsAfk; } |
| 407 | // 0.6 skin |
| 408 | const char *() const { return m_aSkin; } |
| 409 | bool () const { return m_CustomSkinColors; } |
| 410 | int CustomSkinColorBody() const { return m_CustomSkinColorBody; } |
| 411 | int () const { return m_CustomSkinColorFeet; } |
| 412 | // 0.7 skin |
| 413 | const char *(int Part) const { return m_aaSkin7[Part]; } |
| 414 | bool (int Part) const { return m_aUseCustomSkinColor7[Part]; } |
| 415 | int (int Part) const { return m_aCustomSkinColor7[Part]; } |
| 416 | |
| 417 | const void *() const { return &m_aName; } |
| 418 | const void *() const { return &m_FriendState; } |
| 419 | const void *() const { return &m_IsPlayer; } |
| 420 | const void *() const { return &m_aSkin; } |
| 421 | |
| 422 | bool (const CFriendItem &Other) const |
| 423 | { |
| 424 | const int Result = str_comp_nocase(a: m_aName, b: Other.m_aName); |
| 425 | return Result < 0 || (Result == 0 && str_comp_nocase(a: m_aClan, b: Other.m_aClan) < 0); |
| 426 | } |
| 427 | }; |
| 428 | |
| 429 | enum |
| 430 | { |
| 431 | = 0, |
| 432 | , |
| 433 | , |
| 434 | |
| 435 | }; |
| 436 | std::vector<CFriendItem> [NUM_FRIEND_TYPES]; |
| 437 | const CFriendItem * = nullptr; |
| 438 | |
| 439 | // found in menus.cpp |
| 440 | void (); |
| 441 | void (CUIRect Screen); |
| 442 | void (CUIRect Screen); |
| 443 | void (CUIRect Screen); |
| 444 | #if defined(CONF_VIDEORECORDER) |
| 445 | void (); |
| 446 | #endif |
| 447 | void (CUIRect Box, IClient::EClientState ClientState); |
| 448 | void (CUIRect MainView); |
| 449 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 450 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 451 | void (); |
| 452 | |
| 453 | // found in menus_demo.cpp |
| 454 | vec2 = vec2(0.0f, 0.0f); |
| 455 | float = -1.0f; |
| 456 | float = -1.0f; |
| 457 | static constexpr int = 3; |
| 458 | int = DEFAULT_SKIP_DURATION_INDEX; |
| 459 | static bool (const void *pData, int Size, void *pUser); |
| 460 | bool (CDemoItem &Item); |
| 461 | void (); |
| 462 | void HandleDemoSeeking(float PositionToSeek, float TimeToSeek); |
| 463 | void (CUIRect MainView); |
| 464 | void (CUIRect MainView); |
| 465 | bool = false; |
| 466 | void (CUIRect MainView); |
| 467 | void (CUIRect ListView, bool &WasListboxItemActivated); |
| 468 | void (CUIRect DetailsView); |
| 469 | void (CUIRect ButtonsView, bool WasListboxItemActivated); |
| 470 | void (); |
| 471 | void (); |
| 472 | void (); |
| 473 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 474 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 475 | |
| 476 | // found in menus_ingame.cpp |
| 477 | STextContainerIndex ; |
| 478 | void (CUIRect MainView); |
| 479 | void (); |
| 480 | void (); |
| 481 | void (); |
| 482 | void (); |
| 483 | void (); |
| 484 | void (); |
| 485 | void (); |
| 486 | void (); |
| 487 | void (); |
| 488 | void (); |
| 489 | void (); |
| 490 | void (CUIRect MainView); |
| 491 | void (CUIRect MainView); |
| 492 | void (CUIRect Motd); |
| 493 | void (CUIRect MainView); |
| 494 | bool (CUIRect MainView, bool FilterSpectators, bool UpdateScroll); |
| 495 | bool (CUIRect MainView, bool UpdateScroll); |
| 496 | void (); |
| 497 | |
| 498 | // found in menus_browser.cpp |
| 499 | int ; |
| 500 | bool ; |
| 501 | std::vector<CUIElement *> [IServerBrowser::NUM_TYPES]; |
| 502 | void (CUIRect View, bool &WasListboxItemActivated); |
| 503 | void (CUIRect StatusBox, bool WasListboxItemActivated); |
| 504 | void (const char *pAddress); |
| 505 | void (); |
| 506 | void (CUIRect View); |
| 507 | void (); |
| 508 | void (CUIRect View, |
| 509 | IFilterList &Filter, |
| 510 | float ItemHeight, int MaxItems, int ItemsPerRow, |
| 511 | CScrollRegion &ScrollRegion, std::vector<unsigned char> &vItemIds, |
| 512 | bool , |
| 513 | const std::function<const char *(int ItemIndex)> &GetItemName, |
| 514 | const std::function<void(int ItemIndex, CUIRect Item, const void *pItemId, bool Active)> &RenderItem); |
| 515 | void (CUIRect View); |
| 516 | void (CUIRect View); |
| 517 | void (CUIRect View); |
| 518 | struct |
| 519 | { |
| 520 | CMenus *; |
| 521 | int ; |
| 522 | bool ; |
| 523 | }; |
| 524 | static CUi::EPopupMenuFunctionResult (void *pContext, CUIRect View, bool Active); |
| 525 | void (CUIRect View); |
| 526 | void (CUIRect View, const CServerInfo *pSelectedServer); |
| 527 | void (CUIRect View); |
| 528 | void (); |
| 529 | void (); |
| 530 | void (CUIRect TabBar); |
| 531 | void (CUIRect ToolBox); |
| 532 | void (CUIRect MainView); |
| 533 | template<typename F> |
| 534 | bool (const char *pName, F &&PrintFn); |
| 535 | CTeeRenderInfo (vec2 Size, const char *pSkinName, bool CustomSkinColors, int CustomSkinColorBody, int CustomSkinColorFeet) const; |
| 536 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 537 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 538 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 539 | static void (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); |
| 540 | void (bool Force); |
| 541 | |
| 542 | // found in menus_settings.cpp |
| 543 | void (CUIRect MainView); |
| 544 | bool (CUIRect MainView); |
| 545 | void (CUIRect MainView); |
| 546 | void (CUIRect MainView); |
| 547 | void (CUIRect MainView); |
| 548 | void (CUIRect MainView); |
| 549 | void (CUIRect MainView); |
| 550 | void (CUIRect MainView); |
| 551 | void (CUIRect MainView); |
| 552 | void (CUIRect MainView); |
| 553 | void (CUIRect MainView); |
| 554 | void (CUIRect MainView); |
| 555 | void (CUIRect MainView); |
| 556 | void (CUIRect MainView); |
| 557 | |
| 558 | // found in menus_settings_controls.cpp |
| 559 | // TODO: Change PopupConfirm to avoid using a function pointer to a CMenus |
| 560 | // member function, to move this function to CMenusSettingsControls |
| 561 | void (); |
| 562 | |
| 563 | std::vector<CButtonContainer> = {{}, {}, {}, {}}; |
| 564 | std::vector<CButtonContainer> = {{}, {}, {}, {}}; |
| 565 | |
| 566 | class |
| 567 | { |
| 568 | public: |
| 569 | char [IO_MAX_PATH_LENGTH]; |
| 570 | bool ; |
| 571 | }; |
| 572 | class |
| 573 | { |
| 574 | public: |
| 575 | std::vector<CMapListItem> ; |
| 576 | char [IO_MAX_PATH_LENGTH] = "" ; |
| 577 | static int (const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser); |
| 578 | void (); |
| 579 | CMenus *; |
| 580 | int ; |
| 581 | }; |
| 582 | |
| 583 | static bool (const CMapListItem Lhs, const CMapListItem Rhs) |
| 584 | { |
| 585 | if(str_comp(a: Lhs.m_aFilename, b: ".." ) == 0) |
| 586 | return true; |
| 587 | if(str_comp(a: Rhs.m_aFilename, b: ".." ) == 0) |
| 588 | return false; |
| 589 | if(Lhs.m_IsDirectory != Rhs.m_IsDirectory) |
| 590 | return Lhs.m_IsDirectory; |
| 591 | return str_comp_filenames(a: Lhs.m_aFilename, b: Rhs.m_aFilename) < 0; |
| 592 | } |
| 593 | |
| 594 | static CUi::EPopupMenuFunctionResult (void *pContext, CUIRect View, bool Active); |
| 595 | |
| 596 | void (); |
| 597 | void (); |
| 598 | |
| 599 | IGraphics::CTextureHandle ; |
| 600 | |
| 601 | public: |
| 602 | void (); |
| 603 | |
| 604 | (); |
| 605 | int () const override { return sizeof(*this); } |
| 606 | |
| 607 | void (const char *pCaption, const char *pContent, int IncreaseCounter); |
| 608 | void (); |
| 609 | |
| 610 | bool () const { return m_IsInit; } |
| 611 | |
| 612 | bool () const { return m_MenuActive; } |
| 613 | void (bool Active); |
| 614 | |
| 615 | void (CGameClient *pClient) override; |
| 616 | void () override; |
| 617 | |
| 618 | void (int NewState, int OldState) override; |
| 619 | void () override; |
| 620 | void () override; |
| 621 | void () override; |
| 622 | bool (const IInput::CEvent &Event) override; |
| 623 | bool (float x, float y, IInput::ECursorType CursorType) override; |
| 624 | void () override; |
| 625 | |
| 626 | enum |
| 627 | { |
| 628 | = 1, |
| 629 | , |
| 630 | , |
| 631 | , |
| 632 | , |
| 633 | , |
| 634 | , |
| 635 | , |
| 636 | , |
| 637 | , |
| 638 | , |
| 639 | , |
| 640 | , |
| 641 | , |
| 642 | , |
| 643 | , |
| 644 | , |
| 645 | |
| 646 | , |
| 647 | }; |
| 648 | |
| 649 | enum |
| 650 | { |
| 651 | = 0, |
| 652 | , |
| 653 | , |
| 654 | , |
| 655 | , |
| 656 | , |
| 657 | , |
| 658 | , |
| 659 | , |
| 660 | , |
| 661 | |
| 662 | , |
| 663 | }; |
| 664 | |
| 665 | enum |
| 666 | { |
| 667 | = 0, |
| 668 | , |
| 669 | , |
| 670 | , |
| 671 | , |
| 672 | , |
| 673 | , |
| 674 | , |
| 675 | , |
| 676 | , |
| 677 | |
| 678 | , |
| 679 | }; |
| 680 | |
| 681 | enum |
| 682 | { |
| 683 | = 0, |
| 684 | , |
| 685 | , |
| 686 | , |
| 687 | , |
| 688 | , |
| 689 | , |
| 690 | , |
| 691 | , |
| 692 | |
| 693 | , |
| 694 | }; |
| 695 | |
| 696 | SUIAnimator [BIG_TAB_LENGTH]; |
| 697 | SUIAnimator [SMALL_TAB_LENGTH]; |
| 698 | SUIAnimator [SETTINGS_LENGTH]; |
| 699 | |
| 700 | // DDRace |
| 701 | int (const void *pId, const char *pText, TRISTATE Checked, const CUIRect *pRect); |
| 702 | std::vector<CDemoItem> ; |
| 703 | std::vector<CDemoItem *> ; |
| 704 | void (); |
| 705 | void (); |
| 706 | void (IDemoPlayer::ETickOffset TickOffset); |
| 707 | bool ; |
| 708 | |
| 709 | const char *() const { return m_aCurrentDemoFolder; } |
| 710 | |
| 711 | // Ghost |
| 712 | struct |
| 713 | { |
| 714 | char [IO_MAX_PATH_LENGTH]; |
| 715 | char [MAX_NAME_LENGTH]; |
| 716 | |
| 717 | bool ; |
| 718 | int ; |
| 719 | int ; |
| 720 | bool ; |
| 721 | time_t ; |
| 722 | |
| 723 | () : |
| 724 | m_Slot(-1), m_Own(false) { m_aFilename[0] = 0; } |
| 725 | |
| 726 | bool (const CGhostItem &Other) const { return m_Time < Other.m_Time; } |
| 727 | |
| 728 | bool () const { return m_Slot != -1; } |
| 729 | bool () const { return m_aFilename[0]; } |
| 730 | }; |
| 731 | |
| 732 | enum |
| 733 | { |
| 734 | = -1, |
| 735 | , |
| 736 | , |
| 737 | , |
| 738 | }; |
| 739 | |
| 740 | std::vector<CGhostItem> ; |
| 741 | |
| 742 | std::chrono::nanoseconds {0}; |
| 743 | |
| 744 | void (); |
| 745 | CGhostItem *(); |
| 746 | void (CGhostItem Item); |
| 747 | void (int Index); |
| 748 | void (); |
| 749 | |
| 750 | bool CanDisplayWarning() const; |
| 751 | |
| 752 | void (const char *pTopic, const char *pBody, const char *pButton, std::chrono::nanoseconds Duration); |
| 753 | |
| 754 | std::chrono::nanoseconds ; |
| 755 | std::chrono::nanoseconds ; |
| 756 | |
| 757 | int ; |
| 758 | |
| 759 | enum |
| 760 | { |
| 761 | = 0, |
| 762 | , // generic message popup (one button) |
| 763 | , // generic confirmation popup (two buttons) |
| 764 | , |
| 765 | , |
| 766 | , |
| 767 | , |
| 768 | , |
| 769 | , |
| 770 | , |
| 771 | , |
| 772 | , |
| 773 | , |
| 774 | , |
| 775 | , |
| 776 | }; |
| 777 | |
| 778 | enum |
| 779 | { |
| 780 | // demo player states |
| 781 | = 0, |
| 782 | , |
| 783 | }; |
| 784 | |
| 785 | void (int NewPage); |
| 786 | void (bool Force); |
| 787 | void (); |
| 788 | void (bool ShowStart); |
| 789 | void (); |
| 790 | |
| 791 | private: |
| 792 | CCommunityIcons ; |
| 793 | CMenusIngameTouchControls ; |
| 794 | friend CMenusIngameTouchControls; |
| 795 | CMenusSettingsControls ; |
| 796 | friend CMenusSettingsControls; |
| 797 | CMenusStart ; |
| 798 | |
| 799 | static int (const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser); |
| 800 | |
| 801 | // found in menus_ingame.cpp |
| 802 | void (CUIRect MainView); |
| 803 | void (CUIRect MainView); |
| 804 | |
| 805 | // found in menus_settings.cpp |
| 806 | void (CUIRect MainView); |
| 807 | void (CUIRect MainView); |
| 808 | bool (CUIRect *pRect, unsigned int *pColor, bool Alpha, float DarkestLight); |
| 809 | }; |
| 810 | #endif |
| 811 | |