3#ifndef REGISTER_QUICK_ACTION
5#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description)
8#define ALWAYS_FALSE []() -> bool { return false; }
9#define DEFAULT_BTN []() -> int { return -1; }
14 [&]() { ShowHelp(); },
18 "[F1] Open the DDNet Wiki page for the map editor in a web browser.")
26 "[Escape] Exit from the editor.")
30 [&]() { m_ShowPickerToggle = !m_ShowPickerToggle; },
33 Map()->m_vSelectedLayers.size() != 1 ||
34 Map()->SelectedLayer(0) ==
nullptr ||
37 [&]() ->
bool {
return m_ShowPickerToggle; },
39 "[Ctrl+Space, Hold Space] Toggle brush picker.")
43 [&]() { MapView()->MapGrid()->Toggle(); },
45 [&]() ->
bool {
return MapView()->MapGrid()->IsEnabled(); },
47 "[Ctrl+G] Toggle grid.")
52 [&]() ->
bool {
return !CanFillGameTiles(); },
55 "Construct game tiles from this layer.")
58 "Game tiles: Hookable",
60 [&]() ->
bool {
return !CanFillGameTiles(); },
63 "Construct game tiles from this layer.")
68 [&]() ->
bool {
return !CanFillGameTiles(); },
71 "Construct game tiles from this layer.")
74 "Game tiles: Unhookable",
76 [&]() ->
bool {
return !CanFillGameTiles(); },
79 "Construct game tiles from this layer.")
82 "Game tiles: Hookthrough",
84 [&]() ->
bool {
return !CanFillGameTiles(); },
87 "Construct game tiles from this layer.")
92 [&]() ->
bool {
return !CanFillGameTiles(); },
95 "Construct game tiles from this layer.")
98 "Game tiles: Unfreeze",
100 [&]() ->
bool {
return !CanFillGameTiles(); },
103 "Construct game tiles from this layer.")
106 "Game tiles: Deep Freeze",
108 [&]() ->
bool {
return !CanFillGameTiles(); },
111 "Construct game tiles from this layer.")
113 GameTilesDeepUnfreeze,
114 "Game tiles: Deep Unfreeze",
116 [&]() ->
bool {
return !CanFillGameTiles(); },
119 "Construct game tiles from this layer.")
121 GameTilesBlueCheckTele,
122 "Game tiles: Blue Check Tele",
124 [&]() ->
bool {
return !CanFillGameTiles(); },
127 "Construct game tiles from this layer.")
129 GameTilesRedCheckTele,
130 "Game tiles: Red Check Tele",
132 [&]() ->
bool {
return !CanFillGameTiles(); },
135 "Construct game tiles from this layer.")
138 "Game tiles: Live Freeze",
140 [&]() ->
bool {
return !CanFillGameTiles(); },
143 "Construct game tiles from this layer.")
145 GameTilesLiveUnfreeze,
146 "Game tiles: Live Unfreeze",
148 [&]() ->
bool {
return !CanFillGameTiles(); },
151 "Construct game tiles from this layer.")
155 [&]() { AddGroup(); },
163 [&]() { MapView()->ResetZoom(); },
167 "[Numpad*] Zoom to normal and remove editor offset.")
171 [&]() { MapView()->Zoom()->ScaleValue(1.331f); },
175 "[Numpad-] Zoom out.")
179 [&]() { MapView()->Zoom()->ScaleValue(1.0f / 1.331f); },
183 "[Numpad+] Zoom in.")
187 [&]() { MapView()->Focus(); },
191 "[Home] Restore map focus.")
195 [&]() { GotoPosition(); },
199 "Go to a specified coordinate point on the map.")
203 [&]() { MapView()->ProofMode()->Toggle(); },
205 [&]() ->
bool {
return MapView()->ProofMode()->IsEnabled(); },
207 "Toggle proof borders. These borders represent the area that a player can see with default zoom.")
213 [&]() { AddSwitchLayer(); },
214 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSwitchLayer; },
217 "Create a new switch layer.")
221 [&]() { AddTuneLayer(); },
222 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTuneLayer; },
225 "Create a new tuning layer.")
229 [&]() { AddSpeedupLayer(); },
230 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSpeedupLayer; },
233 "Create a new speedup layer.")
237 [&]() { AddTeleLayer(); },
238 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTeleLayer; },
241 "Create a new tele layer.")
245 [&]() { AddFrontLayer(); },
246 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pFrontLayer; },
249 "Create a new item layer.")
264 "[Ctrl+N] Create a new map.")
269 if(Map()->m_aFilename[0] !=
'\0' && Map()->m_ValidSaveFilename)
281 "[Ctrl+S] Save the current map.")
291 "[Ctrl+Shift+S] Save the current map under a new name.")
301 "[Ctrl+Shift+Alt+S] Save a copy of the current map under a new name.")
311 "[Ctrl+L] Open a map for editing.")
321 "[Ctrl+Shift+L] Open the current ingame map for editing.")
331 "[Ctrl+A] Open a map and add everything from that map to the current map.")
335 [&]() { CloseMap(m_SelectedMap,
true); },
339 "[Ctrl+F4] Close the current map.")
343 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES; },
346 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
347 "Toggle the envelope editor.")
351 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
354 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
355 "Toggle the server settings editor.")
359 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
362 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
363 "Toggle the editor history view.")
371 "Load a new image to use in the map.")
375 [&]() { LayerSelectImage(); },
376 [&]() ->
bool {
return !IsNonGameTileLayerSelected(); },
379 "Pick mapres image for currently selected layer.")
384 m_ShowTileInfo = SHOW_TILE_OFF;
387 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_OFF; },
389 "Do not show tile information.")
394 m_ShowTileInfo = SHOW_TILE_DECIMAL;
397 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_DECIMAL; },
399 "[Ctrl+I] Show tile information.")
404 m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
407 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
409 "[Ctrl+Shift+I] Show tile information in hexadecimal.")
411 PreviewQuadEnvelopes,
412 "Preview quad envelopes",
414 m_ShowEnvelopePreview = !m_ShowEnvelopePreview;
415 m_ActiveEnvelopePreview = EEnvelopePreview::NONE;
418 [&]() ->
bool {
return m_ShowEnvelopePreview; },
420 "Toggle previewing the paths of quads with a position envelope when a quad layer is selected.")
424 [&]() { DeleteSelectedLayer(); },
426 std::shared_ptr<CLayer> pCurrentLayer = Map()->SelectedLayer(0);
429 return Map()->m_pGameLayer == pCurrentLayer;
437 [&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
439 [&]() ->
bool {
return m_ColorPipetteActive; },
441 "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
445 [&]() { MapDetails(); },
449 "Adjust the map details of the current map.")
453 [&]() { AddQuadOrSound(); },
455 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
462 "[Ctrl+Q] Add a new quad.")
466 [&]() { AddQuadOrSound(); },
468 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
475 "[Ctrl+Q] Add a new sound source.")
479 [&]() { TestMapLocally(); },
483 "Run a local server with the current map and connect you to it.")
@ IMAGE
Definition file_browser.h:22
@ MAP
Definition file_browser.h:21
@ STATE_DEMOPLAYBACK
Definition client.h:60
@ STATE_ONLINE
Definition client.h:59
@ TYPE_ALL
Definition storage.h:27
@ TYPE_SAVE
Definition storage.h:26
@ MODE_LAYERS
Definition editor.h:56
@ DEEP_FREEZE
Definition enums.h:28
@ DEEP_UNFREEZE
Definition enums.h:29
@ FREEZE
Definition enums.h:26
@ AIR
Definition enums.h:21
@ UNHOOKABLE
Definition enums.h:24
@ LIVE_FREEZE
Definition enums.h:32
@ UNFREEZE
Definition enums.h:27
@ HOOKABLE
Definition enums.h:22
@ DEATH
Definition enums.h:23
@ LIVE_UNFREEZE
Definition enums.h:33
@ HOOKTHROUGH
Definition enums.h:25
@ BLUE_CHECK_TELE
Definition enums.h:30
@ RED_CHECK_TELE
Definition enums.h:31
@ LAYERTYPE_TILES
Definition mapitems.h:14
@ LAYERTYPE_QUADS
Definition mapitems.h:15
@ LAYERTYPE_SOUNDS
Definition mapitems.h:22
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description)
Definition quick_actions.h:5