From bd90f28de8ddd8c424e7fbe3b8827a8a408631f9 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 23 Nov 2024 01:51:26 +0200 Subject: [PATCH] Show tile indices when pressing Control --- src/UI/Canvas/TileModeIndices.gd | 5 +++-- src/UI/TilesPanel.gd | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/UI/Canvas/TileModeIndices.gd b/src/UI/Canvas/TileModeIndices.gd index 980d9c6a5..a577b3bfd 100644 --- a/src/UI/Canvas/TileModeIndices.gd +++ b/src/UI/Canvas/TileModeIndices.gd @@ -2,12 +2,13 @@ extends Node2D func _input(event: InputEvent) -> void: - queue_redraw() + if event.is_action("ctrl"): + queue_redraw() func _draw() -> void: var current_cel := Global.current_project.get_current_cel() - if current_cel is CelTileMap: + if current_cel is CelTileMap and Input.is_action_pressed("ctrl"): var tilemap_cel := current_cel as CelTileMap for i in tilemap_cel.indices.size(): var x := float(tilemap_cel.tileset.tile_size.x) * (i % tilemap_cel.indices_x) diff --git a/src/UI/TilesPanel.gd b/src/UI/TilesPanel.gd index 8c672da38..8328993ea 100644 --- a/src/UI/TilesPanel.gd +++ b/src/UI/TilesPanel.gd @@ -3,8 +3,8 @@ extends PanelContainer enum TileEditingMode { MANUAL, AUTO, STACK } -var current_tileset: TileSetCustom static var tile_editing_mode := TileEditingMode.AUTO +var current_tileset: TileSetCustom @onready var h_flow_container: HFlowContainer = $VBoxContainer/ScrollContainer/HFlowContainer