From: Keith F. <ven...@us...> - 2004-07-07 15:59:06
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29175 Modified Files: cmdutil.cpp Log Message: Committing a patch from Axsyrus: - Fixed a "bug" where the first screenshot was saved as shot2.jpg, instead of shot1.jpg - It now gets the filename to use from PlaneShift.Screenshot.Filename, so you can customize the name you want the screenshots to have. - The first 9 screenshots are now 01,02,03,04,05,06,07,08,09 instead of 1,2,3,4,5,6,7,8,9 Index: cmdutil.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/cmdutil.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** cmdutil.cpp 4 Jul 2004 04:39:59 -0000 1.34 --- cmdutil.cpp 7 Jul 2004 15:58:55 -0000 1.35 *************** *** 188,193 **** //Won't fill this for long :) unsigned long int ssNumber=0; //Get last saved ss and increase it by 1 ! ssNumber=psengine->GetConfig()->GetInt("PlaneShift.Screenshot.LastUsed",1)+1; csString filename; --- 188,195 ---- //Won't fill this for long :) unsigned long int ssNumber=0; + const char* ssFilename; //Get last saved ss and increase it by 1 ! ssNumber=psengine->GetConfig()->GetInt("PlaneShift.Screenshot.LastUsed",0)+1; ! ssFilename = psengine->GetConfig()->GetStr("PlaneShift.Screenshot.Filename", "shot"); csString filename; *************** *** 195,207 **** //Loop until free fileslot while(!free) { - filename = "/this/screenshots/shot"; - filename.Append(ssNumber); - filename.Append(".jpg"); //Check if file exist, we wouldn't want to ruin the users old ss, would we? ! if (!psengine->GetVFS()->Exists(filename.GetData())) { free=true; }else { ! //File existed, increse the number ssNumber++; } --- 197,207 ---- //Loop until free fileslot while(!free) { + filename.Format("/this/screenshots/%s%02d.jpg", ssFilename, ssNumber); //Check if file exist, we wouldn't want to ruin the users old ss, would we? ! if(!psengine->GetVFS()->Exists(filename.GetData())) { free=true; }else { ! //File existed, increase the number ssNumber++; } *************** *** 219,223 **** psengine->GetVFS()->WriteFile(filename.GetData(),buffer->GetData(),buffer->GetSize()); ! csString returnV ("Screenshot saved successfully to 'shot"); returnV.Append(ssNumber); returnV.Append(".jpg'"); --- 219,224 ---- psengine->GetVFS()->WriteFile(filename.GetData(),buffer->GetData(),buffer->GetSize()); ! csString returnV ("Screenshot saved successfully to '"); ! returnV.Append(ssFilename); returnV.Append(ssNumber); returnV.Append(".jpg'"); *************** *** 229,233 **** return NULL; } ! else if (words[0] == "/targetinfo") { pawsDetailWindow* detail = (pawsDetailWindow*)psengine->GetPAWS()->FindWidget("DetailWindow"); --- 230,234 ---- return NULL; } ! else if(words[0] == "/targetinfo") { pawsDetailWindow* detail = (pawsDetailWindow*)psengine->GetPAWS()->FindWidget("DetailWindow"); *************** *** 235,248 **** return NULL; } ! else if (words[0] == "/help") { paws->GetMainWidget()->FindWidget("HelpWindow")->Show(); return NULL; } ! else if (words[0] == "/graphicbug") { return SaveCamera().GetData(); } ! else if (words[0] == "/portals") { csRef<iEngine> engine (CS_QUERY_REGISTRY (objreg, iEngine)); --- 236,249 ---- return NULL; } ! else if(words[0] == "/help") { paws->GetMainWidget()->FindWidget("HelpWindow")->Show(); return NULL; } ! else if(words[0] == "/graphicbug") { return SaveCamera().GetData(); } ! else if(words[0] == "/portals") { csRef<iEngine> engine (CS_QUERY_REGISTRY (objreg, iEngine)); *************** *** 253,257 **** return NULL; } ! else if (words[0] == "/repaintlabels") { psengine->GetCelClient()->GetEntityLabels()->RepaintAllLabels(); --- 254,258 ---- return NULL; } ! else if(words[0] == "/repaintlabels") { psengine->GetCelClient()->GetEntityLabels()->RepaintAllLabels(); *************** *** 298,302 **** //Check if file exist, we wouldn't want to ruin the users old report, would we? ! if (!psengine->GetVFS()->Exists(filename.GetData())) { free=true; --- 299,303 ---- //Check if file exist, we wouldn't want to ruin the users old report, would we? ! if(!psengine->GetVFS()->Exists(filename.GetData())) { free=true; |