; ============================================================================
; Help screen for "Remielle Black - Lewd Hand Toggles"
; Generated by help.py - safe to regenerate, safe to delete.
;
; SELF-CONTAINED. Nothing outside this folder needs editing: the detection
; hooks below are copies of the ones the mod already has, and every global is
; suffixed "remielleblacklewd" so two mods can each ship a help screen without
; clobbering each other. Remove the feature by deleting this file and
; Togglehelp.txt; the mod itself is never touched.
;
; Text is drawn through the current ZZMI API (CommandList\ZZMIv1\PrintText),
; not the deprecated ShaderFixes\help.ini shim.
; ============================================================================

[Constants]
; 1 for exactly the frame in which this character drew. Cleared in [Present].
global $helpactive_remielleblacklewd = 0
; 1 while the help screen is up. Not persisted - a fresh session starts closed.
global $helpshow_remielleblacklewd = 0

; --- Detection --------------------------------------------------------------

; from [TextureOverrideRemielleBlackLegsnBackBlend]
[TextureOverrideHelpremielleblacklewdDetect0]
hash = ff05e5f9
allow_duplicate_hash = true
if DRAW_TYPE == 1
    $helpactive_remielleblacklewd = 1
endif

; from [TextureOverrideRemielleBlackWingsBlend]
[TextureOverrideHelpremielleblacklewdDetect1]
hash = 7b12084f
allow_duplicate_hash = true
if DRAW_TYPE == 1
    $helpactive_remielleblacklewd = 1
endif

; from [TextureOverrideRemielleBlackHairBlend]
[TextureOverrideHelpremielleblacklewdDetect2]
hash = 46eee329
allow_duplicate_hash = true
if DRAW_TYPE == 1
    $helpactive_remielleblacklewd = 1
endif

; from [TextureOverrideRemielleBlackBodyBlend]
[TextureOverrideHelpremielleblacklewdDetect3]
hash = 7f6fe876
allow_duplicate_hash = true
if DRAW_TYPE == 1
    $helpactive_remielleblacklewd = 1
endif

; from [TextureOverrideRemielleBlackMaskBlend]
[TextureOverrideHelpremielleblacklewdDetect4]
hash = 901ac51a
allow_duplicate_hash = true
if DRAW_TYPE == 1
    $helpactive_remielleblacklewd = 1
endif

; --- Toggle -----------------------------------------------------------------
; Use VK_OEM_2 instead of / if a non-US keyboard layout gives trouble.

[KeyHelpToggleremielleblacklewd]
condition = $helpactive_remielleblacklewd == 1
key = no_modifiers /
type = cycle
$helpshow_remielleblacklewd = 0,1

; --- Draw -------------------------------------------------------------------
; PrintText nulls Text/TextParams after every draw, so the assignment has to be
; repeated each frame. The post-clear of $helpactive must stay in [Present] and
; must stay 'post': the key section above reads it before this runs.

[Present]
run = CommandListHelpDrawremielleblacklewd
post $helpactive_remielleblacklewd = 0

[CommandListHelpDrawremielleblacklewd]
if $helpshow_remielleblacklewd == 1 && $helpactive_remielleblacklewd == 1
    Resource\ZZMIv1\Text = ref ResourceHelpTextremielleblacklewd
    Resource\ZZMIv1\TextParams = ref ResourceHelpParamsremielleblacklewd
    run = CommandList\ZZMIv1\PrintText
endif

; --- Resources --------------------------------------------------------------

[ResourceHelpTextremielleblacklewd]
type = buffer
format = R8_UINT
filename = Togglehelp.txt

[ResourceHelpParamsremielleblacklewd]
type = StructuredBuffer
array = 1
data = R32_FLOAT   -.3 -1 0 1      1 0.5 0.5 1    0 0 0 0.5   0.02 0.02     2 2   0   1.5
;                 ^^^^Rectangle^^ | ^^^Colour^^^ | Background  | ^Border^^ | ^ ^ | ^ | ^-- font scale
;                  x1   y1  x2  y2 | r g   b    a | r g b a    | horz vert |  ^  | ^------ text alignment: 0=left 1=center 2=right
;                   range -1:+1   |              | r g b a     | horz vert |  ^----------- h/v-anchor: 0=none 1=left/top 2=center 3=right/bottom
