Merge pull request #8873 from ChillerDragon/pr_actions_settings_and_history

Add quick actions Server settings and History
This commit is contained in:
Dennis Felsing 2024-09-02 06:16:31 +00:00 committed by GitHub
commit f79784bec7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 10 deletions

View file

@ -5739,30 +5739,25 @@ void CEditor::RenderModebar(CUIRect View)
void CEditor::RenderStatusbar(CUIRect View, CUIRect *pTooltipRect)
{
const bool ButtonsDisabled = m_ShowPicker;
CUIRect Button;
View.VSplitRight(100.0f, &View, &Button);
static int s_EnvelopeButton = 0;
if(DoButton_Editor(&s_EnvelopeButton, m_QuickActionEnvelopes.Label(), m_QuickActionEnvelopes.Color(), &Button, 0, m_QuickActionEnvelopes.Description()) == 1)
if(DoButton_Editor(&m_QuickActionEnvelopes, m_QuickActionEnvelopes.Label(), m_QuickActionEnvelopes.Color(), &Button, 0, m_QuickActionEnvelopes.Description()) == 1)
{
m_QuickActionEnvelopes.Call();
}
View.VSplitRight(10.0f, &View, nullptr);
View.VSplitRight(100.0f, &View, &Button);
static int s_SettingsButton = 0;
if(DoButton_Editor(&s_SettingsButton, "Server settings", ButtonsDisabled ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS, &Button, 0, "Toggles the server settings editor.") == 1)
if(DoButton_Editor(&m_QuickActionServerSettings, m_QuickActionServerSettings.Label(), m_QuickActionServerSettings.Color(), &Button, 0, m_QuickActionServerSettings.Description()) == 1)
{
m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS;
m_QuickActionServerSettings.Call();
}
View.VSplitRight(10.0f, &View, nullptr);
View.VSplitRight(100.0f, &View, &Button);
static int s_HistoryButton = 0;
if(DoButton_Editor(&s_HistoryButton, "History", ButtonsDisabled ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY, &Button, 0, "Toggles the editor history view.") == 1)
if(DoButton_Editor(&m_QuickActionHistory, m_QuickActionHistory.Label(), m_QuickActionHistory.Color(), &Button, 0, m_QuickActionHistory.Description()) == 1)
{
m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY;
m_QuickActionHistory.Call();
}
View.VSplitRight(10.0f, pTooltipRect, nullptr);

View file

@ -179,6 +179,22 @@ REGISTER_QUICK_ACTION(
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
"Toggles the envelope editor.")
REGISTER_QUICK_ACTION(
ServerSettings,
"Server settings",
[&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
ALWAYS_FALSE,
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
"Toggles the server settings editor.")
REGISTER_QUICK_ACTION(
History,
"History",
[&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
ALWAYS_FALSE,
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
"Toggles the editor history view.")
REGISTER_QUICK_ACTION(
AddImage,
"Add Image",