Add "survol"/"fin_survol" trigger events (mouseenter/mouseleave, same anti-doublon pattern as bindClicks()) so hovering an element can run flow nodes, instead of the old static hover-text-only control removed from the properties panel. Also add "Contenu" as a settable "Modifier un élément" property so an action can display a defined text on another element on hover — the concrete use case that motivated this. Verified live with Playwright: a "Au survol" trigger on one element correctly updates another element's text via the action, and text stays put with no "Fin du survol" wired (explicit, no implicit revert, consistent with "Au clic").
47 lines
2.3 KiB
Python
47 lines
2.3 KiB
Python
# ---------- Actions : modifier un élément ----------
|
|
|
|
ELEMENT_ACTION_PROPERTIES = [
|
|
("visibilite", "Visibilité"),
|
|
# Voir TRIGGER_EVENTS ("survol"/"fin_survol") : c'est ce qui permet à un
|
|
# créateur de reconstruire l'ancien comportement "texte affiché au
|
|
# survol" (et bien d'autres) à la main dans la Logique de la scène —
|
|
# poser "Modifier un élément → Contenu" sur un déclencheur "Au survol"
|
|
# d'un AUTRE élément. La valeur est un texte littéral (pas encore de
|
|
# binding vers un champ d'objet ici — voir applyOpenRowBindings pour le
|
|
# mécanisme équivalent, propre à "Ouvrir la ligne cliquée").
|
|
("contenu", "Contenu — texte affiché"),
|
|
("bg_color", "Couleur de fond"),
|
|
("border_color", "Couleur de bordure"),
|
|
("width", "Largeur en %"),
|
|
("height", "Hauteur en %"),
|
|
# 3.3 (Confort) — surbrillance générique dynamique : un liseré qui
|
|
# clignote autour de l'élément, pour attirer l'attention du joueur vers
|
|
# ce qu'il doit toucher ensuite (ex. un mentor qui "montre" un bouton) —
|
|
# sans avoir à poser une bordure de couleur togglée à la main. Voir
|
|
# ELEMENT_SURBRILLANCE_VALUES et applyElementProperty() dans play.html.
|
|
("surbrillance", "Surbrillance — liseré clignotant"),
|
|
# 3.5 (Confort) — verrouillage d'un élément après décision : grisé +
|
|
# ignore les clics, DISTINCT de "invisible" (qui garde sa place mais
|
|
# disparaît visuellement) — un bouton "Répondre" qui reste visible mais
|
|
# devient inerte une fois le mail traité, par exemple. Voir
|
|
# ELEMENT_DESACTIVE_VALUES et applyElementProperty() / bindClicks() dans
|
|
# play.html (pointer-events:none empêche aussi le déclencheur "Au clic"
|
|
# de se redéclencher tant que l'élément est désactivé).
|
|
("desactive", "Désactivé — grisé, ignore les clics"),
|
|
]
|
|
ELEMENT_ACTION_PROPERTY_LABELS = dict(ELEMENT_ACTION_PROPERTIES)
|
|
|
|
ELEMENT_SURBRILLANCE_VALUES = [
|
|
("on", "Activer la surbrillance"),
|
|
("off", "Désactiver la surbrillance"),
|
|
("toggle", "Basculer activée / désactivée"),
|
|
]
|
|
ELEMENT_SURBRILLANCE_LABELS = dict(ELEMENT_SURBRILLANCE_VALUES)
|
|
|
|
ELEMENT_DESACTIVE_VALUES = [
|
|
("on", "Désactiver — griser, ignorer les clics"),
|
|
("off", "Réactiver"),
|
|
("toggle", "Basculer désactivé / réactivé"),
|
|
]
|
|
ELEMENT_DESACTIVE_LABELS = dict(ELEMENT_DESACTIVE_VALUES)
|