;/ Decompiled by Champollion V1.0.1
Source   : EnhancedCameraScript.psc
Modified : 2013-01-18 11:40:02
Compiled : 2013-01-18 11:40:30
User     : Lee
Computer : LEES-PC
/;
scriptName EnhancedCameraScript extends Quest

;-- Properties --------------------------------------
Float property ModVersion auto
actor property PlayerRef auto
referencealias property PlayerRefAlias auto

;-- Variables ---------------------------------------
Bool IsStanding = false
Bool IsSneaking = false
Bool IsOnMount = false
Float CurrentModVersion = 0.900000

;-- Functions ---------------------------------------

function CheckVersion()

	if ModVersion < CurrentModVersion
		debug.Notification("Initializing Enhanced 3rd Person Camera " + CurrentModVersion as String)
		ModVersion = CurrentModVersion
	endIf
endFunction

function OnUpdate()

	if PlayerRef.IsSneaking() && !IsSneaking
		self.SetStates(true, false, false)
	elseIf PlayerRef.IsOnMount() && !IsOnMount
		self.SetStates(false, true, false)
	elseIf !PlayerRef.IsSneaking() && !PlayerRef.IsOnMount() && !IsStanding
		self.SetStates(false, false, true)
	endIf
	self.RegisterForSingleUpdate(0.500000)
endFunction

function SetStates(Bool a, Bool b, Bool c)

	IsSneaking = a
	IsOnMount = b
	IsStanding = c
	(PlayerRefAlias as enhancedcameraaliasscript).CheckEquipment()
endFunction

; Skipped compiler generated GotoState

; Skipped compiler generated GetState

function OnInit()

	self.CheckVersion()
	self.RegisterForSingleUpdate(0.500000)
	self.RegisterForMenu("Journal Menu")
endFunction

function OnMenuClose(String MenuName)

	(PlayerRefAlias as enhancedcameraaliasscript).SetCamera()
	(PlayerRefAlias as enhancedcameraaliasscript).CheckEquipment()
endFunction
