104 lines
2.6 KiB
Plaintext
104 lines
2.6 KiB
Plaintext
scn CWxScannerQuestScript
|
|
|
|
ref rTarget
|
|
ref rNewTarget
|
|
int iControl
|
|
|
|
begin GameMode
|
|
|
|
if IsControlPressed 6 == 0 ; not aiming
|
|
call CWxScannerStop
|
|
return
|
|
endif
|
|
|
|
set rNewTarget to ObjectUnderReticle 0 10240
|
|
|
|
if rTarget == rNewTarget
|
|
|
|
if rTarget
|
|
|
|
; If we approach NPC, holding zoom, the interaction prompt will change to "Talk".
|
|
; As normal activation is temporarily disabled, we need to change it back to "Scan".
|
|
|
|
|
|
if GetUIFloat "HUDMainMenu\_DUIF3" > 0 ; DarnUI
|
|
|
|
if eval GetUIString "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" != "Scan"
|
|
SetUIString "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" "Scan"
|
|
endif
|
|
|
|
if GetUIFloat "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/visible" != 1
|
|
SetUIFloat "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/visible" 1
|
|
endif
|
|
|
|
else
|
|
|
|
if eval GetUIString "HUDMainMenu/Info/justify_center_hotrect/string" != "Scan"
|
|
SetUIString "HUDMainMenu/Info/justify_center_hotrect/string" "Scan"
|
|
endif
|
|
|
|
if GetUIFloat "HUDMainMenu/Info/justify_center_hotrect/visible" != 1
|
|
SetUIFloat "HUDMainMenu/Info/justify_center_hotrect/visible" 1
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
return
|
|
endif
|
|
|
|
set rTarget to rNewTarget
|
|
|
|
if rTarget != 0
|
|
if rTarget.GetObjectType == 42 || rTarget.GetObjectType == 43
|
|
if rTarget.GetDead
|
|
set rTarget to 0
|
|
endif
|
|
else
|
|
set rTarget to 0
|
|
endif
|
|
endif
|
|
|
|
; When new target or none, hide report
|
|
; SetStage CWxScannerTextQuest 0
|
|
|
|
if rTarget == 0
|
|
if GetUIFloat "HUDMainMenu\_DUIF3" > 0 ; DarnUI
|
|
if eval GetUIString "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" == "Scan"
|
|
SetUIFloat "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/visible" 0
|
|
endif
|
|
else
|
|
if eval GetUIString "HUDMainMenu/Info/justify_center_hotrect/string" == "Scan"
|
|
SetUIFloat "HUDMainMenu/Info/justify_center_hotrect/visible" 0
|
|
endif
|
|
endif
|
|
|
|
SetOnControlDownEventHandler CWxScannerOnScan 0 5
|
|
EnableControl 5
|
|
;playSound OBJSwitchButtonBFail
|
|
return
|
|
endif
|
|
|
|
set iControl to GetControl 5
|
|
|
|
if GetUIFloat "HUDMainMenu\_DUIF3" > 0 ; DarnUI
|
|
SetUIStringEx "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/_PCButtonText" "%k)" iControl
|
|
SetUIString "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" "Scan"
|
|
SetUIFloat "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/visible" 1
|
|
else
|
|
SetUIStringEx "HUDMainMenu/Info/justify_center_hotrect/_PCButtonText" "%k)" iControl
|
|
SetUIString "HUDMainMenu/Info/justify_center_hotrect/string" "Scan"
|
|
SetUIFloat "HUDMainMenu/Info/justify_center_hotrect/visible" 1
|
|
endif
|
|
|
|
SetOnControlDownEventHandler CWxScannerOnScan 1 5
|
|
DisableControl 5
|
|
|
|
end
|
|
|
|
begin MenuMode
|
|
call CWxScannerStop
|
|
end
|
|
|