Code: Select all
if selected_item != None and selected_item < len(inventory):
if isinstance(inventory[selected_item][0], Consumable):
imagebutton:
pos (669,204)
anchor (0.5,0.5)
idle "gui/frames/generic_button_idle.png"
hover "gui/frames/generic_button_hover.png"
action [SetVariable("consumable_text_point",0),SetVariable("consumable_text",inventory[selected_item][0].useItem(pc, False)),Function(removeFromInventory(inventory,selected_item,1)),Show("consumable_screen")]
text "Consume" size 16 color "#000" anchor (0.5,0.5) pos (669,204)What I'd like to happen is you select the item in the inventory, then you get the new buttons. When you click one of those you use the item. This adds a some dialogue describing the effects of the item to a list. Then applies the item effects. Then removes one copy of that item from the inventory. Then displays the 'consumable_screen' which is just a box that displays the dialogue that was grabbed at the beginning. You then click through the dialogue and the consumable screen is closed, returning you to the inventory.
Thank you for any insight you can give me and thanks for reading.