Changed: replace PrintfCommands by loadingTexts in cff to prevent overwrite of default values in user client.cfg

ryzom/sheets
Ulukyn 5 years ago
parent 1c562ddbe6
commit f9738713a7

@ -415,13 +415,7 @@ SystemInfoColors =
"R2_INVITE","0 255 0 255 around", // Ring invitation "R2_INVITE","0 255 0 255 around", // Ring invitation
}; };
PrintfCommands = { loadingTexts = {
"0", "132", "30 144 255 255", "18", "uiS2",
"0", "105", "255 188 0 255", "14", "uiS2E0",
"0", "65", "255 255 255 255", "12", "NEWS"
};
PrintfCommandsFreeTrial = {
"0", "132", "30 144 255 255", "18", "uiS2", "0", "132", "30 144 255 255", "18", "uiS2",
"0", "105", "255 188 0 255", "14", "uiS2E0", "0", "105", "255 188 0 255", "14", "uiS2E0",
"0", "65", "255 255 255 255", "12", "NEWS" "0", "65", "255 255 255 255", "12", "NEWS"

@ -1413,14 +1413,8 @@ void CClientConfig::setValues()
#ifndef RZ_NO_CLIENT #ifndef RZ_NO_CLIENT
// printf commands in loading screens // printf commands in loading screens
ClientCfg.PrintfCommands.clear(); ClientCfg.loadingTexts.clear();
ClientCfg.PrintfCommandsFreeTrial.clear(); CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr("loadingTexts");
std::vector< std::string > printfCommands(2);
printfCommands[0] = "PrintfCommands";
printfCommands[1] = "PrintfCommandsFreeTrial";
for(uint p=0; p<2; p++)
{
CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr(printfCommands[p].c_str());
if (pc) if (pc)
{ {
if( pc->size()%5 == 0 && pc->size() >= 5) if( pc->size()%5 == 0 && pc->size() >= 5)
@ -1434,14 +1428,12 @@ void CClientConfig::setValues()
pcom.FontSize = pc->asInt(i+3); pcom.FontSize = pc->asInt(i+3);
pcom.Text = pc->asString(i+4); pcom.Text = pc->asString(i+4);
if(p==0) ClientCfg.PrintfCommands.push_back( pcom ); ClientCfg.loadingTexts.push_back( pcom );
else ClientCfg.PrintfCommandsFreeTrial.push_back( pcom );
} }
} }
else else
{ {
cfgWarning(("Missing or too many parameters in " + printfCommands[p]).c_str()); cfgWarning("Missing or too many parameters in loadingTexts");
}
} }
} }
#endif #endif

@ -699,9 +699,7 @@ struct CClientConfig
uint FontSize; uint FontSize;
std::string Text; std::string Text;
}; };
std::vector<SPrintfCommand> PrintfCommands; std::vector<SPrintfCommand> loadingTexts;
std::vector<SPrintfCommand> PrintfCommandsFreeTrial;
// funny loading messages count // funny loading messages count
uint16 LoadingStringCount; uint16 LoadingStringCount;

@ -367,15 +367,14 @@ void CProgress::internalProgress (float value)
// apply text commands // apply text commands
if( ApplyTextCommands ) if( ApplyTextCommands )
{ {
std::vector<CClientConfig::SPrintfCommand> printfCommands = ClientCfg.PrintfCommands; std::vector<CClientConfig::SPrintfCommand> loadingTexts = ClientCfg.loadingTexts;
if(FreeTrial) printfCommands = ClientCfg.PrintfCommandsFreeTrial;
if( !printfCommands.empty() ) if( !loadingTexts.empty() )
{ {
TextContext->setHotSpot(UTextContext::MiddleBottom); TextContext->setHotSpot(UTextContext::MiddleBottom);
vector<CClientConfig::SPrintfCommand>::iterator itpc; vector<CClientConfig::SPrintfCommand>::iterator itpc;
for( itpc = printfCommands.begin(); itpc != printfCommands.end(); ++itpc ) for( itpc = loadingTexts.begin(); itpc != loadingTexts.end(); ++itpc )
{ {
float x = 0.5f;//((*itpc).X / 1024.f); float x = 0.5f;//((*itpc).X / 1024.f);
float y = ((*itpc).Y / 768.f); float y = ((*itpc).Y / 768.f);

Loading…
Cancel
Save