GetSelectedItemRef

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Returns the form currently highlighted in the active menu. The function returns either a temporary Inventory Reference, or a Base Form, depending on the menu type:

Inventory Reference:

  • Inventory Menu (1002)
  • Container Menu (1008)
  • Pipboy Repair Menu (1035)
  • Barter Menu (1053)
  • Vendor Repair Menu (1058)
  • Item Mod Menu (1061)

Base Form:

  • Pipboy DATA Menu (1023) - Quest/Note/Challenge
  • Pipboy STATS Menu (1003) - Perk

Syntax

[help]
(selectedItem:ref) GetSelectedItemRef

Example

set rItemRef to GetSelectedItemRef 

Notes

  • At least for the Inventory Menu, this function does not work when called from console. For debugging, the following OnKeyDown UDF can be used:
scn GetSelectedItemRefUDF

; Enter this in console to enable it:
; SetOnKeyDownEventHandler GetSelectedItemRefUDF 1 43

; 43:    Back Slash key
; Feel free to use any other scancode.

int	iKeyID

begin Function { iKeyID }

	let ref rItemRef := GetSelectedItemRef
	let short isRef := IsReference rItemRef 
	TestExpr print "GetSelectedItemRefUDF: " + $rItemRef + ", isRef: " + $isRef + ", BaseForm: " + $(rItemRef.gbo)

end
    • Other scancodes are listed here.

See Also