Outils pour utilisateurs

Outils du site


en:yaml:imagemaps

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
en:yaml:imagemaps [2026/07/06 00:35] – maj 4.13 : modes d'interface + corrections cyrilfiestaen:yaml:imagemaps [2026/07/15 01:41] (Version actuelle) – maj 4.13 : modes d'interface + corrections cyrilfiesta
Ligne 59: Ligne 59:
   * ''hover-event:'' : id of a local event triggered on hover.   * ''hover-event:'' : id of a local event triggered on hover.
   * ''highlight: true'' : highlights the zone on hover.   * ''highlight: true'' : highlights the zone on hover.
 +  * ''display-color:'' : color used for the highlight or permanent paint.
 +  * ''display-mode:'' : ''fill'' or ''outline''.
 +  * ''state:'' : ''visible'', ''disabled'' or ''invisible''.
  
 ===== Related events ===== ===== Related events =====
Ligne 80: Ligne 83:
 </code> </code>
  
-Usual fields remain available: ''if:'', ''visible-if:''''disabled-if:'', ''do:''''to:'', ''text:'', ''failure-text:'' and ''once:''Zones respect conditions carried by the referenced event.+Related events keep their usual fields: ''if:'', ''do:'', ''to:'', ''text:'', ''failure-text:'' and ''once:''. The ''visible-if:'' and ''disabled-if:'' keys apply to the whole map. To condition a specific zoneuse ''state:'' and its ''if:'' layers. 
 + 
 +===== Zone state ===== 
 + 
 +The state is checked both when the map is displayed and when a click is received. 
 + 
 +^ Value ^ Effect ^ 
 +| ''visible'' | Default state. Clickhover and tooltip work normally. | 
 +''disabled'' | Click and hover highlight are disabled. The tooltip remains available. If ''display-color:'' is setthe zone stays painted. | 
 +''invisible'' | Click, hover and tooltip are disabled. | 
 + 
 +A zone may contain several ''if:'' layers. They are evaluated in order and only replace the keys they declare. 
 + 
 +<code yaml> 
 +zones: 
 +  scene: 
 +    colors: 
 +      color: "#F21010" 
 +        click: find_key 
 +        highlight: true 
 +        if: 
 +          - if: "v_keyfound_v.=.1" 
 +            state: disabled 
 +            display-color: "#777777" 
 +            display-mode: fill 
 +</code> 
 + 
 +A decorative zone may use ''state:'' and ''display-color:'' without a ''click:''A ''disabled'' or ''invisible'' zone cannot be triggered by a forged click sent to the server.
  
 ===== once: zone / once: zone-room ===== ===== once: zone / once: zone-room =====
Ligne 96: Ligne 126:
     do: "bottles.+.1"     do: "bottles.+.1"
 </code> </code>
 +
 +===== once: color / once: color-room =====
 +
 +These values group every separate mask area that uses the same color:
 +
 +  * ''once: color'': the first click consumes the whole color for the rest of the game;
 +  * ''once: color-room'': the first click consumes the whole color until the next room visit.
 +
 +<code yaml>
 +events:
 +  - id: touch_bottles
 +    once: color
 +    text: "Every bottle bears the same symbol."
 +</code>
 +
 +Use ''once: zone'' to handle several same-colored objects separately. Use ''once: color'' when one click should disable them together.
  
 ===== after-click: - marking consumed zones ===== ===== after-click: - marking consumed zones =====
  
-On a zone whose click event carries ''once: zone'' or ''once: zone-room'', the ''after-click:'' key picks how the zone is rendered once clicked:+On a zone whose click event uses one of the ''zone'' or ''color'' modes, the ''after-click:'' key picks how it is rendered once the interaction is consumed:
  
 ^ Value ^ Effect ^ ^ Value ^ Effect ^
Ligne 120: Ligne 166:
 </code> </code>
  
-With ''once: zone'', the marks persist when returning to the room; with ''once: zone-room'', everything re-arms on each visit. +With the ''zone'' and ''color'' variants, marks persist when returning to the room. The ''zone-room'' and ''color-room'' variants reset on each visit.
- +
-===== +
- +
-''once: zone'' is useful when the same mask color contains several separated zones. Each component can then trigger once per room visit. +
- +
-<code yaml> +
-events: +
-  - id: touch_bottle +
-    once: zone +
-    text: "You inspect an empty bottle." +
-    do: "bottles.+.1" +
-</code>+
  
 ===== Inside a HUD ===== ===== Inside a HUD =====
en/yaml/imagemaps.txt · Dernière modification : de cyrilfiesta