#include "MW4Headers.hpp"

#include <GOSScript\GOSScriptHeaders.hpp>
#include <GameOS\ToolOS.hpp>
#include "PopUp.hpp"
#include <Stuff\Stuff.hpp>

namespace gosScript
{

PopUp::PopUp(char * boxtitle,char * msg)
{
	m_boxtitle = (char *)gos_Malloc(strlen(boxtitle)+1);
	m_boxtitle[0] = 0;
	strcpy(m_boxtitle,boxtitle);
	m_message = (char *)gos_Malloc(strlen(msg)+1);
	m_message[0] = 0;
	strcpy(m_message,msg);
	gosScript_RegisterVariable("boxtitle",&m_boxtitle,GOSVAR_STRING,0, NULL);
	gosScript_RegisterVariable("boxmessage",&m_message,GOSVAR_STRING,0, NULL);

}

PopUp::~PopUp()
{
	gosScript_UnregisterVariable("boxtitle");
	gosScript_UnregisterVariable("boxmessage");
	gos_Free(m_boxtitle);
	gos_Free(m_message);
}


void PopUp::Execute()
{
	gosScript_ExecuteScript("popup.script",0x2000,NULL);
}

} // namespace gosScript