Scriptname BaboImmsersiveSlaves_MCM extends SKI_ConfigBase  


Quest Property SexSlavesQuest Auto

GlobalVariable Property BIS_RecruitPercentage Auto

int OID_BISSwitch
int OID_BIS_RecruitPercentage

bool aVal = false

function ModStartCheck()
	if (SexSlavesQuest.IsRunning() == 1)
		aVal = true;
	else  
		aVal = false;
	endIf
endFunction

event OnPageReset(string page)
	ModStartCheck()
	
	SetCursorFillMode(TOP_TO_BOTTOM)
	SetCursorPosition(0)

	AddHeaderOption("Mod status")
	OID_BISSwitch = AddToggleOption("Mod started", aVal)
	AddHeaderOption("Mod Setting")
	OID_BIS_RecruitPercentage = AddSliderOption("Recruit Value", BIS_RecruitPercentage.GetValue(), "{0}")

endEvent

event OnOptionSelect(int option)
	if (option == OID_BISSwitch)
		aVal = !aVal
		SetToggleOptionValue(OID_BISSwitch, aVal)
		SexSlavesQuest.Start()
		Debug.Notification("Babo Immersive Slave quest re-initialized.")
	endIf
endEvent

Event OnOptionSliderOpen(Int Option)

If option == OID_BIS_RecruitPercentage
	SetSliderDialogStartValue(BIS_RecruitPercentage.GetValue())
	SetSliderDialogDefaultValue(50)
	SetSliderDialogRange(0, 100)
	SetSliderDialogInterval(1.0)
EndIf

EndEvent

Event OnOptionSliderAccept(Int Option, Float Value)

If option == OID_BIS_RecruitPercentage
	BIS_RecruitPercentage.SetValue(Value)
	SetSliderOptionValue(option, value as int, "{0}")
EndIf

EndEvent

Event OnOptionHighlight(Int Option)
If (Option == OID_BIS_RecruitPercentage)
		SetInfoText("Through this percentage, you can set the possibility to recruit enslaved knights")
EndIf
EndEvent

event OnOptionDefault(int option)
	if (option == OID_BISSwitch)
        aVal = true ; default value
    endIf
endEvent