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 [&]() { m_ShowPickerToggle = !m_ShowPickerToggle; },
25 Map()->m_vSelectedLayers.size() != 1 ||
26 Map()->SelectedLayer(0) ==
nullptr ||
29 [&]() ->
bool {
return m_ShowPickerToggle; },
31 "[Ctrl+Space, Hold Space] Toggle brush picker.")
35 [&]() { MapView()->MapGrid()->Toggle(); },
37 [&]() ->
bool {
return MapView()->MapGrid()->IsEnabled(); },
39 "[Ctrl+G] Toggle grid.")
44 [&]() ->
bool {
return !CanFillGameTiles(); },
47 "Construct game tiles from this layer.")
50 "Game tiles: Hookable",
52 [&]() ->
bool {
return !CanFillGameTiles(); },
55 "Construct game tiles from this layer.")
60 [&]() ->
bool {
return !CanFillGameTiles(); },
63 "Construct game tiles from this layer.")
66 "Game tiles: Unhookable",
68 [&]() ->
bool {
return !CanFillGameTiles(); },
71 "Construct game tiles from this layer.")
74 "Game tiles: Hookthrough",
76 [&]() ->
bool {
return !CanFillGameTiles(); },
79 "Construct game tiles from this layer.")
84 [&]() ->
bool {
return !CanFillGameTiles(); },
87 "Construct game tiles from this layer.")
90 "Game tiles: Unfreeze",
92 [&]() ->
bool {
return !CanFillGameTiles(); },
95 "Construct game tiles from this layer.")
98 "Game tiles: Deep Freeze",
100 [&]() ->
bool {
return !CanFillGameTiles(); },
103 "Construct game tiles from this layer.")
105 GameTilesDeepUnfreeze,
106 "Game tiles: Deep Unfreeze",
108 [&]() ->
bool {
return !CanFillGameTiles(); },
111 "Construct game tiles from this layer.")
113 GameTilesBlueCheckTele,
114 "Game tiles: Blue Check Tele",
116 [&]() ->
bool {
return !CanFillGameTiles(); },
119 "Construct game tiles from this layer.")
121 GameTilesRedCheckTele,
122 "Game tiles: Red Check Tele",
124 [&]() ->
bool {
return !CanFillGameTiles(); },
127 "Construct game tiles from this layer.")
130 "Game tiles: Live Freeze",
132 [&]() ->
bool {
return !CanFillGameTiles(); },
135 "Construct game tiles from this layer.")
137 GameTilesLiveUnfreeze,
138 "Game tiles: Live Unfreeze",
140 [&]() ->
bool {
return !CanFillGameTiles(); },
143 "Construct game tiles from this layer.")
147 [&]() { AddGroup(); },
155 [&]() { MapView()->ResetZoom(); },
159 "[Numpad*] Zoom to normal and remove editor offset.")
163 [&]() { MapView()->Zoom()->ScaleValue(1.331f); },
167 "[Numpad-] Zoom out.")
171 [&]() { MapView()->Zoom()->ScaleValue(1.0f / 1.331f); },
175 "[Numpad+] Zoom in.")
179 [&]() { MapView()->Focus(); },
183 "[Home] Restore map focus.")
187 [&]() { MapView()->ProofMode()->Toggle(); },
189 [&]() ->
bool {
return MapView()->ProofMode()->IsEnabled(); },
191 "Toggle proof borders. These borders represent the area that a player can see with default zoom.")
197 [&]() { AddSwitchLayer(); },
198 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSwitchLayer; },
201 "Create a new switch layer.")
205 [&]() { AddTuneLayer(); },
206 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTuneLayer; },
209 "Create a new tuning layer.")
213 [&]() { AddSpeedupLayer(); },
214 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pSpeedupLayer; },
217 "Create a new speedup layer.")
221 [&]() { AddTeleLayer(); },
222 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pTeleLayer; },
225 "Create a new tele layer.")
229 [&]() { AddFrontLayer(); },
230 [&]() ->
bool {
return !Map()->SelectedGroup()->m_GameGroup || Map()->m_pFrontLayer; },
233 "Create a new item layer.")
249 "[Ctrl+Shift+S] Save the current map under a new name.")
256 if(!m_PopupEventWasActivated)
258 m_PopupEventType = POPEVENT_LOADCURRENT;
259 m_PopupEventActivated =
true;
270 "[Ctrl+Shift+L] Open the current ingame map for editing.")
274 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES; },
277 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
278 "Toggle the envelope editor.")
282 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
285 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
286 "Toggle the server settings editor.")
290 [&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
293 [&]() ->
int {
return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
294 "Toggle the editor history view.")
302 "Load a new image to use in the map.")
306 [&]() { LayerSelectImage(); },
307 [&]() ->
bool {
return !IsNonGameTileLayerSelected(); },
310 "Pick mapres image for currently selected layer.")
315 m_ShowTileInfo = SHOW_TILE_OFF;
318 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_OFF; },
320 "Do not show tile information.")
325 m_ShowTileInfo = SHOW_TILE_DECIMAL;
328 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_DECIMAL; },
330 "[Ctrl+I] Show tile information.")
335 m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
338 [&]() ->
bool {
return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
340 "[Ctrl+Shift+I] Show tile information in hexadecimal.")
342 PreviewQuadEnvelopes,
343 "Preview quad envelopes",
345 m_ShowEnvelopePreview = !m_ShowEnvelopePreview;
346 m_ActiveEnvelopePreview = EEnvelopePreview::NONE;
349 [&]() ->
bool {
return m_ShowEnvelopePreview; },
351 "Toggle previewing the paths of quads with a position envelope when a quad layer is selected.")
355 [&]() { DeleteSelectedLayer(); },
357 std::shared_ptr<CLayer> pCurrentLayer = Map()->SelectedLayer(0);
360 return Map()->m_pGameLayer == pCurrentLayer;
368 [&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
370 [&]() ->
bool {
return m_ColorPipetteActive; },
372 "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
376 [&]() { MapDetails(); },
380 "Adjust the map details of the current map.")
384 [&]() { AddQuadOrSound(); },
386 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
393 "[Ctrl+Q] Add a new quad.")
397 [&]() { AddQuadOrSound(); },
399 std::shared_ptr<CLayer> pLayer = Map()->SelectedLayer(0);
406 "[Ctrl+Q] Add a new sound source.")
410 [&]() { TestMapLocally(); },
414 "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:57
@ 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
constexpr auto IO_MAX_PATH_LENGTH
Definition types.h:26
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_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