From cf2a9aaecf0d015a8e11b9b2e7a7d77c39cd00c2 Mon Sep 17 00:00:00 2001 From: Torsten Date: Wed, 26 Nov 2025 09:36:23 +0100 Subject: [PATCH] ... --- hexmapper/scenes/MainMap/map/cursor_map_layer.gd | 6 ++++-- hexmapper/scenes/MainMap/map/map_layer_logic.gd | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hexmapper/scenes/MainMap/map/cursor_map_layer.gd b/hexmapper/scenes/MainMap/map/cursor_map_layer.gd index 3a419fe..6ff24b6 100644 --- a/hexmapper/scenes/MainMap/map/cursor_map_layer.gd +++ b/hexmapper/scenes/MainMap/map/cursor_map_layer.gd @@ -2,6 +2,8 @@ extends TileMapLayer func _unhandled_input(event): if event is InputEventMouseButton: - print("A click reached the ui layer") + pass + #print("A click reached the ui layer") else: - print("Non UI-Layer event:", event) + pass + #print("Non UI-Layer event:", event) diff --git a/hexmapper/scenes/MainMap/map/map_layer_logic.gd b/hexmapper/scenes/MainMap/map/map_layer_logic.gd index 6ff47f4..89237ba 100644 --- a/hexmapper/scenes/MainMap/map/map_layer_logic.gd +++ b/hexmapper/scenes/MainMap/map/map_layer_logic.gd @@ -7,16 +7,17 @@ func _ready(): func _input(event: InputEvent): + if %MapMenuContainer.visible==true: return if event is InputEventMouseButton: if event.pressed==false: return + var mouse_pos = get_viewport().get_mouse_position() - var mouse_pos = get_local_mouse_position() #print("Local Mouse Position:", mouse_pos) - if mouse_pos.y < 0: return # outside of TileMap - var cell_pos = local_to_map(mouse_pos) + if mouse_pos.y < 33: return # outside of TileMap + var cell_pos = local_to_map(get_local_mouse_position()) var source_id = get_cell_source_id(cell_pos) @@ -27,11 +28,11 @@ func _input(event: InputEvent): #Example: Place/erase tile on click if event.button_index == MOUSE_BUTTON_LEFT: - print("Click left") + #print("Click left") var atlas_source_id = self.tile_set.get_source_id(0) # source id of first atlas in TileMapLayer set_cell(cell_pos, atlas_source_id, Vector2i(1, 2)) # Place tile elif event.button_index == MOUSE_BUTTON_RIGHT: - print("Click right") + #print("Click right") set_cell(cell_pos, -1) # Erase tile