Move command friendly names to the strings file

Related to #124
This commit is contained in:
David Capello 2017-11-30 23:41:45 -03:00
parent 3c3914c7d8
commit ccee49c02b
133 changed files with 783 additions and 874 deletions

View File

@ -454,6 +454,12 @@
<param name="format" value="indexed" /> <param name="format" value="indexed" />
<param name="dithering" value="old-ordered" /> <param name="dithering" value="old-ordered" />
</key> </key>
<key command="ChangeBrush">
<param name="change" value="increment-angle" />
</key>
<key command="ChangeBrush">
<param name="change" value="decrement-angle" />
</key>
</commands> </commands>
<!-- Keyboard shortcuts to select tools --> <!-- Keyboard shortcuts to select tools -->
@ -992,19 +998,19 @@
</menu> </menu>
<menu id="ink_popup_menu"> <menu id="ink_popup_menu">
<item command="SetInkType" text="@.simple_ink"> <item command="SetInkType" text="@inks.simple_ink">
<param name="type" value="simple" /> <param name="type" value="simple" />
</item> </item>
<item command="SetInkType" text="@.alpha_compositing"> <item command="SetInkType" text="@inks.alpha_compositing">
<param name="type" value="alpha-compositing" /> <param name="type" value="alpha-compositing" />
</item> </item>
<item command="SetInkType" text="@.copy_color"> <item command="SetInkType" text="@inks.copy_color">
<param name="type" value="copy-color" /> <param name="type" value="copy-color" />
</item> </item>
<item command="SetInkType" text="@.lock_alpha"> <item command="SetInkType" text="@inks.lock_alpha">
<param name="type" value="lock-alpha" /> <param name="type" value="lock-alpha" />
</item> </item>
<item command="SetInkType" text="@.shading"> <item command="SetInkType" text="@inks.shading">
<param name="type" value="shading" /> <param name="type" value="shading" />
</item> </item>
<separator /> <separator />

View File

@ -164,10 +164,221 @@ unlink = &Unlink
link_cels = &Link Cels link_cels = &Link Cels
[commands] [commands]
About = About
AddColor = Add {0} Color to Palette
AddColor_Background = Background
AddColor_Foreground = Foreground
AddColor_Specific = Specific
AdvancedMode = Advanced Mode
AutocropSprite = Trim Sprite
BackgroundFromLayer = Background From Layer
BrightnessContrast = Adjust Brightness/Contrast
Cancel = Cancel Current Operation
CanvasSize = Canvas Size
CelProperties = Cel Properties
ChangeBrush = Change Brush: {0}
ChangeBrush_CustomBrush = Custom Brush #{0}
ChangeBrush_DecrementAngle = Decrement Angle
ChangeBrush_DecrementSize = Decrement Size
ChangeBrush_IncrementAngle = Increment Angle
ChangeBrush_IncrementSize = Increment Size
ChangeColor = Change Color: {0}
ChangeColor_IncrementFgIndex = Increment Foreground Index
ChangeColor_DecrementFgIndex = Decrement Foreground Index
ChangeColor_IncrementBgIndex = Increment Background Index
ChangeColor_DecrementBgIndex = Decrement Background Index
ChangePixelFormat = Change Color Mode: {0}
ChangePixelFormat_RGB = RGB
ChangePixelFormat_Grayscale = Grayscale
ChangePixelFormat_Indexed = Indexed
ChangePixelFormat_Indexed_OrderedDithering = Indexed with Ordered Dithering
ChangePixelFormat_Indexed_OldDithering = Indexed with Old Dithering
ChangePixelFormat_Indexed = Indexed
Clear = Clear
ClearCel = Clear Cel
CloseAllFiles = Close All Files
CloseFile = Close File
ColorCurve = Color Curve
ColorQuantization = Create Palette from Current Sprite (Color Quantization)
ContiguousFill = Switch Contiguous Fill
ConvolutionMatrix = Convolution Matrix
Copy = Copy
CopyCel = Copy Cel
CopyMerged = Copy Merged
CropSprite = Crop Sprite
Cut = Cut
DeselectMask = Deselect Mask
Despeckle = Despeckle
DeveloperConsole = Developer Console
DiscardBrush = Discard Brush
DuplicateLayer = Duplicate Layer
DuplicateSprite = Duplicate Sprite
DuplicateView = Duplicate View
Exit = Exit
ExportSpriteSheet = Export Sprite Sheet
Eyedropper = Eyedropper
FitScreen = Fit on Screen
FlattenLayers = Flatten Layers
Flip = Flip {0} {1}
Flip_Canvas = Canvas
Flip_Horizontally = Horizontally
Flip_Selection = Selection
Flip_Vertically = Vertically
FrameProperties = Frame Properties
FrameTagProperties = Frame Tag Properties
FullscreenPreview = Fullscreen Preview
GotoFirstFrame = Go to First Frame
GotoFrame = Go to Frame
GotoLastFrame = Go to Last Frame
GotoNextFrame = Go to Next Frame
GotoNextFrameWithSameTag = Go to Next Frame with same tag
GotoNextLayer = Go to Next Layer
GotoNextTab = Go to Next Tab
GotoPreviousFrame = Go to Previous Frame
GotoPreviousFrameWithSameTag = Go to Previous Frame with same tag
GotoPreviousLayer = Go to Previous Layer
GotoPreviousTab = Go to Previous tab
GridSettings = Grid Settings
Home = Home
HueSaturation = Adjust Hue/Saturation
ImportSpriteSheet = Import Sprite Sheet
InvertColor = Invert Color
InvertMask = Invert Selection
KeyboardShortcuts = Keyboard Shortcuts
Launch = Launch
LayerFromBackground = Layer From Background
LayerLock = Lock Layers
LayerOpacity = Set Layer Opacity to {0} ({1}%)
LayerProperties = Layer Properties
LayerVisibility = Layer Visibility
LinkCels = Links Cels
LoadMask = Load Selection
LoadPalette = Load Palette
MaskAll = Mask All
MaskByColor = Mask By Color
MaskContent = Mask Content
MergeDownLayer = Merge Down Layer
ModifySelection = {0} Selection {1}
ModifySelection_Border = Border
ModifySelection_Expand = Expand
ModifySelection_Contract = Contract
ModifySelection_Modify = Modify
ModifySelection_Quantity = by {0} pixel(s)
Move_Thing = {0} {1} {2}
Move_Pixel = pixel(s)
Move_TileWidth = tile(s) width
Move_TileHeight = tile(s) height
Move_ZoomedPixel = zoomed pixel(s)
Move_ZoomedTileWidth = zoomed tile(s) width
Move_ZoomedTileHeight = zoomed tile(s) height
Move_ViewportWidth = viewport width
Move_ViewportHeight = viewport height
Move_Left = left
Move_Right = right
Move_Up = up
Move_Down = down
MoveCel = Move Cel
MoveMask = Move {0} {1}
MoveMask_Boundaries = Selection Boundaries
MoveMask_Content = Selection Content
NewBrush = New Brush
NewFile = New File
NewFrame = New Frame
NewFrame_NewEmptyFrame = New Empty Frame
NewFrame_DuplicateCels = Duplicate Linked Cels
NewFrame_DuplicateCelsBlock = Duplicate Cels
NewFrameTag = New Frame Tag
NewLayer = New Layer
NewSpriteFromSelection = New Sprite From Selection
OpenBrowser = Open Browser
OpenFile = Open Sprite
OpenGroup = Open/Close Group
OpenInFolder = Open In Folder
OpenWithApp = Open With Associated Application
Options = Preferences
PaletteEditor = Switch{0}{1}{2}
PaletteEditor_Edit = <<<END
Edit Palette Mode
END
PaletteEditor_And = <<<END
and
END
PaletteEditor_FgPopup = <<<END
Foreground Color Popup
END
PaletteEditor_BgPopup = <<<END
Background Color Popup
END
PaletteSize = Palette Size
Paste = Paste
PasteText = Insert Text
PixelPerfectMode = Switch Pixel Perfect Mode
PlayAnimation = Play Animation
Redo = Redo
Refresh = Refresh
RemoveFrame = Remove Frame
RemoveFrameTag = Remove Frame Tag
RemoveLayer = Remove Layer
RemoveSlice = Remove Slice
RepeatLastExport = Repeat Last Export
ReplaceColor = Replace Color
ReselectMask = Reselect Mask
ReverseFrames = Reverse Frames
Rotate = Rotate {0} {1}
Rotate_Selection = Selection
Rotate_Sprite = Sprite
RunScript = Run Script
SaveFile = Save File
SaveFileAs = Save File As
SaveFileCopyAs = Export
SaveMask = Save Selection
SavePalette = Save Palette
Scroll = Scroll {0}
ScrollCenter = Scroll to center of canvas
SelectTile = Select Tile
SelectTile_Add = Select Tile (Add)
SelectTile_Subtract = Select Tile (Subtract)
SelectionAsGrid = Selection as Grid
SetColorSelector = Set Color Selector
SetColorSelector_Spectrum = Color Spectrum
SetColorSelector_TintShadeTone = Color Tint/Shade/Tone
SetColorSelector_RGBWheel = RGB Color Wheel
SetColorSelector_RYBWheel = RYB Color Wheel
SetInkType = Set Ink Type: {0}
SetLoopSection = Set Loop Section
SetPalette = Set Palette
SetPaletteEntrySize = Set Palette Entry Size
SetSameInk = Same Ink in All Tools
ShowAutoGuides = Show Auto Guides
ShowBrushPreview = Show Brush Preview
ShowBrushes = Show Brushes ShowBrushes = Show Brushes
ShowExtras = Show Extras
ShowGrid = Show Grid
ShowLayerEdges = Show Layer Edges
ShowOnionSkin = Show Onion Skin
ShowPaletteOptions = Show Palette Options ShowPaletteOptions = Show Palette Options
ShowPalettePresets = Show Palette Presets ShowPalettePresets = Show Palette Presets
ShowPaletteSortOptions = Show Palette Sort Options ShowPaletteSortOptions = Show Palette Sort Options
ShowPixelGrid = Show Pixel Grid
ShowSelectionEdges = Show Selection Edges
ShowSlices = Show Slices
SliceProperties = Slice Properties
SnapToGrid = Snap to Grid
SpriteProperties = Sprite Properties
SpriteSize = Sprite Size
SwitchColors = Switch Colors
SymmetryMode = Symmetry Mode
TiledMode = Tiled Mode
Timeline = Switch Timeline
TogglePreview = Toggle Preview
ToggleTimelineThumbnails = Toggle Timeline Thumbnails
Undo = Undo
UndoHistory = Undo History
UnlinkCel = Unlink Cel
Zoom = Zoom
Zoom_In = Zoom In
Zoom_Out = Zoom Out
Zoom_Set = Zoom {0}%
[document_tab_popup_menu] [document_tab_popup_menu]
duplicate_view = Duplicate &View duplicate_view = Duplicate &View
@ -338,12 +549,14 @@ partial_tiles = Include partial tiles at bottom/right edges
import = &Import import = &Import
cancel = &Cancel cancel = &Cancel
[ink_popup_menu] [inks]
simple_ink = Simple Ink simple_ink = Simple Ink
alpha_compositing = Alpha Compositing alpha_compositing = Alpha Compositing
copy_color = Copy Alpha+Color copy_color = Copy Alpha+Color
lock_alpha = Lock Alpha lock_alpha = Lock Alpha
shading = Shading shading = Shading
[ink_popup_menu]
same_in_all_tools = Same in all Tools same_in_all_tools = Same in all Tools
[jpeg_options] [jpeg_options]

View File

@ -364,6 +364,7 @@ add_library(app-lib
commands/filters/filter_target_buttons.cpp commands/filters/filter_target_buttons.cpp
commands/filters/filter_window.cpp commands/filters/filter_window.cpp
commands/filters/filter_worker.cpp commands/filters/filter_worker.cpp
commands/move_thing.cpp
commands/quick_command.cpp commands/quick_command.cpp
console.cpp console.cpp
context.cpp context.cpp

View File

@ -29,9 +29,7 @@ protected:
}; };
AboutCommand::AboutCommand() AboutCommand::AboutCommand()
: Command("About", : Command("About", CmdUIOnlyFlag)
"About",
CmdUIOnlyFlag)
{ {
} }

View File

@ -15,12 +15,14 @@
#include "app/console.h" #include "app/console.h"
#include "app/context.h" #include "app/context.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/i18n/strings.h"
#include "app/modules/palettes.h" #include "app/modules/palettes.h"
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/ui/context_bar.h" #include "app/ui/context_bar.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "doc/palette.h" #include "doc/palette.h"
#include "fmt/format.h"
#include "ui/manager.h" #include "ui/manager.h"
namespace app { namespace app {
@ -43,9 +45,7 @@ protected:
}; };
AddColorCommand::AddColorCommand() AddColorCommand::AddColorCommand()
: Command("AddColor", : Command("AddColor", CmdUIOnlyFlag)
"Add Color",
CmdUIOnlyFlag)
, m_source(Source::Fg) , m_source(Source::Fg)
{ {
} }
@ -121,7 +121,7 @@ void AddColorCommand::onExecute(Context* ctx)
if (document) { if (document) {
frame_t frame = writer.frame(); frame_t frame = writer.frame();
Transaction transaction(writer.context(), "Add Color", ModifyDocument); Transaction transaction(writer.context(), friendlyName(), ModifyDocument);
transaction.execute(new cmd::SetPalette(sprite, frame, newPalette)); transaction.execute(new cmd::SetPalette(sprite, frame, newPalette));
transaction.commit(); transaction.commit();
} }
@ -136,16 +136,13 @@ void AddColorCommand::onExecute(Context* ctx)
std::string AddColorCommand::onGetFriendlyName() const std::string AddColorCommand::onGetFriendlyName() const
{ {
std::string text = "Add "; std::string source;
switch (m_source) { switch (m_source) {
case Source::Fg: text += "Foreground"; break; case Source::Fg: source = Strings::commands_AddColor_Foreground(); break;
case Source::Bg: text += "Background"; break; case Source::Bg: source = Strings::commands_AddColor_Background(); break;
case Source::Color: text += "Specific"; break; case Source::Color: source = Strings::commands_AddColor_Specific(); break;
} }
return fmt::format(getBaseFriendlyName(), source);
text += " Color to Palette";
return text;
} }
Command* CommandFactory::createAddColorCommand() Command* CommandFactory::createAddColorCommand()

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -33,9 +33,7 @@ protected:
}; };
AdvancedModeCommand::AdvancedModeCommand() AdvancedModeCommand::AdvancedModeCommand()
: Command("AdvancedMode", : Command("AdvancedMode", CmdUIOnlyFlag)
"Advanced Mode",
CmdUIOnlyFlag)
{ {
} }

View File

@ -12,8 +12,8 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document_api.h" #include "app/document_api.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/ui/color_bar.h"
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/color_bar.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h" #include "doc/sprite.h"
@ -30,9 +30,7 @@ protected:
}; };
BackgroundFromLayerCommand::BackgroundFromLayerCommand() BackgroundFromLayerCommand::BackgroundFromLayerCommand()
: Command("BackgroundFromLayer", : Command("BackgroundFromLayer", CmdRecordableFlag)
"Background From Layer",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015, 2017 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -38,9 +38,7 @@ private:
}; };
CancelCommand::CancelCommand() CancelCommand::CancelCommand()
: Command("Cancel", : Command("Cancel", CmdUIOnlyFlag)
"Cancel Current Operation",
CmdUIOnlyFlag)
, m_type(NoOp) , m_type(NoOp)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -281,9 +281,7 @@ protected:
}; };
CanvasSizeCommand::CanvasSizeCommand() CanvasSizeCommand::CanvasSizeCommand()
: Command("CanvasSize", : Command("CanvasSize", CmdRecordableFlag)
"Canvas Size",
CmdRecordableFlag)
{ {
m_left = m_right = m_top = m_bottom = 0; m_left = m_right = m_top = m_bottom = 0;
} }

View File

@ -282,9 +282,7 @@ protected:
}; };
CelPropertiesCommand::CelPropertiesCommand() CelPropertiesCommand::CelPropertiesCommand()
: Command("CelProperties", : Command("CelProperties", CmdUIOnlyFlag)
"Cel Properties",
CmdUIOnlyFlag)
{ {
} }

View File

@ -14,12 +14,14 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context.h" #include "app/context.h"
#include "app/i18n/strings.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tools/active_tool.h" #include "app/tools/active_tool.h"
#include "app/tools/tool.h" #include "app/tools/tool.h"
#include "app/ui/context_bar.h" #include "app/ui/context_bar.h"
#include "base/convert_to.h" #include "base/convert_to.h"
#include "doc/brush.h" #include "doc/brush.h"
#include "fmt/format.h"
namespace app { namespace app {
@ -48,9 +50,7 @@ private:
}; };
ChangeBrushCommand::ChangeBrushCommand() ChangeBrushCommand::ChangeBrushCommand()
: Command("ChangeBrush", : Command("ChangeBrush", CmdUIOnlyFlag)
"Change Brush",
CmdUIOnlyFlag)
{ {
m_change = None; m_change = None;
m_slot = 0; m_slot = 0;
@ -108,30 +108,18 @@ void ChangeBrushCommand::onExecute(Context* context)
std::string ChangeBrushCommand::onGetFriendlyName() const std::string ChangeBrushCommand::onGetFriendlyName() const
{ {
std::string text = "Brush"; std::string change;
switch (m_change) { switch (m_change) {
case None: case None: break;
break; case IncrementSize: change = Strings::commands_ChangeBrush_IncrementSize(); break;
case IncrementSize: case DecrementSize: change = Strings::commands_ChangeBrush_DecrementSize(); break;
text += ": Increment Size"; case IncrementAngle: change = Strings::commands_ChangeBrush_IncrementAngle(); break;
break; case DecrementAngle: change = Strings::commands_ChangeBrush_DecrementAngle(); break;
case DecrementSize:
text += ": Decrement Size";
break;
case IncrementAngle:
text += ": Increment Angle";
break;
case DecrementAngle:
text += ": Decrement Angle";
break;
case CustomBrush: case CustomBrush:
text += ": Custom Brush #"; change = fmt::format(Strings::commands_ChangeBrush_CustomBrush(), m_slot);
text += base::convert_to<std::string>(m_slot);
break; break;
} }
return fmt::format(getBaseFriendlyName(), change);
return text;
} }
Command* CommandFactory::createChangeBrushCommand() Command* CommandFactory::createChangeBrushCommand()

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -13,9 +13,11 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/i18n/strings.h"
#include "app/modules/palettes.h" #include "app/modules/palettes.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "doc/palette.h" #include "doc/palette.h"
#include "fmt/format.h"
namespace app { namespace app {
@ -45,9 +47,7 @@ protected:
}; };
ChangeColorCommand::ChangeColorCommand() ChangeColorCommand::ChangeColorCommand()
: Command("ChangeColor", : Command("ChangeColor", CmdUIOnlyFlag)
"Change Color",
CmdUIOnlyFlag)
{ {
m_background = false; m_background = false;
m_change = None; m_change = None;
@ -96,25 +96,26 @@ void ChangeColorCommand::onExecute(Context* context)
std::string ChangeColorCommand::onGetFriendlyName() const std::string ChangeColorCommand::onGetFriendlyName() const
{ {
std::string text = "Color"; std::string action;
switch (m_change) { switch (m_change) {
case None: case None:
return text; break;
case IncrementIndex: case IncrementIndex:
text += ": Increment"; if (m_background)
action = Strings::commands_ChangeColor_IncrementBgIndex();
else
action = Strings::commands_ChangeColor_IncrementFgIndex();
break; break;
case DecrementIndex: case DecrementIndex:
text += ": Decrement"; if (m_background)
action = Strings::commands_ChangeColor_DecrementBgIndex();
else
action = Strings::commands_ChangeColor_DecrementFgIndex();
break; break;
} }
if (m_background) return fmt::format(getBaseFriendlyName(), action);
text += " Background Index";
else
text += " Foreground Index";
return text;
} }
Command* CommandFactory::createChangeColorCommand() Command* CommandFactory::createChangeColorCommand()

View File

@ -15,6 +15,7 @@
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/extensions.h" #include "app/extensions.h"
#include "app/i18n/strings.h"
#include "app/load_matrix.h" #include "app/load_matrix.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
@ -28,6 +29,7 @@
#include "base/thread.h" #include "base/thread.h"
#include "doc/image.h" #include "doc/image.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h"
#include "render/dithering_algorithm.h" #include "render/dithering_algorithm.h"
#include "render/ordered_dither.h" #include "render/ordered_dither.h"
#include "render/quantization.h" #include "render/quantization.h"
@ -349,9 +351,7 @@ private:
}; };
ChangePixelFormatCommand::ChangePixelFormatCommand() ChangePixelFormatCommand::ChangePixelFormatCommand()
: Command("ChangePixelFormat", : Command("ChangePixelFormat", CmdUIOnlyFlag)
"Change Pixel Format",
CmdUIOnlyFlag)
{ {
m_useUI = true; m_useUI = true;
m_format = IMAGE_RGB; m_format = IMAGE_RGB;
@ -488,33 +488,33 @@ void ChangePixelFormatCommand::onExecute(Context* context)
std::string ChangePixelFormatCommand::onGetFriendlyName() const std::string ChangePixelFormatCommand::onGetFriendlyName() const
{ {
std::string text = "Change Color Mode"; std::string conversion;
if (!m_useUI) { if (!m_useUI) {
switch (m_format) { switch (m_format) {
case IMAGE_RGB: case IMAGE_RGB:
text += " to RGB"; conversion = Strings::commands_ChangePixelFormat_RGB();
break;
case IMAGE_INDEXED:
text += " to Indexed";
switch (m_ditheringAlgorithm) {
case render::DitheringAlgorithm::None:
break;
case render::DitheringAlgorithm::Ordered:
text += " with Ordered Dithering";
break;
case render::DitheringAlgorithm::Old:
text += " with Old Dithering";
break;
}
break; break;
case IMAGE_GRAYSCALE: case IMAGE_GRAYSCALE:
text += " to Grayscale"; conversion = Strings::commands_ChangePixelFormat_Grayscale();
break;
case IMAGE_INDEXED:
switch (m_ditheringAlgorithm) {
case render::DitheringAlgorithm::None:
conversion = Strings::commands_ChangePixelFormat_Indexed();
break;
case render::DitheringAlgorithm::Ordered:
conversion = Strings::commands_ChangePixelFormat_Indexed_OrderedDithering();
break;
case render::DitheringAlgorithm::Old:
conversion = Strings::commands_ChangePixelFormat_Indexed_OldDithering();
break;
}
break; break;
} }
} }
return text; return fmt::format(getBaseFriendlyName(), conversion);
} }
Command* CommandFactory::createChangePixelFormatCommand() Command* CommandFactory::createChangePixelFormatCommand()

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -25,9 +25,7 @@ protected:
}; };
ClearCommand::ClearCommand() ClearCommand::ClearCommand()
: Command("Clear", : Command("Clear", CmdUIOnlyFlag)
"Clear",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -32,9 +32,7 @@ protected:
}; };
ClearCelCommand::ClearCelCommand() ClearCelCommand::ClearCelCommand()
: Command("ClearCel", : Command("ClearCel", CmdRecordableFlag)
"Clear Cel",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ using namespace ui;
class CloseFileCommand : public Command { class CloseFileCommand : public Command {
public: public:
CloseFileCommand() CloseFileCommand()
: Command("CloseFile", : Command("CloseFile", CmdUIOnlyFlag) {
"Close File",
CmdUIOnlyFlag) {
} }
Command* clone() const override { return new CloseFileCommand(*this); } Command* clone() const override { return new CloseFileCommand(*this); }
@ -56,9 +54,7 @@ protected:
class CloseAllFilesCommand : public Command { class CloseAllFilesCommand : public Command {
public: public:
CloseAllFilesCommand() CloseAllFilesCommand()
: Command("CloseAllFiles", : Command("CloseAllFiles", CmdRecordableFlag) {
"Close All Files",
CmdRecordableFlag) {
m_quitting = false; m_quitting = false;
} }

View File

@ -43,9 +43,7 @@ protected:
}; };
ColorQuantizationCommand::ColorQuantizationCommand() ColorQuantizationCommand::ColorQuantizationCommand()
: Command("ColorQuantization", : Command("ColorQuantization", CmdRecordableFlag)
"Create Palette from Current Sprite (Color Quantization)",
CmdRecordableFlag)
{ {
} }

View File

@ -26,9 +26,7 @@ protected:
}; };
ContiguousFillCommand::ContiguousFillCommand() ContiguousFillCommand::ContiguousFillCommand()
: Command("ContiguousFill", : Command("ContiguousFill", CmdUIOnlyFlag)
"Switch Contiguous Fill",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -25,9 +25,7 @@ protected:
}; };
CopyCommand::CopyCommand() CopyCommand::CopyCommand()
: Command("Copy", : Command("Copy", CmdUIOnlyFlag)
"Copy",
CmdUIOnlyFlag)
{ {
} }

View File

@ -27,9 +27,7 @@ protected:
}; };
CopyCelCommand::CopyCelCommand() CopyCelCommand::CopyCelCommand()
: Command("CopyCel", : Command("CopyCel", CmdUIOnlyFlag)
"Copy Cel",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2016 David Capello // Copyright (C) 2016-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -25,9 +25,7 @@ protected:
}; };
CopyMergedCommand::CopyMergedCommand() CopyMergedCommand::CopyMergedCommand()
: Command("CopyMerged", : Command("CopyMerged", CmdUIOnlyFlag)
"Copy Merged",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -37,9 +37,7 @@ private:
}; };
CropSpriteCommand::CropSpriteCommand() CropSpriteCommand::CropSpriteCommand()
: Command("CropSprite", : Command("CropSprite", CmdRecordableFlag)
"Crop Sprite",
CmdRecordableFlag)
{ {
} }
@ -92,9 +90,7 @@ protected:
}; };
AutocropSpriteCommand::AutocropSpriteCommand() AutocropSpriteCommand::AutocropSpriteCommand()
: Command("AutocropSprite", : Command("AutocropSprite", CmdRecordableFlag)
"Trim Sprite",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -25,9 +25,7 @@ protected:
}; };
CutCommand::CutCommand() CutCommand::CutCommand()
: Command("Cut", : Command("Cut", CmdUIOnlyFlag)
"Cut",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-42017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -29,9 +29,7 @@ protected:
}; };
DeselectMaskCommand::DeselectMaskCommand() DeselectMaskCommand::DeselectMaskCommand()
: Command("DeselectMask", : Command("DeselectMask", CmdRecordableFlag)
"Deselect Mask",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
DeveloperConsoleCommand::DeveloperConsoleCommand() DeveloperConsoleCommand::DeveloperConsoleCommand()
: Command("DeveloperConsole", : Command("DeveloperConsole", CmdUIOnlyFlag)
"Developer Console",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
DiscardBrushCommand::DiscardBrushCommand() DiscardBrushCommand::DiscardBrushCommand()
: Command("DiscardBrush", : Command("DiscardBrush", CmdUIOnlyFlag)
"Discard Brush",
CmdUIOnlyFlag)
{ {
} }

View File

@ -35,9 +35,7 @@ protected:
}; };
DuplicateLayerCommand::DuplicateLayerCommand() DuplicateLayerCommand::DuplicateLayerCommand()
: Command("DuplicateLayer", : Command("DuplicateLayer", CmdRecordableFlag)
"Duplicate Layer",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -37,9 +37,7 @@ protected:
}; };
DuplicateSpriteCommand::DuplicateSpriteCommand() DuplicateSpriteCommand::DuplicateSpriteCommand()
: Command("DuplicateSprite", : Command("DuplicateSprite", CmdUIOnlyFlag)
"Duplicate Sprite",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
DuplicateViewCommand::DuplicateViewCommand() DuplicateViewCommand::DuplicateViewCommand()
: Command("DuplicateView", : Command("DuplicateView", CmdUIOnlyFlag)
"Duplicate View",
CmdUIOnlyFlag)
{ {
} }

View File

@ -29,9 +29,7 @@ protected:
}; };
ExitCommand::ExitCommand() ExitCommand::ExitCommand()
: Command("Exit", : Command("Exit", CmdUIOnlyFlag)
"Exit",
CmdUIOnlyFlag)
{ {
} }

View File

@ -593,9 +593,7 @@ private:
}; };
ExportSpriteSheetCommand::ExportSpriteSheetCommand() ExportSpriteSheetCommand::ExportSpriteSheetCommand()
: Command("ExportSpriteSheet", : Command("ExportSpriteSheet", CmdRecordableFlag)
"Export Sprite Sheet",
CmdRecordableFlag)
, m_useUI(true) , m_useUI(true)
, m_askOverwrite(true) , m_askOverwrite(true)
{ {

View File

@ -32,9 +32,7 @@ namespace app {
using namespace ui; using namespace ui;
EyedropperCommand::EyedropperCommand() EyedropperCommand::EyedropperCommand()
: Command("Eyedropper", : Command("Eyedropper", CmdUIOnlyFlag)
"Eyedropper",
CmdUIOnlyFlag)
{ {
m_background = false; m_background = false;
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -27,9 +27,7 @@ protected:
}; };
FitScreenCommand::FitScreenCommand() FitScreenCommand::FitScreenCommand()
: Command("FitScreen", : Command("FitScreen", CmdUIOnlyFlag)
"Fit on Screen",
CmdUIOnlyFlag)
{ {
} }

View File

@ -29,9 +29,7 @@ protected:
}; };
FlattenLayersCommand::FlattenLayersCommand() FlattenLayersCommand::FlattenLayersCommand()
: Command("FlattenLayers", : Command("FlattenLayers", CmdUIOnlyFlag)
"Flatten Layers",
CmdUIOnlyFlag)
{ {
} }

View File

@ -20,6 +20,7 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document_api.h" #include "app/document_api.h"
#include "app/document_range.h" #include "app/document_range.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
@ -32,14 +33,13 @@
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h"
#include "gfx/size.h" #include "gfx/size.h"
namespace app { namespace app {
FlipCommand::FlipCommand() FlipCommand::FlipCommand()
: Command("Flip", : Command("Flip", CmdRecordableFlag)
"Flip",
CmdRecordableFlag)
{ {
m_flipMask = false; m_flipMask = false;
m_flipType = doc::algorithm::FlipHorizontal; m_flipType = doc::algorithm::FlipHorizontal;
@ -210,19 +210,20 @@ void FlipCommand::onExecute(Context* context)
std::string FlipCommand::onGetFriendlyName() const std::string FlipCommand::onGetFriendlyName() const
{ {
std::string text = "Flip"; std::string content;
std::string orientation;
if (m_flipMask) if (m_flipMask)
text += " Selection"; content = Strings::commands_Flip_Selection();
else else
text += " Canvas"; content = Strings::commands_Flip_Canvas();
if (m_flipType == doc::algorithm::FlipHorizontal) if (m_flipType == doc::algorithm::FlipHorizontal)
text += " Horizontal"; content = Strings::commands_Flip_Horizontally();
else else
text += " Vertical"; content = Strings::commands_Flip_Vertically();
return text; return fmt::format(getBaseFriendlyName(), content, orientation);
} }
Command* CommandFactory::createFlipCommand() Command* CommandFactory::createFlipCommand()

View File

@ -51,9 +51,7 @@ private:
}; };
FramePropertiesCommand::FramePropertiesCommand() FramePropertiesCommand::FramePropertiesCommand()
: Command("FrameProperties", : Command("FrameProperties", CmdUIOnlyFlag)
"Frame Properties",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -44,9 +44,7 @@ private:
}; };
FrameTagPropertiesCommand::FrameTagPropertiesCommand() FrameTagPropertiesCommand::FrameTagPropertiesCommand()
: Command("FrameTagProperties", : Command("FrameTagProperties", CmdUIOnlyFlag)
"Frame Tag Properties",
CmdUIOnlyFlag)
, m_tagId(NullId) , m_tagId(NullId)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -264,9 +264,7 @@ protected:
}; };
FullscreenPreviewCommand::FullscreenPreviewCommand() FullscreenPreviewCommand::FullscreenPreviewCommand()
: Command("FullscreenPreview", : Command("FullscreenPreview", CmdUIOnlyFlag)
"Fullscreen Preview",
CmdUIOnlyFlag)
{ {
} }

View File

@ -30,8 +30,8 @@ using namespace doc;
class GotoCommand : public Command { class GotoCommand : public Command {
protected: protected:
GotoCommand(const char* short_name, const char* friendly_name) GotoCommand(const char* id)
: Command(short_name, friendly_name, CmdRecordableFlag) { } : Command(id, CmdRecordableFlag) { }
bool onEnabled(Context* context) override { bool onEnabled(Context* context) override {
return (current_editor != NULL); return (current_editor != NULL);
@ -49,8 +49,7 @@ protected:
class GotoFirstFrameCommand : public GotoCommand { class GotoFirstFrameCommand : public GotoCommand {
public: public:
GotoFirstFrameCommand() GotoFirstFrameCommand()
: GotoCommand("GotoFirstFrame", : GotoCommand("GotoFirstFrame") { }
"Go to First Frame") { }
Command* clone() const override { return new GotoFirstFrameCommand(*this); } Command* clone() const override { return new GotoFirstFrameCommand(*this); }
protected: protected:
@ -62,8 +61,7 @@ protected:
class GotoPreviousFrameCommand : public GotoCommand { class GotoPreviousFrameCommand : public GotoCommand {
public: public:
GotoPreviousFrameCommand() GotoPreviousFrameCommand()
: GotoCommand("GotoPreviousFrame", : GotoCommand("GotoPreviousFrame") { }
"Go to Previous Frame") { }
Command* clone() const override { return new GotoPreviousFrameCommand(*this); } Command* clone() const override { return new GotoPreviousFrameCommand(*this); }
protected: protected:
@ -77,8 +75,7 @@ protected:
class GotoNextFrameCommand : public GotoCommand { class GotoNextFrameCommand : public GotoCommand {
public: public:
GotoNextFrameCommand() : GotoCommand("GotoNextFrame", GotoNextFrameCommand() : GotoCommand("GotoNextFrame") { }
"Go to Next Frame") { }
Command* clone() const override { return new GotoNextFrameCommand(*this); } Command* clone() const override { return new GotoNextFrameCommand(*this); }
protected: protected:
@ -92,8 +89,7 @@ protected:
class GotoNextFrameWithSameTagCommand : public GotoCommand { class GotoNextFrameWithSameTagCommand : public GotoCommand {
public: public:
GotoNextFrameWithSameTagCommand() : GotoCommand("GotoNextFrameWithSameTag", GotoNextFrameWithSameTagCommand() : GotoCommand("GotoNextFrameWithSameTag") { }
"Go to Next Frame with same tag") { }
Command* clone() const override { return new GotoNextFrameWithSameTagCommand(*this); } Command* clone() const override { return new GotoNextFrameWithSameTagCommand(*this); }
protected: protected:
@ -112,8 +108,7 @@ protected:
class GotoPreviousFrameWithSameTagCommand : public GotoCommand { class GotoPreviousFrameWithSameTagCommand : public GotoCommand {
public: public:
GotoPreviousFrameWithSameTagCommand() : GotoCommand("GotoPreviousFrameWithSameTag", GotoPreviousFrameWithSameTagCommand() : GotoCommand("GotoPreviousFrameWithSameTag") { }
"Go to Previous Frame with same tag") { }
Command* clone() const override { return new GotoPreviousFrameWithSameTagCommand(*this); } Command* clone() const override { return new GotoPreviousFrameWithSameTagCommand(*this); }
protected: protected:
@ -132,8 +127,7 @@ protected:
class GotoLastFrameCommand : public GotoCommand { class GotoLastFrameCommand : public GotoCommand {
public: public:
GotoLastFrameCommand() : GotoCommand("GotoLastFrame", GotoLastFrameCommand() : GotoCommand("GotoLastFrame") { }
"Go to Last Frame") { }
Command* clone() const override { return new GotoLastFrameCommand(*this); } Command* clone() const override { return new GotoLastFrameCommand(*this); }
protected: protected:
@ -144,8 +138,7 @@ protected:
class GotoFrameCommand : public GotoCommand { class GotoFrameCommand : public GotoCommand {
public: public:
GotoFrameCommand() : GotoCommand("GotoFrame", GotoFrameCommand() : GotoCommand("GotoFrame")
"Go to Frame")
, m_showUI(true) { } , m_showUI(true) { }
Command* clone() const override { return new GotoFrameCommand(*this); } Command* clone() const override { return new GotoFrameCommand(*this); }

View File

@ -24,10 +24,9 @@ namespace app {
class GotoLayerCommand : public Command { class GotoLayerCommand : public Command {
public: public:
GotoLayerCommand(int offset, GotoLayerCommand(int offset,
const char* shortName, const char* id,
const char* friendlyName,
CommandFlags flags) CommandFlags flags)
: Command(shortName, friendlyName, flags), : Command(id, flags),
m_offset(offset) { m_offset(offset) {
} }
@ -87,7 +86,6 @@ class GotoPreviousLayerCommand : public GotoLayerCommand {
public: public:
GotoPreviousLayerCommand() GotoPreviousLayerCommand()
: GotoLayerCommand(-1, "GotoPreviousLayer", : GotoLayerCommand(-1, "GotoPreviousLayer",
"Go to Previous Layer",
CmdUIOnlyFlag) { CmdUIOnlyFlag) {
} }
Command* clone() const override { Command* clone() const override {
@ -99,7 +97,6 @@ class GotoNextLayerCommand : public GotoLayerCommand {
public: public:
GotoNextLayerCommand() GotoNextLayerCommand()
: GotoLayerCommand(+1, "GotoNextLayer", : GotoLayerCommand(+1, "GotoNextLayer",
"Go to Next Layer",
CmdUIOnlyFlag) { CmdUIOnlyFlag) {
} }
Command* clone() const override { Command* clone() const override {

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -26,9 +26,7 @@ protected:
}; };
GotoNextTabCommand::GotoNextTabCommand() GotoNextTabCommand::GotoNextTabCommand()
: Command("GotoNextTab", : Command("GotoNextTab", CmdUIOnlyFlag)
"Go to Next Tab",
CmdUIOnlyFlag)
{ {
} }
@ -53,9 +51,7 @@ protected:
}; };
GotoPreviousTabCommand::GotoPreviousTabCommand() GotoPreviousTabCommand::GotoPreviousTabCommand()
: Command("GotoPreviousTab", : Command("GotoPreviousTab", CmdRecordableFlag)
"Go to Previous tab",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -31,9 +31,7 @@ using namespace gfx;
class SnapToGridCommand : public Command { class SnapToGridCommand : public Command {
public: public:
SnapToGridCommand() SnapToGridCommand()
: Command("SnapToGrid", : Command("SnapToGrid", CmdUIOnlyFlag) {
"Snap to Grid",
CmdUIOnlyFlag) {
} }
Command* clone() const override { return new SnapToGridCommand(*this); } Command* clone() const override { return new SnapToGridCommand(*this); }
@ -56,9 +54,7 @@ protected:
class SelectionAsGridCommand : public Command { class SelectionAsGridCommand : public Command {
public: public:
SelectionAsGridCommand() SelectionAsGridCommand()
: Command("SelectionAsGrid", : Command("SelectionAsGrid", CmdUIOnlyFlag) {
"Selection as Grid",
CmdUIOnlyFlag) {
} }
Command* clone() const override { return new SelectionAsGridCommand(*this); } Command* clone() const override { return new SelectionAsGridCommand(*this); }
@ -95,9 +91,7 @@ protected:
}; };
GridSettingsCommand::GridSettingsCommand() GridSettingsCommand::GridSettingsCommand()
: Command("GridSettings", : Command("GridSettings", CmdUIOnlyFlag)
"Grid Settings",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -27,9 +27,7 @@ protected:
}; };
HomeCommand::HomeCommand() HomeCommand::HomeCommand()
: Command("Home", : Command("Home", CmdUIOnlyFlag)
"Home",
CmdUIOnlyFlag)
{ {
} }

View File

@ -297,9 +297,7 @@ protected:
}; };
ImportSpriteSheetCommand::ImportSpriteSheetCommand() ImportSpriteSheetCommand::ImportSpriteSheetCommand()
: Command("ImportSpriteSheet", : Command("ImportSpriteSheet", CmdRecordableFlag)
"Import Sprite Sheet",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015, 2017 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -33,9 +33,7 @@ protected:
}; };
InvertMaskCommand::InvertMaskCommand() InvertMaskCommand::InvertMaskCommand()
: Command("InvertMask", : Command("InvertMask", CmdRecordableFlag)
"Invert Mask",
CmdRecordableFlag)
{ {
} }

View File

@ -749,9 +749,7 @@ private:
}; };
KeyboardShortcutsCommand::KeyboardShortcutsCommand() KeyboardShortcutsCommand::KeyboardShortcutsCommand()
: Command("KeyboardShortcuts", : Command("KeyboardShortcuts", CmdUIOnlyFlag)
"Keyboard Shortcuts",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -32,9 +32,7 @@ private:
}; };
LaunchCommand::LaunchCommand() LaunchCommand::LaunchCommand()
: Command("Launch", : Command("Launch", CmdUIOnlyFlag)
"Launch",
CmdUIOnlyFlag)
, m_type(Url) , m_type(Url)
, m_path("") , m_path("")
{ {

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
LayerFromBackgroundCommand::LayerFromBackgroundCommand() LayerFromBackgroundCommand::LayerFromBackgroundCommand()
: Command("LayerFromBackground", : Command("LayerFromBackground", CmdRecordableFlag)
"Layer From Background",
CmdRecordableFlag)
{ {
} }

View File

@ -32,9 +32,7 @@ protected:
}; };
LayerLockCommand::LayerLockCommand() LayerLockCommand::LayerLockCommand()
: Command("LayerLock", : Command("LayerLock", CmdRecordableFlag)
"Lock Layers",
CmdRecordableFlag)
{ {
} }

View File

@ -14,11 +14,12 @@
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context.h" #include "app/context.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "base/convert_to.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "fmt/format.h"
#include <string> #include <string>
@ -40,9 +41,7 @@ private:
}; };
LayerOpacityCommand::LayerOpacityCommand() LayerOpacityCommand::LayerOpacityCommand()
: Command("LayerOpacity", : Command("LayerOpacity", CmdUIOnlyFlag)
"Layer Opacity",
CmdUIOnlyFlag)
{ {
m_opacity = 255; m_opacity = 255;
} }
@ -95,12 +94,9 @@ void LayerOpacityCommand::onExecute(Context* context)
std::string LayerOpacityCommand::onGetFriendlyName() const std::string LayerOpacityCommand::onGetFriendlyName() const
{ {
std::string text = "Set Layer Opacity to "; return fmt::format(getBaseFriendlyName(),
text += base::convert_to<std::string>(m_opacity); m_opacity,
text += " ("; int(100.0 * m_opacity / 255.0));
text += base::convert_to<std::string>(int(100.0 * m_opacity / 255.0));
text += "%)";
return text;
} }
Command* CommandFactory::createLayerOpacityCommand() Command* CommandFactory::createLayerOpacityCommand()

View File

@ -353,9 +353,7 @@ private:
}; };
LayerPropertiesCommand::LayerPropertiesCommand() LayerPropertiesCommand::LayerPropertiesCommand()
: Command("LayerProperties", : Command("LayerProperties", CmdRecordableFlag)
"Layer Properties",
CmdRecordableFlag)
{ {
} }

View File

@ -32,9 +32,7 @@ protected:
}; };
LayerVisibilityCommand::LayerVisibilityCommand() LayerVisibilityCommand::LayerVisibilityCommand()
: Command("LayerVisibility", : Command("LayerVisibility", CmdRecordableFlag)
"Layer Visibility",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -32,9 +32,7 @@ protected:
}; };
LinkCelsCommand::LinkCelsCommand() LinkCelsCommand::LinkCelsCommand()
: Command("LinkCels", : Command("LinkCels", CmdRecordableFlag)
"Links Cels",
CmdRecordableFlag)
{ {
} }

View File

@ -38,9 +38,7 @@ protected:
}; };
LoadMaskCommand::LoadMaskCommand() LoadMaskCommand::LoadMaskCommand()
: Command("LoadMask", : Command("LoadMask", CmdRecordableFlag)
"Load Mask",
CmdRecordableFlag)
{ {
m_filename = ""; m_filename = "";
} }

View File

@ -41,9 +41,7 @@ private:
}; };
LoadPaletteCommand::LoadPaletteCommand() LoadPaletteCommand::LoadPaletteCommand()
: Command("LoadPalette", : Command("LoadPalette", CmdRecordableFlag)
"Load Palette",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -29,9 +29,7 @@ protected:
}; };
MaskAllCommand::MaskAllCommand() MaskAllCommand::MaskAllCommand()
: Command("MaskAll", : Command("MaskAll", CmdRecordableFlag)
"Mask All",
CmdRecordableFlag)
{ {
} }

View File

@ -63,9 +63,7 @@ private:
}; };
MaskByColorCommand::MaskByColorCommand() MaskByColorCommand::MaskByColorCommand()
: Command("MaskByColor", : Command("MaskByColor", CmdUIOnlyFlag)
"Mask By Color",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -40,9 +40,7 @@ protected:
}; };
MaskContentCommand::MaskContentCommand() MaskContentCommand::MaskContentCommand()
: Command("MaskContent", : Command("MaskContent", CmdRecordableFlag)
"Mask Content",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -42,9 +42,7 @@ protected:
}; };
MergeDownLayerCommand::MergeDownLayerCommand() MergeDownLayerCommand::MergeDownLayerCommand()
: Command("MergeDownLayer", : Command("MergeDownLayer", CmdRecordableFlag)
"Merge Down Layer",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2015, 2016 David Capello // Copyright (C) 2015-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -13,6 +13,7 @@
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document.h" #include "app/document.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/transaction.h" #include "app/transaction.h"
@ -20,6 +21,7 @@
#include "doc/brush_type.h" #include "doc/brush_type.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "filters/neighboring_pixels.h" #include "filters/neighboring_pixels.h"
#include "fmt/format.h"
#include "modify_selection.xml.h" #include "modify_selection.xml.h"
@ -57,9 +59,7 @@ private:
}; };
ModifySelectionCommand::ModifySelectionCommand() ModifySelectionCommand::ModifySelectionCommand()
: Command("ModifySelection", : Command("ModifySelection", CmdRecordableFlag)
"Modify Selection",
CmdRecordableFlag)
, m_modifier(Expand) , m_modifier(Expand)
, m_quantity(0) , m_quantity(0)
, m_brushType(doc::kCircleBrushType) , m_brushType(doc::kCircleBrushType)
@ -141,7 +141,7 @@ void ModifySelectionCommand::onExecute(Context* context)
// Set the new mask // Set the new mask
Transaction transaction(writer.context(), Transaction transaction(writer.context(),
getActionName() + " Selection", friendlyName(),
DoesntModifyDocument); DoesntModifyDocument);
transaction.execute(new cmd::SetMask(document, mask)); transaction.execute(new cmd::SetMask(document, mask));
transaction.commit(); transaction.commit();
@ -152,29 +152,22 @@ void ModifySelectionCommand::onExecute(Context* context)
std::string ModifySelectionCommand::onGetFriendlyName() const std::string ModifySelectionCommand::onGetFriendlyName() const
{ {
std::string text; std::string quantity;
if (m_quantity > 0)
quantity = fmt::format(Strings::commands_ModifySelection_Quantity(), m_quantity);
text += getActionName(); return fmt::format(getBaseFriendlyName(),
text += " Selection"; getActionName(),
quantity);
if (m_quantity > 0) {
text += " by ";
text += base::convert_to<std::string>(m_quantity);
text += " pixel";
if (m_quantity > 1)
text += "s";
}
return text;
} }
std::string ModifySelectionCommand::getActionName() const std::string ModifySelectionCommand::getActionName() const
{ {
switch (m_modifier) { switch (m_modifier) {
case Border: return "Border"; case Border: return Strings::commands_ModifySelection_Border();
case Expand: return "Expand"; case Expand: return Strings::commands_ModifySelection_Expand();
case Contract: return "Contract"; case Contract: return Strings::commands_ModifySelection_Contract();
default: return "Modify"; default: return Strings::commands_ModifySelection_Modify();
} }
} }

View File

@ -27,9 +27,7 @@ protected:
}; };
MoveCelCommand::MoveCelCommand() MoveCelCommand::MoveCelCommand()
: Command("MoveCel", : Command("MoveCel", CmdUIOnlyFlag)
"Move Cel",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -15,6 +15,7 @@
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document_api.h" #include "app/document_api.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
@ -25,14 +26,13 @@
#include "base/convert_to.h" #include "base/convert_to.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h"
#include "ui/view.h" #include "ui/view.h"
namespace app { namespace app {
MoveMaskCommand::MoveMaskCommand() MoveMaskCommand::MoveMaskCommand()
: Command("MoveMask", : Command("MoveMask", CmdRecordableFlag)
"Move Mask",
CmdRecordableFlag)
{ {
} }
@ -42,29 +42,12 @@ void MoveMaskCommand::onLoadParams(const Params& params)
if (target == "boundaries") m_target = Boundaries; if (target == "boundaries") m_target = Boundaries;
else if (target == "content") m_target = Content; else if (target == "content") m_target = Content;
std::string direction = params.get("direction");
if (direction == "left") m_direction = Left;
else if (direction == "right") m_direction = Right;
else if (direction == "up") m_direction = Up;
else if (direction == "down") m_direction = Down;
std::string units = params.get("units");
if (units == "pixel") m_units = Pixel;
else if (units == "tile-width") m_units = TileWidth;
else if (units == "tile-height") m_units = TileHeight;
else if (units == "zoomed-pixel") m_units = ZoomedPixel;
else if (units == "zoomed-tile-width") m_units = ZoomedTileWidth;
else if (units == "zoomed-tile-height") m_units = ZoomedTileHeight;
else if (units == "viewport-width") m_units = ViewportWidth;
else if (units == "viewport-height") m_units = ViewportHeight;
int quantity = params.get_as<int>("quantity");
m_quantity = std::max<int>(1, quantity);
if (params.has_param("wrap")) if (params.has_param("wrap"))
m_wrap = params.get_as<bool>("wrap"); m_wrap = params.get_as<bool>("wrap");
else else
m_wrap = false; m_wrap = false;
m_moveThing.onLoadParams(params);
} }
bool MoveMaskCommand::onEnabled(Context* context) bool MoveMaskCommand::onEnabled(Context* context)
@ -90,7 +73,7 @@ bool MoveMaskCommand::onEnabled(Context* context)
void MoveMaskCommand::onExecute(Context* context) void MoveMaskCommand::onExecute(Context* context)
{ {
gfx::Point delta = getDelta(context); gfx::Point delta = m_moveThing.getDelta(context);
switch (m_target) { switch (m_target) {
@ -128,114 +111,15 @@ void MoveMaskCommand::onExecute(Context* context)
} }
} }
gfx::Point MoveMaskCommand::getDelta(Context* context) const
{
DocumentView* view = static_cast<UIContext*>(context)->activeView();
if (!view)
return gfx::Point(0, 0);
DocumentPreferences& docPref = Preferences::instance().document(view->document());
Editor* editor = view->editor();
gfx::Rect vp = view->viewWidget()->viewportBounds();
gfx::Rect gridBounds = docPref.grid.bounds();
int dx = 0;
int dy = 0;
int pixels = 0;
switch (m_units) {
case Pixel:
pixels = 1;
break;
case TileWidth:
pixels = gridBounds.w;
break;
case TileHeight:
pixels = gridBounds.h;
break;
case ZoomedPixel:
pixels = editor->zoom().apply(1);
break;
case ZoomedTileWidth:
pixels = editor->zoom().apply(gridBounds.w);
break;
case ZoomedTileHeight:
pixels = editor->zoom().apply(gridBounds.h);
break;
case ViewportWidth:
pixels = vp.h;
break;
case ViewportHeight:
pixels = vp.w;
break;
}
switch (m_direction) {
case Left: dx = -m_quantity * pixels; break;
case Right: dx = +m_quantity * pixels; break;
case Up: dy = -m_quantity * pixels; break;
case Down: dy = +m_quantity * pixels; break;
}
return gfx::Point(dx, dy);
}
std::string MoveMaskCommand::onGetFriendlyName() const std::string MoveMaskCommand::onGetFriendlyName() const
{ {
std::string text = "Move"; std::string content;
switch (m_target) { switch (m_target) {
case Boundaries: content = Strings::commands_MoveMask_Boundaries(); break;
case Boundaries: { case Content: content = Strings::commands_MoveMask_Content(); break;
text += " Selection Boundaries";
break;
} }
return fmt::format(getBaseFriendlyName(),
case Content: { content, m_moveThing.getFriendlyString());
text += " Selection Content";
break;
}
}
text += " " + base::convert_to<std::string>(m_quantity);
switch (m_units) {
case Pixel:
text += " pixel";
break;
case TileWidth:
text += " horizontal tile";
break;
case TileHeight:
text += " vertical tile";
break;
case ZoomedPixel:
text += " zoomed pixel";
break;
case ZoomedTileWidth:
text += " zoomed horizontal tile";
break;
case ZoomedTileHeight:
text += " zoomed vertical tile";
break;
case ViewportWidth:
text += " viewport width";
break;
case ViewportHeight:
text += " viewport height";
break;
}
if (m_quantity != 1)
text += "s";
switch (m_direction) {
case Left: text += " left"; break;
case Right: text += " right"; break;
case Up: text += " up"; break;
case Down: text += " down"; break;
}
return text;
} }
Command* CommandFactory::createMoveMaskCommand() Command* CommandFactory::createMoveMaskCommand()

View File

@ -9,23 +9,13 @@
#pragma once #pragma once
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/move_thing.h"
namespace app { namespace app {
class MoveMaskCommand : public Command { class MoveMaskCommand : public Command {
public: public:
enum Target { Boundaries, Content }; enum Target { Boundaries, Content };
enum Direction { Left, Up, Right, Down, }; // TODO join this enum with scroll command
enum Units {
Pixel,
TileWidth,
TileHeight,
ZoomedPixel,
ZoomedTileWidth,
ZoomedTileHeight,
ViewportWidth,
ViewportHeight
};
MoveMaskCommand(); MoveMaskCommand();
Command* clone() const override { return new MoveMaskCommand(*this); } Command* clone() const override { return new MoveMaskCommand(*this); }
@ -42,9 +32,7 @@ namespace app {
private: private:
Target m_target; Target m_target;
Direction m_direction; MoveThing m_moveThing;
Units m_units;
int m_quantity;
bool m_wrap; bool m_wrap;
}; };

View File

@ -55,9 +55,7 @@ private:
}; };
NewBrushCommand::NewBrushCommand() NewBrushCommand::NewBrushCommand()
: Command("NewBrush", : Command("NewBrush", CmdUIOnlyFlag)
"New Brush",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -14,6 +14,7 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/console.h" #include "app/console.h"
#include "app/document.h" #include "app/document.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/modules/palettes.h" #include "app/modules/palettes.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
@ -50,9 +51,7 @@ protected:
static int _sprite_counter = 0; static int _sprite_counter = 0;
NewFileCommand::NewFileCommand() NewFileCommand::NewFileCommand()
: Command("NewFile", : Command("NewFile", CmdRecordableFlag)
"New File",
CmdRecordableFlag)
{ {
} }

View File

@ -15,6 +15,7 @@
#include "app/console.h" #include "app/console.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document_api.h" #include "app/document_api.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/document_view.h" #include "app/ui/document_view.h"
@ -27,6 +28,7 @@
#include "doc/image.h" #include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h"
#include "ui/ui.h" #include "ui/ui.h"
#include <stdexcept> #include <stdexcept>
@ -56,9 +58,7 @@ private:
}; };
NewFrameCommand::NewFrameCommand() NewFrameCommand::NewFrameCommand()
: Command("NewFrame", : Command("NewFrame", CmdRecordableFlag)
"New Frame",
CmdRecordableFlag)
{ {
} }
@ -191,20 +191,20 @@ void NewFrameCommand::onExecute(Context* context)
std::string NewFrameCommand::onGetFriendlyName() const std::string NewFrameCommand::onGetFriendlyName() const
{ {
std::string text = "New Frame"; std::string text;
switch (m_content) { switch (m_content) {
case Content::DUPLICATE_FRAME: case Content::DUPLICATE_FRAME:
text = "New Frame"; text = Strings::commands_NewFrame();
break; break;
case Content::NEW_EMPTY_FRAME: case Content::NEW_EMPTY_FRAME:
text = "New Empty Frame"; text = Strings::commands_NewFrame_NewEmptyFrame();
break; break;
case Content::DUPLICATE_CELS: case Content::DUPLICATE_CELS:
text = "Duplicate Linked Cels"; text = Strings::commands_NewFrame_DuplicateCels();
break; break;
case Content::DUPLICATE_CELS_BLOCK: case Content::DUPLICATE_CELS_BLOCK:
text = "Duplicate Cels"; text = Strings::commands_NewFrame_DuplicateCelsBlock();
break; break;
} }

View File

@ -35,9 +35,7 @@ protected:
}; };
NewFrameTagCommand::NewFrameTagCommand() NewFrameTagCommand::NewFrameTagCommand()
: Command("NewFrameTag", : Command("NewFrameTag", CmdRecordableFlag)
"New Frame Tag",
CmdRecordableFlag)
{ {
} }

View File

@ -65,9 +65,7 @@ private:
}; };
NewLayerCommand::NewLayerCommand() NewLayerCommand::NewLayerCommand()
: Command("NewLayer", : Command("NewLayer", CmdRecordableFlag)
"New Layer",
CmdRecordableFlag)
{ {
m_name = ""; m_name = "";
m_type = Type::Layer; m_type = Type::Layer;

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -38,9 +38,7 @@ protected:
}; };
NewSpriteFromSelectionCommand::NewSpriteFromSelectionCommand() NewSpriteFromSelectionCommand::NewSpriteFromSelectionCommand()
: Command("NewSpriteFromSelection", : Command("NewSpriteFromSelection", CmdUIOnlyFlag)
"New Sprite From Selection",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -21,9 +21,7 @@ using namespace gfx;
class ShowOnionSkinCommand : public Command { class ShowOnionSkinCommand : public Command {
public: public:
ShowOnionSkinCommand() ShowOnionSkinCommand()
: Command("ShowOnionSkin", : Command("ShowOnionSkin", CmdUIOnlyFlag)
"Show Onion Skin",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2016 David Capello // Copyright (C) 2016-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ private:
}; };
OpenBrowserCommand::OpenBrowserCommand() OpenBrowserCommand::OpenBrowserCommand()
: Command("OpenBrowser", : Command("OpenBrowser", CmdUIOnlyFlag)
"Open Browser",
CmdUIOnlyFlag)
{ {
} }

View File

@ -75,9 +75,7 @@ private:
}; };
OpenFileCommand::OpenFileCommand() OpenFileCommand::OpenFileCommand()
: Command("OpenFile", : Command("OpenFile", CmdRecordableFlag)
"Open Sprite",
CmdRecordableFlag)
, m_repeatCheckbox(false) , m_repeatCheckbox(false)
, m_oneFrame(false) , m_oneFrame(false)
, m_seqDecision(SequenceDecision::Ask) , m_seqDecision(SequenceDecision::Ask)

View File

@ -33,9 +33,7 @@ protected:
}; };
OpenGroupCommand::OpenGroupCommand() OpenGroupCommand::OpenGroupCommand()
: Command("OpenGroup", : Command("OpenGroup", CmdRecordableFlag)
"Open/Close Group",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -27,9 +27,7 @@ protected:
}; };
OpenInFolderCommand::OpenInFolderCommand() OpenInFolderCommand::OpenInFolderCommand()
: Command("OpenInFolder", : Command("OpenInFolder", CmdUIOnlyFlag)
"Open In Folder",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -27,9 +27,7 @@ protected:
}; };
OpenWithAppCommand::OpenWithAppCommand() OpenWithAppCommand::OpenWithAppCommand()
: Command("OpenWithApp", : Command("OpenWithApp", CmdUIOnlyFlag)
"Open With Associated Application",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1037,9 +1037,7 @@ protected:
}; };
OptionsCommand::OptionsCommand() OptionsCommand::OptionsCommand()
: Command("Options", : Command("Options", CmdUIOnlyFlag)
"Options",
CmdUIOnlyFlag)
{ {
Preferences& preferences = Preferences::instance(); Preferences& preferences = Preferences::instance();

View File

@ -10,7 +10,9 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/i18n/strings.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "fmt/format.h"
namespace app { namespace app {
@ -32,9 +34,7 @@ private:
}; };
PaletteEditorCommand::PaletteEditorCommand() PaletteEditorCommand::PaletteEditorCommand()
: Command("PaletteEditor", : Command("PaletteEditor", CmdRecordableFlag)
"Edit Palette",
CmdRecordableFlag)
{ {
m_edit = true; m_edit = true;
m_popup = false; m_popup = false;
@ -91,21 +91,20 @@ void PaletteEditorCommand::onExecute(Context* context)
std::string PaletteEditorCommand::onGetFriendlyName() const std::string PaletteEditorCommand::onGetFriendlyName() const
{ {
std::string text = "Switch"; std::string edit, plus, popup;
if (m_edit) { if (m_edit) {
text += " Edit Palette Mode"; edit = Strings::commands_PaletteEditor_Edit();
} }
if (m_edit && m_popup) { if (m_edit && m_popup) {
text += " and"; plus = Strings::commands_PaletteEditor_And();
} }
if (m_popup) { if (m_popup) {
if (m_background) if (m_background)
text += " Background"; popup = Strings::commands_PaletteEditor_BgPopup();
else else
text += " Foreground"; popup = Strings::commands_PaletteEditor_FgPopup();
text += " Color Popup";
} }
return text; return fmt::format(getBaseFriendlyName(), edit, plus, popup);
} }
Command* CommandFactory::createPaletteEditorCommand() Command* CommandFactory::createPaletteEditorCommand()

View File

@ -37,9 +37,7 @@ private:
}; };
PaletteSizeCommand::PaletteSizeCommand() PaletteSizeCommand::PaletteSizeCommand()
: Command("PaletteSize", : Command("PaletteSize", CmdRecordableFlag)
"Palette Size",
CmdRecordableFlag)
{ {
m_size = 0; m_size = 0;
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -25,9 +25,7 @@ protected:
}; };
PasteCommand::PasteCommand() PasteCommand::PasteCommand()
: Command("Paste", : Command("Paste", CmdUIOnlyFlag)
"Paste",
CmdUIOnlyFlag)
{ {
} }

View File

@ -45,9 +45,7 @@ protected:
}; };
PasteTextCommand::PasteTextCommand() PasteTextCommand::PasteTextCommand()
: Command("PasteText", : Command("PasteText", CmdUIOnlyFlag)
"Insert Text",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
PixelPerfectModeCommand::PixelPerfectModeCommand() PixelPerfectModeCommand::PixelPerfectModeCommand()
: Command("PixelPerfectMode", : Command("PixelPerfectMode", CmdUIOnlyFlag)
"Switch Pixel Perfect Mode",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
PlayAnimationCommand::PlayAnimationCommand() PlayAnimationCommand::PlayAnimationCommand()
: Command("PlayAnimation", : Command("PlayAnimation", CmdUIOnlyFlag)
"Play Animation",
CmdUIOnlyFlag)
{ {
} }

View File

@ -33,9 +33,7 @@ protected:
}; };
RefreshCommand::RefreshCommand() RefreshCommand::RefreshCommand()
: Command("Refresh", : Command("Refresh", CmdUIOnlyFlag)
"Refresh",
CmdUIOnlyFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -30,9 +30,7 @@ protected:
}; };
RemoveFrameCommand::RemoveFrameCommand() RemoveFrameCommand::RemoveFrameCommand()
: Command("RemoveFrame", : Command("RemoveFrame", CmdRecordableFlag)
"Remove Frame",
CmdRecordableFlag)
{ {
} }

View File

@ -38,9 +38,7 @@ private:
}; };
RemoveFrameTagCommand::RemoveFrameTagCommand() RemoveFrameTagCommand::RemoveFrameTagCommand()
: Command("RemoveFrameTag", : Command("RemoveFrameTag", CmdRecordableFlag)
"Remove Frame Tag",
CmdRecordableFlag)
, m_tagId(NullId) , m_tagId(NullId)
{ {
} }

View File

@ -34,9 +34,7 @@ protected:
}; };
RemoveLayerCommand::RemoveLayerCommand() RemoveLayerCommand::RemoveLayerCommand()
: Command("RemoveLayer", : Command("RemoveLayer", CmdRecordableFlag)
"Remove Layer",
CmdRecordableFlag)
{ {
} }

View File

@ -41,9 +41,7 @@ private:
}; };
RemoveSliceCommand::RemoveSliceCommand() RemoveSliceCommand::RemoveSliceCommand()
: Command("RemoveSlice", : Command("RemoveSlice", CmdRecordableFlag)
"Remove Slice",
CmdRecordableFlag)
{ {
} }

View File

@ -29,9 +29,7 @@ protected:
}; };
RepeatLastExportCommand::RepeatLastExportCommand() RepeatLastExportCommand::RepeatLastExportCommand()
: Command("RepeatLastExport", : Command("RepeatLastExport", CmdRecordableFlag)
"Repeat Last Export",
CmdRecordableFlag)
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -29,9 +29,7 @@ protected:
}; };
ReselectMaskCommand::ReselectMaskCommand() ReselectMaskCommand::ReselectMaskCommand()
: Command("ReselectMask", : Command("ReselectMask", CmdRecordableFlag)
"Reselect Mask",
CmdRecordableFlag)
{ {
} }

View File

@ -28,9 +28,7 @@ protected:
}; };
ReverseFramesCommand::ReverseFramesCommand() ReverseFramesCommand::ReverseFramesCommand()
: Command("ReverseFrames", : Command("ReverseFrames", CmdUIOnlyFlag)
"Reverse Frames",
CmdUIOnlyFlag)
{ {
} }

View File

@ -15,6 +15,7 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document_api.h" #include "app/document_api.h"
#include "app/document_range.h" #include "app/document_range.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/sprite_job.h" #include "app/sprite_job.h"
@ -31,6 +32,7 @@
#include "doc/image.h" #include "doc/image.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h"
#include "ui/ui.h" #include "ui/ui.h"
namespace app { namespace app {
@ -165,9 +167,7 @@ protected:
}; };
RotateCommand::RotateCommand() RotateCommand::RotateCommand()
: Command("Rotate", : Command("Rotate", CmdRecordableFlag)
"Rotate Canvas",
CmdRecordableFlag)
{ {
m_flipMask = false; m_flipMask = false;
m_angle = 0; m_angle = 0;
@ -241,16 +241,13 @@ void RotateCommand::onExecute(Context* context)
std::string RotateCommand::onGetFriendlyName() const std::string RotateCommand::onGetFriendlyName() const
{ {
std::string text = "Rotate"; std::string content;
if (m_flipMask) if (m_flipMask)
text += " Selection"; content = Strings::commands_Rotate_Selection();
else else
text += " Sprite"; content = Strings::commands_Rotate_Sprite();
return fmt::format(getBaseFriendlyName(),
text += " " + base::convert_to<std::string>(m_angle) + "\xc2\xb0"; content, base::convert_to<std::string>(m_angle));
return text;
} }
Command* CommandFactory::createRotateCommand() Command* CommandFactory::createRotateCommand()

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -21,6 +21,7 @@ namespace app {
int angle() const { return m_angle; } int angle() const { return m_angle; }
protected: protected:
bool onNeedsParams() const override { return true; }
void onLoadParams(const Params& params) override; void onLoadParams(const Params& params) override;
bool onEnabled(Context* context) override; bool onEnabled(Context* context) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;

View File

@ -49,9 +49,7 @@ private:
}; };
RunScriptCommand::RunScriptCommand() RunScriptCommand::RunScriptCommand()
: Command("RunScript", : Command("RunScript", CmdRecordableFlag)
"Run Script",
CmdRecordableFlag)
{ {
} }

View File

@ -141,8 +141,8 @@ private:
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
SaveFileBaseCommand::SaveFileBaseCommand(const char* short_name, const char* friendly_name, CommandFlags flags) SaveFileBaseCommand::SaveFileBaseCommand(const char* id, CommandFlags flags)
: Command(short_name, friendly_name, flags) : Command(id, flags)
{ {
} }
@ -357,7 +357,7 @@ protected:
}; };
SaveFileCommand::SaveFileCommand() SaveFileCommand::SaveFileCommand()
: SaveFileBaseCommand("SaveFile", "Save File", CmdRecordableFlag) : SaveFileBaseCommand("SaveFile", CmdRecordableFlag)
{ {
} }
@ -393,7 +393,7 @@ protected:
}; };
SaveFileAsCommand::SaveFileAsCommand() SaveFileAsCommand::SaveFileAsCommand()
: SaveFileBaseCommand("SaveFileAs", "Save File As", CmdRecordableFlag) : SaveFileBaseCommand("SaveFileAs", CmdRecordableFlag)
{ {
} }
@ -412,7 +412,7 @@ protected:
}; };
SaveFileCopyAsCommand::SaveFileCopyAsCommand() SaveFileCopyAsCommand::SaveFileCopyAsCommand()
: SaveFileBaseCommand("SaveFileCopyAs", "Export", CmdRecordableFlag) : SaveFileBaseCommand("SaveFileCopyAs", CmdRecordableFlag)
{ {
} }

View File

@ -19,7 +19,7 @@ namespace app {
class SaveFileBaseCommand : public Command { class SaveFileBaseCommand : public Command {
public: public:
SaveFileBaseCommand(const char* shortName, const char* friendlyName, CommandFlags flags); SaveFileBaseCommand(const char* id, CommandFlags flags);
std::string selectedFilename() const { std::string selectedFilename() const {
return m_selectedFilename; return m_selectedFilename;

View File

@ -32,9 +32,7 @@ protected:
}; };
SaveMaskCommand::SaveMaskCommand() SaveMaskCommand::SaveMaskCommand()
: Command("SaveMask", : Command("SaveMask", CmdUIOnlyFlag)
"Save Mask",
CmdUIOnlyFlag)
{ {
} }

View File

@ -39,9 +39,7 @@ private:
}; };
SavePaletteCommand::SavePaletteCommand() SavePaletteCommand::SavePaletteCommand()
: Command("SavePalette", : Command("SavePalette", CmdRecordableFlag)
"Save Palette",
CmdRecordableFlag)
{ {
} }

View File

@ -10,30 +10,20 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/move_thing.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/pref/preferences.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "base/convert_to.h" #include "base/convert_to.h"
#include "fmt/format.h"
#include "ui/view.h" #include "ui/view.h"
namespace app { namespace app {
class ScrollCommand : public Command { class ScrollCommand : public Command {
public: public:
enum Direction { Left, Up, Right, Down, };
enum Units {
Pixel,
TileWidth,
TileHeight,
ZoomedPixel,
ZoomedTileWidth,
ZoomedTileHeight,
ViewportWidth,
ViewportHeight
};
ScrollCommand(); ScrollCommand();
Command* clone() const override { return new ScrollCommand(*this); } Command* clone() const override { return new ScrollCommand(*this); }
@ -45,38 +35,17 @@ protected:
std::string onGetFriendlyName() const override; std::string onGetFriendlyName() const override;
private: private:
Direction m_direction; MoveThing m_moveThing;
Units m_units;
int m_quantity;
}; };
ScrollCommand::ScrollCommand() ScrollCommand::ScrollCommand()
: Command("Scroll", : Command("Scroll", CmdUIOnlyFlag)
"Scroll",
CmdUIOnlyFlag)
{ {
} }
void ScrollCommand::onLoadParams(const Params& params) void ScrollCommand::onLoadParams(const Params& params)
{ {
std::string direction = params.get("direction"); m_moveThing.onLoadParams(params);
if (direction == "left") m_direction = Left;
else if (direction == "right") m_direction = Right;
else if (direction == "up") m_direction = Up;
else if (direction == "down") m_direction = Down;
std::string units = params.get("units");
if (units == "pixel") m_units = Pixel;
else if (units == "tile-width") m_units = TileWidth;
else if (units == "tile-height") m_units = TileHeight;
else if (units == "zoomed-pixel") m_units = ZoomedPixel;
else if (units == "zoomed-tile-width") m_units = ZoomedTileWidth;
else if (units == "zoomed-tile-height") m_units = ZoomedTileHeight;
else if (units == "viewport-width") m_units = ViewportWidth;
else if (units == "viewport-height") m_units = ViewportHeight;
int quantity = params.get_as<int>("quantity");
m_quantity = std::max<int>(1, quantity);
} }
bool ScrollCommand::onEnabled(Context* context) bool ScrollCommand::onEnabled(Context* context)
@ -87,92 +56,17 @@ bool ScrollCommand::onEnabled(Context* context)
void ScrollCommand::onExecute(Context* context) void ScrollCommand::onExecute(Context* context)
{ {
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
ui::View* view = ui::View::getView(current_editor); ui::View* view = ui::View::getView(current_editor);
gfx::Rect vp = view->viewportBounds();
gfx::Point scroll = view->viewScroll(); gfx::Point scroll = view->viewScroll();
gfx::Rect gridBounds = docPref.grid.bounds(); gfx::Point delta = m_moveThing.getDelta(context);
gfx::Point delta(0, 0);
int pixels = 0;
switch (m_units) {
case Pixel:
pixels = 1;
break;
case TileWidth:
pixels = gridBounds.w;
break;
case TileHeight:
pixels = gridBounds.h;
break;
case ZoomedPixel:
pixels = current_editor->zoom().apply(1);
break;
case ZoomedTileWidth:
pixels = current_editor->zoom().apply(gridBounds.w);
break;
case ZoomedTileHeight:
pixels = current_editor->zoom().apply(gridBounds.h);
break;
case ViewportWidth:
pixels = vp.h;
break;
case ViewportHeight:
pixels = vp.w;
break;
}
switch (m_direction) {
case Left: delta.x = -m_quantity * pixels; break;
case Right: delta.x = +m_quantity * pixels; break;
case Up: delta.y = -m_quantity * pixels; break;
case Down: delta.y = +m_quantity * pixels; break;
}
current_editor->setEditorScroll(scroll+delta); current_editor->setEditorScroll(scroll+delta);
} }
std::string ScrollCommand::onGetFriendlyName() const std::string ScrollCommand::onGetFriendlyName() const
{ {
std::string text = "Scroll " + base::convert_to<std::string>(m_quantity); return fmt::format(getBaseFriendlyName(),
m_moveThing.getFriendlyString());
switch (m_units) {
case Pixel:
text += " pixel";
break;
case TileWidth:
text += " horizontal tile";
break;
case TileHeight:
text += " vertical tile";
break;
case ZoomedPixel:
text += " zoomed pixel";
break;
case ZoomedTileWidth:
text += " zoomed horizontal tile";
break;
case ZoomedTileHeight:
text += " zoomed vertical tile";
break;
case ViewportWidth:
text += " viewport width";
break;
case ViewportHeight:
text += " viewport height";
break;
}
if (m_quantity != 1)
text += "s";
switch (m_direction) {
case Left: text += " left"; break;
case Right: text += " right"; break;
case Up: text += " up"; break;
case Down: text += " down"; break;
}
return text;
} }
Command* CommandFactory::createScrollCommand() Command* CommandFactory::createScrollCommand()

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2017 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -27,9 +27,7 @@ protected:
}; };
ScrollCenterCommand::ScrollCenterCommand() ScrollCenterCommand::ScrollCenterCommand()
: Command("ScrollCenter", : Command("ScrollCenter", CmdUIOnlyFlag)
"Scroll to center of canvas",
CmdUIOnlyFlag)
{ {
} }

View File

@ -12,6 +12,7 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/document.h" #include "app/document.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
@ -19,6 +20,7 @@
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "fmt/format.h"
#include "ui/system.h" #include "ui/system.h"
namespace app { namespace app {
@ -41,9 +43,7 @@ private:
}; };
SelectTileCommand::SelectTileCommand() SelectTileCommand::SelectTileCommand()
: Command("SelectTile", : Command("SelectTile", CmdRecordableFlag)
"Select Tile",
CmdRecordableFlag)
, m_mode(gen::SelectionMode::DEFAULT) , m_mode(gen::SelectionMode::DEFAULT)
{ {
} }
@ -94,7 +94,7 @@ void SelectTileCommand::onExecute(Context* ctx)
// Set the new mask // Set the new mask
Transaction transaction(writer.context(), Transaction transaction(writer.context(),
"Select Tile", friendlyName(),
DoesntModifyDocument); DoesntModifyDocument);
transaction.execute(new cmd::SetMask(doc, mask)); transaction.execute(new cmd::SetMask(doc, mask));
transaction.commit(); transaction.commit();
@ -105,13 +105,18 @@ void SelectTileCommand::onExecute(Context* ctx)
std::string SelectTileCommand::onGetFriendlyName() const std::string SelectTileCommand::onGetFriendlyName() const
{ {
std::string text = "Select Tile"; std::string text;
switch (m_mode) { switch (m_mode) {
case gen::SelectionMode::ADD: text += " (Add)"; break; case gen::SelectionMode::ADD:
case gen::SelectionMode::SUBTRACT: text += " (Subtract)"; break; text = Strings::commands_SelectTile_Add();
break;
case gen::SelectionMode::SUBTRACT:
text = Strings::commands_SelectTile_Subtract();
break;
default:
text = getBaseFriendlyName();;
break;
} }
return text; return text;
} }

Some files were not shown because too many files have changed in this diff Show More