;/ Decompiled by Champollion V1.0.1
Source   : EnhancedCameraMCM.psc
Modified : 2013-01-18 11:39:21
Compiled : 2013-01-18 11:40:27
User     : Lee
Computer : LEES-PC
/;
scriptName EnhancedCameraMCM extends SKI_ConfigBase

;-- Properties --------------------------------------
Float[] property SneakingXYZ auto
Float[] property StandingXYZ auto
referencealias property PlayerRefAlias auto
Float[] property GeneralXYZ auto
Int[] property TextID auto
Int[] property SliderID auto
Int property counter2 auto
Int property counter auto
;
Float[] property CombatY auto

;-- Variables ---------------------------------------

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

function OnPageReset(String page)

	self.SetCursorFillMode(self.TOP_TO_BOTTOM)
	if page == ""
		self.LoadCustomContent("EC/EClogo.dds", 176 as Float, 103 as Float)
	else
		self.UnloadCustomContent()
	endIf
	if page == Pages[0]
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddHeaderOption("General Default Camera", 0)
		TextID[0] = self.AddTextOption("Weapon Sheathed / Torch Only", "", 0)
		self.AddEmptyOption()
		self.AddHeaderOption("Mounted Default Camera", 0)
		TextID[1] = self.AddTextOption("Weapon Sheathed / Torch Only", "", 0)
		self.AddEmptyOption()
		self.AddHeaderOption("Mounted Combat Camera", 0)
		TextID[2] = self.AddTextOption("Weapon Out", "", 0)
	elseIf page == Pages[1]
		self.AddHeaderOption("Melee Camera", 0)
		TextID[3] = self.AddTextOption("One-Handed Weapon / Shield Only", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[4] = self.AddTextOption("One-Handed Weapon and Shield/Torch", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[5] = self.AddTextOption("Two-Handed Weapon", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[6] = self.AddTextOption("Dual-Wield Weapons", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[7] = self.AddTextOption("Unarmed", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddHeaderOption("Magic Camera", 0)
		TextID[8] = self.AddTextOption("Spell / Staff Only", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[9] = self.AddTextOption("Spell And Staff", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[10] = self.AddTextOption("Spell / Staff and One-Handed (Any)", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[11] = self.AddTextOption("Dual-Wield Spells / Staffs", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddHeaderOption("Archery Camera", 0)
		TextID[12] = self.AddTextOption("Bow", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[13] = self.AddTextOption("Crossbow", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
	elseIf page == Pages[2]
		self.AddHeaderOption("Melee Camera", 0)
		TextID[14] = self.AddTextOption("One-Handed Weapon / Shield Only", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[15] = self.AddTextOption("One-Handed Weapon and Shield/Torch", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[16] = self.AddTextOption("Two-Handed Weapon", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[17] = self.AddTextOption("Dual-Wield Weapons", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[18] = self.AddTextOption("Unarmed", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddHeaderOption("Magic Camera", 0)
		TextID[19] = self.AddTextOption("Spell / Staff Only", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[20] = self.AddTextOption("Spell And Staff", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[21] = self.AddTextOption("Spell / Staff and One-Handed (Any)", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[22] = self.AddTextOption("Dual-Wield Spells / Staffs", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddHeaderOption("Archery Camera", 0)
		TextID[23] = self.AddTextOption("Bow", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
		TextID[24] = self.AddTextOption("Crossbow", "", 0)
		self.AddEmptyOption()
		self.AddEmptyOption()
	endIf
	self.SetCursorPosition(1)
	if page == Pages[0]
		self.AddEmptyOption()
		self.AddEmptyOption()
		self.AddEmptyOption()
		SliderID[0] = self.AddSliderOption("X Value", GeneralXYZ[0], "X Position: {1}", 0)
		SliderID[1] = self.AddSliderOption("Z Value", GeneralXYZ[1], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[2] = self.AddSliderOption("X Value", GeneralXYZ[2], "X Position: {1}", 0)
		SliderID[3] = self.AddSliderOption("Z Value", GeneralXYZ[3], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[4] = self.AddSliderOption("X Value", GeneralXYZ[4], "X Position: {1}", 0)
;		SliderID[5] = self.AddSliderOption("Z Value:", GeneralXYZ[5], "Z Position: {1}", 0)
		SliderID[5] = self.AddSliderOption("Z Value", GeneralXYZ[5], "Z Position: {1}", 0)
	elseIf page == Pages[1]
;		self.AddEmptyOption()
		SliderID[50] = self.AddSliderOption("Melee Y Value", CombatY[0], "Y Position: {1}", 0)
		SliderID[6] = self.AddSliderOption("X Value", StandingXYZ[0], "X Position: {1}", 0)
		SliderID[7] = self.AddSliderOption("Z Value", StandingXYZ[1], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[8] = self.AddSliderOption("X Value", StandingXYZ[2], "X Position: {1}", 0)
		SliderID[9] = self.AddSliderOption("Z Value", StandingXYZ[3], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[10] = self.AddSliderOption("X Value", StandingXYZ[4], "X Position: {1}", 0)
		SliderID[11] = self.AddSliderOption("Z Value", StandingXYZ[5], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[12] = self.AddSliderOption("X Value", StandingXYZ[6], "X Position: {1}", 0)
		SliderID[13] = self.AddSliderOption("Z Value", StandingXYZ[7], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[14] = self.AddSliderOption("X Value", StandingXYZ[8], "X Position: {1}", 0)
		SliderID[15] = self.AddSliderOption("Z Value", StandingXYZ[9], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[51] = self.AddSliderOption("Magic Y Value", CombatY[1], "Y Position: {1}", 0)
		SliderID[16] = self.AddSliderOption("X Value", StandingXYZ[10], "X Position: {1}", 0)
		SliderID[17] = self.AddSliderOption("Z Value", StandingXYZ[11], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[18] = self.AddSliderOption("X Value", StandingXYZ[12], "X Position: {1}", 0)
		SliderID[19] = self.AddSliderOption("Z Value", StandingXYZ[13], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[20] = self.AddSliderOption("X Value", StandingXYZ[14], "X Position: {1}", 0)
		SliderID[21] = self.AddSliderOption("Z Value", StandingXYZ[15], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[22] = self.AddSliderOption("X Value", StandingXYZ[16], "X Position: {1}", 0)
		SliderID[23] = self.AddSliderOption("Z Value", StandingXYZ[17], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[52] = self.AddSliderOption("Archery Y Value", CombatY[2], "Y Position: {1}", 0)
		SliderID[24] = self.AddSliderOption("X Value", StandingXYZ[18], "X Position: {1}", 0)
		SliderID[25] = self.AddSliderOption("Z Value", StandingXYZ[19], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[26] = self.AddSliderOption("X Value", StandingXYZ[20], "X Position: {1}", 0)
		SliderID[27] = self.AddSliderOption("Z Value", StandingXYZ[21], "Z Position: {1}", 0)
	elseIf page == Pages[2]
;		self.AddEmptyOption()
		SliderID[53] = self.AddSliderOption("Melee Y Value", CombatY[0], "Y Position: {1}", 0)
		SliderID[28] = self.AddSliderOption("X Value", SneakingXYZ[0], "X Position: {1}", 0)
		SliderID[29] = self.AddSliderOption("Z Value", SneakingXYZ[1], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[30] = self.AddSliderOption("X Value", SneakingXYZ[2], "X Position: {1}", 0)
		SliderID[31] = self.AddSliderOption("Z Value", SneakingXYZ[3], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[32] = self.AddSliderOption("X Value", SneakingXYZ[4], "X Position: {1}", 0)
		SliderID[33] = self.AddSliderOption("Z Value", SneakingXYZ[5], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[34] = self.AddSliderOption("X Value", SneakingXYZ[6], "X Position: {1}", 0)
		SliderID[35] = self.AddSliderOption("Z Value", SneakingXYZ[7], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[36] = self.AddSliderOption("X Value", SneakingXYZ[8], "X Position: {1}", 0)
		SliderID[37] = self.AddSliderOption("Z Value", SneakingXYZ[9], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[54] = self.AddSliderOption("Magic Y Value", CombatY[1], "Y Position: {1}", 0)
		SliderID[38] = self.AddSliderOption("X Value", SneakingXYZ[10], "X Position: {1}", 0)
		SliderID[39] = self.AddSliderOption("Z Value", SneakingXYZ[11], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[40] = self.AddSliderOption("X Value", SneakingXYZ[12], "X Position: {1}", 0)
		SliderID[41] = self.AddSliderOption("Z Value", SneakingXYZ[13], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[42] = self.AddSliderOption("X Value", SneakingXYZ[14], "X Position: {1}", 0)
		SliderID[43] = self.AddSliderOption("Z Value", SneakingXYZ[15], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[44] = self.AddSliderOption("X Value", SneakingXYZ[16], "X Position: {1}", 0)
		SliderID[45] = self.AddSliderOption("Z Value", SneakingXYZ[17], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[55] = self.AddSliderOption("Archery Y Value", CombatY[2], "Y Position: {1}", 0)
		SliderID[46] = self.AddSliderOption("X Value", SneakingXYZ[18], "X Position: {1}", 0)
		SliderID[47] = self.AddSliderOption("Z Value", SneakingXYZ[19], "Z Position: {1}", 0)
		self.AddEmptyOption()
		SliderID[48] = self.AddSliderOption("X Value", SneakingXYZ[20], "X Position: {1}", 0)
		SliderID[49] = self.AddSliderOption("Z Value", SneakingXYZ[21], "Z Position: {1}", 0)
	endIf
endFunction

;function SetArrays(Float[] General, Float[] Standing, Float[] Sneaking)
function SetArrays(Float[] General, Float[] Standing, Float[] Sneaking, Float[] AddY)

	(PlayerRefAlias as enhancedcameraaliasscript).General(General)
	(PlayerRefAlias as enhancedcameraaliasscript).Standing(Standing)
	(PlayerRefAlias as enhancedcameraaliasscript).Sneaking(Sneaking)
	(PlayerRefAlias as enhancedcameraaliasscript).AddY(AddY)
endFunction

function OnConfigInit()

	SliderID = new Int[56]
	TextID = new Int[25]
	Pages = new String[3]
	Pages[0] = "General"
	Pages[1] = "Standing"
	Pages[2] = "Sneaking"
	GeneralXYZ = new Float[6]
	StandingXYZ = new Float[22]
	SneakingXYZ = new Float[22]
;
	CombatY = new Float[6]
endFunction

; Skipped compiler generated GotoState

function OnOptionSliderAccept(Int option, Float value)

	counter = 0
	counter2 = -1
;	while counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length
	while counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length + CombatY.length
		if counter2 == 1
			counter2 = 0
		else
			counter2 += 1
		endIf
		if option == SliderID[counter]
			if counter < GeneralXYZ.length
				GeneralXYZ[counter] = value
			elseIf counter >= GeneralXYZ.length && counter < GeneralXYZ.length + StandingXYZ.length
				StandingXYZ[counter - GeneralXYZ.length] = value
;			else
			elseIf counter >= GeneralXYZ.length + StandingXYZ.length && counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length
;				SneakingXYZ[counter - GeneralXYZ.length + StandingXYZ.length] = value
				SneakingXYZ[counter - GeneralXYZ.length - StandingXYZ.length] = value
;
			else
				CombatY[counter - GeneralXYZ.length - StandingXYZ.length - SneakingXYZ.length] = value
;
			endIf
			self.SetXYZ(value)
		endIf
		counter += 1
	endWhile
;	self.SetArrays(GeneralXYZ, StandingXYZ, SneakingXYZ)
	self.SetArrays(GeneralXYZ, StandingXYZ, SneakingXYZ, CombatY)
endFunction

function SetXYZ(Float value)
;
	if counter <= GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length
		if counter2 == 0
			self.SetSliderOptionValue(SliderID[counter], value, "X Position: {1}", false)
		elseIf counter2 == 1
			self.SetSliderOptionValue(SliderID[counter], value, "Z Position: {1}", false)
		endIf
	else
			self.SetSliderOptionValue(SliderID[counter], value, "Y Position: {1}", false)
	endIf
endFunction

; Skipped compiler generated GetState

function OnOptionSliderOpen(Int option)

	counter = 0
;	while counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length
	while counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length + CombatY.length
		if option == SliderID[counter]
			if counter < GeneralXYZ.length
				self.SetSliderDialogStartValue(GeneralXYZ[counter])
			elseIf counter >= GeneralXYZ.length && counter < GeneralXYZ.length + StandingXYZ.length
				self.SetSliderDialogStartValue(StandingXYZ[counter - GeneralXYZ.length])
;			else
			elseIf counter >= GeneralXYZ.length + StandingXYZ.length && counter < GeneralXYZ.length + StandingXYZ.length + SneakingXYZ.length
;
				self.SetSliderDialogStartValue(SneakingXYZ[counter - GeneralXYZ.length - StandingXYZ.length])
;
			else
				self.SetSliderDialogStartValue(CombatY[counter - GeneralXYZ.length - StandingXYZ.length - SneakingXYZ.length])
;
			endIf
		endIf
		counter += 1
	endWhile
	self.SetSliderDialogDefaultValue(0.000000)
	self.SetSliderDialogRange(-100.000, 100.000)
	self.SetSliderDialogInterval(0.500000)
endFunction
