mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-05 06:20:10 +00:00
Change errors UI related to locked/hidden layers to status bar tips
This was mainly done for Ctrl+click, so when we try to move the Background layer, we avoid an annoying message box.
This commit is contained in:
parent
3645ffe2a5
commit
80501899ca
@ -198,14 +198,14 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
|||||||
|
|
||||||
if ((layer) &&
|
if ((layer) &&
|
||||||
(layer->type() == OBJECT_LAYER_IMAGE)) {
|
(layer->type() == OBJECT_LAYER_IMAGE)) {
|
||||||
// TODO you can move the `Background' with tiled mode
|
// TODO we should be able to move the `Background' with tiled mode
|
||||||
if (layer->isBackground()) {
|
if (layer->isBackground()) {
|
||||||
Alert::show(PACKAGE
|
StatusBar::instance()->showTip(1000,
|
||||||
"<<You can't move the `Background' layer."
|
"The background layer cannot be moved");
|
||||||
"||&Close");
|
|
||||||
}
|
}
|
||||||
else if (!layer->isMoveable()) {
|
else if (!layer->isMoveable() || !layer->isWritable()) {
|
||||||
Alert::show(PACKAGE "<<The layer movement is locked.||&Close");
|
StatusBar::instance()->showTip(1000,
|
||||||
|
"Layer '%s' is locked", layer->name().c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Change to MovingCelState
|
// Change to MovingCelState
|
||||||
@ -237,7 +237,8 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
|||||||
Image* image = location.image(&x, &y, &opacity);
|
Image* image = location.image(&x, &y, &opacity);
|
||||||
if (image) {
|
if (image) {
|
||||||
if (!layer->isWritable()) {
|
if (!layer->isWritable()) {
|
||||||
Alert::show(PACKAGE "<<The layer is locked.||&Close");
|
StatusBar::instance()->showTip(1000,
|
||||||
|
"Layer '%s' is locked", layer->name().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +252,8 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
|||||||
// Move selected pixels
|
// Move selected pixels
|
||||||
if (editor->isInsideSelection() && msg->left()) {
|
if (editor->isInsideSelection() && msg->left()) {
|
||||||
if (!layer->isWritable()) {
|
if (!layer->isWritable()) {
|
||||||
Alert::show(PACKAGE "<<The layer is locked.||&Close");
|
StatusBar::instance()->showTip(1000,
|
||||||
|
"Layer '%s' is locked", layer->name().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,24 +298,21 @@ tools::ToolLoop* create_tool_loop(Editor* editor, Context* context)
|
|||||||
|
|
||||||
Layer* layer = editor->layer();
|
Layer* layer = editor->layer();
|
||||||
if (!layer) {
|
if (!layer) {
|
||||||
Alert::show(PACKAGE "<<The current sprite does not have any layer.||&Close");
|
StatusBar::instance()->showTip(1000,
|
||||||
|
"There is no active layer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the active layer is not visible.
|
// If the active layer is not visible.
|
||||||
if (!layer->isReadable()) {
|
if (!layer->isReadable()) {
|
||||||
Alert::show(PACKAGE
|
StatusBar::instance()->showTip(1000,
|
||||||
"<<The current layer is hidden,"
|
"Layer '%s' is hidden", layer->name().c_str());
|
||||||
"<<make it visible and try again"
|
|
||||||
"||&Close");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// If the active layer is read-only.
|
// If the active layer is read-only.
|
||||||
else if (!layer->isWritable()) {
|
else if (!layer->isWritable()) {
|
||||||
Alert::show(PACKAGE
|
StatusBar::instance()->showTip(1000,
|
||||||
"<<The current layer is locked,"
|
"Layer '%s' is locked", layer->name().c_str());
|
||||||
"<<unlock it and try again"
|
|
||||||
"||&Close");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user