bottle-rinse-repeat/src/EBxOnControlUp.gek

39 lines
895 B
Plaintext
Raw Normal View History

2022-07-23 15:38:20 +00:00
scn EBxOnControlUp
int iControl
ref rSource
string_var sPrompt
begin function { iControl }
SetGameMainLoopCallback EBxOnCrosshairTracker 0
SetOnControlUpEventHandler EBxOnControlUp 0 5
EnableControl 5
let rSource := GetCrosshairRef
call EBxFillFromObject rSource
if GetCrosshairWater
let sPrompt := playerRef.AuxiliaryVariableGetString "*sDrinkPrompt"
elseif eval (sPrompt := rSource.GetActivatorPrompt) == ""
let sPrompt := playerRef.AuxiliaryVariableGetString "*sActivatePrompt"
endif
if GetUIFloat "HUDMainMenu\_DUIF3" > 0 ; DarnUI
SetUIStringAlt "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" $sPrompt
else
SetUIStringAlt "HUDMainMenu/Info/justify_center_hotrect/string" $sPrompt
endif
sv_destruct sPrompt
if IsFormValid rSource
if rSource.HasScriptBlock 2
rSource.Activate playerRef 1
endif
endif
end