// Pseudo-actionscript documentation for additional functions added by SKSE
// I don't really know actionscript well, so the syntax will probably be not totally correct.

dynamic intrinsic class skse
{
	// Enable text input for Scaleform UI components.
	// Each 'true' call must be matched with a 'false' call, or text input will remain enabled.
	function AllowTextInput(allow : Boolean) : Void;
	
	// Write a string to skse.log.
	function Log(str : String) : Void;
	
	// Change an INI setting.
	// The setting's name must contain the section, for example "fUIMistMenu_CameraX_G:Interface".
	// Currently only numeric settings are supported.
	function SetINISetting(settingName : String, data : Number) : Void;
	function GetINISetting(settingName : String) : Number;
	
	// Open a menu. Known menu names:
	// "Inventory Menu"
	// "Console"
	// "Dialogue Menu"
	// "HUD Menu"
	// "Main Menu"
	// "MessageBoxMenu"
	// "Cursor Menu"
	// "Fader Menu"
	// "Magic Menu"
	// "Top Menu"
	// "Overlay Menu"
	// "Overlay Interaction Menu"
	// "Loading Menu"
	// "Tween Menu"
	// "Barter Menu"
	// "Gift Menu"
	// "Debug Text Menu"
	// "Map Menu"
	// "Lockpicking Menu"
	// "Quantity Menu"
	// "Stats Menu"
	// "Container Menu"
	// "Sleep/Wait Menu"
	// "LevelUp Menu"
	// "Journal Menu"
	// "Book Menu"
	// "Favorites Menu"
	// "RaceSex Menu"
	// "Crafting Menu"
	// "Training Menu"
	// "Mist Menu"
	// "Tutorial Menu"
	// "Credits Menu"
	// "TitleSequence Menu"
	// "Console Native UI Menu"
	function OpenMenu(menuName : String) : Void;
	function CloseMenu(menuName : String) : Void;
	
	// Enable extended data for item cards and favorites menu
	// ### this is out of date, see ScaleformExtendedData.cpp ###
	// common data for all objects:
	//	var extended : Boolean;		// always set to true
	//	var formType : Number;		// object type (see GameForms.h for a list)
	//	var formId : Number;		// form's ID number
	// if an object can have keywords:
	//	var keywords : Object;		// object containing a boolean set to true, named after each keyword
	// data for armor:
	//	var armor : Number;			// armor value
	//	var partMask : Number;		// body parts used, see BGSBipedObjectForm for a list
	//	var weightClass : Number;	// 0 - light, 1 - heavy, 2 - none
	// data for weapons:
	//	var subType : Number;		// specific weapon type (see TESObjectWEAP::DataC4 in GameObjects.h)
	//	var damage : Number;		// damage
	//	var speed : Number;			// speed
	//	var reach : Number;			// reach
	//	var stagger : Number;		// stagger
	//	var critDamage : Number;	// crit damage
	//	var	minRange : Number;		// min range
	//	var	maxRange : Number;		// max range
	// data for ammo:
	//	var damage : Number;		// damage
	// data for spells/scrolls/ingredients/potions:
	//	var subType : Number;		// strongest effect's magic school
	//	var skillLevel : Number;	// strongest effect's skill level
	//	var magnitude : Number;		// strongest effect's magnitude
	//	var duration : Number;		// strongest effect's duration
	//	var actorValue : Number;	// strongest effect's actor value
	//	var magicType : Number;		// strongest effect's magic type
	// data for soul gems:
	//	var soulSize : Number;		// captured soul size (0 = none, 5 = grand)
	//	var gemSize : Number;		// gem capacity (1 = petty, 5 = grand)
	// data for potions:
	//	var flags : Number;			// flags (see AlchemyItem)
	// data for books:
	//  var bookType : Number;		// 0 - none, 1 - skill, 4 - spell
	//  var teachesSkill : Number;	// present on skill books, index of the skill the book teaches
	//  var teachesSpell : Number;	// present on spell books, form ID of the spell the book teaches, or -1 on error
	// data for messages:
	//	var buttons[] : String;
	function ExtendData(enable : Boolean) : Void;
	
	// forces containers to show categories like NPCs
	function ForceContainerCategorization(enable : Boolean) : Void;
	
	// send an event to SKSE's papyrus event dispatcher
	// strArg, numArg, formIDArg are optional
	function SendModEvent(eventName : String, strArg : String, numArg : Number, formIDArg : Number) : Void;
	
	// write the current magic effects active on the player to the outEffects array
	//	var	duration : Number;
	//	var	elapsed : Number;
	//	var	effectFlags : Number;
	//	var	subType : Number;
	//	var	archetype : Number;
	//	var	actorValue : Number;
	//	var	magicType : Number;
	function RequestActivePlayerEffects(outEffects : Object) : Void;
	
	// request details about a form
	// same format as ExendData
	// extra and recursive are optional
	function ExtendForm(formID : Number, outData : Object, extra : Boolean, recursive : Boolean) : Void;
	
	// request details about an actor value
	//	var	base : Number;
	//	var	current : Number;
	//	var	maximum : Number;
	function RequestActorValue(formID : Number, actorValue : Number, outData : Object) : Void;
	
	// returns the keycode mapped to an input event
	// device types:
	//	0	keyboard
	//	1	mouse
	//	2	gamepad
	// contexts:
	//	0	gameplay
	//	1	menumode
	//	2	console
	//	3	item menu
	//	4	inventory
	//	5	debug text
	//	6	favorites
	//	7	map
	//	8	stats
	//	9	cursor
	//	10	book
	//	11	debug overlay
	//	12	journal
	//	13	TFC mode
	//	14	map debug
	//	15	lockpicking
	//	16	favor
	function GetMappedKey(name : String, deviceType : Number, contextIdx : Number) : Number;
	
	// enters input event rebind mode
	// callbackObject.EndRemapMode(keyCode : Number) will be called when the next input event occurs
	function StartRemapMode(callbackObject : Object);

	// gets name of the last control detected by the SKSE input handler
	// bKeyDown specifies whether it's the last pressed or released control
	function GetLastControl(bKeyDown : Boolean) : String;

	// gets the last keycode detected by the SKSE input handler
	// bKeyDown specifies whether it's the last pressed or released key
	function GetLastKeycode(bKeyDown : Boolean) : Number;

	// enables mouse wheel events to trigger onMouseWheel for the MapMenu
	function EnableMapMenuMouseWheel(enable : Boolean) : Void;

	// centers map on the marker with the given index. only works if the map is open
	function ShowOnMap(markerIndex : Number) : Void;

	// centers map on the marker with the given index. only works if the map is open
	function ShowOnMap(markerIndex : Number) : Void;

	// centers map on the marker with the given index. only works if the map is open
	function ShowOnMap(markerIndex : Number) : Void;

	// store an array of numbers under the given key. any existing data under the same key will be replaced
	function StoreIndices(key : String, indicesIn : Array) : Void;

	// load an array of numbers associated with the given key into the passed indicesOut
	function LoadIndices(key : String, indicesOut : Array) : Void;
	
	dynamic intrinsic class version
	{
		var	major : Number;			// SKSE major revision number
		var	minor : Number;			// SKSE minor revision number
		var	beta : Number;			// SKSE beta revision number
		var	releaseIdx : Number;	// SKSE release index
	};
};

//	release history
//	
//	skse	runtime		release
//	1.1.0	1.1.21.0	none
//	1.2.0	1.2.12.0	none
//	1.2.1	1.2.12.0	none
//	1.3.0	1.3.7.0		0
//	1.4.0	1.3.7.0		1
//	1.4.1	1.3.7.0		2
//	1.4.2	1.3.10.0	3
//	1.4.3	1.3.10.0	4
//	1.4.4	1.3.10.0	5
//	1.4.5	1.3.10.0	6
//	1.4.6	1.4.15.0	7
//	1.4.7	1.4.20.0	8
//	1.4.8	1.4.21.0	9
//	1.4.9	1.4.21.0	10
//	1.4.10	1.4.21.0	11
//	1.4.11	1.4.26.0	12
//	1.4.12	1.4.27.0	13
//	1.4.13	1.4.27.0	14
//	1.4.14	1.5.24.0	15
//	1.4.15	1.5.26.0	16
//	1.5.1	1.5.26.0	17
//	1.5.2	1.5.26.0	18
//	1.5.3	1.5.26.0	19
//	1.5.4	1.5.26.0	20
//	1.5.5	1.5.26.0	21
//	1.5.6	1.5.26.0	22
//	1.5.7	1.5.26.0	23
//	1.5.8	1.6.87.0	24
//	1.5.9	1.6.89.0	25
//	1.5.10	1.7.7.0		26
//	1.5.11	1.7.7.0		27
//	1.6.0	1.7.7.0		28
//	1.6.1	1.7.7.0		29
//	1.6.2	1.8.145.0	30
//	1.6.3	1.8.151.0	31
//	1.6.4	1.8.151.0	32
//	1.6.5	1.8.151.0	33
//	1.6.6	1.8.151.0	34
//	1.6.7	1.8.151.0	35
//	1.6.8	1.8.151.0	36
//	1.6.9	1.8.151.0	37
//	1.6.10	1.9.26.0	38
//	1.6.11	1.9.29.0	39
//	1.6.12	1.9.32.0	40
//	1.6.13	1.9.32.0	41
//	1.6.14	1.9.32.0	42
//	1.6.15	1.9.32.0	43
//	1.6.16	1.9.32.0	44
//	1.7.0	1.9.32.0	45
//	1.7.1	1.9.32.0	46
//	1.7.2	1.9.32.0	47
//	1.7.3	1.9.32.0	48
