mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 00:23:48 +00:00
Change TilesetMode names: Manual/Auto/Stack
This commit is contained in:
parent
2bb8dc93af
commit
f2abf09bbf
@ -420,8 +420,8 @@
|
||||
<part id="outline_full_pixel" x="214" y="224" w="5" h="5" />
|
||||
<part id="tiles" x="144" y="208" w="6" h="6" />
|
||||
<part id="tiles_manual" x="150" y="208" w="6" h="6" />
|
||||
<part id="tiles_semi" x="156" y="208" w="6" h="6" />
|
||||
<part id="tiles_auto" x="162" y="208" w="6" h="6" />
|
||||
<part id="tiles_auto" x="156" y="208" w="6" h="6" />
|
||||
<part id="tiles_stack" x="162" y="208" w="6" h="6" />
|
||||
</parts>
|
||||
<styles>
|
||||
<style id="box" />
|
||||
|
@ -350,8 +350,8 @@ Engine::Engine()
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, "TilesetMode");
|
||||
setfield_integer(L, "MANUAL", TilesetMode::Manual);
|
||||
setfield_integer(L, "SEMI", TilesetMode::Semi);
|
||||
setfield_integer(L, "AUTO", TilesetMode::Auto);
|
||||
setfield_integer(L, "STACK", TilesetMode::Stack);
|
||||
lua_pop(L, 1);
|
||||
|
||||
// Register classes/prototypes
|
||||
|
@ -14,8 +14,8 @@ namespace app {
|
||||
// tilemap is edited.
|
||||
enum class TilesetMode {
|
||||
Manual, // Modify existent tiles (don't create new ones)
|
||||
Semi, // Auto-generate new tiles if needed, edit existent ones
|
||||
Auto, // Auto-generate new and modified tiles
|
||||
Auto, // Add/remove tiles automatically when needed
|
||||
Stack, // Stack modified tiles as new ones
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -165,7 +165,7 @@ ColorBar::ColorBar(int align, TooltipManager* tooltipManager)
|
||||
, m_lastButtons(kButtonLeft)
|
||||
, m_editMode(false)
|
||||
, m_tilesMode(false)
|
||||
, m_tilesetMode(TilesetMode::Semi)
|
||||
, m_tilesetMode(TilesetMode::Auto)
|
||||
, m_redrawTimer(250, this)
|
||||
, m_redrawAll(false)
|
||||
, m_implantChange(false)
|
||||
@ -182,12 +182,12 @@ ColorBar::ColorBar(int align, TooltipManager* tooltipManager)
|
||||
m_tilesButton.addItem(theme->parts.tiles());
|
||||
|
||||
static_assert(0 == int(TilesetMode::Manual) &&
|
||||
1 == int(TilesetMode::Semi) &&
|
||||
2 == int(TilesetMode::Auto), "Tileset mode buttons doesn't match TilesetMode enum values");
|
||||
1 == int(TilesetMode::Auto) &&
|
||||
2 == int(TilesetMode::Stack), "Tileset mode buttons doesn't match TilesetMode enum values");
|
||||
|
||||
m_tilesetModeButtons.addItem(theme->parts.tilesManual());
|
||||
m_tilesetModeButtons.addItem(theme->parts.tilesSemi());
|
||||
m_tilesetModeButtons.addItem(theme->parts.tilesAuto());
|
||||
m_tilesetModeButtons.addItem(theme->parts.tilesStack());
|
||||
setTilesetMode(m_tilesetMode);
|
||||
|
||||
m_paletteView.setColumns(8);
|
||||
@ -1420,11 +1420,11 @@ void ColorBar::setupTooltips(TooltipManager* tooltipManager)
|
||||
tooltipManager->addTooltipFor(
|
||||
m_tilesButton.getItem(0), "Show/Hide Tileset", BOTTOM);
|
||||
tooltipManager->addTooltipFor(
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Manual), "Manual-mode: Modify existent tiles,\ndon't create new tiles automatically", BOTTOM);
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Manual), "Manual: Modify existent tiles,\ndon't create new tiles automatically", BOTTOM);
|
||||
tooltipManager->addTooltipFor(
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Semi), "Semi-mode: Modify and reuse existent tiles,\ncreate/delete tiles if needed/possible", BOTTOM);
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Auto), "Auto: Modify and reuse existent tiles,\ncreate/delete tiles if needed/possible", BOTTOM);
|
||||
tooltipManager->addTooltipFor(
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Auto), "Auto-mode: Don't modify existent tiles,\ngenerate new tiles automatically only", BOTTOM);
|
||||
m_tilesetModeButtons.getItem((int)TilesetMode::Stack), "Stack: Don't modify existent tiles,\ngenerate and stack new tiles automatically", BOTTOM);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -407,7 +407,7 @@ void modify_tilemap_cel_region(
|
||||
|
||||
// Autogenerate tiles
|
||||
if (tilesetMode == TilesetMode::Auto ||
|
||||
tilesetMode == TilesetMode::Semi) {
|
||||
tilesetMode == TilesetMode::Stack) {
|
||||
doc::TilesetHashTable hashImages; // TODO the hashImages should be inside the Tileset
|
||||
{
|
||||
// Add existent tiles in the hash table
|
||||
@ -451,7 +451,7 @@ void modify_tilemap_cel_region(
|
||||
const doc::tile_index ti = doc::tile_geti(t);
|
||||
const doc::ImageRef existenTileImage = tileset->get(ti);
|
||||
|
||||
if (tilesetMode == TilesetMode::Semi)
|
||||
if (tilesetMode == TilesetMode::Auto)
|
||||
modifiedTileIndexes[ti] = true;
|
||||
|
||||
const gfx::Rect tileInCanvasRc(grid.tileToCanvas(tilePt), tileSize);
|
||||
@ -465,7 +465,7 @@ void modify_tilemap_cel_region(
|
||||
if (it != hashImages.end()) {
|
||||
tileIndex = it->second; // TODO
|
||||
|
||||
if (tilesetMode == TilesetMode::Semi) {
|
||||
if (tilesetMode == TilesetMode::Auto) {
|
||||
if (tileIndex >= 0 && tileIndex < modifiedTileIndexes.size())
|
||||
modifiedTileIndexes[tileIndex] = false;
|
||||
}
|
||||
@ -507,7 +507,7 @@ void modify_tilemap_cel_region(
|
||||
}
|
||||
|
||||
// Remove unused tiles
|
||||
if (tilesetMode == TilesetMode::Semi) {
|
||||
if (tilesetMode == TilesetMode::Auto) {
|
||||
// TODO reuse tiles that will be removed in the algorithm above
|
||||
remove_unused_tiles_from_tileset(cmds, tileset, modifiedTileIndexes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user