Hello, I have a small problem. I suppose the answer must be quite simple, but no matter how hard I try, I can't achieve what I want to do. I have an eye icon at the top right that allows me to show and hide all the card animations, and it works well. But I would like to create an eye icon for each card, which would allow me to show and hide the animation of only the current card. However, despite all my attempts, it doesn't work. When the eye icon at the top right shows the animation, the eye icon on the card works correctly and can show and hide the animation. But when the eye icon at the top right hides all animations, the eye icon on the card cannot show the animation of the card. My function is called "vision_carte".
init python:
# Initialisation des variables
vision_carte_allan = 1
vision_carte_armin = 1
show_cards = True
def toggle_vision_carte_allan():
global vision_carte_allan, show_cards
vision_carte_allan = 1
show_cards = not show_cards
def toggle_devision_carte_allan():
global vision_carte_allan, show_cards
vision_carte_allan = 0
show_cards = not show_cards
renpy.restart_interaction()
renpy.restart_interaction()
def toggle_vision_carte_armin():
global vision_carte_armin, show_cards_armin
show_cards_armin = not show_cards_armin
renpy.restart_interaction()
screen collection:
tag menu
use game_menu("collection"):
frame:
has vbox
viewport:
draggable True
mousewheel True
text "{size=20}{color=FFFFFF}Collection [persistent.total_carte]/125{/color}{/size}" xpos 0 ypos 0
text "{size=20}{color=FFFFFF}Deck [carte_select]/20{/size}" xpos 210 ypos 0
text "{size=20}{color=FFFFFF}Commun [persistent.carte_commun]/20{/size}" xpos 400 ypos 0
text "{size=20}{color=FFFFFF}Rare [persistent.carte_rare]/20{/size}" xpos 600 ypos 0
text "{size=20}{color=FFFFFF}Super Rare [persistent.carte_super]/20{/size}" xpos 800 ypos 0
text "{size=20}{color=FFFFFF}Ultra Rare [persistent.carte_ultra]/20{/size}" xpos 1050 ypos 0
text "{size=20}{color=FFFFFF}Arme [persistent.carte_arme]/20{/size}" xpos 0 ypos 25
text "{size=20}{color=FFFFFF}Object(Psycho) [persistent.carte_objet]/20{/size}" xpos 150 ypos 25
text "{size=20}{color=FFFFFF}Suspect [persistent.carte_suspect]/20{/size}" xpos 450 ypos 25
text "{size=20}{color=FFFFFF}Hero [persistent.carte_hero]/20{/size}" xpos 600 ypos 25
text "{size=20}{color=FFFFFF}Bleu [persistent.carte_hero]/20{/size}" xpos 750 ypos 25
text "{size=20}{color=FFFFFF}Jaune [persistent.carte_hero]/20{/size}" xpos 950 ypos 25
text "{size=20}{color=FFFFFF}Rouge [persistent.carte_hero]/20{/size}" xpos 1150 ypos 25
fixed:
imagebutton:
xpos 1250
ypos 0
idle "drapeau_anglais_idle.png"
hover "drapeau_anglais_hover.png"
at rikiki
if vision_carte_flag == 1:
imagebutton:
xpos 1325
ypos 30
idle "vision_carte_hover.png"
hover "vision_carte_idle.png"
action [Function(vision_carte_func)]
at rikiki
else:
imagebutton:
xpos 1325
ypos 30
idle "vision_carte_idle.png"
hover "vision_carte_hover.png"
action [Function(devision_carte_func)]
at rikiki
if persistent.carte_allan_lock == 0:
imagebutton:
xpos 0
ypos 50
idle "carte_jeux.png"
hover_sound "bouton.mp3"
at petit
else:
if carte_allan_select == 1:
imagebutton:
xpos 0
ypos 50
idle "carte_allan_idle.png"
hover "carte_allan_hover.png"
hover_sound "bouton.mp3"
at petit
action [Function(deselect_allan), Function(deselection_carte)]
elif carte_allan_select == 0:
imagebutton:
xpos 0
ypos 50
idle "carte_allan_lock_idle.png"
hover "carte_allan_lock_hover.png"
hover_sound "bouton.mp3"
at petit
action [Function(select_allan), Function(selection_carte)]
if show_cards:
if persistent.allan_rouge == 1 and vision_carte_flag == 1 or vision_carte_allan == 1:
add "ultra" xpos 25 ypos 75
elif persistent.allan_jaune == 1 and vision_carte_flag == 1 or vision_carte_allan == 1:
add "super" xpos 25 ypos 75
elif persistent.allan_bleu == 1 and vision_carte_flag == 1 or vision_carte_allan == 1:
add "rare" xpos 25 ypos 75
if persistent.allan_blanc == 1:
imagebutton:
xpos 15
ypos 300
idle "bouton_blanc"
at rikiki
if persistent.allan_bleu == 1:
imagebutton:
xpos 40
ypos 300
idle "bouton_bleu"
at rikiki
if persistent.allan_jaune == 1:
imagebutton:
xpos 115
ypos 300
idle "bouton_jaune"
at rikiki
if persistent.allan_rouge == 1:
imagebutton:
xpos 140
ypos 300
idle "bouton_rouge"
at rikiki
if vision_carte_allan == 1:
imagebutton:
xpos 15
ypos 60
idle "vision_carte_hover.png"
hover "vision_carte_idle.png"
action [Function(toggle_vision_carte_allan)]
at rikiki
else:
imagebutton:
xpos 15
ypos 60
idle "vision_carte_hover.png"
hover "vision_carte_idle.png"
action [Function(toggle_devision_carte_allan)]
at rikiki
imagebutton:
xpos 40
ypos 60
idle "loupe_carte_idle.png"
hover "loupe_carte_hover.png"
hover_sound "bouton.mp3"
at rikiki
action Show("collection_allan")