[Editor] Clean some code
This commit is contained in:
@@ -2,7 +2,6 @@ package com.bartlomiejpluta.base.editor.autotile.canvas
|
||||
|
||||
import com.bartlomiejpluta.base.editor.map.model.brush.AutoTileBrush
|
||||
import com.bartlomiejpluta.base.editor.map.model.layer.AutoTileLayer
|
||||
import com.bartlomiejpluta.base.editor.map.model.layer.TileLayer
|
||||
import com.bartlomiejpluta.base.editor.map.viewmodel.BrushVM
|
||||
import com.bartlomiejpluta.base.editor.map.viewmodel.EditorStateVM
|
||||
import com.bartlomiejpluta.base.editor.map.viewmodel.GameMapVM
|
||||
@@ -24,7 +23,7 @@ class AutoTileSelection(private val editorStateVM: EditorStateVM, private val ga
|
||||
|
||||
if (editorStateVM.selectedLayer is AutoTileLayer) {
|
||||
val autoTile = (editorStateVM.selectedLayer as AutoTileLayer).autoTile
|
||||
(brushVM.item as AutoTileBrush).id = (1 + row * autoTile.columns + column).toInt() //((column % autoTile.columns).toInt()) + row.toInt() + 1
|
||||
(brushVM.item as AutoTileBrush).id = (1 + row * autoTile.columns + column).toInt()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@ class AutoTile(uid: String, name: String, image: Image, rows: Int, columns: Int)
|
||||
val bottomRightCornerTile = cropTile(tileSet, 1, 2)
|
||||
|
||||
/*
|
||||
* Indexes:
|
||||
* 0 - No connected tiles
|
||||
* 1 - Left tile is connected
|
||||
* 2 - Right tile is connected
|
||||
* 3 - Left and Right tiles are connected
|
||||
* 4 - Left, Right, and Center tiles are connected.
|
||||
*/
|
||||
* Indexes:
|
||||
* 0 - No connected tiles
|
||||
* 1 - Left tile is connected
|
||||
* 2 - Right tile is connected
|
||||
* 3 - Left and Right tiles are connected
|
||||
* 4 - Left, Right, and Center tiles are connected.
|
||||
*/
|
||||
val (tl3, tr3, bl3, br3) = cutSubTiles(crossTile)
|
||||
val (tl0, tr2, bl1, br4) = cutSubTiles(topLeftCornerTile)
|
||||
val (tl1, tr0, bl4, br2) = cutSubTiles(topRightCornerTile)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
package com.bartlomiejpluta.base.editor.map.model.brush
|
||||
|
||||
class AutoTileBrush : Brush() {
|
||||
var id = 0
|
||||
}
|
||||
class AutoTileBrush(var id: Int = 0) : Brush()
|
||||
@@ -58,7 +58,7 @@ class MapView : View() {
|
||||
|
||||
private fun determineBrush(layer: Layer?) : Brush? = when (layer) {
|
||||
is TileLayer -> TileBrush((arrayOf(arrayOf(layer.tileSetProperty.value.tiles[0]))))
|
||||
is AutoTileLayer -> AutoTileBrush()
|
||||
is AutoTileLayer -> AutoTileBrush(1)
|
||||
is ObjectLayer -> PassageAbilityBrush()
|
||||
else -> null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user