ScriptName aaaKimachuuSaveLoadQuitPatch Extends ReferenceAlias

Message Property MesLoad Auto
Message Property MesQuit Auto
Message Property MesSave Auto

Function RegisterForEvents()
	RegisterForModEvent("KimachuuSaveLoadQuitS", "SLQSave")
	RegisterForModEvent("KimachuuSaveLoadQuitL", "SLQLoad")
	RegisterForModEvent("KimachuuSaveLoadQuitQ", "SLQQuit")
EndFunction

Event OnPlayerLoadGame() 
    RegisterForEvents()
Endevent

Event OnInit()
    RegisterForEvents()
EndEvent

Event SLQSave(string evn, string str, float num, Form sender)
	MesSave.Show()
	Game.SaveGame("SLQSave")
EndEvent

Event SLQLoad(string evn, string str, float num, Form sender)
	Int iIndex = MesLoad.Show()
	If iIndex == 0
		Game.LoadGame("SLQSave")
	EndIf
EndEvent

Event SLQQuit(string evn, string str, float num, Form sender)
	Int iIndex = MesQuit.Show()
	If iIndex == 1
		ConsoleUtil.ExecuteCommand("qqq")
	EndIf
EndEvent