mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Add quick action "Load Current Map"
This commit is contained in:
parent
36f0bcc509
commit
e20250cd65
|
@ -68,17 +68,9 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
|||
|
||||
View.HSplitTop(2.0f, nullptr, &View);
|
||||
View.HSplitTop(12.0f, &Slot, &View);
|
||||
if(pEditor->DoButton_MenuItem(&s_OpenCurrentMapButton, "Load Current Map", 0, &Slot, 0, "Opens the current in game map for editing (ctrl+alt+l)"))
|
||||
if(pEditor->DoButton_MenuItem(&s_OpenCurrentMapButton, pEditor->m_QuickActionLoadCurrentMap.Label(), 0, &Slot, 0, pEditor->m_QuickActionLoadCurrentMap.Description()))
|
||||
{
|
||||
if(pEditor->HasUnsavedData())
|
||||
{
|
||||
pEditor->m_PopupEventType = POPEVENT_LOADCURRENT;
|
||||
pEditor->m_PopupEventActivated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pEditor->LoadCurrentMap();
|
||||
}
|
||||
pEditor->m_QuickActionLoadCurrentMap.Call();
|
||||
return CUi::POPUP_CLOSE_CURRENT;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,24 @@ REGISTER_QUICK_ACTION(
|
|||
ALWAYS_FALSE,
|
||||
DEFAULT_BTN,
|
||||
"Saves the current map under a new name (ctrl+shift+s)")
|
||||
REGISTER_QUICK_ACTION(
|
||||
LoadCurrentMap,
|
||||
"Load Current Map",
|
||||
[&]() {
|
||||
if(HasUnsavedData())
|
||||
{
|
||||
m_PopupEventType = POPEVENT_LOADCURRENT;
|
||||
m_PopupEventActivated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadCurrentMap();
|
||||
}
|
||||
},
|
||||
ALWAYS_FALSE,
|
||||
ALWAYS_FALSE,
|
||||
DEFAULT_BTN,
|
||||
"Opens the current in game map for editing (ctrl+alt+l)")
|
||||
REGISTER_QUICK_ACTION(
|
||||
Envelopes,
|
||||
"Envelopes",
|
||||
|
|
Loading…
Reference in a new issue