Even if I read carfully this page https://www.renpy.org/doc/html/screen_a ... magebutton,
I can't find a way to do what I want.
I have this imagebutton in the mainscreen :
Code: Select all
screen inventory_main:
modal True
add "gui/Inventory_bar_simple.png" xpos 0.0015 ypos 0.75
imagebutton:
xpos 0.174 ypos 0.75
idle "gui/Inventory_bar_simple_button_blank.png"
hover "gui/Inventory_bar_simple_button_hover.png"
action [ToggleScreen("inventory_main_button_trash"), ToggleScreen("inventory_main_button_equip")]
Code: Select all
screen inventory_main_button_trash:
# modal True
imagebutton:
xpos 0.174 ypos 0.75
idle "gui/inventory_main_button_trash.png"
hover "gui/inventory_main_button_trash_hover.png"
action [ToggleScreen("container_trash"), 'THE DIFFICULT PART IS HERE"]
The variable ("container") will have to switch between this to
container=container_trash
container=container
First I used the "call" fonction in the action line, like this :
Code: Select all
action [ToggleScreen("container_trash"), Function(toggle_trash)]
Code: Select all
label inventory_main_activate_trash:
if trash_session:
$ container=container
$ trash_session=False
else:
$ container=container_trash
$ trash_session=True
Code: Select all
action [ToggleScreen("container_trash"), Function(toggle_trash)]
Code: Select all
init -1 python:
def toggle_trash():
if trash_session:
container=container
trash_session=False
else:
container=container_trash
trash_session=True
So if someone is enough talented in Python can help me understand the error or give me a better and cleaner way to do what I want I would be really grateful !
Thanks