From dd72f182bafb762aae5d807ea1f00f23fff02bb0 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Wed, 11 Mar 2026 12:55:54 +0100 Subject: [PATCH] - [FIX] Encara que es tinga un item seleccionat, es pot treballar amb els items en pantalla --- data/editor.lua | 6 +++--- data/sprites.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/editor.lua b/data/editor.lua index e3403c7..05b244c 100644 --- a/data/editor.lua +++ b/data/editor.lua @@ -105,7 +105,7 @@ editor = { editor.modified = true end if mouse.press(mouse.LEFT) then - if editor.item_selected then + if not editor.item_hovered and not editor.item_dragged and editor.item_selected then map.surf(rooms.surf_items) --print(editor.item_selected) map.tile(tx,ty,editor.item_selected) @@ -118,7 +118,7 @@ editor = { if mouse.press(mouse.RIGHT) then editor.item_selected = nil end - if editor.item_selected then + if not editor.item_hovered and not editor.item_dragged and editor.item_selected then local k = items[editor.item_selected] surf.source(surf_sprites) draw.surf(k.visual.x, k.visual.y, k.visual.w, k.visual.h, mx, my, k.visual.w, k.visual.h, editor.flip) @@ -161,7 +161,7 @@ editor = { if editor.layer==LAYER_ITEMS then if key.press(key.F) then - if editor.item_selected then + if not editor.item_hovered and editor.item_selected then editor.flip = not editor.flip elseif editor.item_hovered then local sprite = sprites.list[editor.item_hovered] diff --git a/data/sprites.lua b/data/sprites.lua index 5728da9..4a32b62 100644 --- a/data/sprites.lua +++ b/data/sprites.lua @@ -573,7 +573,7 @@ sprites = { editor.item_hovered = nil local mx,my = mouse.pos() - if (app.update == editor.update) and (editor.item_selected or editor.layer~=LAYER_ITEMS) then ignore_selected = true end + if (app.update == editor.update) and (editor.layer~=LAYER_ITEMS) then ignore_selected = true end for i,v in ipairs(sprites.list) do if not ignore_selected and app.update == editor.update and mx>=v.pos.x and mx<=v.pos.x+v.size.w and my>=v.pos.y and my<=v.pos.y+v.size.h then editor.item_hovered = i