mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 21:19:10 +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">
|
<section id="canvas_size">
|
||||||
<option id="trim_outside" type="bool" default="false" />
|
<option id="trim_outside" type="bool" default="false" />
|
||||||
</section>
|
</section>
|
||||||
|
<section id="tileset">
|
||||||
|
<option id="base_index" type="int" default="1" />
|
||||||
|
</section>
|
||||||
</global>
|
</global>
|
||||||
|
|
||||||
<tool>
|
<tool>
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "app/i18n/strings.h"
|
#include "app/i18n/strings.h"
|
||||||
#include "app/load_widget.h"
|
#include "app/load_widget.h"
|
||||||
#include "app/modules/gui.h"
|
#include "app/modules/gui.h"
|
||||||
|
#include "app/pref/preferences.h"
|
||||||
#include "app/restore_visible_layers.h"
|
#include "app/restore_visible_layers.h"
|
||||||
#include "app/tx.h"
|
#include "app/tx.h"
|
||||||
#include "app/ui/main_window.h"
|
#include "app/ui/main_window.h"
|
||||||
@ -208,6 +209,9 @@ void NewLayerCommand::onExecute(Context* context)
|
|||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
// If params specify to ask the user about the name...
|
// If params specify to ask the user about the name...
|
||||||
if (params().ask() && context->isUIAvailable()) {
|
if (params().ask() && context->isUIAvailable()) {
|
||||||
|
auto& pref = Preferences::instance();
|
||||||
|
tilesetInfo.baseIndex = pref.tileset.baseIndex();
|
||||||
|
|
||||||
// We open the window to ask the name
|
// We open the window to ask the name
|
||||||
app::gen::NewLayer window;
|
app::gen::NewLayer window;
|
||||||
TilesetSelector* tilesetSelector = nullptr;
|
TilesetSelector* tilesetSelector = nullptr;
|
||||||
@ -227,6 +231,8 @@ void NewLayerCommand::onExecute(Context* context)
|
|||||||
if (window.closer() != window.ok())
|
if (window.closer() != window.ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
pref.tileset.baseIndex(tilesetSelector->getInfo().baseIndex);
|
||||||
|
|
||||||
name = window.name()->text();
|
name = window.name()->text();
|
||||||
if (tilesetSelector)
|
if (tilesetSelector)
|
||||||
tilesetInfo = tilesetSelector->getInfo();
|
tilesetInfo = tilesetSelector->getInfo();
|
||||||
|
Loading…
Reference in New Issue
Block a user