Code: Select all
init python:
class ITEMS (object):
def __init__ (self, location, isActive, icon, func):
self.location = location
self.isActive = isActive
self.icon = icon
self.func = func
Objects = []
Objects.append(ITEMS("2nd Floor Hallway", True, "items/pawn.png", "pawn_00"))
screen items():
for q in Objects:
if q.location.lower() == location and q.isActive:
imagebutton:
idle q.icon
hover q.icon
focus_mask True
action SetVariable("clickType", "items"), Return(q.func)
label start:
if clickType == "items":
call expression UIreturn
label pawn_00:
"I took a pawn"
return
As i think i should put somewhere after "action" in "screen items" something like q.isActive=False to make object not active anymore. But i dont know syntax good enough Help pls.