void InitInterface(string iniName)
{
	ResetTimeToNormal();
	Log_SetActiveAction("Nothing");
	BLI_RefreshCommandMenu();
	BLI_DisableShow();
	SendMessage(&ILogAndActions,"ll",LI_SET_VISIBLE,false);
	EngineLayersOffOn(true);
	characters[GetMainCharacterIndex()].paused = 1.0;
	SetTimeScale(0.0);

	SendMessage(&GameInterface,"ls",MSG_INTERFACE_INIT,iniName);

	CreateStringCheckCase(true,"Message",XI_ConvertString("GAME_PAUSED"),"interface_title",COLOR_NORMAL,320,210,SCRIPT_ALIGN_CENTER,0.9,true);

	SetEventHandler("exitCancel","ProcessCancelExit",0);
}

void ResetView()
{
	SetTimeScale(stf(characters[GetMainCharacterIndex()].paused));
	DeleteAttribute(&characters[GetMainCharacterIndex()], "Paused");

    EngineLayersOffOn(false);
	SendMessage(&ILogAndActions,"ll",LI_SET_VISIBLE,true);
	BLI_EnableShow();
	BLI_RefreshCommandMenu();
	CheckCharacterAction();
}

void ProcessCancelExit()
{
	IDoExit(RC_INTERFACE_ADV_EXIT);
}

void IDoExit(int exitCode)
{
	DelEventHandler("exitCancel","ProcessCancelExit");

	interfaceResultCommand = exitCode;
    ResetView();
	EndCancelInterface(true);
}