2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_CLIENT_COMPONENTS_MENUS_H
|
|
|
|
#define GAME_CLIENT_COMPONENTS_MENUS_H
|
|
|
|
|
|
|
|
#include <base/vmath.h>
|
|
|
|
#include <base/tl/sorted_array.h>
|
|
|
|
|
2011-03-13 09:41:10 +00:00
|
|
|
#include <engine/demo.h>
|
2011-06-26 15:10:13 +00:00
|
|
|
#include <engine/friends.h>
|
2020-02-19 10:24:58 +00:00
|
|
|
#include <engine/shared/config.h>
|
2020-09-03 12:08:26 +00:00
|
|
|
#include <engine/shared/linereader.h>
|
2011-03-13 09:41:10 +00:00
|
|
|
|
2011-03-26 16:44:34 +00:00
|
|
|
#include <game/voting.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/client/component.h>
|
|
|
|
#include <game/client/ui.h>
|
|
|
|
|
2020-09-03 12:08:26 +00:00
|
|
|
struct CServerProcess
|
|
|
|
{
|
2020-09-05 22:38:35 +00:00
|
|
|
PROCESS Process;
|
2020-09-03 12:08:26 +00:00
|
|
|
bool Initialized;
|
|
|
|
CLineReader LineReader;
|
|
|
|
};
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// compnent to fetch keypresses, override all other input
|
|
|
|
class CMenusKeyBinder : public CComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool m_TakeKey;
|
|
|
|
bool m_GotKey;
|
|
|
|
IInput::CEvent m_Key;
|
2019-04-28 17:22:19 +00:00
|
|
|
int m_Modifier;
|
2010-05-29 07:25:38 +00:00
|
|
|
CMenusKeyBinder();
|
|
|
|
virtual bool OnInput(IInput::CEvent Event);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CMenus : public CComponent
|
2011-04-13 18:37:12 +00:00
|
|
|
{
|
2019-04-26 21:47:34 +00:00
|
|
|
static ColorRGBA ms_GuiColor;
|
|
|
|
static ColorRGBA ms_ColorTabbarInactiveOutgame;
|
|
|
|
static ColorRGBA ms_ColorTabbarActiveOutgame;
|
|
|
|
static ColorRGBA ms_ColorTabbarInactiveIngame;
|
|
|
|
static ColorRGBA ms_ColorTabbarActiveIngame;
|
|
|
|
static ColorRGBA ms_ColorTabbarInactive;
|
|
|
|
static ColorRGBA ms_ColorTabbarActive;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2019-04-26 21:47:34 +00:00
|
|
|
float ButtonColorMul(const void *pID);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
int DoButton_DemoPlayer(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
2011-03-28 22:48:36 +00:00
|
|
|
int DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners);
|
2012-01-10 22:03:23 +00:00
|
|
|
int DoButton_Toggle(const void *pID, int Checked, const CUIRect *pRect, bool Active);
|
2020-09-03 12:08:26 +00:00
|
|
|
int DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pImageName=0, int Corners=CUI::CORNER_ALL, float r=5.0f, float FontFactor=0.0f, vec4 ColorHot=vec4(1.0f, 1.0f, 1.0f, 0.75f), vec4 Color=vec4(1,1,1,0.5f));
|
2010-05-29 07:25:38 +00:00
|
|
|
int DoButton_MenuTab(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Corners);
|
|
|
|
|
|
|
|
int DoButton_CheckBox_Common(const void *pID, const char *pText, const char *pBoxText, const CUIRect *pRect);
|
|
|
|
int DoButton_CheckBox(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
|
|
|
int DoButton_CheckBox_Number(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
|
|
|
|
|
|
|
/*static void ui_draw_menu_button(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
static void ui_draw_keyselect_button(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
static void ui_draw_menu_tab_button(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
static void ui_draw_settings_tab_button(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
*/
|
|
|
|
|
2010-11-17 18:46:50 +00:00
|
|
|
int DoButton_Icon(int ImageId, int SpriteId, const CUIRect *pRect);
|
2010-05-29 07:25:38 +00:00
|
|
|
int DoButton_GridHeader(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
|
|
|
|
|
|
|
//static void ui_draw_browse_icon(int what, const CUIRect *r);
|
|
|
|
//static void ui_draw_grid_header(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
/*static void ui_draw_checkbox_common(const void *id, const char *text, const char *boxtext, const CUIRect *r, const void *extra);
|
|
|
|
static void ui_draw_checkbox(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
static void ui_draw_checkbox_number(const void *id, const char *text, int checked, const CUIRect *r, const void *extra);
|
|
|
|
*/
|
2014-12-24 02:38:40 +00:00
|
|
|
int DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *Offset, bool Hidden=false, int Corners=CUI::CORNER_ALL, const char *pEmptyText = "");
|
2018-09-20 05:43:05 +00:00
|
|
|
int DoClearableEditBox(void *pID, void *pClearID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *Offset, bool Hidden=false, int Corners=CUI::CORNER_ALL, const char *pEmptyText = "");
|
2010-05-29 07:25:38 +00:00
|
|
|
//static int ui_do_edit_box(void *id, const CUIRect *rect, char *str, unsigned str_size, float font_size, bool hidden=false);
|
|
|
|
|
|
|
|
float DoScrollbarV(const void *pID, const CUIRect *pRect, float Current);
|
|
|
|
float DoScrollbarH(const void *pID, const CUIRect *pRect, float Current);
|
|
|
|
void DoButton_KeySelect(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
2019-04-28 17:22:19 +00:00
|
|
|
int DoKeyReader(void *pID, const CUIRect *pRect, int Key, int Modifier, int *NewModifier);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
//static int ui_do_key_reader(void *id, const CUIRect *rect, int key);
|
2017-07-22 15:35:30 +00:00
|
|
|
void UiDoGetButtons(int Start, int Stop, CUIRect View, CUIRect ScopeView);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
struct CListboxItem
|
|
|
|
{
|
|
|
|
int m_Visible;
|
|
|
|
int m_Selected;
|
|
|
|
CUIRect m_Rect;
|
|
|
|
CUIRect m_HitRect;
|
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-16 20:31:55 +00:00
|
|
|
void UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
2011-04-13 18:37:12 +00:00
|
|
|
int ItemsPerRow, int SelectedIndex, float ScrollValue);
|
2016-04-27 18:26:33 +00:00
|
|
|
CListboxItem UiDoListboxNextItem(const void *pID, bool Selected = false, bool KeyEvents = true);
|
2010-12-14 00:20:47 +00:00
|
|
|
CListboxItem UiDoListboxNextRow();
|
2018-02-13 02:44:43 +00:00
|
|
|
int UiDoListboxEnd(float *pScrollValue, bool *pItemActivated, bool *pListBoxActive = 0);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//static void demolist_listdir_callback(const char *name, int is_dir, void *user);
|
|
|
|
//static void demolist_list_callback(const CUIRect *rect, int index, void *user);
|
|
|
|
|
2020-09-03 12:08:26 +00:00
|
|
|
int m_MenuPage;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_GamePage;
|
|
|
|
int m_Popup;
|
|
|
|
int m_ActivePage;
|
2020-09-03 12:08:26 +00:00
|
|
|
bool m_ShowStart;
|
2010-05-29 07:25:38 +00:00
|
|
|
bool m_MenuActive;
|
|
|
|
bool m_UseMouseButtons;
|
|
|
|
vec2 m_MousePos;
|
2016-05-03 13:11:52 +00:00
|
|
|
bool m_MouseSlow;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int64 m_LastInput;
|
2011-02-27 16:56:03 +00:00
|
|
|
|
2020-09-03 12:08:26 +00:00
|
|
|
// images
|
|
|
|
struct CMenuImage
|
|
|
|
{
|
|
|
|
char m_aName[64];
|
|
|
|
IGraphics::CTextureHandle m_OrgTexture;
|
|
|
|
IGraphics::CTextureHandle m_GreyTexture;
|
|
|
|
};
|
|
|
|
array<CMenuImage> m_lMenuImages;
|
|
|
|
|
|
|
|
static int MenuImageScan(const char *pName, int IsDir, int DirType, void *pUser);
|
|
|
|
|
|
|
|
const CMenuImage *FindMenuImage(const char* pName);
|
|
|
|
|
2011-02-27 16:56:03 +00:00
|
|
|
// loading
|
|
|
|
int m_LoadCurrent;
|
|
|
|
int m_LoadTotal;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
char m_aMessageTopic[512];
|
|
|
|
char m_aMessageBody[512];
|
|
|
|
char m_aMessageButton[512];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void PopupMessage(const char *pTopic, const char *pBody, const char *pButton);
|
|
|
|
|
2011-04-13 18:37:12 +00:00
|
|
|
// TODO: this is a bit ugly but.. well.. yeah
|
2010-05-29 07:25:38 +00:00
|
|
|
enum { MAX_INPUTEVENTS = 32 };
|
|
|
|
static IInput::CEvent m_aInputEvents[MAX_INPUTEVENTS];
|
|
|
|
static int m_NumInputEvents;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// some settings
|
|
|
|
static float ms_ButtonHeight;
|
|
|
|
static float ms_ListheaderHeight;
|
2014-06-16 11:29:18 +00:00
|
|
|
static float ms_ListitemAdditionalHeight;
|
2010-05-29 07:25:38 +00:00
|
|
|
static float ms_FontmodHeight;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-10-16 09:24:42 +00:00
|
|
|
// for settings
|
2019-07-18 23:53:27 +00:00
|
|
|
bool m_NeedRestartGeneral;
|
2014-08-17 03:34:16 +00:00
|
|
|
bool m_NeedRestartSkins;
|
2010-10-16 09:24:42 +00:00
|
|
|
bool m_NeedRestartGraphics;
|
|
|
|
bool m_NeedRestartSound;
|
2015-03-08 17:51:13 +00:00
|
|
|
bool m_NeedRestartUpdate;
|
2016-05-07 13:59:13 +00:00
|
|
|
bool m_NeedRestartDDNet;
|
2010-05-29 07:25:38 +00:00
|
|
|
bool m_NeedSendinfo;
|
2014-04-28 13:19:57 +00:00
|
|
|
bool m_NeedSendDummyinfo;
|
2011-03-16 20:31:55 +00:00
|
|
|
int m_SettingPlayerPage;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
bool m_EscapePressed;
|
|
|
|
bool m_EnterPressed;
|
2010-09-03 18:05:22 +00:00
|
|
|
bool m_DeletePressed;
|
2010-12-16 00:52:29 +00:00
|
|
|
|
|
|
|
// for map download popup
|
|
|
|
int64 m_DownloadLastCheckTime;
|
|
|
|
int m_DownloadLastCheckSize;
|
|
|
|
float m_DownloadSpeed;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// for call vote
|
|
|
|
int m_CallvoteSelectedOption;
|
|
|
|
int m_CallvoteSelectedPlayer;
|
2011-03-26 16:44:34 +00:00
|
|
|
char m_aCallvoteReason[VOTE_REASON_LENGTH];
|
2015-03-13 15:44:05 +00:00
|
|
|
char m_aFilterString[25];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// demo
|
2019-01-08 19:12:21 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SORT_DEMONAME=0,
|
|
|
|
SORT_MARKERS,
|
|
|
|
SORT_LENGTH,
|
|
|
|
SORT_DATE,
|
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
struct CDemoItem
|
|
|
|
{
|
2010-09-28 22:53:53 +00:00
|
|
|
char m_aFilename[128];
|
|
|
|
char m_aName[128];
|
|
|
|
bool m_IsDir;
|
2010-10-06 21:07:35 +00:00
|
|
|
int m_StorageType;
|
2015-08-27 12:57:56 +00:00
|
|
|
time_t m_Date;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-11-20 13:45:09 +00:00
|
|
|
bool m_InfosLoaded;
|
2010-10-09 11:27:21 +00:00
|
|
|
bool m_Valid;
|
2011-03-13 09:41:10 +00:00
|
|
|
CDemoHeader m_Info;
|
2019-01-08 19:12:21 +00:00
|
|
|
CTimelineMarkers m_TimelineMarkers;
|
2019-10-14 00:27:08 +00:00
|
|
|
CMapInfo m_MapInfo;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2019-01-08 19:12:21 +00:00
|
|
|
int NumMarkers() const
|
2015-08-27 12:57:56 +00:00
|
|
|
{
|
2019-01-08 19:12:21 +00:00
|
|
|
return ((m_TimelineMarkers.m_aNumTimelineMarkers[0]<<24)&0xFF000000) | ((m_TimelineMarkers.m_aNumTimelineMarkers[1]<<16)&0xFF0000) |
|
|
|
|
((m_TimelineMarkers.m_aNumTimelineMarkers[2]<<8)&0xFF00) | (m_TimelineMarkers.m_aNumTimelineMarkers[3]&0xFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
int Length() const
|
|
|
|
{
|
|
|
|
return ((m_Info.m_aLength[0]<<24)&0xFF000000) | ((m_Info.m_aLength[1]<<16)&0xFF0000) |
|
|
|
|
((m_Info.m_aLength[2]<<8)&0xFF00) | (m_Info.m_aLength[3]&0xFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator<(const CDemoItem &Other) const
|
|
|
|
{
|
|
|
|
if(!str_comp(m_aFilename, ".."))
|
|
|
|
return true;
|
|
|
|
if(!str_comp(Other.m_aFilename, ".."))
|
|
|
|
return false;
|
|
|
|
if(m_IsDir && !Other.m_IsDir)
|
|
|
|
return true;
|
|
|
|
if(!m_IsDir && Other.m_IsDir)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
const CDemoItem &Left = g_Config.m_BrDemoSortOrder ? Other : *this;
|
|
|
|
const CDemoItem &Right = g_Config.m_BrDemoSortOrder ? *this : Other;
|
|
|
|
|
|
|
|
if(g_Config.m_BrDemoSort == SORT_DEMONAME)
|
|
|
|
return str_comp_nocase(Left.m_aFilename, Right.m_aFilename) < 0;
|
|
|
|
if(g_Config.m_BrDemoSort == SORT_DATE)
|
|
|
|
return Left.m_Date < Right.m_Date;
|
|
|
|
|
|
|
|
if(!Other.m_InfosLoaded)
|
|
|
|
return m_InfosLoaded;
|
|
|
|
if(!m_InfosLoaded)
|
|
|
|
return !Other.m_InfosLoaded;
|
|
|
|
|
|
|
|
if(g_Config.m_BrDemoSort == SORT_MARKERS)
|
|
|
|
return Left.NumMarkers() < Right.NumMarkers();
|
|
|
|
if(g_Config.m_BrDemoSort == SORT_LENGTH)
|
|
|
|
return Left.Length() < Right.Length();
|
|
|
|
|
|
|
|
// Unknown sort
|
|
|
|
return true;
|
2015-08-27 12:57:56 +00:00
|
|
|
}
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-02-13 05:35:13 +00:00
|
|
|
//sorted_array<CDemoItem> m_lDemos;
|
2010-06-04 20:14:02 +00:00
|
|
|
char m_aCurrentDemoFolder[256];
|
2011-03-12 18:08:44 +00:00
|
|
|
char m_aCurrentDemoFile[64];
|
2010-09-28 22:53:53 +00:00
|
|
|
int m_DemolistSelectedIndex;
|
|
|
|
bool m_DemolistSelectedIsDir;
|
2010-10-07 22:13:05 +00:00
|
|
|
int m_DemolistStorageType;
|
2019-09-28 04:18:38 +00:00
|
|
|
int m_Speed = 4;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-09-28 22:53:53 +00:00
|
|
|
void DemolistOnUpdate(bool Reset);
|
2011-02-13 05:35:13 +00:00
|
|
|
//void DemolistPopulate();
|
2015-08-27 12:57:56 +00:00
|
|
|
static int DemolistFetchCallback(const char *pName, time_t Date, int IsDir, int StorageType, void *pUser);
|
2011-03-23 12:06:35 +00:00
|
|
|
|
2011-06-26 15:10:13 +00:00
|
|
|
// friends
|
|
|
|
struct CFriendItem
|
|
|
|
{
|
|
|
|
const CFriendInfo *m_pFriendInfo;
|
|
|
|
int m_NumFound;
|
|
|
|
|
|
|
|
bool operator<(const CFriendItem &Other)
|
|
|
|
{
|
|
|
|
if(m_NumFound && !Other.m_NumFound)
|
|
|
|
return true;
|
|
|
|
else if(!m_NumFound && Other.m_NumFound)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int Result = str_comp(m_pFriendInfo->m_aName, Other.m_pFriendInfo->m_aName);
|
|
|
|
if(Result)
|
|
|
|
return Result < 0;
|
|
|
|
else
|
|
|
|
return str_comp(m_pFriendInfo->m_aClan, Other.m_pFriendInfo->m_aClan) < 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
sorted_array<CFriendItem> m_lFriends;
|
2011-03-23 12:06:35 +00:00
|
|
|
int m_FriendlistSelectedIndex;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-06-26 15:10:13 +00:00
|
|
|
void FriendlistOnUpdate();
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// found in menus.cpp
|
|
|
|
int Render();
|
|
|
|
//void render_background();
|
|
|
|
//void render_loading(float percent);
|
|
|
|
int RenderMenubar(CUIRect r);
|
|
|
|
void RenderNews(CUIRect MainView);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// found in menus_demo.cpp
|
2017-02-28 09:08:14 +00:00
|
|
|
static bool DemoFilterChat(const void *pData, int Size, void *pUser);
|
2019-01-08 19:12:21 +00:00
|
|
|
bool FetchHeader(CDemoItem &Item);
|
2019-03-19 17:28:09 +00:00
|
|
|
void FetchAllHeaders();
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderDemoPlayer(CUIRect MainView);
|
|
|
|
void RenderDemoList(CUIRect MainView);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-09-03 12:08:26 +00:00
|
|
|
// found in menus_start.cpp
|
|
|
|
void RenderStartMenu(CUIRect MainView);
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// found in menus_ingame.cpp
|
|
|
|
void RenderGame(CUIRect MainView);
|
2011-04-06 18:18:31 +00:00
|
|
|
void RenderPlayers(CUIRect MainView);
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderServerInfo(CUIRect MainView);
|
|
|
|
void RenderServerControl(CUIRect MainView);
|
2016-04-27 18:04:31 +00:00
|
|
|
bool RenderServerControlKick(CUIRect MainView, bool FilterSpectators);
|
|
|
|
bool RenderServerControlServer(CUIRect MainView);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// found in menus_browser.cpp
|
|
|
|
int m_SelectedIndex;
|
2014-06-16 11:29:18 +00:00
|
|
|
int m_DoubleClickIndex;
|
2011-06-26 15:10:13 +00:00
|
|
|
int m_ScrollOffset;
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderServerbrowserServerList(CUIRect View);
|
|
|
|
void RenderServerbrowserServerDetail(CUIRect View);
|
|
|
|
void RenderServerbrowserFilters(CUIRect View);
|
2011-03-23 12:06:35 +00:00
|
|
|
void RenderServerbrowserFriends(CUIRect View);
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderServerbrowser(CUIRect MainView);
|
2011-06-26 15:10:13 +00:00
|
|
|
static void ConchainFriendlistUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2010-07-04 14:10:00 +00:00
|
|
|
static void ConchainServerbrowserUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// found in menus_settings.cpp
|
2010-12-12 18:20:30 +00:00
|
|
|
void RenderLanguageSelection(CUIRect MainView);
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderSettingsGeneral(CUIRect MainView);
|
|
|
|
void RenderSettingsPlayer(CUIRect MainView);
|
2014-04-26 18:29:42 +00:00
|
|
|
void RenderSettingsDummyPlayer(CUIRect MainView);
|
2011-04-01 17:36:44 +00:00
|
|
|
void RenderSettingsTee(CUIRect MainView);
|
2010-05-29 07:25:38 +00:00
|
|
|
void RenderSettingsControls(CUIRect MainView);
|
|
|
|
void RenderSettingsGraphics(CUIRect MainView);
|
|
|
|
void RenderSettingsSound(CUIRect MainView);
|
|
|
|
void RenderSettings(CUIRect MainView);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void SetActive(bool Active);
|
2012-08-12 10:41:50 +00:00
|
|
|
|
|
|
|
IGraphics::CTextureHandle m_TextureBlob;
|
2020-09-03 12:08:26 +00:00
|
|
|
|
|
|
|
bool CheckHotKey(int Key) const;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
|
|
|
void RenderBackground();
|
|
|
|
|
|
|
|
void UseMouseButtons(bool Use) { m_UseMouseButtons = Use; }
|
|
|
|
|
|
|
|
static CMenusKeyBinder m_Binder;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CMenus();
|
|
|
|
|
2011-02-27 16:56:03 +00:00
|
|
|
void RenderLoading();
|
2014-04-27 03:01:03 +00:00
|
|
|
void RenderUpdating(const char *pCaption, int current=0, int total=0);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
bool IsActive() const { return m_MenuActive; }
|
|
|
|
|
|
|
|
virtual void OnInit();
|
|
|
|
|
|
|
|
virtual void OnStateChange(int NewState, int OldState);
|
|
|
|
virtual void OnReset();
|
|
|
|
virtual void OnRender();
|
|
|
|
virtual bool OnInput(IInput::CEvent Event);
|
|
|
|
virtual bool OnMouseMove(float x, float y);
|
2011-01-30 16:21:41 +00:00
|
|
|
|
2014-06-05 10:11:41 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PAGE_NEWS=1,
|
|
|
|
PAGE_GAME,
|
|
|
|
PAGE_PLAYERS,
|
|
|
|
PAGE_SERVER_INFO,
|
|
|
|
PAGE_CALLVOTE,
|
|
|
|
PAGE_INTERNET,
|
|
|
|
PAGE_LAN,
|
|
|
|
PAGE_FAVORITES,
|
2014-09-13 14:36:25 +00:00
|
|
|
PAGE_DDNET,
|
2019-03-24 22:15:38 +00:00
|
|
|
PAGE_KOG,
|
2014-06-05 10:11:41 +00:00
|
|
|
PAGE_DEMOS,
|
|
|
|
PAGE_SETTINGS,
|
|
|
|
PAGE_SYSTEM,
|
2016-04-27 18:14:03 +00:00
|
|
|
PAGE_NETWORK,
|
2019-11-17 17:11:33 +00:00
|
|
|
PAGE_GHOST,
|
|
|
|
|
|
|
|
SETTINGS_LANGUAGE=0,
|
|
|
|
SETTINGS_GENERAL,
|
|
|
|
SETTINGS_PLAYER,
|
|
|
|
SETTINGS_TEE,
|
|
|
|
SETTINGS_HUD,
|
|
|
|
SETTINGS_CONTROLS,
|
|
|
|
SETTINGS_GRAPHICS,
|
|
|
|
SETTINGS_SOUND,
|
|
|
|
SETTINGS_DDNET,
|
2014-06-05 10:11:41 +00:00
|
|
|
};
|
|
|
|
|
2011-04-09 06:41:31 +00:00
|
|
|
// DDRace
|
2011-01-30 16:21:41 +00:00
|
|
|
int DoButton_CheckBox_DontCare(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
2011-02-04 17:25:04 +00:00
|
|
|
sorted_array<CDemoItem> m_lDemos;
|
|
|
|
void DemolistPopulate();
|
2015-08-28 18:44:07 +00:00
|
|
|
bool m_Dummy;
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2017-09-09 21:10:42 +00:00
|
|
|
const char *GetCurrentDemoFolder() const { return m_aCurrentDemoFolder; }
|
|
|
|
|
2011-04-09 06:41:31 +00:00
|
|
|
// Ghost
|
2011-02-04 17:25:04 +00:00
|
|
|
struct CGhostItem
|
|
|
|
{
|
|
|
|
char m_aFilename[256];
|
|
|
|
char m_aPlayer[MAX_NAME_LENGTH];
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2017-08-30 23:59:22 +00:00
|
|
|
int m_Time;
|
2017-09-09 16:25:32 +00:00
|
|
|
int m_Slot;
|
|
|
|
bool m_Own;
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2017-09-12 15:01:32 +00:00
|
|
|
CGhostItem() : m_Slot(-1), m_Own(false) { m_aFilename[0] = 0; }
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2011-02-04 17:25:04 +00:00
|
|
|
bool operator<(const CGhostItem &Other) { return m_Time < Other.m_Time; }
|
2019-04-28 17:22:19 +00:00
|
|
|
|
2017-09-09 16:25:32 +00:00
|
|
|
bool Active() const { return m_Slot != -1; }
|
|
|
|
bool HasFile() const { return m_aFilename[0]; }
|
2011-02-04 17:25:04 +00:00
|
|
|
};
|
2011-04-09 06:41:31 +00:00
|
|
|
|
2011-02-04 17:25:04 +00:00
|
|
|
sorted_array<CGhostItem> m_lGhosts;
|
2017-09-09 16:25:32 +00:00
|
|
|
|
2011-02-04 17:25:04 +00:00
|
|
|
void GhostlistPopulate();
|
2017-09-09 16:25:32 +00:00
|
|
|
CGhostItem *GetOwnGhost();
|
2017-09-10 01:48:22 +00:00
|
|
|
void UpdateOwnGhost(CGhostItem Item);
|
|
|
|
void DeleteGhostItem(int Index);
|
2017-09-09 16:25:32 +00:00
|
|
|
|
2014-05-17 12:28:50 +00:00
|
|
|
void setPopup(int Popup) { m_Popup = Popup; }
|
2020-08-29 10:49:45 +00:00
|
|
|
int GetCurPopup() { return m_Popup; }
|
|
|
|
bool CanDisplayWarning();
|
|
|
|
|
|
|
|
void PopupWarning(const char *pTopic, const char *pBody, const char *pButton, int64 Duration);
|
|
|
|
|
|
|
|
int64 m_PopupWarningLastTime;
|
|
|
|
int64 m_PopupWarningDuration;
|
2014-05-17 12:28:50 +00:00
|
|
|
|
2014-08-23 15:48:04 +00:00
|
|
|
int m_DemoPlayerState;
|
2014-08-25 09:19:00 +00:00
|
|
|
char m_aDemoPlayerPopupHint[256];
|
2014-08-23 15:48:04 +00:00
|
|
|
|
2014-05-17 12:28:50 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
POPUP_NONE=0,
|
|
|
|
POPUP_FIRST_LAUNCH,
|
|
|
|
POPUP_CONNECTING,
|
|
|
|
POPUP_MESSAGE,
|
|
|
|
POPUP_DISCONNECTED,
|
|
|
|
POPUP_PURE,
|
|
|
|
POPUP_LANGUAGE,
|
|
|
|
POPUP_COUNTRY,
|
|
|
|
POPUP_DELETE_DEMO,
|
|
|
|
POPUP_RENAME_DEMO,
|
2019-09-26 15:28:29 +00:00
|
|
|
POPUP_RENDER_DEMO,
|
2019-09-27 06:51:08 +00:00
|
|
|
POPUP_REPLACE_VIDEO,
|
2014-05-17 12:28:50 +00:00
|
|
|
POPUP_REMOVE_FRIEND,
|
|
|
|
POPUP_SOUNDERROR,
|
|
|
|
POPUP_PASSWORD,
|
|
|
|
POPUP_QUIT,
|
2014-08-23 15:48:04 +00:00
|
|
|
POPUP_DISCONNECT,
|
2019-03-30 15:59:25 +00:00
|
|
|
POPUP_DISCONNECT_DUMMY,
|
2020-08-29 10:49:45 +00:00
|
|
|
POPUP_WARNING,
|
2014-08-23 15:48:04 +00:00
|
|
|
|
|
|
|
// demo player states
|
|
|
|
DEMOPLAYER_NONE=0,
|
|
|
|
DEMOPLAYER_SLICE_SAVE,
|
2014-05-17 12:28:50 +00:00
|
|
|
};
|
2011-04-09 06:41:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
static int GhostlistFetchCallback(const char *pName, int IsDir, int StorageType, void *pUser);
|
2020-09-03 12:08:26 +00:00
|
|
|
void SetMenuPage(int NewPage);
|
2011-04-09 06:41:31 +00:00
|
|
|
|
|
|
|
// found in menus_ingame.cpp
|
2016-04-27 18:14:03 +00:00
|
|
|
void RenderInGameNetwork(CUIRect MainView);
|
2011-04-09 06:41:31 +00:00
|
|
|
void RenderGhost(CUIRect MainView);
|
|
|
|
|
|
|
|
// found in menus_settings.cpp
|
2016-05-07 13:59:13 +00:00
|
|
|
void RenderSettingsDDNet(CUIRect MainView);
|
2014-07-07 13:47:11 +00:00
|
|
|
void RenderSettingsHUD(CUIRect MainView);
|
2020-06-27 13:08:35 +00:00
|
|
|
ColorHSLA RenderHSLScrollbars(CUIRect *pRect, unsigned int *pColor, bool Alpha = false);
|
2020-09-03 12:08:26 +00:00
|
|
|
|
|
|
|
CServerProcess m_ServerProcess;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
#endif
|