bottle-rinse-repeat/src/EBxActivateWaterSource.gek

42 lines
993 B
Plaintext
Raw Normal View History

2022-07-24 14:13:55 +00:00
scn EBxActivateWaterSource
ref rSource
string_var sPrompt
begin function {}
SetGameMainLoopCallback EBxOnCrosshairTracker 0
SetOnControlDownEventHandler EBxOnControlDown 0 5
;SetOnControlUpEventHandler EBxOnControlUp 0 5
;EnableControl 5
let rSource := GetCrosshairRef
if GetCrosshairWater
let sPrompt := playerRef.AuxiliaryVariableGetString "*sDrinkPrompt"
elseif eval IsFormValid rSource && (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
MessageEx "filling bottles"
call EBxFillFromObject rSource
if rSource.HasScriptBlock 2
rSource.Activate playerRef 1
endif
endif
end