Thanks to Remix i mangage to get a first working result for my inventory system.
But now I am trying really hard to find a way to handle the fonction to make a button sensitive or insensitive.
Iam not talking about hovering. The hovered button works fine. But sometime I want it to be disabeled (but not hidden) in order to use the insensitive image button (the button will be gray).
So please if someone could take a look at this and tell me :
1 - What is the syntax for using the insensitive button fonction,
2 - What's the best way to impement it in this code.
3 - The best for me will be to find a way to order my button to become sensitive/insensitive from my story progression label (in script folder, not screen folder).
Exemple :
label dialog_with_jessica:
e "blabla"
j "Did you have an apple on you ?"
---> here : make button inventory sensitive.
PS : I know this is a really specific request but I am just hoping their is a person aroud here who has some experience with this insensitive shit. So thank you in advance!
ILLUSTRATION OF THE CODE :
The following images are the result of my code right now. Its just to illustrate what we are talking about.
Image 1 : here you can see the story in progress, and a little inventory button on the right of the say window. Image 2 : here you can see the story in progress, and the hovered image of my little inventory button when the player pass the mouse on it. Image 3 : here you can see the story stop temporarily and display the inventory bar when the players click the inventory button. Image 4 : this is what happens when the player hit again the inventory button on the right. This come back to the story progression.
THE CODE :
Code: Select all
image 0-0-inv_bar_simple = "gui/Inventory_bar_simple.png"
image 0-0-inv-butt-small = "gui/inventory_button.png"
image 0-0-inv-butt-small-hover = "gui/inventory_button_hover.png"
image 0-0-inv-butt-small-insensitive = "gui/inventory_button_insensitive.png"
screen say(who, what):
style_prefix "say"
window:
id "window"
if show_inventory:
pass
else:
text what id "what"
if who is not None:
window:
style "namebox"
text who id "who"
imagebutton:
keysym "i"
xpos 0.806 ypos 0.859
insensitive "0-0-inv-butt-small-insensitive"
idle "0-0-inv-butt-small"
hover "0-0-inv-butt-small-hover"
action [ToggleVariable( "show_inventory" ), Show("inventory_main")]
screen inventory_main:
modal True
add "gui/Inventory_bar_simple.png" xpos 0.0015 ypos 0.75
#Here i will add all the inventory fonctionnality (displaying item in the slot, etc)
imagebutton:
keysym "i"
xpos 0.806 ypos 0.859
insensitive "0-0-inv-butt-small-insensitive"
idle "0-0-inv-butt-small"
hover "0-0-inv-butt-small-hover"
action [ToggleVariable( "show_inventory" ), Hide("inventory_main")]