mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 09:12:19 +00:00
Add "Console" button to start menu
Add button to open the local console in the bottom left of the start menu to ensure that the local console is usable also when no physical keyboard (with F-keys) is available.
This commit is contained in:
parent
028bd148f3
commit
56b9240594
|
@ -160,8 +160,6 @@ class CGameConsole : public CComponent
|
|||
static const ColorRGBA ms_SearchHighlightColor;
|
||||
static const ColorRGBA ms_SearchSelectedColor;
|
||||
|
||||
void Toggle(int Type);
|
||||
|
||||
static void PossibleCommandsRenderCallback(int Index, const char *pStr, void *pUser);
|
||||
static void ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
||||
|
@ -196,6 +194,7 @@ public:
|
|||
virtual bool OnInput(const IInput::CEvent &Event) override;
|
||||
void Prompt(char (&aPrompt)[32]);
|
||||
|
||||
void Toggle(int Type);
|
||||
bool IsClosed() { return m_ConsoleState == CONSOLE_CLOSED; }
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -39,6 +39,14 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
MainView.VSplitLeft(30.0f, 0, &ExtMenu);
|
||||
ExtMenu.VSplitLeft(100.0f, &ExtMenu, 0);
|
||||
|
||||
ExtMenu.HSplitBottom(20.0f, &ExtMenu, &Button);
|
||||
ExtMenu.HSplitBottom(5.0f, &ExtMenu, nullptr);
|
||||
static CButtonContainer s_ConsoleButton;
|
||||
if(DoButton_Menu(&s_ConsoleButton, Localize("Console"), 0, &Button, nullptr, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
|
||||
{
|
||||
GameClient()->m_GameConsole.Toggle(CGameConsole::CONSOLETYPE_LOCAL);
|
||||
}
|
||||
|
||||
ExtMenu.HSplitBottom(20.0f, &ExtMenu, &Button);
|
||||
static CButtonContainer s_DiscordButton;
|
||||
if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
|
||||
|
|
Loading…
Reference in a new issue