[ENH] Mapa modificat

[NEW] Capacitat per a habilitar/deshabilitar el hint al obrir una porta
This commit is contained in:
2026-05-23 22:17:31 +02:00
parent 4759767823
commit a8aa041000
2 changed files with 12 additions and 2 deletions
+4 -2
View File
@@ -1,11 +1,12 @@
trigger={}
function trigger.new(_hab,_x,_y,_action,_escena,_id,_type,_doors,_linked_id)
function trigger.new(_hab,_x,_y,_action,_escena,_id,_type,_doors,_linked_id,_remote_view)
local world_x, world_y = coords.room_to_world(_hab,_x,_y)
_bb={x=0,y=0,w=16,h=16} --default
-- if _type=="switch" then _bb={x=0,y=0,w=16,h=17} end
-- if _id then print("NEW => ".._id) end
_type = _type or "invisible"
if _remote_view==nil then _remote_view=true end
return {
name="trigger",
type=_type,
@@ -18,6 +19,7 @@ function trigger.new(_hab,_x,_y,_action,_escena,_id,_type,_doors,_linked_id)
h=16,
fun=_action,
doors=_doors,
remote_view=_remote_view,
update=trigger.update,
draw=trigger.draw,
linked_id=_linked_id,
@@ -76,7 +78,7 @@ triggers={}
function triggers:open_door()
local hab= self.doors[1]-1
if hab~=abad.hab then
if hab~=abad.hab and self.remote_view then
remote_view(hab)
end
for i=2,#self.doors do