You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
993 B

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