From 8a13b07eb95ed2e83276ce5ab903f705f7a3f8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 1 Jan 2025 20:15:49 +0100 Subject: [PATCH] Improve editor labels and tooltips - Use English sentence case for all tooltips and labels, i.e. only capitalize the first word of every sentence. - End all tooltips with a period. - Consistently format hotkey descriptions in square brackets at the beginning of tooltips with title case capitalization. - Change verb form of tooltips to fit the sentence "Clicking this button will [tooltip]", e.g. use "Rotate X" instead of "Rotates X". - Improve clarity, consistency and readability of various tooltips. - Remove unnecessary `grabbing` debug message when grabbing a brush. - Remove unnecessary temporary variable `m_aMenuBackgroundTooltip`. --- src/game/editor/editor.cpp | 125 +++++++++--------- src/game/editor/editor.h | 1 - src/game/editor/editor_props.cpp | 26 ++-- src/game/editor/editor_server_settings.cpp | 33 ++--- src/game/editor/explanations.cpp | 16 +-- src/game/editor/layer_selector.cpp | 2 +- src/game/editor/map_grid.cpp | 2 +- src/game/editor/mapitems/layer_tiles.cpp | 8 +- src/game/editor/popups.cpp | 139 +++++++++++---------- src/game/editor/quick_actions.h | 90 ++++++------- 10 files changed, 220 insertions(+), 222 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index c3ff40a34e7..ee46b890272 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -323,7 +323,7 @@ SEditResult CEditor::UiDoValueSelector(void *pId, CUIRect *pRect, const cha if(s_pLastTextId == pId) { - str_copy(m_aTooltip, "Type your number"); + str_copy(m_aTooltip, "Type your number. Press enter to confirm."); Ui()->SetActiveItem(&s_NumberInput); DoEditBox(&s_NumberInput, pRect, 10.0f, Corners); @@ -975,7 +975,7 @@ void CEditor::DoAudioPreview(CUIRect View, const void *pPlayPauseButtonId, const // play/pause button { View.VSplitLeft(View.h, &Button, &View); - if(DoButton_FontIcon(pPlayPauseButtonId, Sound()->IsPlaying(SampleId) ? FONT_ICON_PAUSE : FONT_ICON_PLAY, 0, &Button, 0, "Play/pause audio preview", IGraphics::CORNER_ALL) || + if(DoButton_FontIcon(pPlayPauseButtonId, Sound()->IsPlaying(SampleId) ? FONT_ICON_PAUSE : FONT_ICON_PLAY, 0, &Button, 0, "Play/pause audio preview.", IGraphics::CORNER_ALL) || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_SPACE))) { if(Sound()->IsPlaying(SampleId)) @@ -995,7 +995,7 @@ void CEditor::DoAudioPreview(CUIRect View, const void *pPlayPauseButtonId, const { View.VSplitLeft(2.0f, nullptr, &View); View.VSplitLeft(View.h, &Button, &View); - if(DoButton_FontIcon(pStopButtonId, FONT_ICON_STOP, 0, &Button, 0, "Stop audio preview", IGraphics::CORNER_ALL)) + if(DoButton_FontIcon(pStopButtonId, FONT_ICON_STOP, 0, &Button, 0, "Stop audio preview.", IGraphics::CORNER_ALL)) { Sound()->Stop(SampleId); } @@ -1094,7 +1094,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // detail button TB_Top.VSplitLeft(40.0f, &Button, &TB_Top); static int s_HqButton = 0; - if(DoButton_Editor(&s_HqButton, "HD", m_ShowDetail, &Button, 0, "[ctrl+h] Toggle High Detail") || + if(DoButton_Editor(&s_HqButton, "HD", m_ShowDetail, &Button, 0, "[Ctrl+H] Toggle high detail.") || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_H) && ModPressed)) { m_ShowDetail = !m_ShowDetail; @@ -1105,7 +1105,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // animation button TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static char s_AnimateButton; - if(DoButton_FontIcon(&s_AnimateButton, FONT_ICON_CIRCLE_PLAY, m_Animate, &Button, 0, "[ctrl+m] Toggle animation", IGraphics::CORNER_L) || + if(DoButton_FontIcon(&s_AnimateButton, FONT_ICON_CIRCLE_PLAY, m_Animate, &Button, 0, "[Ctrl+M] Toggle animation.", IGraphics::CORNER_L) || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_M) && ModPressed)) { m_AnimateStart = time_get(); @@ -1115,7 +1115,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // animation settings button TB_Top.VSplitLeft(14.0f, &Button, &TB_Top); static char s_AnimateSettingsButton; - if(DoButton_FontIcon(&s_AnimateSettingsButton, FONT_ICON_CIRCLE_CHEVRON_DOWN, 0, &Button, 0, "Change animation settings.", IGraphics::CORNER_R, 8.0f)) + if(DoButton_FontIcon(&s_AnimateSettingsButton, FONT_ICON_CIRCLE_CHEVRON_DOWN, 0, &Button, 0, "Change the animation settings.", IGraphics::CORNER_R, 8.0f)) { m_AnimateUpdatePopup = true; static SPopupMenuId s_PopupAnimateSettingsId; @@ -1144,7 +1144,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // zoom button TB_Top.VSplitLeft(40.0f, &Button, &TB_Top); static int s_ZoomButton = 0; - if(DoButton_Editor(&s_ZoomButton, "Zoom", m_PreviewZoom, &Button, 0, "Toggles preview of how layers will be zoomed in-game")) + if(DoButton_Editor(&s_ZoomButton, "Zoom", m_PreviewZoom, &Button, 0, "Toggle preview of how layers will be zoomed ingame.")) { m_PreviewZoom = !m_PreviewZoom; } @@ -1163,7 +1163,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // grid settings button TB_Top.VSplitLeft(14.0f, &Button, &TB_Top); static char s_GridSettingsButton; - if(DoButton_FontIcon(&s_GridSettingsButton, FONT_ICON_CIRCLE_CHEVRON_DOWN, 0, &Button, 0, "Change grid settings.", IGraphics::CORNER_R, 8.0f)) + if(DoButton_FontIcon(&s_GridSettingsButton, FONT_ICON_CIRCLE_CHEVRON_DOWN, 0, &Button, 0, "Change the grid settings.", IGraphics::CORNER_R, 8.0f)) { MapView()->MapGrid()->DoSettingsPopup(vec2(Button.x, Button.y + Button.h)); } @@ -1197,14 +1197,14 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // undo/redo group TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static int s_UndoButton = 0; - if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_EditorHistory.CanUndo() - 1, &Button, 0, "[ctrl+z] Undo last action", IGraphics::CORNER_L)) + if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_EditorHistory.CanUndo() - 1, &Button, 0, "[Ctrl+Z] Undo the last action.", IGraphics::CORNER_L)) { m_EditorHistory.Undo(); } TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static int s_RedoButton = 0; - if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_EditorHistory.CanRedo() - 1, &Button, 0, "[ctrl+y] Redo last action", IGraphics::CORNER_R)) + if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_EditorHistory.CanRedo() - 1, &Button, 0, "[Ctrl+Y] Redo the last action.", IGraphics::CORNER_R)) { m_EditorHistory.Redo(); } @@ -1218,7 +1218,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) // flip buttons TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static int s_FlipXButton = 0; - if(DoButton_FontIcon(&s_FlipXButton, FONT_ICON_ARROWS_LEFT_RIGHT, Enabled, &Button, 0, "[N] Flip brush horizontal", IGraphics::CORNER_L) || (Input()->KeyPress(KEY_N) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) + if(DoButton_FontIcon(&s_FlipXButton, FONT_ICON_ARROWS_LEFT_RIGHT, Enabled, &Button, 0, "[N] Flip the brush horizontally.", IGraphics::CORNER_L) || (Input()->KeyPress(KEY_N) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) { for(auto &pLayer : m_pBrush->m_vpLayers) pLayer->BrushFlipX(); @@ -1226,7 +1226,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static int s_FlipyButton = 0; - if(DoButton_FontIcon(&s_FlipyButton, FONT_ICON_ARROWS_UP_DOWN, Enabled, &Button, 0, "[M] Flip brush vertical", IGraphics::CORNER_R) || (Input()->KeyPress(KEY_M) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) + if(DoButton_FontIcon(&s_FlipyButton, FONT_ICON_ARROWS_UP_DOWN, Enabled, &Button, 0, "[M] Flip the brush vertically.", IGraphics::CORNER_R) || (Input()->KeyPress(KEY_M) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) { for(auto &pLayer : m_pBrush->m_vpLayers) pLayer->BrushFlipY(); @@ -1247,7 +1247,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) } static int s_CcwButton = 0; - if(DoButton_FontIcon(&s_CcwButton, FONT_ICON_ARROW_ROTATE_LEFT, Enabled, &Button, 0, "[R] Rotates the brush counter clockwise", IGraphics::CORNER_L) || (Input()->KeyPress(KEY_R) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) + if(DoButton_FontIcon(&s_CcwButton, FONT_ICON_ARROW_ROTATE_LEFT, Enabled, &Button, 0, "[R] Rotate the brush counter-clockwise.", IGraphics::CORNER_L) || (Input()->KeyPress(KEY_R) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) { for(auto &pLayer : m_pBrush->m_vpLayers) pLayer->BrushRotate(-s_RotationAmount / 360.0f * pi * 2); @@ -1259,7 +1259,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) TB_Top.VSplitLeft(25.0f, &Button, &TB_Top); static int s_CwButton = 0; - if(DoButton_FontIcon(&s_CwButton, FONT_ICON_ARROW_ROTATE_RIGHT, Enabled, &Button, 0, "[T] Rotates the brush clockwise", IGraphics::CORNER_R) || (Input()->KeyPress(KEY_T) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) + if(DoButton_FontIcon(&s_CwButton, FONT_ICON_ARROW_ROTATE_RIGHT, Enabled, &Button, 0, "[T] Rotate the brush clockwise.", IGraphics::CORNER_R) || (Input()->KeyPress(KEY_T) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) { for(auto &pLayer : m_pBrush->m_vpLayers) pLayer->BrushRotate(s_RotationAmount / 360.0f * pi * 2); @@ -1350,7 +1350,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) if(pButtonName != nullptr) { static char s_aButtonTooltip[64]; - str_format(s_aButtonTooltip, sizeof(s_aButtonTooltip), "[ctrl+t] %s", pButtonName); + str_format(s_aButtonTooltip, sizeof(s_aButtonTooltip), "[Ctrl+T] %s", pButtonName); TB_Bottom.VSplitLeft(60.0f, &Button, &TB_Bottom); static int s_ModifierButton = 0; @@ -1384,10 +1384,10 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) } else if(pLayer->m_Type == LAYERTYPE_SOUNDS) { - if(DoButton_Editor(&m_QuickActionAddSound, m_QuickActionAddSound.Label(), 0, &Button, 0, m_QuickActionAddSound.Description()) || + if(DoButton_Editor(&m_QuickActionAddSoundSource, m_QuickActionAddSoundSource.Label(), 0, &Button, 0, m_QuickActionAddSoundSource.Description()) || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_Q) && ModPressed)) { - m_QuickActionAddSound.Call(); + m_QuickActionAddSoundSource.Call(); } } @@ -1398,7 +1398,7 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar) { TB_Bottom.VSplitLeft(65.0f, &Button, &TB_Bottom); static int s_BrushDrawModeButton = 0; - if(DoButton_Editor(&s_BrushDrawModeButton, "Destructive", m_BrushDrawDestructive, &Button, 0, "[ctrl+d] Toggle brush draw mode") || + if(DoButton_Editor(&s_BrushDrawModeButton, "Destructive", m_BrushDrawDestructive, &Button, 0, "[Ctrl+D] Toggle brush draw mode: preserve or override existing tiles.") || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_D) && ModPressed && !ShiftPressed)) m_BrushDrawDestructive = !m_BrushDrawDestructive; TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom); @@ -2300,7 +2300,7 @@ void CEditor::DoQuad(int LayerIndex, const std::shared_ptr &pLayer, ms_pUiGotContext = pId; Graphics()->SetColor(1, 1, 1, 1); - str_copy(m_aTooltip, "Left mouse button to move. Hold shift to move pivot. Hold alt to ignore grid. Hold shift and right click to delete."); + str_copy(m_aTooltip, "Left mouse button to move. Hold shift to move pivot. Hold alt to ignore grid. Shift+right click to delete."); if(Ui()->MouseButton(0)) { @@ -2609,7 +2609,7 @@ void CEditor::DoQuadKnife(int QuadIndex) vec2(fx2f(pQuad->m_aPoints[3].x), fx2f(pQuad->m_aPoints[3].y)), vec2(fx2f(pQuad->m_aPoints[2].x), fx2f(pQuad->m_aPoints[2].y))}; - str_copy(m_aTooltip, "Left click inside the quad to select an area to slice. Hold alt to ignore grid. Right click to leave knife mode"); + str_copy(m_aTooltip, "Left click inside the quad to select an area to slice. Hold alt to ignore grid. Right click to leave knife mode."); if(Ui()->MouseButtonClicked(1)) { @@ -3262,16 +3262,16 @@ void CEditor::DoMapEditor(CUIRect View) } } else if(m_pBrush->IsEmpty() && GetSelectedLayerType(0, LAYERTYPE_QUADS) != nullptr) - str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Hold shift to select multiple quads. Press R to rotate selected quads. Use ctrl+right mouse to select layer."); + str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Hold shift to select multiple quads. Press R to rotate selected quads. Use ctrl+right click to select layer."); else if(m_pBrush->IsEmpty()) { if(g_Config.m_EdLayerSelector) - str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Use ctrl+right click to select layer for hovered tile."); + str_copy(m_aTooltip, "Use left mouse button to drag and create a brush. Use ctrl+right click to select layer of hovered tile."); else str_copy(m_aTooltip, "Use left mouse button to drag and create a brush."); } else - str_copy(m_aTooltip, "Use left mouse button to paint with the brush. Right button clears the brush."); + str_copy(m_aTooltip, "Use left mouse button to paint with the brush. Right click to clear the brush."); if(Ui()->CheckActiveItem(&m_MapEditorId)) { @@ -3336,11 +3336,6 @@ void CEditor::DoMapEditor(CUIRect View) } else { - // grab brush - char aBuf[256]; - str_format(aBuf, sizeof(aBuf), "grabbing %f %f %f %f", r.x, r.y, r.w, r.h); - Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "editor", aBuf); - // TODO: do all layers int Grabs = 0; for(size_t k = 0; k < NumEditLayers; k++) @@ -3569,9 +3564,8 @@ void CEditor::DoMapEditor(CUIRect View) str_copy(aTooltipPositionsCopy, aTooltipPositions); str_format(aTooltipPositions, sizeof(aTooltipPositions), "%s, %s %s", aTooltipPositionsCopy, MapView()->ProofMode()->m_vpMenuBackgroundPositionNames[k], aNumBuf); } - str_format(m_aMenuBackgroundTooltip, sizeof(m_aMenuBackgroundTooltip), "%s %s", aTooltipPrefix, aTooltipPositions); + str_format(m_aTooltip, sizeof(m_aTooltip), "%s %s.", aTooltipPrefix, aTooltipPositions); - str_copy(m_aTooltip, m_aMenuBackgroundTooltip); if(Ui()->MouseButton(0)) Ui()->SetActiveItem(&MapView()->ProofMode()->m_vMenuBackgroundPositions[i]); } @@ -3715,7 +3709,7 @@ void CEditor::DoColorPickerButton(const void *pId, const CUIRect *pRect, ColorRG pRect->Margin(1.0f, &ColorRect); ColorRect.Draw(Color, IGraphics::CORNER_ALL, 3.0f); - const int ButtonResult = DoButton_Editor_Common(pId, nullptr, 0, pRect, 0, "Click to show the color picker. Shift+rightclick to copy color to clipboard. Shift+leftclick to paste color from clipboard."); + const int ButtonResult = DoButton_Editor_Common(pId, nullptr, 0, pRect, 0, "Click to show the color picker. Shift+right click to copy color to clipboard. Shift+left click to paste color from clipboard."); if(Input()->ShiftIsPressed()) { if(ButtonResult == 1) @@ -3954,7 +3948,7 @@ void CEditor::RenderLayers(CUIRect LayersBox) bool Clicked; bool Abrupted; if(int Result = DoButton_DraggableEx(m_Map.m_vpGroups[g].get(), aBuf, g == m_SelectedGroup, &Slot, &Clicked, &Abrupted, - BUTTON_CONTEXT, m_Map.m_vpGroups[g]->m_Collapse ? "Select group. Shift click to select all layers. Double click to expand." : "Select group. Shift click to select all layers. Double click to collapse.", IGraphics::CORNER_R)) + BUTTON_CONTEXT, m_Map.m_vpGroups[g]->m_Collapse ? "Select group. Shift+left click to select all layers. Double click to expand." : "Select group. Shift+left click to select all layers. Double click to collapse.", IGraphics::CORNER_R)) { if(s_Operation == OP_NONE) { @@ -4138,7 +4132,7 @@ void CEditor::RenderLayers(CUIRect LayersBox) bool Clicked; bool Abrupted; if(int Result = DoButton_DraggableEx(m_Map.m_vpGroups[g]->m_vpLayers[i].get(), aBuf, Checked, &Button, &Clicked, &Abrupted, - BUTTON_CONTEXT, "Select layer. Shift click to select multiple.", IGraphics::CORNER_R)) + BUTTON_CONTEXT, "Select layer. Hold shift to select multiple.", IGraphics::CORNER_R)) { if(s_Operation == OP_NONE) { @@ -4412,7 +4406,7 @@ void CEditor::RenderLayers(CUIRect LayersBox) CollapseAllButton.HSplitTop(RowHeight, &CollapseAllButton, 0); static int s_CollapseAllButton = 0; - if(DoButton_Editor(&s_CollapseAllButton, pActionText, 0, &CollapseAllButton, IGraphics::CORNER_R, "Expand or collapse all groups")) + if(DoButton_Editor(&s_CollapseAllButton, pActionText, 0, &CollapseAllButton, IGraphics::CORNER_R, "Expand or collapse all groups.")) { for(const auto &pGroup : m_Map.m_vpGroups) { @@ -5053,7 +5047,7 @@ void CEditor::RenderSounds(CUIRect ToolBox) { AddSoundButton.HSplitTop(5.0f, nullptr, &AddSoundButton); AddSoundButton.HSplitTop(RowHeight, &AddSoundButton, nullptr); - if(DoButton_Editor(&s_AddSoundButton, "Add", 0, &AddSoundButton, 0, "Load a new sound to use in the map")) + if(DoButton_Editor(&s_AddSoundButton, "Add sound", 0, &AddSoundButton, 0, "Load a new sound to use in the map.")) InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_SOUND, "Add Sound", "Add", "mapres", false, AddSound, this); } s_ScrollRegion.End(); @@ -5150,7 +5144,7 @@ void CEditor::RenderFileDialog() static int s_ButtonTimeModified = 0; char aBufLabelButtonTimeModified[64]; str_format(aBufLabelButtonTimeModified, sizeof(aBufLabelButtonTimeModified), "Time modified %s", aSortIndicator[m_SortByTimeModified + 1]); - if(DoButton_Editor(&s_ButtonTimeModified, aBufLabelButtonTimeModified, 0, &ButtonTimeModified, 0, "Sort by time modified")) + if(DoButton_Editor(&s_ButtonTimeModified, aBufLabelButtonTimeModified, 0, &ButtonTimeModified, 0, "Sort by time modified.")) { if(m_SortByTimeModified == 1) { @@ -5171,7 +5165,7 @@ void CEditor::RenderFileDialog() static int s_ButtonFileName = 0; char aBufLabelButtonFilename[64]; str_format(aBufLabelButtonFilename, sizeof(aBufLabelButtonFilename), "Filename %s", aSortIndicator[m_SortByFilename + 1]); - if(DoButton_Editor(&s_ButtonFileName, aBufLabelButtonFilename, 0, &ButtonFileName, 0, "Sort by file name")) + if(DoButton_Editor(&s_ButtonFileName, aBufLabelButtonFilename, 0, &ButtonFileName, 0, "Sort by file name.")) { if(m_SortByFilename == 1) { @@ -5582,7 +5576,7 @@ void CEditor::RenderFileDialog() { ButtonBar.VSplitRight(ButtonSpacing, &ButtonBar, nullptr); ButtonBar.VSplitRight(90.0f, &ButtonBar, &Button); - if(DoButton_Editor(&s_ShowDirectoryButton, "Show directory", 0, &Button, 0, "Open the current directory in the file browser")) + if(DoButton_Editor(&s_ShowDirectoryButton, "Show directory", 0, &Button, 0, "Open the current directory in the file browser.")) { char aOpenPath[IO_MAX_PATH_LENGTH]; Storage()->GetCompletePath(m_FilesSelectedIndex >= 0 ? m_vpFilteredFileList[m_FilesSelectedIndex]->m_StorageType : IStorage::TYPE_SAVE, m_pFileDialogPath, aOpenPath, sizeof(aOpenPath)); @@ -6315,7 +6309,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) // redo button ToolBar.VSplitRight(25.0f, &ToolBar, &Button); static int s_RedoButton = 0; - if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_EnvelopeEditorHistory.CanRedo() ? 0 : -1, &Button, 0, "[Ctrl+Y] Redo last action", IGraphics::CORNER_R, 11.0f) == 1) + if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_EnvelopeEditorHistory.CanRedo() ? 0 : -1, &Button, 0, "[Ctrl+Y] Redo the last action.", IGraphics::CORNER_R, 11.0f) == 1) { m_EnvelopeEditorHistory.Redo(); } @@ -6324,14 +6318,14 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(25.0f, &ToolBar, &Button); ToolBar.VSplitRight(10.0f, &ToolBar, nullptr); static int s_UndoButton = 0; - if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_EnvelopeEditorHistory.CanUndo() ? 0 : -1, &Button, 0, "[Ctrl+Z] Undo last action", IGraphics::CORNER_L, 11.0f) == 1) + if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_EnvelopeEditorHistory.CanUndo() ? 0 : -1, &Button, 0, "[Ctrl+Z] Undo the last action.", IGraphics::CORNER_L, 11.0f) == 1) { m_EnvelopeEditorHistory.Undo(); } ToolBar.VSplitRight(50.0f, &ToolBar, &Button); static int s_NewSoundButton = 0; - if(DoButton_Editor(&s_NewSoundButton, "Sound+", 0, &Button, 0, "Creates a new sound envelope")) + if(DoButton_Editor(&s_NewSoundButton, "Sound+", 0, &Button, 0, "Create a new sound envelope.")) { m_Map.OnModify(); pNewEnv = m_Map.NewEnvelope(CEnvelope::EType::SOUND); @@ -6340,7 +6334,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(5.0f, &ToolBar, nullptr); ToolBar.VSplitRight(50.0f, &ToolBar, &Button); static int s_New4dButton = 0; - if(DoButton_Editor(&s_New4dButton, "Color+", 0, &Button, 0, "Creates a new color envelope")) + if(DoButton_Editor(&s_New4dButton, "Color+", 0, &Button, 0, "Create a new color envelope.")) { m_Map.OnModify(); pNewEnv = m_Map.NewEnvelope(CEnvelope::EType::COLOR); @@ -6349,7 +6343,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(5.0f, &ToolBar, nullptr); ToolBar.VSplitRight(50.0f, &ToolBar, &Button); static int s_New2dButton = 0; - if(DoButton_Editor(&s_New2dButton, "Pos.+", 0, &Button, 0, "Creates a new position envelope")) + if(DoButton_Editor(&s_New2dButton, "Pos.+", 0, &Button, 0, "Create a new position envelope.")) { m_Map.OnModify(); pNewEnv = m_Map.NewEnvelope(CEnvelope::EType::POSITION); @@ -6361,7 +6355,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(10.0f, &ToolBar, nullptr); ToolBar.VSplitRight(25.0f, &ToolBar, &Button); static int s_DeleteButton = 0; - if(DoButton_Editor(&s_DeleteButton, "✗", 0, &Button, 0, "Delete this envelope")) + if(DoButton_Editor(&s_DeleteButton, "✗", 0, &Button, 0, "Delete this envelope.")) { m_EnvelopeEditorHistory.RecordAction(std::make_shared(this, m_SelectedEnvelope)); m_Map.DeleteEnvelope(m_SelectedEnvelope); @@ -6375,7 +6369,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(5.0f, &ToolBar, nullptr); ToolBar.VSplitRight(25.0f, &ToolBar, &Button); static int s_MoveRightButton = 0; - if(DoButton_Ex(&s_MoveRightButton, "→", 0, &Button, 0, "Move this envelope to the right", IGraphics::CORNER_R)) + if(DoButton_Ex(&s_MoveRightButton, "→", 0, &Button, 0, "Move this envelope to the right.", IGraphics::CORNER_R)) { m_EnvelopeEditorHistory.RecordAction(std::make_shared(this, m_SelectedEnvelope, CEditorActionEnvelopeEdit::EEditType::ORDER, m_SelectedEnvelope, m_SelectedEnvelope + 1)); m_Map.SwapEnvelopes(m_SelectedEnvelope, m_SelectedEnvelope + 1); @@ -6387,7 +6381,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) // Move left button ToolBar.VSplitRight(25.0f, &ToolBar, &Button); static int s_MoveLeftButton = 0; - if(DoButton_Ex(&s_MoveLeftButton, "←", 0, &Button, 0, "Move this envelope to the left", IGraphics::CORNER_L)) + if(DoButton_Ex(&s_MoveLeftButton, "←", 0, &Button, 0, "Move this envelope to the left.", IGraphics::CORNER_L)) { m_EnvelopeEditorHistory.RecordAction(std::make_shared(this, m_SelectedEnvelope, CEditorActionEnvelopeEdit::EEditType::ORDER, m_SelectedEnvelope, m_SelectedEnvelope - 1)); m_Map.SwapEnvelopes(m_SelectedEnvelope - 1, m_SelectedEnvelope); @@ -6401,7 +6395,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(5.0f, &ToolBar, nullptr); ToolBar.VSplitRight(20.0f, &ToolBar, &Button); static int s_ZoomOutButton = 0; - if(DoButton_FontIcon(&s_ZoomOutButton, FONT_ICON_MINUS, 0, &Button, 0, "[NumPad-] Zoom out horizontally, hold shift to zoom vertically", IGraphics::CORNER_R, 9.0f)) + if(DoButton_FontIcon(&s_ZoomOutButton, FONT_ICON_MINUS, 0, &Button, 0, "[NumPad-] Zoom out horizontally, hold shift to zoom vertically.", IGraphics::CORNER_R, 9.0f)) { if(Input()->ShiftIsPressed()) m_ZoomEnvelopeY.ChangeValue(0.1f * m_ZoomEnvelopeY.GetValue()); @@ -6411,12 +6405,12 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitRight(20.0f, &ToolBar, &Button); static int s_ResetZoomButton = 0; - if(DoButton_FontIcon(&s_ResetZoomButton, FONT_ICON_MAGNIFYING_GLASS, 0, &Button, 0, "[NumPad*] Reset zoom to default value", IGraphics::CORNER_NONE, 9.0f)) + if(DoButton_FontIcon(&s_ResetZoomButton, FONT_ICON_MAGNIFYING_GLASS, 0, &Button, 0, "[NumPad*] Reset zoom to default value.", IGraphics::CORNER_NONE, 9.0f)) ResetZoomEnvelope(pEnvelope, s_ActiveChannels); ToolBar.VSplitRight(20.0f, &ToolBar, &Button); static int s_ZoomInButton = 0; - if(DoButton_FontIcon(&s_ZoomInButton, FONT_ICON_PLUS, 0, &Button, 0, "[NumPad+] Zoom in horizontally, hold shift to zoom vertically", IGraphics::CORNER_L, 9.0f)) + if(DoButton_FontIcon(&s_ZoomInButton, FONT_ICON_PLUS, 0, &Button, 0, "[NumPad+] Zoom in horizontally, hold shift to zoom vertically.", IGraphics::CORNER_L, 9.0f)) { if(Input()->ShiftIsPressed()) m_ZoomEnvelopeY.ChangeValue(-0.1f * m_ZoomEnvelopeY.GetValue()); @@ -6459,7 +6453,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) } static int s_EnvelopeSelector = 0; - auto NewValueRes = UiDoValueSelector(&s_EnvelopeSelector, &Shifter, aBuf, m_SelectedEnvelope + 1, 1, m_Map.m_vpEnvelopes.size(), 1, 1.0f, "Select Envelope", false, false, IGraphics::CORNER_NONE, &EnvColor, false); + auto NewValueRes = UiDoValueSelector(&s_EnvelopeSelector, &Shifter, aBuf, m_SelectedEnvelope + 1, 1, m_Map.m_vpEnvelopes.size(), 1, 1.0f, "Select the envelope.", false, false, IGraphics::CORNER_NONE, &EnvColor, false); int NewValue = NewValueRes.m_Value; if(NewValue - 1 != m_SelectedEnvelope) { @@ -6468,7 +6462,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) } static int s_PrevButton = 0; - if(DoButton_FontIcon(&s_PrevButton, FONT_ICON_MINUS, 0, &Dec, 0, "Previous Envelope", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon(&s_PrevButton, FONT_ICON_MINUS, 0, &Dec, 0, "Select previous envelope.", IGraphics::CORNER_L, 7.0f)) { m_SelectedEnvelope--; if(m_SelectedEnvelope < 0) @@ -6477,7 +6471,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) } static int s_NextButton = 0; - if(DoButton_FontIcon(&s_NextButton, FONT_ICON_PLUS, 0, &Inc, 0, "Next Envelope", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(&s_NextButton, FONT_ICON_PLUS, 0, &Inc, 0, "Select next envelope.", IGraphics::CORNER_R, 7.0f)) { m_SelectedEnvelope++; if(m_SelectedEnvelope >= (int)m_Map.m_vpEnvelopes.size()) @@ -6495,7 +6489,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitLeft(ToolBar.w > ToolBar.h * 40 ? 80.0f : 60.0f, &Button, &ToolBar); s_NameInput.SetBuffer(pEnvelope->m_aName, sizeof(pEnvelope->m_aName)); - if(DoEditBox(&s_NameInput, &Button, 10.0f, IGraphics::CORNER_ALL, "The name of the selected envelope")) + if(DoEditBox(&s_NameInput, &Button, 10.0f, IGraphics::CORNER_ALL, "The name of the selected envelope.")) { m_Map.OnModify(); } @@ -6534,10 +6528,10 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) }; static const char *s_aapDescriptions[4][CEnvPoint::MAX_CHANNELS] = { - {"Volume of the envelope", "", "", ""}, + {"Volume of the envelope.", "", "", ""}, {"", "", "", ""}, - {"X-axis of the envelope", "Y-axis of the envelope", "Rotation of the envelope", ""}, - {"Red value of the envelope", "Green value of the envelope", "Blue value of the envelope", "Alpha value of the envelope"}, + {"X-axis of the envelope.", "Y-axis of the envelope.", "Rotation of the envelope.", ""}, + {"Red value of the envelope.", "Green value of the envelope.", "Blue value of the envelope.", "Alpha value of the envelope."}, }; static int s_aChannelButtons[CEnvPoint::MAX_CHANNELS] = {0}; @@ -6566,7 +6560,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) ToolBar.VSplitLeft(40.0f, &Button, &ToolBar); static int s_SyncButton; - if(DoButton_Editor(&s_SyncButton, "Sync", pEnvelope->m_Synchronized, &Button, 0, "Synchronize envelope animation to game time (restarts when you touch the start line)")) + if(DoButton_Editor(&s_SyncButton, "Sync", pEnvelope->m_Synchronized, &Button, 0, "Synchronize envelope animation to game time (restarts when you touch the start line).")) { m_EnvelopeEditorHistory.RecordAction(std::make_shared(this, m_SelectedEnvelope, CEditorActionEnvelopeEdit::EEditType::SYNC, pEnvelope->m_Synchronized, !pEnvelope->m_Synchronized)); pEnvelope->m_Synchronized = !pEnvelope->m_Synchronized; @@ -6662,7 +6656,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) } m_ShowEnvelopePreview = SHOWENV_SELECTED; - str_copy(m_aTooltip, "Double-click to create a new point. Use shift to change the zoom axis. Press S to scale selected envelope points."); + str_copy(m_aTooltip, "Double click to create a new point. Use shift to change the zoom axis. Press S to scale selected envelope points."); } UpdateZoomEnvelopeX(View); @@ -7157,7 +7151,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) m_ShowEnvelopePreview = SHOWENV_SELECTED; Graphics()->SetColor(1, 1, 1, 1); - str_copy(m_aTooltip, "Envelope point. Left mouse to drag. Hold ctrl to be more precise. Hold shift to alter time. Shift + right-click to delete."); + str_copy(m_aTooltip, "Envelope point. Left mouse to drag. Hold ctrl to be more precise. Hold shift to alter time. Shift+right click to delete."); ms_pUiGotContext = pId; } else @@ -7292,7 +7286,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) m_ShowEnvelopePreview = SHOWENV_SELECTED; Graphics()->SetColor(1, 1, 1, 1); - str_copy(m_aTooltip, "Bezier out-tangent. Left mouse to drag. Hold ctrl to be more precise. Shift + right-click to reset."); + str_copy(m_aTooltip, "Bezier out-tangent. Left mouse to drag. Hold ctrl to be more precise. Shift+right click to reset."); ms_pUiGotContext = pId; } else @@ -7425,7 +7419,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) m_ShowEnvelopePreview = SHOWENV_SELECTED; Graphics()->SetColor(1, 1, 1, 1); - str_copy(m_aTooltip, "Bezier in-tangent. Left mouse to drag. Hold ctrl to be more precise. Shift + right-click to reset."); + str_copy(m_aTooltip, "Bezier in-tangent. Left mouse to drag. Hold ctrl to be more precise. Shift+right click to reset."); ms_pUiGotContext = pId; } else @@ -7886,7 +7880,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar) TextRender()->SetRenderFlags(0); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); static int s_ChangedIndicator; - DoButton_Editor_Common(&s_ChangedIndicator, "", 0, &ChangedIndicator, 0, "This map has unsaved changes"); // just for the tooltip, result unused + DoButton_Editor_Common(&s_ChangedIndicator, "", 0, &ChangedIndicator, 0, "This map has unsaved changes."); // just for the tooltip, result unused } char aBuf[IO_MAX_PATH_LENGTH + 32]; @@ -7903,7 +7897,8 @@ void CEditor::RenderMenubar(CUIRect MenuBar) Ui()->DoLabel(&Info, aBuf, 10.0f, TEXTALIGN_MR); static int s_HelpButton = 0; - if(DoButton_Editor(&s_HelpButton, "?", 0, &Help, 0, "[F1] Open the DDNet Wiki page for the Map Editor in a web browser") || (Input()->KeyPress(KEY_F1) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) + if(DoButton_Editor(&s_HelpButton, "?", 0, &Help, 0, "[F1] Open the DDNet Wiki page for the map editor in a web browser.") || + (Input()->KeyPress(KEY_F1) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)) { const char *pLink = Localize("https://wiki.ddnet.org/wiki/Mapping"); if(!Client()->ViewLink(pLink)) @@ -7913,7 +7908,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar) } static int s_CloseButton = 0; - if(DoButton_Editor(&s_CloseButton, "×", 0, &Close, 0, "Exits from the editor")) + if(DoButton_Editor(&s_CloseButton, "×", 0, &Close, 0, "[Escape] Exit from the editor.")) { OnClose(); g_Config.m_ClEditor = 0; @@ -8209,7 +8204,7 @@ void CEditor::Render() return pLayer->m_Type == LAYERTYPE_TILES && std::static_pointer_cast(pLayer)->m_Tele; }); if(HasTeleTiles) - str_copy(m_aTooltip, "Use shift+mousewheel up/down to adjust the tele numbers. Use ctrl+f to change all tele numbers to the first unused number."); + str_copy(m_aTooltip, "Use shift+mouse wheel up/down to adjust the tele numbers. Use ctrl+f to change all tele numbers to the first unused number."); if(Input()->ShiftIsPressed()) { diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index 9d566126f33..944d7b2f7d7 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -743,7 +743,6 @@ class CEditor : public IEditor bool m_ShowMousePointer; bool m_GuiActive; - char m_aMenuBackgroundTooltip[256]; bool m_PreviewZoom; float m_MouseWorldScale = 1.0f; // Mouse (i.e. UI) scale relative to the World (selected Group) vec2 m_MouseWorldPos = vec2(0.0f, 0.0f); diff --git a/src/game/editor/editor_props.cpp b/src/game/editor/editor_props.cpp index 34d1e92e98c..65557a348c0 100644 --- a/src/game/editor/editor_props.cpp +++ b/src/game/editor/editor_props.cpp @@ -40,7 +40,7 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro Shifter.VSplitRight(10.0f, &Shifter, &Inc); Shifter.VSplitLeft(10.0f, &Dec, &Shifter); str_format(aBuf, sizeof(aBuf), "%d", pProps[i].m_Value); - auto NewValueRes = UiDoValueSelector((char *)&pIds[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1, 1.0f, "Use left mouse button to drag and change the value. Hold shift to be more precise. Rightclick to edit as text.", false, false, 0, pColor); + auto NewValueRes = UiDoValueSelector((char *)&pIds[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1, 1.0f, "Use left mouse button to drag and change the value. Hold shift to be more precise. Right click to edit as text.", false, false, 0, pColor); int NewValue = NewValueRes.m_Value; if(NewValue != pProps[i].m_Value || (NewValueRes.m_State != EEditState::NONE && NewValueRes.m_State != EEditState::EDITING)) { @@ -48,13 +48,13 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro Change = i; State = NewValueRes.m_State; } - if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease value.", IGraphics::CORNER_L, 7.0f)) { *pNewVal = clamp(pProps[i].m_Value - 1, pProps[i].m_Min, pProps[i].m_Max); Change = i; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase value.", IGraphics::CORNER_R, 7.0f)) { *pNewVal = clamp(pProps[i].m_Value + 1, pProps[i].m_Min, pProps[i].m_Max); Change = i; @@ -87,16 +87,16 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro int Step = Shift ? 1 : 45; int Value = pProps[i].m_Value; - auto NewValueRes = UiDoValueSelector(&pIds[i], &Shifter, "", Value, pProps[i].m_Min, pProps[i].m_Max, Shift ? 1 : 45, Shift ? 1.0f : 10.0f, "Use left mouse button to drag and change the value. Hold shift to be more precise. Rightclick to edit as text.", false, false, 0); + auto NewValueRes = UiDoValueSelector(&pIds[i], &Shifter, "", Value, pProps[i].m_Min, pProps[i].m_Max, Shift ? 1 : 45, Shift ? 1.0f : 10.0f, "Use left mouse button to drag and change the value. Hold shift to be more precise. Right click to edit as text.", false, false, 0); int NewValue = NewValueRes.m_Value; - if(DoButton_FontIcon(&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon(&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease value.", IGraphics::CORNER_L, 7.0f)) { NewValue = (std::ceil((pProps[i].m_Value / (float)Step)) - 1) * Step; if(NewValue < 0) NewValue += 360; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(&pIds[i] + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(&pIds[i] + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase value.", IGraphics::CORNER_R, 7.0f)) { NewValue = (pProps[i].m_Value + Step) / Step * Step; State = EEditState::ONE_GO; @@ -153,25 +153,25 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro Shifter.VSplitRight(10.0f, &Shifter, &Down); Shifter.Draw(ColorRGBA(1, 1, 1, 0.5f), IGraphics::CORNER_NONE, 0.0f); Ui()->DoLabel(&Shifter, "Y", 10.0f, TEXTALIGN_MC); - if(DoButton_FontIcon(&pIds[i], FONT_ICON_MINUS, 0, &Left, 0, "Left", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon(&pIds[i], FONT_ICON_MINUS, 0, &Left, 0, "Shift left.", IGraphics::CORNER_L, 7.0f)) { *pNewVal = DIRECTION_LEFT; Change = i; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(((char *)&pIds[i]) + 3, FONT_ICON_PLUS, 0, &Right, 0, "Right", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(((char *)&pIds[i]) + 3, FONT_ICON_PLUS, 0, &Right, 0, "Shift right.", IGraphics::CORNER_R, 7.0f)) { *pNewVal = DIRECTION_RIGHT; Change = i; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(((char *)&pIds[i]) + 1, FONT_ICON_MINUS, 0, &Up, 0, "Up", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon(((char *)&pIds[i]) + 1, FONT_ICON_MINUS, 0, &Up, 0, "Shift up.", IGraphics::CORNER_L, 7.0f)) { *pNewVal = DIRECTION_UP; Change = i; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Down, 0, "Down", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Down, 0, "Shift down.", IGraphics::CORNER_R, 7.0f)) { *pNewVal = DIRECTION_DOWN; Change = i; @@ -239,7 +239,7 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro else aBuf[0] = '\0'; - auto NewValueRes = UiDoValueSelector((char *)&pIds[i], &Shifter, aBuf, CurValue, 0, m_Map.m_vpEnvelopes.size(), 1, 1.0f, "Set Envelope", false, false, IGraphics::CORNER_NONE); + auto NewValueRes = UiDoValueSelector((char *)&pIds[i], &Shifter, aBuf, CurValue, 0, m_Map.m_vpEnvelopes.size(), 1, 1.0f, "Select envelope.", false, false, IGraphics::CORNER_NONE); int NewVal = NewValueRes.m_Value; if(NewVal != CurValue || (NewValueRes.m_State != EEditState::NONE && NewValueRes.m_State != EEditState::EDITING)) { @@ -248,13 +248,13 @@ SEditResult CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro State = NewValueRes.m_State; } - if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Previous Envelope", IGraphics::CORNER_L, 7.0f)) + if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Select previous envelope.", IGraphics::CORNER_L, 7.0f)) { *pNewVal = pProps[i].m_Value - 1; Change = i; State = EEditState::ONE_GO; } - if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Next Envelope", IGraphics::CORNER_R, 7.0f)) + if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Select next envelope.", IGraphics::CORNER_R, 7.0f)) { *pNewVal = pProps[i].m_Value + 1; Change = i; diff --git a/src/game/editor/editor_server_settings.cpp b/src/game/editor/editor_server_settings.cpp index 02678474cd5..b230bd0fcf4 100644 --- a/src/game/editor/editor_server_settings.cpp +++ b/src/game/editor/editor_server_settings.cpp @@ -123,7 +123,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd // redo button ToolBar.VSplitRight(25.0f, &ToolBar, &Button); static int s_RedoButton = 0; - if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_ServerSettingsHistory.CanRedo() ? 0 : -1, &Button, 0, "[Ctrl+Y] Redo command edit", IGraphics::CORNER_R, 11.0f) == 1 || (CanMoveDown && Input()->AltIsPressed() && Ui()->ConsumeHotkey(CUi::HOTKEY_DOWN))) + if(DoButton_FontIcon(&s_RedoButton, FONT_ICON_REDO, m_ServerSettingsHistory.CanRedo() ? 0 : -1, &Button, 0, "[Ctrl+Y] Redo the last command edit.", IGraphics::CORNER_R, 11.0f) == 1 || (CanMoveDown && Input()->AltIsPressed() && Ui()->ConsumeHotkey(CUi::HOTKEY_DOWN))) { m_ServerSettingsHistory.Redo(); } @@ -132,7 +132,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd ToolBar.VSplitRight(25.0f, &ToolBar, &Button); ToolBar.VSplitRight(5.0f, &ToolBar, nullptr); static int s_UndoButton = 0; - if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_ServerSettingsHistory.CanUndo() ? 0 : -1, &Button, 0, "[Ctrl+Z] Undo command edit", IGraphics::CORNER_L, 11.0f) == 1 || (CanMoveUp && Input()->AltIsPressed() && Ui()->ConsumeHotkey(CUi::HOTKEY_UP))) + if(DoButton_FontIcon(&s_UndoButton, FONT_ICON_UNDO, m_ServerSettingsHistory.CanUndo() ? 0 : -1, &Button, 0, "[Ctrl+Z] Undo the last command edit.", IGraphics::CORNER_L, 11.0f) == 1 || (CanMoveUp && Input()->AltIsPressed() && Ui()->ConsumeHotkey(CUi::HOTKEY_UP))) { m_ServerSettingsHistory.Undo(); } @@ -318,14 +318,17 @@ void CEditor::DoMapSettingsEditBox(CMapSettingsBackend::CContext *pContext, cons // If we have a valid command, display the help in the tooltip if(Context.CommandIsValid() && pLineInput->IsActive() && Ui()->HotItem() == nullptr) + { Context.GetCommandHelpText(m_aTooltip, sizeof(m_aTooltip)); + str_append(m_aTooltip, "."); + } CUIRect ToolBar = *pRect; CUIRect Button; ToolBar.VSplitRight(ToolBar.h, &ToolBar, &Button); // Do the unknown command toggle button - if(DoButton_FontIcon(&Context.m_AllowUnknownCommands, FONT_ICON_QUESTION, Context.m_AllowUnknownCommands, &Button, 0, "Disallow/allow unknown or invalid commands", IGraphics::CORNER_R)) + if(DoButton_FontIcon(&Context.m_AllowUnknownCommands, FONT_ICON_QUESTION, Context.m_AllowUnknownCommands, &Button, 0, "Disallow/allow unknown or invalid commands.", IGraphics::CORNER_R)) { Context.m_AllowUnknownCommands = !Context.m_AllowUnknownCommands; Context.Update(); @@ -336,7 +339,7 @@ void CEditor::DoMapSettingsEditBox(CMapSettingsBackend::CContext *pContext, cons Context.ColorArguments(vColorSplits); // Do and render clearable edit box with the colors - if(DoClearableEditBox(pLineInput, &ToolBar, FontSize, IGraphics::CORNER_L, "Enter a server setting.", vColorSplits)) + if(DoClearableEditBox(pLineInput, &ToolBar, FontSize, IGraphics::CORNER_L, "Enter a server setting. Press ctrl+space to show available settings.", vColorSplits)) { Context.Update(); // Update the context when contents change Context.m_DropdownContext.m_ShouldHide = false; @@ -645,11 +648,11 @@ void CEditor::RenderMapSettingsErrorDialog() FixBtn.HMargin(1.0f, &FixBtn); // Delete button - if(DoButton_FontIcon(&pInvalidSetting->m_Context.m_Deleted, FONT_ICON_TRASH, pInvalidSetting->m_Context.m_Deleted, &DelBtn, 0, "Delete this command", IGraphics::CORNER_ALL, 10.0f)) + if(DoButton_FontIcon(&pInvalidSetting->m_Context.m_Deleted, FONT_ICON_TRASH, pInvalidSetting->m_Context.m_Deleted, &DelBtn, 0, "Delete this command.", IGraphics::CORNER_ALL, 10.0f)) pInvalidSetting->m_Context.m_Deleted = !pInvalidSetting->m_Context.m_Deleted; // Fix button - if(DoButton_Editor(&pInvalidSetting->m_Context.m_Fixed, "Fix", !pInvalidSetting->m_Context.m_Deleted ? (s_FixingCommandIndex == -1 ? 0 : (IsFixing ? 1 : -1)) : -1, &FixBtn, 0, "Fix this command")) + if(DoButton_Editor(&pInvalidSetting->m_Context.m_Fixed, "Fix", !pInvalidSetting->m_Context.m_Deleted ? (s_FixingCommandIndex == -1 ? 0 : (IsFixing ? 1 : -1)) : -1, &FixBtn, 0, "Fix this command.")) { s_FixingCommandIndex = i; SetInput(pInvalidSetting->m_aSetting); @@ -669,7 +672,7 @@ void CEditor::RenderMapSettingsErrorDialog() // Buttons static int s_Cancel = 0, s_Ok = 0; - if(DoButton_Editor(&s_Cancel, "Cancel", 0, &CancelBtn, 0, "Cancel fixing this command") || Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE)) + if(DoButton_Editor(&s_Cancel, "Cancel", 0, &CancelBtn, 0, "Cancel fixing this command.") || Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE)) { s_FixingCommandIndex = -1; s_Input.Clear(); @@ -682,7 +685,7 @@ void CEditor::RenderMapSettingsErrorDialog() s_Context.CheckCollision(vSettingsValid, Res); bool Valid = s_Context.Valid() && Res == ECollisionCheckResult::ADD; - if(DoButton_Editor(&s_Ok, "Done", Valid ? 0 : -1, &OkBtn, 0, "Confirm editing of this command") || (s_Input.IsActive() && Valid && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER))) + if(DoButton_Editor(&s_Ok, "Done", Valid ? 0 : -1, &OkBtn, 0, "Confirm editing of this command.") || (s_Input.IsActive() && Valid && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER))) { // Mark the setting is being fixed pInvalidSetting->m_Context.m_Fixed = true; @@ -768,7 +771,7 @@ void CEditor::RenderMapSettingsErrorDialog() Label.VSplitRight(50.0f, &Label, &ChooseBtn); Label.VSplitRight(5.0f, &Label, nullptr); ChooseBtn.HMargin(1.0f, &ChooseBtn); - if(DoButton_Editor(&vDuplicates, "Choose", Chosen == -1, &ChooseBtn, 0, "Choose this command")) + if(DoButton_Editor(&vDuplicates, "Choose", Chosen == -1, &ChooseBtn, 0, "Choose this command.")) { if(Chosen != -1) vSettingsInvalid[vDuplicates[Chosen]].m_Context.m_Chosen = false; @@ -803,7 +806,7 @@ void CEditor::RenderMapSettingsErrorDialog() SubSlot.VSplitRight(50.0f, &SubSlot, &ChooseBtn); SubSlot.VSplitRight(5.0f, &SubSlot, nullptr); ChooseBtn.HMargin(1.0f, &ChooseBtn); - if(DoButton_Editor(&Duplicate.m_Context.m_Chosen, "Choose", IsInvalid && !Duplicate.m_Context.m_Fixed ? -1 : Duplicate.m_Context.m_Chosen, &ChooseBtn, 0, "Override with this command")) + if(DoButton_Editor(&Duplicate.m_Context.m_Chosen, "Choose", IsInvalid && !Duplicate.m_Context.m_Fixed ? -1 : Duplicate.m_Context.m_Chosen, &ChooseBtn, 0, "Override with this command.")) { Duplicate.m_Context.m_Chosen = !Duplicate.m_Context.m_Chosen; if(Chosen != -1 && Chosen != DuplicateIndex) @@ -820,7 +823,7 @@ void CEditor::RenderMapSettingsErrorDialog() SubSlot.VSplitRight(30.0f, &SubSlot, &FixBtn); SubSlot.VSplitRight(10.0f, &SubSlot, nullptr); FixBtn.HMargin(1.0f, &FixBtn); - if(DoButton_Editor(&Duplicate.m_Context.m_Fixed, "Fix", s_FixingCommandIndex == -1 ? 0 : (IsFixing ? 1 : -1), &FixBtn, 0, "Fix this command (needed before it can be chosen)")) + if(DoButton_Editor(&Duplicate.m_Context.m_Fixed, "Fix", s_FixingCommandIndex == -1 ? 0 : (IsFixing ? 1 : -1), &FixBtn, 0, "Fix this command (needed before it can be chosen).")) { s_FixingCommandIndex = Duplicate.m_Index; SetInput(Duplicate.m_aSetting); @@ -845,7 +848,7 @@ void CEditor::RenderMapSettingsErrorDialog() OkBtn.HMargin(1.0f, &OkBtn); static int s_Cancel = 0, s_Ok = 0; - if(DoButton_Editor(&s_Cancel, "Cancel", 0, &CancelBtn, 0, "Cancel fixing this command") || Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE)) + if(DoButton_Editor(&s_Cancel, "Cancel", 0, &CancelBtn, 0, "Cancel fixing this command.") || Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE)) { s_FixingCommandIndex = -1; s_Input.Clear(); @@ -862,7 +865,7 @@ void CEditor::RenderMapSettingsErrorDialog() s_Context.CheckCollision({m_Map.m_vSettings[i]}, Res); bool Valid = s_Context.Valid() && Res == ECollisionCheckResult::REPLACE; - if(DoButton_Editor(&s_Ok, "Done", Valid ? 0 : -1, &OkBtn, 0, "Confirm editing of this command") || (s_Input.IsActive() && Valid && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER))) + if(DoButton_Editor(&s_Ok, "Done", Valid ? 0 : -1, &OkBtn, 0, "Confirm editing of this command.") || (s_Input.IsActive() && Valid && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER))) { if(Valid) // Just to make sure { @@ -1088,8 +1091,8 @@ void CMapSettingsBackend::LoadAllMapSettings() // Load list of commands LoadCommand("tune", "s[tuning] f[value]", "Tune variable to value or show current value"); LoadCommand("tune_zone", "i[zone] s[tuning] f[value]", "Tune in zone a variable to value"); - LoadCommand("tune_zone_enter", "i[zone] r[message]", "which message to display on zone enter; use 0 for normal area"); - LoadCommand("tune_zone_leave", "i[zone] r[message]", "which message to display on zone leave; use 0 for normal area"); + LoadCommand("tune_zone_enter", "i[zone] r[message]", "Which message to display on zone enter; use 0 for normal area"); + LoadCommand("tune_zone_leave", "i[zone] r[message]", "Which message to display on zone leave; use 0 for normal area"); LoadCommand("mapbug", "s[mapbug]", "Enable map compatibility mode using the specified bug (example: grenade-doubleexplosion@ddnet.tw)"); LoadCommand("switch_open", "i[switch]", "Whether a switch is deactivated by default (otherwise activated)"); } diff --git a/src/game/editor/explanations.cpp b/src/game/editor/explanations.cpp index ad52b5d26e8..f305e22cda8 100644 --- a/src/game/editor/explanations.cpp +++ b/src/game/editor/explanations.cpp @@ -508,35 +508,35 @@ const char *CEditor::ExplainFNG(int Tile, int Layer) break; case TILE_FNG_SPIKE_GOLD: if(Layer == LAYER_GAME) - return "GOLDEN SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)"; + return "GOLDEN SPIKE: Kills the tee and gives points to the killer. Amount of points given is set inside the server."; break; case TILE_FNG_SPIKE_NORMAL: if(Layer == LAYER_GAME) - return "NORMAL SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)"; + return "NORMAL SPIKE: Kills the tee and gives points to the killer. Amount of points given is set inside the server."; break; case TILE_FNG_SPIKE_RED: if(Layer == LAYER_GAME) - return "RED SPIKE: Red team spikes. Gives negative points when killer is in blue team (Amount of points given is set inside the server)"; + return "RED SPIKE: Red team spikes. Gives negative points when killer is in blue team. Amount of points given is set inside the server."; break; case TILE_FNG_SPIKE_BLUE: if(Layer == LAYER_GAME) - return "BLUE SPIKE: Blue team spikes. Gives negative points when killer is in red team (Amount of points given is set inside the server)"; + return "BLUE SPIKE: Blue team spikes. Gives negative points when killer is in red team. Amount of points given is set inside the server."; break; case TILE_FNG_SCORE_RED: if(Layer == LAYER_GAME) - return "SCORE: Old tile used for showing red team score using laser text. No longer usable in FNG2"; + return "SCORE: Old tile used for showing red team score using laser text. No longer usable in FNG2."; break; case TILE_FNG_SCORE_BLUE: if(Layer == LAYER_GAME) - return "SCORE: Old tile used for showing blue team score using laser text. No longer usable in FNG2"; + return "SCORE: Old tile used for showing blue team score using laser text. No longer usable in FNG2."; break; case TILE_FNG_SPIKE_GREEN: if(Layer == LAYER_GAME) - return "GREEN SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)"; + return "GREEN SPIKE: Kills the tee and gives points to the killer. Amount of points given is set inside the server."; break; case TILE_FNG_SPIKE_PURPLE: if(Layer == LAYER_GAME) - return "PURPLE SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)"; + return "PURPLE SPIKE: Kills the tee and gives points to the killer. Amount of points given is set inside the server."; break; case TILE_FNG_SPAWN: if(Layer == LAYER_GAME) diff --git a/src/game/editor/layer_selector.cpp b/src/game/editor/layer_selector.cpp index 4db70b67c84..8b415ad029a 100644 --- a/src/game/editor/layer_selector.cpp +++ b/src/game/editor/layer_selector.cpp @@ -13,7 +13,7 @@ void CLayerSelector::OnInit(CEditor *pEditor) bool CLayerSelector::SelectByTile() { - // ctrl+rightclick a map index to select the layer that has a tile there + // ctrl+right click a map index to select the layer that has a tile there if(Ui()->HotItem() != &Editor()->m_MapEditorId) return false; if(!Input()->ModifierIsPressed() || !Ui()->MouseButtonClicked(1)) diff --git a/src/game/editor/map_grid.cpp b/src/game/editor/map_grid.cpp index 6b090610fa7..a116fe86579 100644 --- a/src/game/editor/map_grid.cpp +++ b/src/game/editor/map_grid.cpp @@ -140,7 +140,7 @@ CUi::EPopupMenuFunctionResult CMapGrid::PopupGridSettings(void *pContext, CUIRec View.HSplitBottom(12.0f, &View, &Button); static char s_DefaultButton; - if(pMapGrid->Editor()->DoButton_Ex(&s_DefaultButton, "Default", 0, &Button, 0, "Normal grid size", IGraphics::CORNER_ALL)) + if(pMapGrid->Editor()->DoButton_Ex(&s_DefaultButton, "Default", 0, &Button, 0, "Reset to normal grid size.", IGraphics::CORNER_ALL)) { pMapGrid->SetFactor(1); } diff --git a/src/game/editor/mapitems/layer_tiles.cpp b/src/game/editor/mapitems/layer_tiles.cpp index b65151d15bf..1c8b8f1f232 100644 --- a/src/game/editor/mapitems/layer_tiles.cpp +++ b/src/game/editor/mapitems/layer_tiles.cpp @@ -917,7 +917,7 @@ CUi::EPopupMenuFunctionResult CLayerTiles::RenderProperties(CUIRect *pToolBox) { pToolBox->HSplitBottom(12.0f, pToolBox, &Button); static int s_GameTilesButton = 0; - if(m_pEditor->DoButton_Editor(&s_GameTilesButton, "Game tiles", 0, &Button, 0, "Constructs game tiles from this layer")) + if(m_pEditor->DoButton_Editor(&s_GameTilesButton, "Game tiles", 0, &Button, 0, "Construct game tiles from this layer.")) m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->Ui()->MouseX(), m_pEditor->Ui()->MouseY()); const int Selected = m_pEditor->PopupSelectGameTileOpResult(); FillGameTiles((EGameTileOp)Selected); @@ -935,7 +935,7 @@ CUi::EPopupMenuFunctionResult CLayerTiles::RenderProperties(CUIRect *pToolBox) Button.VSplitRight(16.0f, &Button, &ButtonAuto); Button.VSplitRight(2.0f, &Button, nullptr); static int s_AutoMapperButtonAuto = 0; - if(m_pEditor->DoButton_Editor(&s_AutoMapperButtonAuto, "A", m_AutoAutoMap, &ButtonAuto, 0, "Automatically run automap after modifications.")) + if(m_pEditor->DoButton_Editor(&s_AutoMapperButtonAuto, "A", m_AutoAutoMap, &ButtonAuto, 0, "Automatically run the automapper after modifications.")) { m_AutoAutoMap = !m_AutoAutoMap; FlagModified(0, 0, m_Width, m_Height); @@ -949,7 +949,7 @@ CUi::EPopupMenuFunctionResult CLayerTiles::RenderProperties(CUIRect *pToolBox) } static int s_AutoMapperButton = 0; - if(m_pEditor->DoButton_Editor(&s_AutoMapperButton, "Automap", 0, &Button, 0, "Run the automapper")) + if(m_pEditor->DoButton_Editor(&s_AutoMapperButton, "Automap", 0, &Button, 0, "Run the automapper.")) { m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.Proceed(this, m_AutoMapperConfig, m_Seed); // record undo @@ -1113,7 +1113,7 @@ CUi::EPopupMenuFunctionResult CLayerTiles::RenderCommonProperties(SCommonPropSta CUIRect Commit; pToolbox->HSplitBottom(20.0f, pToolbox, &Commit); static int s_CommitButton = 0; - if(pEditor->DoButton_Editor(&s_CommitButton, "Commit", 0, &Commit, 0, "Applies the changes")) + if(pEditor->DoButton_Editor(&s_CommitButton, "Commit", 0, &Commit, 0, "Apply the changes.")) { bool HasModifiedSize = (State.m_Modified & SCommonPropState::MODIFIED_SIZE) != 0; bool HasModifiedColor = (State.m_Modified & SCommonPropState::MODIFIED_COLOR) != 0; diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index b9b1b85919b..e606d98d07a 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -36,7 +36,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie CUIRect Slot; View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_NewMapButton, "New", 0, &Slot, 0, "Creates a new map (ctrl+n)")) + if(pEditor->DoButton_MenuItem(&s_NewMapButton, "New", 0, &Slot, 0, "[Ctrl+N] Create a new map.")) { if(pEditor->HasUnsavedData()) { @@ -53,7 +53,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie View.HSplitTop(10.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_OpenButton, "Load", 0, &Slot, 0, "Opens a map for editing (ctrl+l)")) + if(pEditor->DoButton_MenuItem(&s_OpenButton, "Load", 0, &Slot, 0, "[Ctrl+L] Open a map for editing.")) { if(pEditor->HasUnsavedData()) { @@ -75,7 +75,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie View.HSplitTop(10.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_AppendButton, "Append", 0, &Slot, 0, "Opens a map and adds everything from that map to the current one (ctrl+a)")) + if(pEditor->DoButton_MenuItem(&s_AppendButton, "Append", 0, &Slot, 0, "[Ctrl+A] Open a map and add everything from that map to the current one.")) { pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Append map", "Append", "maps", false, CEditor::CallbackAppendMap, pEditor); return CUi::POPUP_CLOSE_CURRENT; @@ -83,7 +83,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie View.HSplitTop(10.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_SaveButton, "Save", 0, &Slot, 0, "Saves the current map (ctrl+s)")) + if(pEditor->DoButton_MenuItem(&s_SaveButton, "Save", 0, &Slot, 0, "[Ctrl+S] Save the current map.")) { if(pEditor->m_aFileName[0] && pEditor->m_ValidSaveFilename) { @@ -106,7 +106,7 @@ 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_SaveCopyButton, "Save Copy", 0, &Slot, 0, "Saves a copy of the current map under a new name (ctrl+shift+alt+s)")) + if(pEditor->DoButton_MenuItem(&s_SaveCopyButton, "Save copy", 0, &Slot, 0, "[Ctrl+Shift+Alt+S] Save a copy of the current map under a new name.")) { pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CEditor::CallbackSaveCopyMap, pEditor); return CUi::POPUP_CLOSE_CURRENT; @@ -122,7 +122,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie View.HSplitTop(10.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ExitButton, "Exit", 0, &Slot, 0, "Exits from the editor")) + if(pEditor->DoButton_MenuItem(&s_ExitButton, "Exit", 0, &Slot, 0, "[Escape] Exit from the editor.")) { if(pEditor->HasUnsavedData()) { @@ -148,7 +148,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuTools(void *pContext, CUIRect Vi View.HSplitTop(12.0f, &Slot, &View); static int s_RemoveUnusedEnvelopesButton = 0; static CUi::SConfirmPopupContext s_ConfirmPopupContext; - if(pEditor->DoButton_MenuItem(&s_RemoveUnusedEnvelopesButton, "Remove unused envelopes", 0, &Slot, 0, "Removes all unused envelopes from the map")) + if(pEditor->DoButton_MenuItem(&s_RemoveUnusedEnvelopesButton, "Remove unused envelopes", 0, &Slot, 0, "Remove all unused envelopes from the map.")) { s_ConfirmPopupContext.Reset(); s_ConfirmPopupContext.YesNoButtons(); @@ -166,7 +166,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuTools(void *pContext, CUIRect Vi static int s_BorderButton = 0; View.HSplitTop(2.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_BorderButton, "Place Border", 0, &Slot, 0, "Place tiles in a 2-tile wide border at the edges of the layer")) + if(pEditor->DoButton_MenuItem(&s_BorderButton, "Place border", 0, &Slot, 0, "Place tiles in a 2-tile wide border at the edges of the selected tile layer.")) { std::shared_ptr pT = std::static_pointer_cast(pEditor->GetSelectedLayerType(0, LAYERTYPE_TILES)); if(pT && !pT->m_Tele && !pT->m_Speedup && !pT->m_Switch && !pT->m_Front && !pT->m_Tune) @@ -176,17 +176,14 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuTools(void *pContext, CUIRect Vi } else { - static CUi::SMessagePopupContext s_MessagePopupContext; - s_MessagePopupContext.DefaultColor(pEditor->m_pTextRender); - str_copy(s_MessagePopupContext.m_aMessage, "No tile layer selected"); - pEditor->Ui()->ShowPopupMessage(Slot.x, Slot.y + Slot.h, &s_MessagePopupContext); + pEditor->ShowFileDialogError("No tile layer selected"); } } static int s_GotoButton = 0; View.HSplitTop(2.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_GotoButton, "Goto XY", 0, &Slot, 0, "Go to a specified coordinate point on the map")) + if(pEditor->DoButton_MenuItem(&s_GotoButton, "Goto position", 0, &Slot, 0, "Go to a specified coordinate point on the map.")) { static SPopupMenuId s_PopupGotoId; pEditor->Ui()->DoPopupMenu(&s_PopupGotoId, Slot.x, Slot.y + Slot.h, 120, 52, pEditor, PopupGoto); @@ -195,7 +192,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuTools(void *pContext, CUIRect Vi static int s_TileartButton = 0; View.HSplitTop(2.0f, nullptr, &View); View.HSplitTop(12.0f, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_TileartButton, "Add tileart", 0, &Slot, 0, "Generate tileart from image")) + if(pEditor->DoButton_MenuItem(&s_TileartButton, "Add tileart", 0, &Slot, 0, "Generate tileart from image.")) { pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_IMG, "Add tileart", "Open", "mapres", false, CallbackAddTileart, pEditor); return CUi::POPUP_CLOSE_CURRENT; @@ -225,7 +222,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect static int s_EntitiesButtonId = 0; char aButtonText[64]; str_format(aButtonText, sizeof(aButtonText), "Entities: %s", pEditor->m_SelectEntitiesImage.c_str()); - if(pEditor->DoButton_MenuItem(&s_EntitiesButtonId, aButtonText, 0, &Slot, 0, "Choose game layer entities image for different gametypes")) + if(pEditor->DoButton_MenuItem(&s_EntitiesButtonId, aButtonText, 0, &Slot, 0, "Choose game layer entities image for different gametypes.")) { pEditor->m_vSelectEntitiesFiles.clear(); pEditor->Storage()->ListDirectory(IStorage::TYPE_ALL, "editor/entities", EntitiesListdirCallback, pEditor); @@ -249,11 +246,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect pEditor->Ui()->DoLabel(&Label, "Brush coloring", 10.0f, TEXTALIGN_ML); static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !pEditor->m_BrushColorEnabled, &No, 0, "Disable brush coloring", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !pEditor->m_BrushColorEnabled, &No, 0, "Disable brush coloring.", IGraphics::CORNER_L)) { pEditor->m_BrushColorEnabled = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", pEditor->m_BrushColorEnabled, &Yes, 0, "Enable brush coloring", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", pEditor->m_BrushColorEnabled, &Yes, 0, "Enable brush coloring.", IGraphics::CORNER_R)) { pEditor->m_BrushColorEnabled = true; } @@ -274,11 +271,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect { static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !pEditor->m_AllowPlaceUnusedTiles, &No, 0, "[ctrl+u] Disallow placing unused tiles", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !pEditor->m_AllowPlaceUnusedTiles, &No, 0, "[Ctrl+U] Disallow placing unused tiles.", IGraphics::CORNER_L)) { pEditor->m_AllowPlaceUnusedTiles = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", pEditor->m_AllowPlaceUnusedTiles, &Yes, 0, "[ctrl+u] Allow placing unused tiles", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", pEditor->m_AllowPlaceUnusedTiles, &Yes, 0, "[Ctrl+U] Allow placing unused tiles.", IGraphics::CORNER_R)) { pEditor->m_AllowPlaceUnusedTiles = true; } @@ -296,7 +293,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect Selector.VSplitLeft(Selector.w / 3.0f, &Off, &Selector); Selector.VSplitMid(&Dec, &Hex); - pEditor->Ui()->DoLabel(&Label, "Show Info", 10.0f, TEXTALIGN_ML); + pEditor->Ui()->DoLabel(&Label, "Show info", 10.0f, TEXTALIGN_ML); static int s_ButtonOff = 0; static int s_ButtonDec = 0; static int s_ButtonHex = 0; @@ -331,11 +328,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdAlignQuads, &No, 0, "Do not perform quad alignment to other quads/points when moving quads", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdAlignQuads, &No, 0, "Do not perform quad alignment to other quads/points when moving quads.", IGraphics::CORNER_L)) { g_Config.m_EdAlignQuads = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdAlignQuads, &Yes, 0, "Allow quad alignment to other quads/points when moving quads", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdAlignQuads, &Yes, 0, "Allow quad alignment to other quads/points when moving quads.", IGraphics::CORNER_R)) { g_Config.m_EdAlignQuads = true; } @@ -355,11 +352,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdShowQuadsRect, &No, 0, "Do not show quad bounds when moving quads", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdShowQuadsRect, &No, 0, "Do not show quad bounds when moving quads.", IGraphics::CORNER_L)) { g_Config.m_EdShowQuadsRect = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdShowQuadsRect, &Yes, 0, "Show quad bounds when moving quads", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdShowQuadsRect, &Yes, 0, "Show quad bounds when moving quads.", IGraphics::CORNER_R)) { g_Config.m_EdShowQuadsRect = true; } @@ -379,11 +376,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdAutoMapReload, &No, 0, "Do not run 'hot_reload' on the local server while rcon authed on map save", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdAutoMapReload, &No, 0, "Do not run 'hot_reload' on the local server while rcon authed on map save.", IGraphics::CORNER_L)) { g_Config.m_EdAutoMapReload = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdAutoMapReload, &Yes, 0, "Run 'hot_reload' on the local server while rcon authed on map save", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdAutoMapReload, &Yes, 0, "Run 'hot_reload' on the local server while rcon authed on map save.", IGraphics::CORNER_R)) { g_Config.m_EdAutoMapReload = true; } @@ -403,11 +400,11 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect static int s_ButtonNo = 0; static int s_ButtonYes = 0; - if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdLayerSelector, &No, 0, "Do not select layers when Ctrl+right clicking on a tile", IGraphics::CORNER_L)) + if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdLayerSelector, &No, 0, "Do not select layers when ctrl+right clicking on a tile.", IGraphics::CORNER_L)) { g_Config.m_EdLayerSelector = false; } - if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdLayerSelector, &Yes, 0, "Select layers when Ctrl+right clicking on a tile", IGraphics::CORNER_R)) + if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdLayerSelector, &Yes, 0, "Select layers when ctrl+right clicking on a tile.", IGraphics::CORNER_R)) { g_Config.m_EdLayerSelector = true; } @@ -428,7 +425,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupGroup(void *pContext, CUIRect View, // don't allow deletion of game group if(pEditor->m_Map.m_pGameGroup != pEditor->GetSelectedGroup()) { - if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete group", 0, &Button, 0, "Delete group")) + if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete group", 0, &Button, 0, "Delete the group.")) { pEditor->m_EditorHistory.RecordAction(std::make_shared(pEditor, pEditor->m_SelectedGroup, true)); pEditor->m_Map.DeleteGroup(pEditor->m_SelectedGroup); @@ -438,7 +435,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupGroup(void *pContext, CUIRect View, } else { - if(pEditor->DoButton_Editor(&s_DeleteButton, "Clean up game tiles", 0, &Button, 0, "Removes game tiles that aren't based on a layer")) + if(pEditor->DoButton_Editor(&s_DeleteButton, "Clean up game tiles", 0, &Button, 0, "Remove game tiles that aren't based on a layer.")) { // gather all tile layers std::vector> vpLayers; @@ -713,7 +710,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupLayer(void *pContext, CUIRect View, View.HSplitBottom(4.0f, &View, nullptr); View.HSplitBottom(12.0f, &View, &DuplicateButton); static int s_DuplicationButton = 0; - if(pEditor->DoButton_Editor(&s_DuplicationButton, "Duplicate layer", 0, &DuplicateButton, 0, "Duplicates the layer")) + if(pEditor->DoButton_Editor(&s_DuplicationButton, "Duplicate layer", 0, &DuplicateButton, 0, "Create an identical copy of the selected layer.")) { pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->DuplicateLayer(pEditor->m_vSelectedLayers[0]); pEditor->m_EditorHistory.RecordAction(std::make_shared(pEditor, pEditor->m_SelectedGroup, pEditor->m_vSelectedLayers[0] + 1, true)); @@ -807,7 +804,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b // delete button View.HSplitBottom(12.0f, &View, &Button); static int s_DeleteButton = 0; - if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete", 0, &Button, 0, "Deletes the current quad")) + if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete", 0, &Button, 0, "Delete the current quad.")) { if(pLayer) { @@ -823,7 +820,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b if(pLayer && pLayer->m_Image >= 0 && (size_t)pLayer->m_Image < pEditor->m_Map.m_vpImages.size()) { static int s_AspectRatioButton = 0; - if(pEditor->DoButton_Editor(&s_AspectRatioButton, "Aspect ratio", 0, &Button, 0, "Resizes the current Quad based on the aspect ratio of the image")) + if(pEditor->DoButton_Editor(&s_AspectRatioButton, "Aspect ratio", 0, &Button, 0, "Resize the current quad based on the aspect ratio of its image.")) { pEditor->m_QuadTracker.BeginQuadTrack(pLayer, pEditor->m_vSelectedQuads); for(auto &pQuad : vpQuads) @@ -864,7 +861,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b View.HSplitBottom(6.0f, &View, nullptr); View.HSplitBottom(12.0f, &View, &Button); static int s_CenterButton = 0; - if(pEditor->DoButton_Editor(&s_CenterButton, "Center pivot", 0, &Button, 0, "Centers the pivot of the current quad")) + if(pEditor->DoButton_Editor(&s_CenterButton, "Center pivot", 0, &Button, 0, "Center the pivot of the current quad.")) { pEditor->m_QuadTracker.BeginQuadTrack(pLayer, pEditor->m_vSelectedQuads); int Top = pCurrentQuad->m_aPoints[0].y; @@ -895,7 +892,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b View.HSplitBottom(6.0f, &View, nullptr); View.HSplitBottom(12.0f, &View, &Button); static int s_AlignButton = 0; - if(pEditor->DoButton_Editor(&s_AlignButton, "Align", 0, &Button, 0, "Aligns coordinates of the quad points")) + if(pEditor->DoButton_Editor(&s_AlignButton, "Align", 0, &Button, 0, "Align coordinates of the quad points.")) { pEditor->m_QuadTracker.BeginQuadTrack(pLayer, pEditor->m_vSelectedQuads); for(auto &pQuad : vpQuads) @@ -915,7 +912,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b View.HSplitBottom(6.0f, &View, nullptr); View.HSplitBottom(12.0f, &View, &Button); static int s_Button = 0; - if(pEditor->DoButton_Editor(&s_Button, "Square", 0, &Button, 0, "Squares the current quad")) + if(pEditor->DoButton_Editor(&s_Button, "Square", 0, &Button, 0, "Square the current quad.")) { pEditor->m_QuadTracker.BeginQuadTrack(pLayer, pEditor->m_vSelectedQuads); for(auto &pQuad : vpQuads) @@ -955,7 +952,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupQuad(void *pContext, CUIRect View, b View.HSplitBottom(6.0f, &View, nullptr); View.HSplitBottom(12.0f, &View, &Button); static int s_SliceButton = 0; - if(pEditor->DoButton_Editor(&s_SliceButton, "Slice", 0, &Button, 0, "Enables quad knife mode")) + if(pEditor->DoButton_Editor(&s_SliceButton, "Slice", 0, &Button, 0, "Enable quad knife mode.")) { pEditor->m_QuadKnifeCount = 0; pEditor->m_QuadKnifeActive = true; @@ -1066,7 +1063,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSource(void *pContext, CUIRect View, // delete button View.HSplitBottom(12.0f, &View, &Button); static int s_DeleteButton = 0; - if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete", 0, &Button, 0, "Deletes the current source")) + if(pEditor->DoButton_Editor(&s_DeleteButton, "Delete", 0, &Button, 0, "Delete the current sound source.")) { std::shared_ptr pLayer = std::static_pointer_cast(pEditor->GetSelectedLayerType(0, LAYERTYPE_SOUNDS)); if(pLayer) @@ -1088,7 +1085,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSource(void *pContext, CUIRect View, pSource->m_Shape.m_Type = pSource->m_Shape.m_Type % CSoundShape::NUM_SHAPES; // prevent out of array errors static int s_ShapeTypeButton = 0; - if(pEditor->DoButton_Editor(&s_ShapeTypeButton, s_apShapeNames[pSource->m_Shape.m_Type], 0, &ShapeButton, 0, "Change shape")) + if(pEditor->DoButton_Editor(&s_ShapeTypeButton, s_apShapeNames[pSource->m_Shape.m_Type], 0, &ShapeButton, 0, "Change sound source shape.")) { pEditor->m_EditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedGroup, pEditor->m_vSelectedLayers[0], pEditor->m_SelectedSource, CEditorActionEditSoundSource::EEditType::SHAPE, (pSource->m_Shape.m_Type + 1) % CSoundShape::NUM_SHAPES)); } @@ -1418,14 +1415,14 @@ CUi::EPopupMenuFunctionResult CEditor::PopupEnvPoint(void *pContext, CUIRect Vie Row.VSplitLeft(60.0f, &Label, &Row); Row.VSplitLeft(10.0f, nullptr, &EditBox); pEditor->Ui()->DoLabel(&Label, "Value:", RowHeight - 2.0f, TEXTALIGN_ML); - pEditor->DoEditBox(&s_CurValueInput, &EditBox, RowHeight - 2.0f, IGraphics::CORNER_ALL, "The value of the selected envelope point"); + pEditor->DoEditBox(&s_CurValueInput, &EditBox, RowHeight - 2.0f, IGraphics::CORNER_ALL, "The value of the selected envelope point."); View.HSplitTop(4.0f, nullptr, &View); View.HSplitTop(RowHeight, &Row, &View); Row.VSplitLeft(60.0f, &Label, &Row); Row.VSplitLeft(10.0f, nullptr, &EditBox); pEditor->Ui()->DoLabel(&Label, "Time (in s):", RowHeight - 2.0f, TEXTALIGN_ML); - pEditor->DoEditBox(&s_CurTimeInput, &EditBox, RowHeight - 2.0f, IGraphics::CORNER_ALL, "The time of the selected envelope point"); + pEditor->DoEditBox(&s_CurTimeInput, &EditBox, RowHeight - 2.0f, IGraphics::CORNER_ALL, "The time of the selected envelope point."); if(pEditor->Input()->KeyIsPressed(KEY_RETURN) || pEditor->Input()->KeyIsPressed(KEY_KP_ENTER)) { @@ -1661,7 +1658,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, if(pImg->m_External) { - if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Embed", 0, &Slot, 0, "Embeds the image into the map file.")) + if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Embed", 0, &Slot, 0, "Embed the image into the map file.")) { if(pImg->m_pData == nullptr) { @@ -1676,7 +1673,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, } else if(CEditor::IsVanillaImage(pImg->m_aName)) { - if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Make external", 0, &Slot, 0, "Removes the image from the map file.")) + if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Make external", 0, &Slot, 0, "Remove the image from the map file.")) { pImg->m_External = 1; return CUi::POPUP_CLOSE_CURRENT; @@ -1688,7 +1685,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, static CUi::SSelectionPopupContext s_SelectionPopupContext; static CScrollRegion s_SelectionPopupScrollRegion; s_SelectionPopupContext.m_pScrollRegion = &s_SelectionPopupScrollRegion; - if(pEditor->DoButton_MenuItem(&s_ReimportButton, "Re-import", 0, &Slot, 0, "Re-imports the image from the mapres folder")) + if(pEditor->DoButton_MenuItem(&s_ReimportButton, "Re-import", 0, &Slot, 0, "Re-import the image from the mapres folder.")) { char aFilename[IO_MAX_PATH_LENGTH]; str_format(aFilename, sizeof(aFilename), "%s.png", pImg->m_aName); @@ -1722,7 +1719,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ReplaceButton, "Replace", 0, &Slot, 0, "Replaces the image with a new one")) + if(pEditor->DoButton_MenuItem(&s_ReplaceButton, "Replace", 0, &Slot, 0, "Replace the image with a new one.")) { pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_IMG, "Replace Image", "Replace", "mapres", false, ReplaceImageCallback, pEditor); return CUi::POPUP_CLOSE_CURRENT; @@ -1730,7 +1727,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Removes the image from the map")) + if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Remove the image from the map.")) { if(IsAssetUsed(FILETYPE_IMG, pEditor->m_SelectedImage, pEditor)) { @@ -1749,7 +1746,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View, { View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ExportButton, "Export", 0, &Slot, 0, "Export the image")) + if(pEditor->DoButton_MenuItem(&s_ExportButton, "Export", 0, &Slot, 0, "Export the image to a separate file.")) { if(pImg->m_pData == nullptr) { @@ -1800,7 +1797,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSound(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ReimportButton, "Re-import", 0, &Slot, 0, "Re-imports the sound from the mapres folder")) + if(pEditor->DoButton_MenuItem(&s_ReimportButton, "Re-import", 0, &Slot, 0, "Re-import the sound from the mapres folder.")) { char aFilename[IO_MAX_PATH_LENGTH]; str_format(aFilename, sizeof(aFilename), "%s.opus", pSound->m_aName); @@ -1832,7 +1829,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSound(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ReplaceButton, "Replace", 0, &Slot, 0, "Replaces the sound with a new one")) + if(pEditor->DoButton_MenuItem(&s_ReplaceButton, "Replace", 0, &Slot, 0, "Replace the sound with a new one.")) { pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_SOUND, "Replace sound", "Replace", "mapres", false, ReplaceSoundCallback, pEditor); return CUi::POPUP_CLOSE_CURRENT; @@ -1840,7 +1837,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSound(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Removes the sound from the map")) + if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Remove the sound from the map.")) { if(IsAssetUsed(FILETYPE_SOUND, pEditor->m_SelectedImage, pEditor)) { @@ -1857,7 +1854,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSound(void *pContext, CUIRect View, View.HSplitTop(5.0f, nullptr, &View); View.HSplitTop(RowHeight, &Slot, &View); - if(pEditor->DoButton_MenuItem(&s_ExportButton, "Export", 0, &Slot, 0, "Export sound")) + if(pEditor->DoButton_MenuItem(&s_ExportButton, "Export", 0, &Slot, 0, "Export the sound to a separate file.")) { if(pSound->m_pData == nullptr) { @@ -2043,7 +2040,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupEvent(void *pContext, CUIRect View, else if(pEditor->m_PopupEventType == POPEVENT_PREVENTUNUSEDTILES) { pTitle = "Unused tiles disabled"; - pMessage = "Unused tiles can't be placed by default because they could get a use later and then destroy your map.\n\nActivate the 'Allow Unused' setting to be able to place every tile."; + pMessage = "Unused tiles can't be placed by default because they could get a use later and then destroy your map.\n\nActivate the 'Allow unused' setting to be able to place every tile."; } else if(pEditor->m_PopupEventType == POPEVENT_IMAGEDIV16) { @@ -2522,10 +2519,10 @@ CUi::EPopupMenuFunctionResult CEditor::PopupTele(void *pContext, CUIRect View, b // Pressing ctrl+f will find next free numbers for both tele and checkpoints static int s_NextFreeTelePid = 0; - if(pEditor->DoButton_Editor(&s_NextFreeTelePid, "F", 0, &FindFreeTeleSlot, 0, "[ctrl+f] Find next free tele number") || (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) + if(pEditor->DoButton_Editor(&s_NextFreeTelePid, "F", 0, &FindFreeTeleSlot, 0, "[Ctrl+F] Find next free tele number.") || + (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) { int TeleNumber = pEditor->FindNextFreeTeleNumber(); - if(TeleNumber != -1) { pEditor->m_TeleNumber = TeleNumber; @@ -2534,21 +2531,23 @@ CUi::EPopupMenuFunctionResult CEditor::PopupTele(void *pContext, CUIRect View, b } static int s_NextFreeCheckpointPid = 0; - if(pEditor->DoButton_Editor(&s_NextFreeCheckpointPid, "F", 0, &FindFreeCheckpointSlot, 0, "[ctrl+f] Find next free checkpoint number") || (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) + if(pEditor->DoButton_Editor(&s_NextFreeCheckpointPid, "F", 0, &FindFreeCheckpointSlot, 0, "[Ctrl+F] Find next free checkpoint number.") || + (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) { - int CPNumber = pEditor->FindNextFreeTeleNumber(true); - - if(CPNumber != -1) + int CheckpointNumber = pEditor->FindNextFreeTeleNumber(true); + if(CheckpointNumber != -1) { - pEditor->m_TeleCheckpointNumber = CPNumber; + pEditor->m_TeleCheckpointNumber = CheckpointNumber; pEditor->AdjustBrushSpecialTiles(false); } } static int s_NextFreeViewPid = 0; - int btn = pEditor->DoButton_Editor(&s_NextFreeViewPid, "N", 0, &FindFreeViewSlot, 0, "[n] Show next tele with this number"); - if(btn || (Active && pEditor->Input()->KeyPress(KEY_N))) + if(pEditor->DoButton_Editor(&s_NextFreeViewPid, "N", 0, &FindFreeViewSlot, 0, "[N] Show next tele with this number.") || + (Active && pEditor->Input()->KeyPress(KEY_N))) + { s_vColors[PROP_TELE_VIEW] = ViewTele(pEditor) ? ColorRGBA(0.5f, 1, 0.5f, 0.5f) : ColorRGBA(1, 0.5f, 0.5f, 0.5f); + } } // number picker @@ -2678,18 +2677,20 @@ CUi::EPopupMenuFunctionResult CEditor::PopupSwitch(void *pContext, CUIRect View, // find empty number button { static int s_EmptySlotPid = 0; - if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[ctrl+f] Find empty slot") || (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) + if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[Ctrl+F] Find empty slot.") || + (Active && pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F))) { int Number = pEditor->FindNextFreeSwitchNumber(); - if(Number != -1) pEditor->m_SwitchNum = Number; } static int s_NextViewPid = 0; - int ButtonResult = pEditor->DoButton_Editor(&s_NextViewPid, "N", 0, &ViewEmptySlot, 0, "[n] Show next switcher with this number"); - if(ButtonResult || (Active && pEditor->Input()->KeyPress(KEY_N))) + if(pEditor->DoButton_Editor(&s_NextViewPid, "N", 0, &ViewEmptySlot, 0, "[N] Show next switcher with this number.") || + (Active && pEditor->Input()->KeyPress(KEY_N))) + { s_vColors[PROP_SWITCH_VIEW] = ViewSwitch() ? ColorRGBA(0.5f, 1, 0.5f, 0.5f) : ColorRGBA(1, 0.5f, 0.5f, 0.5f); + } } // number picker @@ -2881,7 +2882,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupAnimateSettings(void *pContext, CUIR pEditor->Ui()->DoLabel(&Label, "Speed", 10.0f, TEXTALIGN_ML); static char s_DecreaseButton; - if(pEditor->DoButton_FontIcon(&s_DecreaseButton, FONT_ICON_MINUS, 0, &ButtonDecrease, 0, "Decrease animation speed", IGraphics::CORNER_L, 7.0f)) + if(pEditor->DoButton_FontIcon(&s_DecreaseButton, FONT_ICON_MINUS, 0, &ButtonDecrease, 0, "Decrease animation speed.", IGraphics::CORNER_L, 7.0f)) { pEditor->m_AnimateSpeed -= pEditor->m_AnimateSpeed <= 1.0f ? 0.1f : 0.5f; pEditor->m_AnimateSpeed = maximum(pEditor->m_AnimateSpeed, MIN_ANIM_SPEED); @@ -2889,7 +2890,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupAnimateSettings(void *pContext, CUIR } static char s_IncreaseButton; - if(pEditor->DoButton_FontIcon(&s_IncreaseButton, FONT_ICON_PLUS, 0, &ButtonIncrease, 0, "Increase animation speed", IGraphics::CORNER_R, 7.0f)) + if(pEditor->DoButton_FontIcon(&s_IncreaseButton, FONT_ICON_PLUS, 0, &ButtonIncrease, 0, "Increase animation speed.", IGraphics::CORNER_R, 7.0f)) { if(pEditor->m_AnimateSpeed < 0.1f) pEditor->m_AnimateSpeed = 0.1f; @@ -2900,7 +2901,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupAnimateSettings(void *pContext, CUIR } static char s_DefaultButton; - if(pEditor->DoButton_Ex(&s_DefaultButton, "Default", 0, &ButtonReset, 0, "Normal animation speed", IGraphics::CORNER_ALL)) + if(pEditor->DoButton_Ex(&s_DefaultButton, "Default", 0, &ButtonReset, 0, "Reset to normal animation speed.", IGraphics::CORNER_ALL)) { pEditor->m_AnimateSpeed = 1.0f; pEditor->m_AnimateUpdatePopup = true; @@ -2913,7 +2914,7 @@ CUi::EPopupMenuFunctionResult CEditor::PopupAnimateSettings(void *pContext, CUIR pEditor->m_AnimateUpdatePopup = false; } - if(pEditor->DoEditBox(&s_SpeedInput, &EditBox, 10.0f, IGraphics::CORNER_NONE, "The animation speed")) + if(pEditor->DoEditBox(&s_SpeedInput, &EditBox, 10.0f, IGraphics::CORNER_NONE, "The animation speed.")) { pEditor->m_AnimateSpeed = clamp(s_SpeedInput.GetFloat(), MIN_ANIM_SPEED, MAX_ANIM_SPEED); } diff --git a/src/game/editor/quick_actions.h b/src/game/editor/quick_actions.h index f1e1b282fbe..3cdd0b161d4 100644 --- a/src/game/editor/quick_actions.h +++ b/src/game/editor/quick_actions.h @@ -9,12 +9,12 @@ REGISTER_QUICK_ACTION( ToggleGrid, - "Toggle Grid", + "Toggle grid", [&]() { MapView()->MapGrid()->Toggle(); }, ALWAYS_FALSE, [&]() -> bool { return MapView()->MapGrid()->IsEnabled(); }, DEFAULT_BTN, - "[Ctrl+G] Toggle Grid.") + "[Ctrl+G] Toggle grid.") REGISTER_QUICK_ACTION( GameTilesAir, "Game tiles: Air", @@ -22,7 +22,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesHookable, "Game tiles: Hookable", @@ -30,7 +30,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesDeath, "Game tiles: Death", @@ -38,7 +38,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesUnhookable, "Game tiles: Unhookable", @@ -46,7 +46,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesHookthrough, "Game tiles: Hookthrough", @@ -54,7 +54,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesFreeze, "Game tiles: Freeze", @@ -62,7 +62,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesUnfreeze, "Game tiles: Unfreeze", @@ -70,7 +70,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesDeepFreeze, "Game tiles: Deep Freeze", @@ -78,7 +78,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesDeepUnfreeze, "Game tiles: Deep Unfreeze", @@ -86,7 +86,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesBlueCheckTele, "Game tiles: Blue Check Tele", @@ -94,7 +94,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesRedCheckTele, "Game tiles: Red Check Tele", @@ -102,7 +102,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesLiveFreeze, "Game tiles: Live Freeze", @@ -110,7 +110,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( GameTilesLiveUnfreeze, "Game tiles: Live Unfreeze", @@ -118,7 +118,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !CanFillGameTiles(); }, ALWAYS_FALSE, DEFAULT_BTN, - "Constructs game tiles from this layer.") + "Construct game tiles from this layer.") REGISTER_QUICK_ACTION( AddGroup, "Add group", @@ -126,10 +126,10 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, - "Adds a new group.") + "Add a new group.") REGISTER_QUICK_ACTION( ResetZoom, - "Reset Zoom", + "Reset zoom", [&]() { MapView()->ResetZoom(); }, ALWAYS_FALSE, ALWAYS_FALSE, @@ -137,7 +137,7 @@ REGISTER_QUICK_ACTION( "[Numpad*] Zoom to normal and remove editor offset.") REGISTER_QUICK_ACTION( ZoomOut, - "Zoom Out", + "Zoom out", [&]() { MapView()->Zoom()->ChangeValue(50.0f); }, ALWAYS_FALSE, ALWAYS_FALSE, @@ -145,7 +145,7 @@ REGISTER_QUICK_ACTION( "[Numpad-] Zoom out.") REGISTER_QUICK_ACTION( ZoomIn, - "Zoom In", + "Zoom in", [&]() { MapView()->Zoom()->ChangeValue(-50.0f); }, ALWAYS_FALSE, ALWAYS_FALSE, @@ -166,9 +166,9 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, [&]() -> bool { return MapView()->ProofMode()->IsEnabled(); }, DEFAULT_BTN, - "Toggles proof borders. These borders represent the area that a player can see with default zoom.") + "Toggle proof borders. These borders represent the area that a player can see with default zoom.") REGISTER_QUICK_ACTION( - AddTileLayer, "Add tile layer", [&]() { AddTileLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new tile layer.") + AddTileLayer, "Add tile layer", [&]() { AddTileLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Create a new tile layer.") REGISTER_QUICK_ACTION( AddSwitchLayer, "Add switch layer", @@ -176,7 +176,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pSwitchLayer; }, ALWAYS_FALSE, DEFAULT_BTN, - "Creates a new switch layer.") + "Create a new switch layer.") REGISTER_QUICK_ACTION( AddTuneLayer, "Add tune layer", @@ -184,7 +184,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pTuneLayer; }, ALWAYS_FALSE, DEFAULT_BTN, - "Creates a new tuning layer.") + "Create a new tuning layer.") REGISTER_QUICK_ACTION( AddSpeedupLayer, "Add speedup layer", @@ -192,7 +192,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pSpeedupLayer; }, ALWAYS_FALSE, DEFAULT_BTN, - "Creates a new speedup layer.") + "Create a new speedup layer.") REGISTER_QUICK_ACTION( AddTeleLayer, "Add tele layer", @@ -200,7 +200,7 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pTeleLayer; }, ALWAYS_FALSE, DEFAULT_BTN, - "Creates a new tele layer.") + "Create a new tele layer.") REGISTER_QUICK_ACTION( AddFrontLayer, "Add front layer", @@ -208,22 +208,22 @@ REGISTER_QUICK_ACTION( [&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pFrontLayer; }, ALWAYS_FALSE, DEFAULT_BTN, - "Creates a new item layer.") + "Create a new item layer.") REGISTER_QUICK_ACTION( - AddQuadsLayer, "Add quads layer", [&]() { AddQuadsLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new quads layer.") + AddQuadsLayer, "Add quads layer", [&]() { AddQuadsLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Create a new quads layer.") REGISTER_QUICK_ACTION( - AddSoundLayer, "Add sound layer", [&]() { AddSoundLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new sound layer.") + AddSoundLayer, "Add sound layer", [&]() { AddSoundLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Create a new sound layer.") REGISTER_QUICK_ACTION( SaveAs, - "Save As", - [&]() { InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save As", "maps", true, CEditor::CallbackSaveMap, this); }, + "Save as", + [&]() { InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save as", "maps", true, CEditor::CallbackSaveMap, this); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, - "[Ctrl+Shift+S] Saves the current map under a new name.") + "[Ctrl+Shift+S] Save the current map under a new name.") REGISTER_QUICK_ACTION( LoadCurrentMap, - "Load Current Map", + "Load current map", [&]() { if(HasUnsavedData()) { @@ -238,7 +238,7 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, - "[Ctrl+Alt+L] Opens the current in game map for editing.") + "[Ctrl+Alt+L] Open the current ingame map for editing.") REGISTER_QUICK_ACTION( Envelopes, "Envelopes", @@ -246,7 +246,7 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, ALWAYS_FALSE, [&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; }, - "Toggles the envelope editor.") + "Toggle the envelope editor.") REGISTER_QUICK_ACTION( ServerSettings, "Server settings", @@ -254,7 +254,7 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, ALWAYS_FALSE, [&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; }, - "Toggles the server settings editor.") + "Toggle the server settings editor.") REGISTER_QUICK_ACTION( History, "History", @@ -262,10 +262,10 @@ REGISTER_QUICK_ACTION( ALWAYS_FALSE, ALWAYS_FALSE, [&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; }, - "Toggles the editor history view.") + "Toggle the editor history view.") REGISTER_QUICK_ACTION( AddImage, - "Add Image", + "Add image", [&]() { InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_IMG, "Add Image", "Add", "mapres", false, AddImage, this); }, ALWAYS_FALSE, ALWAYS_FALSE, @@ -273,7 +273,7 @@ REGISTER_QUICK_ACTION( "Load a new image to use in the map.") REGISTER_QUICK_ACTION( LayerPropAddImage, - "Layer: Add Image", + "Layer: add image", [&]() { LayerSelectImage(); }, [&]() -> bool { return !IsNonGameTileLayerSelected(); }, ALWAYS_FALSE, @@ -281,7 +281,7 @@ REGISTER_QUICK_ACTION( "Pick mapres image for currently selected layer.") REGISTER_QUICK_ACTION( ShowInfoOff, - "Show Info: Off", + "Show info: Off", [&]() { m_ShowTileInfo = SHOW_TILE_OFF; m_ShowEnvelopePreview = SHOWENV_NONE; @@ -292,7 +292,7 @@ REGISTER_QUICK_ACTION( "Do not show tile information.") REGISTER_QUICK_ACTION( ShowInfoDec, - "Show Info: Dec", + "Show info: Dec", [&]() { m_ShowTileInfo = SHOW_TILE_DECIMAL; m_ShowEnvelopePreview = SHOWENV_NONE; @@ -303,7 +303,7 @@ REGISTER_QUICK_ACTION( "[Ctrl+I] Show tile information.") REGISTER_QUICK_ACTION( ShowInfoHex, - "Show Info: Hex", + "Show info: Hex", [&]() { m_ShowTileInfo = SHOW_TILE_HEXADECIMAL; m_ShowEnvelopePreview = SHOWENV_NONE; @@ -324,7 +324,7 @@ REGISTER_QUICK_ACTION( }, ALWAYS_FALSE, DEFAULT_BTN, - "Deletes the layer.") + "Delete the layer.") REGISTER_QUICK_ACTION( Pipette, "Pipette", @@ -343,7 +343,7 @@ REGISTER_QUICK_ACTION( "Adjust the map details of the current map.") REGISTER_QUICK_ACTION( AddQuad, - "Add Quad", + "Add quad", [&]() { AddQuadOrSound(); }, [&]() -> bool { std::shared_ptr pLayer = GetSelectedLayer(0); @@ -355,8 +355,8 @@ REGISTER_QUICK_ACTION( DEFAULT_BTN, "[Ctrl+Q] Add a new quad.") REGISTER_QUICK_ACTION( - AddSound, - "Add Sound", + AddSoundSource, + "Add sound source", [&]() { AddQuadOrSound(); }, [&]() -> bool { std::shared_ptr pLayer = GetSelectedLayer(0);