Code: Select all
style inventory_label:
xalign 0.2
style slot:
background Frame("square", 0,0)
minimum(80,80)
maximum(80,80)
xalign 0.5
screen inventory_screen:
style_prefix "inventory"
add "invbg.png"
hbox:
#characters detail/stats and stuff
vbox:
xmaximum 300
spacing 10
label "Character Details"
label "Health Points:[pc.hp]/[pc.max_hp]"
label "Magic Points : [pc.mp]/[pc.max_mp]"
label "Attack : [pc.atk]"
label "Physical Defense : [pc.defense]"
label "Magic Defense : [pc.mdef]"
frame:
style "slot"
if pc.weapon != None:
add pc.weapon.img
else:
label "weapon" xalign 0.5 yalign 0.5 text_size 14
frame:
style "slot"
if pc.armor["head"] != None:
add pc.armor["head"].img
else:
label "head" xalign 0.5 yalign 0.5 text_size 14
frame:
style "slot"
if pc.armor["chest"] !=None:
add pc.armor["chest"].img
else:
label "head" xalign 0.5 yalign 0.5 text_size 14
frame:
style "slot"
if pc.armor["acc"] != None:
add pc.armor["acc"].img
else:
label "accessory" xalign 0.5 yalign 0.5 text_size 14
#Inventory grid
grid 10 7:
yalign 0.2
spacing 5
for item in inventory:
frame:
style "slot"
if isinstance(item, KeyItem):
add "bg keyitem"
imagebutton idle item.img action SetVariable ("selected_item", item)
for i in range(len(inventory), 70):
frame:
style "slot"
#Items info/details
vbox:
spacing 10
label "Current Item" xalign 0.5
if selected_item != None:
frame:
style "slot"
if isinstance(selected_item, KeyItem):
add "bg keyitem"
add selected_item.img
label "Value: [selected_item.value]"
if isinstance (selected_item, Consumable):
textbutton "Use" action Function(selected_item.use, pc)
if isinstance (selected_item, Equipable):
textbutton "Equip" action Function(selected_item.equip, pc)
textbutton "Return":
action Return()
xalign 0.5
yalign 0.95