Skip to content

Commit 792eaa0

Browse files
authored
Editor: Support multiple autotilesets per tile (#3082)
Tiles can now be present in multiple autotilesets in the same tileset. They would be autotileable with all (max. 10) autotilesets they are included in. The editor allows for pressing keys 0-9 to choose from all 10 autotilesets the user can tile with. This is visually indicated in the autotile help strings.
1 parent 2379967 commit 792eaa0

11 files changed

+250
-180
lines changed

data/images/autotiles.satc

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
;; |
1515
;; V
1616
;; Contains :
17-
;; The autotileset name (unused as of writing these lines) : (name "snow")
17+
;; The autotileset name (used as an indicator in the editor) : (name "snow")
1818
;; The name of the autotileset is "snow".
1919
;; The default tile ID (used if no tile matches any mask) : (default 11)
2020
;; If a very special tile is needed (and it doesn't exist), it will use this tile (it's a center tile) by default.
@@ -75,7 +75,7 @@
7575
;; (Contributor, 2020)
7676
;;
7777
;;
78-
;; NOTE : A single id MUST NOT OCCUR MORE THAN ONE AUTOTILE IN THE ENTIRE FILE.
78+
;; NOTE : A single id MUST NOT OCCUR IN MORE THAN ONE AUTOTILE IN AN AUTOTILESET.
7979
;; Otherwise, the behavior is UNDEFINED.
8080

8181
(supertux-autotiles

src/editor/editor.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ Editor::get_tileselect_move_mode() const
410410
return m_toolbox_widget->get_tileselect_move_mode();
411411
}
412412

413+
void
414+
Editor::update_autotileset()
415+
{
416+
m_overlay_widget->update_autotileset();
417+
}
418+
413419
void
414420
Editor::scroll(const Vector& velocity)
415421
{

src/editor/editor.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ class Editor final : public Screen,
124124
void check_deprecated_tiles(bool focus = false);
125125
bool has_deprecated_tiles() const { return m_has_deprecated_tiles; }
126126

127+
void update_autotileset();
128+
127129
/** Checks whether the level can be saved and does not contain
128130
obvious issues (currently: check if main sector and a spawn point
129131
named "main" is present) */

0 commit comments

Comments
 (0)