mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Add remember new tilemap layer base index (fix #2735)
This commit is contained in:
parent
8c3aac3926
commit
12e59b887f
@ -423,6 +423,9 @@
|
||||
<section id="canvas_size">
|
||||
<option id="trim_outside" type="bool" default="false" />
|
||||
</section>
|
||||
<section id="tileset">
|
||||
<option id="base_index" type="int" default="1" />
|
||||
</section>
|
||||
</global>
|
||||
|
||||
<tool>
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "app/i18n/strings.h"
|
||||
#include "app/load_widget.h"
|
||||
#include "app/modules/gui.h"
|
||||
#include "app/pref/preferences.h"
|
||||
#include "app/restore_visible_layers.h"
|
||||
#include "app/tx.h"
|
||||
#include "app/ui/main_window.h"
|
||||
@ -208,6 +209,9 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
#ifdef ENABLE_UI
|
||||
// If params specify to ask the user about the name...
|
||||
if (params().ask() && context->isUIAvailable()) {
|
||||
auto& pref = Preferences::instance();
|
||||
tilesetInfo.baseIndex = pref.tileset.baseIndex();
|
||||
|
||||
// We open the window to ask the name
|
||||
app::gen::NewLayer window;
|
||||
TilesetSelector* tilesetSelector = nullptr;
|
||||
@ -227,6 +231,8 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
if (window.closer() != window.ok())
|
||||
return;
|
||||
|
||||
pref.tileset.baseIndex(tilesetSelector->getInfo().baseIndex);
|
||||
|
||||
name = window.name()->text();
|
||||
if (tilesetSelector)
|
||||
tilesetInfo = tilesetSelector->getInfo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user