3#ifndef REGISTER_QUICK_ACTION
4#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description)
7#define ALWAYS_FALSE []() -> bool { return false; }
8#define DEFAULT_BTN []() -> int { return -1; }
13 [&]() { MapView()->MapGrid()->Toggle(); },
15 [&]() ->
bool {
return MapView()->MapGrid()->IsEnabled(); },
17 "[Ctrl+G] Toggle Grid.")
22 [&]() ->
bool {
return !CanFillGameTiles(); },
25 "Constructs game tiles from this layer.")
28 "Game tiles: Hookable",
30 [&]() ->
bool {
return !CanFillGameTiles(); },
33 "Constructs game tiles from this layer.")
38 [&]() ->
bool {
return !CanFillGameTiles(); },
41 "Constructs game tiles from this layer.")
44 "Game tiles: Unhookable",
46 [&]() ->
bool {
return !CanFillGameTiles(); },
49 "Constructs game tiles from this layer.")
52 "Game tiles: Hookthrough",
54 [&]() ->
bool {
return !CanFillGameTiles(); },
57 "Constructs game tiles from this layer.")
62 [&]() ->
bool {
return !CanFillGameTiles(); },
65 "Constructs game tiles from this layer.")
68 "Game tiles: Unfreeze",
70 [&]() ->
bool {
return !CanFillGameTiles(); },
73 "Constructs game tiles from this layer.")
76 "Game tiles: Deep Freeze",
78 [&]() ->
bool {
return !CanFillGameTiles(); },
81 "Constructs game tiles from this layer.")
83 GameTilesDeepUnfreeze,
84 "Game tiles: Deep Unfreeze",
86 [&]() ->
bool {
return !CanFillGameTiles(); },
89 "Constructs game tiles from this layer.")
91 GameTilesBlueCheckTele,
92 "Game tiles: Blue Check Tele",
94 [&]() ->
bool {
return !CanFillGameTiles(); },
97 "Constructs game tiles from this layer.")
99 GameTilesRedCheckTele,
100 "Game tiles: Red Check Tele",
102 [&]() ->
bool {
return !CanFillGameTiles(); },
105 "Constructs game tiles from this layer.")
108 "Game tiles: Live Freeze",
110 [&]() ->
bool {
return !CanFillGameTiles(); },
113 "Constructs game tiles from this layer.")
115 GameTilesLiveUnfreeze,
116 "Game tiles: Live Unfreeze",
118 [&]() ->
bool {
return !CanFillGameTiles(); },
121 "Constructs game tiles from this layer.")
125 [&]() { AddGroup(); },
133 [&]() { MapView()->ResetZoom(); },
137 "[Numpad*] Zoom to normal and remove editor offset.")
141 [&]() { MapView()->Zoom()->ChangeValue(50.0f); },
145 "[Numpad-] Zoom out.")
149 [&]() { MapView()->Zoom()->ChangeValue(-50.0f); },
153 "[Numpad+] Zoom in.")
157 [&]() { MapView()->Focus(); },
161 "[Home] Restore map focus.")
165 [&]() { MapView()->ProofMode()->Toggle(); },
167 [&]() ->
bool {
return MapView()->ProofMode()->IsEnabled(); },
169 "Toggles proof borders. These borders represent the area that a player can see with default zoom.")
175 [&]() { AddSwitchLayer(); },
176 [&]() ->
bool {
return !GetSelectedGroup()->m_GameGroup || m_Map.m_pSwitchLayer; },
179 "Creates a new switch layer.")
183 [&]() { AddTuneLayer(); },
184 [&]() ->
bool {
return !GetSelectedGroup()->m_GameGroup || m_Map.m_pTuneLayer; },
187 "Creates a new tuning layer.")
191 [&]() { AddSpeedupLayer(); },
192 [&]() ->
bool {
return !GetSelectedGroup()->m_GameGroup || m_Map.m_pSpeedupLayer; },
195 "Creates a new speedup layer.")
199 [&]() { AddTeleLayer(); },
200 [&]() ->
bool {
return !GetSelectedGroup()->m_GameGroup || m_Map.m_pTeleLayer; },
203 "Creates a new tele layer.")
207 [&]() { AddFrontLayer(); },
208 [&]() ->
bool {
return !GetSelectedGroup()->m_GameGroup || m_Map.m_pFrontLayer; },
211 "Creates a new item layer.")
223 "[Ctrl+Shift+S] Saves the current map under a new name.")
230 m_PopupEventType = POPEVENT_LOADCURRENT;
231 m_PopupEventActivated =
true;
241 "[Ctrl+Alt+L] Opens the current in game map for editing.")
245 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES; },
248 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
249 "Toggles the envelope editor.")
253 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
256 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
257 "Toggles the server settings editor.")
261 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
264 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
265 "Toggles the editor history view.")
269 [&]() { InvokeFileDialog(
IStorage::TYPE_ALL, FILETYPE_IMG,
"Add Image",
"Add",
"mapres",
false, AddImage,
this); },
273 "Load a new image to use in the map.")
277 [&]() { LayerSelectImage(); },
278 [&]() ->
bool {
return !IsNonGameTileLayerSelected(); },
281 "Pick mapres image for currently selected layer.")
286 m_ShowTileInfo = SHOW_TILE_OFF;
287 m_ShowEnvelopePreview = SHOWENV_NONE;
290 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_OFF; },
292 "Do not show tile information.")
297 m_ShowTileInfo = SHOW_TILE_DECIMAL;
298 m_ShowEnvelopePreview = SHOWENV_NONE;
301 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_DECIMAL; },
303 "[Ctrl+I] Show tile information.")
308 m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
309 m_ShowEnvelopePreview = SHOWENV_NONE;
312 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
314 "[Ctrl+Shift+I] Show tile information in hexadecimal.")
318 [&]() { DeleteSelectedLayer(); },
320 std::shared_ptr<CLayer> pCurrentLayer = GetSelectedLayer(0);
323 return m_Map.m_pGameLayer == pCurrentLayer;
327 "Deletes the layer.")
331 [&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
333 [&]() ->
bool {
return m_ColorPipetteActive; },
335 "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
339 [&]() { MapDetails(); },
343 "Adjust the map details of the current map.")
347 [&]() { AddQuadOrSound(); },
349 std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
356 "[Ctrl+Q] Add a new quad.")
360 [&]() { AddQuadOrSound(); },
362 std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
369 "[Ctrl+Q] Add a new sound source.")
static bool CallbackSaveMap(const char *pFileName, int StorageType, void *pUser)
Definition: editor.cpp:822
@ TYPE_ALL
Definition: storage.h:26
@ TYPE_SAVE
Definition: storage.h:25
@ LAYERTYPE_QUADS
Definition: mapitems.h:14
@ LAYERTYPE_SOUNDS
Definition: mapitems.h:21
#define ALWAYS_FALSE
Definition: quick_actions.h:7
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description)
Definition: quick_actions.h:4
#define DEFAULT_BTN
Definition: quick_actions.h:8