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.")
22 [&]() { MapView()->MapGrid()->Toggle(); },
24 [&]() ->
bool {
return MapView()->MapGrid()->IsEnabled(); },
26 "[Ctrl+G] Toggle grid.")
31 [&]() ->
bool {
return !CanFillGameTiles(); },
34 "Construct game tiles from this layer.")
37 "Game tiles: Hookable",
39 [&]() ->
bool {
return !CanFillGameTiles(); },
42 "Construct game tiles from this layer.")
47 [&]() ->
bool {
return !CanFillGameTiles(); },
50 "Construct game tiles from this layer.")
53 "Game tiles: Unhookable",
55 [&]() ->
bool {
return !CanFillGameTiles(); },
58 "Construct game tiles from this layer.")
61 "Game tiles: Hookthrough",
63 [&]() ->
bool {
return !CanFillGameTiles(); },
66 "Construct game tiles from this layer.")
71 [&]() ->
bool {
return !CanFillGameTiles(); },
74 "Construct game tiles from this layer.")
77 "Game tiles: Unfreeze",
79 [&]() ->
bool {
return !CanFillGameTiles(); },
82 "Construct game tiles from this layer.")
85 "Game tiles: Deep Freeze",
87 [&]() ->
bool {
return !CanFillGameTiles(); },
90 "Construct game tiles from this layer.")
92 GameTilesDeepUnfreeze,
93 "Game tiles: Deep Unfreeze",
95 [&]() ->
bool {
return !CanFillGameTiles(); },
98 "Construct game tiles from this layer.")
100 GameTilesBlueCheckTele,
101 "Game tiles: Blue Check Tele",
103 [&]() ->
bool {
return !CanFillGameTiles(); },
106 "Construct game tiles from this layer.")
108 GameTilesRedCheckTele,
109 "Game tiles: Red Check Tele",
111 [&]() ->
bool {
return !CanFillGameTiles(); },
114 "Construct game tiles from this layer.")
117 "Game tiles: Live Freeze",
119 [&]() ->
bool {
return !CanFillGameTiles(); },
122 "Construct game tiles from this layer.")
124 GameTilesLiveUnfreeze,
125 "Game tiles: Live Unfreeze",
127 [&]() ->
bool {
return !CanFillGameTiles(); },
130 "Construct game tiles from this layer.")
134 [&]() { AddGroup(); },
142 [&]() { MapView()->ResetZoom(); },
146 "[Numpad*] Zoom to normal and remove editor offset.")
150 [&]() { MapView()->Zoom()->ChangeValue(50.0f); },
154 "[Numpad-] Zoom out.")
158 [&]() { MapView()->Zoom()->ChangeValue(-50.0f); },
162 "[Numpad+] Zoom in.")
166 [&]() { MapView()->Focus(); },
170 "[Home] Restore map focus.")
174 [&]() { MapView()->ProofMode()->Toggle(); },
176 [&]() ->
bool {
return MapView()->ProofMode()->IsEnabled(); },
178 "Toggle proof borders. These borders represent the area that a player can see with default zoom.")
184 [&]() { AddSwitchLayer(); },
185 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSwitchLayer; },
188 "Create a new switch layer.")
192 [&]() { AddTuneLayer(); },
193 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTuneLayer; },
196 "Create a new tuning layer.")
200 [&]() { AddSpeedupLayer(); },
201 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSpeedupLayer; },
204 "Create a new speedup layer.")
208 [&]() { AddTeleLayer(); },
209 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTeleLayer; },
212 "Create a new tele layer.")
216 [&]() { AddFrontLayer(); },
217 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pFrontLayer; },
220 "Create a new item layer.")
236 "[Ctrl+Shift+S] Save the current map under a new name.")
243 if(!m_PopupEventWasActivated)
245 m_PopupEventType = POPEVENT_LOADCURRENT;
246 m_PopupEventActivated =
true;
257 "[Ctrl+Shift+L] Open the current ingame map for editing.")
261 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES; },
264 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
265 "Toggle the envelope editor.")
269 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
272 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
273 "Toggle the server settings editor.")
277 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
280 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
281 "Toggle the editor history view.")
289 "Load a new image to use in the map.")
293 [&]() { LayerSelectImage(); },
294 [&]() ->
bool {
return !IsNonGameTileLayerSelected(); },
297 "Pick mapres image for currently selected layer.")
302 m_ShowTileInfo = SHOW_TILE_OFF;
305 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_OFF; },
307 "Do not show tile information.")
312 m_ShowTileInfo = SHOW_TILE_DECIMAL;
315 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_DECIMAL; },
317 "[Ctrl+I] Show tile information.")
322 m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
325 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
327 "[Ctrl+Shift+I] Show tile information in hexadecimal.")
329 PreviewQuadEnvelopes,
330 "Preview quad envelopes",
332 m_ShowEnvelopePreview = !m_ShowEnvelopePreview;
333 m_ActiveEnvelopePreview = EEnvelopePreview::NONE;
336 [&]() ->
bool {
return m_ShowEnvelopePreview; },
338 "Toggle previewing the paths of quads with a position envelope when a quad layer is selected.")
342 [&]() { DeleteSelectedLayer(); },
344 std::shared_ptr<CLayer> pCurrentLayer = Map()->SelectedLayer(0);
347 return Map()->m_pGameLayer == pCurrentLayer;
355 [&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
357 [&]() ->
bool {
return m_ColorPipetteActive; },
359 "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
363 [&]() { MapDetails(); },
367 "Adjust the map details of the current map.")
371 [&]() { AddQuadOrSound(); },
373 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
380 "[Ctrl+Q] Add a new quad.")
384 [&]() { AddQuadOrSound(); },
386 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
393 "[Ctrl+Q] Add a new sound source.")
397 [&]() { TestMapLocally(); },
401 "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:58
@ STATE_ONLINE
Definition client.h:57
@ TYPE_ALL
Definition storage.h:27
@ TYPE_SAVE
Definition storage.h:26
@ 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
const char * fs_filename(const char *path)
Definition fs.cpp:456
void fs_split_file_extension(const char *filename, char *name, size_t name_size, char *extension, size_t extension_size)
Definition fs.cpp:466
@ 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
constexpr auto IO_MAX_PATH_LENGTH
Definition types.h:56