void LoadingScreen::updateUIDataText(const char* name, const char* desc, const char* tip)
{
/*if(g_num_matches_played->GetInt() == 1 && g_num_game_executed2->GetInt()==1) // first time launch of the game, show keyboard schematic
{
Scaleform::GFx::Value::DisplayInfo dinfo;
dinfo.SetVisible(true);
m_GFX_Main2.SetDisplayInfo(dinfo);
dinfo.SetVisible(false);
m_GFX_Main.SetDisplayInfo(dinfo);
}
else*/
{
//Scaleform::GFx::Value::DisplayInfo dinfo;
//dinfo.SetVisible(true);
//m_GFX_Main.SetDisplayInfo(dinfo);
//dinfo.SetVisible(false);
//m_GFX_Main2.SetDisplayInfo(dinfo);
}
Scaleform::GFx::Value tmp, tmp2, tmp3;
/*m_GFX_Main2.GetMember("Name", &tmp);
tmp.GetMember("Name", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.SetText(name);*/
m_GFX_Main.GetMember("Name", &tmp);
tmp.GetMember("Name", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.SetText(name);
/*m_GFX_Main2.GetMember("Desc", &tmp);
tmp.GetMember("Text", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.SetText(desc);*/
//----------------------------------------------------------
//Tobi double GD Icon
// m_EventStatus / 1 - true / 0 - false
int apiCode = gUserProfile.ApiGetServerStatus();
if(apiCode != 0)
{
gfxMovie.SetVariable("_root.Main.DoubleGD.visible", false);
}
else {
for(size_t i=0; i<gUserProfile.m_ServerStatus.size(); i++)
{
const CUserProfile::ServerStatus_s& ss = gUserProfile.m_ServerStatus[i];
if(ss.IsGameDollarEvent == 1) {
gfxMovie.SetVariable("_root.Main.DoubleGD.visible", true);
} else {
gfxMovie.SetVariable("_root.Main.DoubleGD.visible", false);
}
}
}
// end
// Tobi
// Loadingscreen servername
char ServerName[256];
if( g_bEditMode )
{
sprintf(ServerName, "Level Editor");
}
else if(!gClientLogic().m_gameInfo.IsValid())
{
sprintf(ServerName, gLangMngr.getString("$LG_Connecting"));
}
else {
sprintf(ServerName, "%s", gClientLogic().m_gameInfo.name);
}
m_GFX_Main.GetMember("Desc", &tmp);
tmp.GetMember("Text", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.SetText(ServerName);
//----------------------------------------------------------
m_GFX_Main.GetMember("Tip", &tmp);
Scaleform::GFx::Value::DisplayInfo dinfo;
dinfo.SetVisible(tip!=NULL);
tmp.SetDisplayInfo(dinfo);
if(tip)
{
tmp.GetMember("Tip", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.SetText(tip);
tmp2.GetMember("Caption", &tmp3);
tmp3.SetText(gLangMngr.getString("TipOfTheDay"));
}
/*Scaleform::GFx::Value vFrame[1], vImages;
m_GFX_Main.GetMember("Images", &vImages);
vFrame[0].SetInt(int(u_GetRandom(1.0f, 4.99f)));
vImages.Invoke("gotoAndStop", NULL, vFrame, 1);*/
}
//------------------------------------------------------------------------
void
LoadingScreen::SetProgress( float progress )
{
R3D_ENSURE_MAIN_THREAD();
if(!m_GFX_Main.IsUndefined())
{
Scaleform::GFx::Value tmp, tmp1, tmp2, tmp3, tmp4;
m_GFX_Main.GetMember("Bar", &tmp);
tmp.GetMember("RankBar", &tmp1);
tmp1.GetMember("Bar", &tmp2);
float baseWidth = 1510;
tmp2.GetMember("width", &tmp4);
tmp4.SetNumber(baseWidth*R3D_CLAMP(progress, 0.01f, 1.0f));
tmp2.SetMember("width", tmp4);
//----------------------------------
// Tobi
// loading Progress Text
char loadingProgressText[512];
if(!gClientLogic().m_gameInfo.IsValid())
{
sprintf(loadingProgressText, gLangMngr.getString("$LG_ProgressConnecting"));
}
else {
sprintf(loadingProgressText, gLangMngr.getString("$LG_ProgressText"), progress* 100);
}
if( g_bEditMode )
sprintf(loadingProgressText, gLangMngr.getString("$LG_ProgressText"), progress* 100);
m_GFX_Main.GetMember("Bar", &tmp);
tmp.GetMember("RankBar", &tmp1);
tmp1.GetMember("Text", &tmp2);
tmp2.GetMember("Text", &tmp3);
tmp3.GetMember("Text", &tmp4);
tmp4.SetText(loadingProgressText);
//----------------------------------
/*baseWidth = (float)tmp4.GetNumber();
tmp2.GetMember("width", &tmp4);
tmp4.SetNumber(baseWidth*R3D_CLAMP(progress, 0.01f, 1.0f));
tmp2.SetMember("width", tmp4);*/
// Bar._width = Math.round(Scale._width*_global.LocalPercent/100)-5;
}
//gfxMovie.SetVariable("_global.LoadedPercent", progress*100);
}
//------------------------------------------------------------------------