#include "global.h"
+#include "HelpDisplay.h"
#include "ScreenArcadePatch.h"
#include "ScreenManager.h"
#include "RageLog.h"
#include "XmlFile.h"
#include "MiscITG.h"
-#include "StepMania.h" // For ExitAndReboot()
+#include "arch/ArchHooks/ArchHooks.h" // for HOOKS->SystemReboot()
#include "Foreach.h" // Foreach loops without the command is hard.
#include "MemoryCardManager.h" // Where else are we getting the patch from?
LOG->Trace( "ScreenArcadePatch::~ScreenArcadePatch() %i", (int)g_doReboot );
if( g_doReboot )
- ExitAndReboot();
+ HOOKS->SystemReboot();
}
void ScreenArcadePatch::Init()
{
ScreenWithMenuElements::Init();
- this->SortByDrawOrder();
-
m_Status.LoadFromFont( THEME->GetPathF("ScreenArcadePatch","text") );
m_Patch.LoadFromFont( THEME->GetPathF("ScreenArcadePatch","text") );
m_Status.SetName( "State" );
m_Patch.SetName( "List" );
-
- m_Status.SetXY( SCREEN_CENTER_X , SCREEN_CENTER_Y );
- m_Patch.SetXY( SCREEN_CENTER_X , SCREEN_CENTER_Y + 200 );
- m_Status.SetZoom( 0.6 );
+ SET_XY_AND_ON_COMMAND( m_Status );
+ SET_XY_AND_ON_COMMAND( m_Patch );
+
+ m_Status.SetText( THEME->GetMetric("ScreenArcadePatch","IntroText") );
+ m_Patch.SetText( "Please insert a USB Card containing an update." );
+ m_textHelp->SetText( "THIS IS A TEST LOL" );
- //m_Status.SetHidden( false );
- m_Patch.SetHidden( true );
-
this->AddChild( &m_Status );
this->AddChild( &m_Patch );
+
+ this->SortByDrawOrder();
bChecking = false;
m_PatchStatus = &m_Status;
- g_doReboot = true;
+ g_doReboot = false;
}
void ScreenArcadePatch::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
if ( CopyPatchContents() )
{
m_Status.SetText(m_sSuccessMsg);
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextFinished" ) );
g_doReboot = true;
return 0;
}
{
if(!IsTransitioning())
{
- SCREENMAN->PlayStartSound();
- StartTransitioning( SM_GoToPrevScreen );
+ COMMAND( m_Status, "Off" );
+ COMMAND( m_Patch, "Off" );
+ this->StartTransitioning( SM_GoToPrevScreen );
}
}
{
// Set first, so it doesn't check again.
bChecking = true;
-
+
FOREACH_PlayerNumber( p )
{
if( MEMCARDMAN->IsNameAvailable( p ) )
{
+ m_Patch.SetVisible(false);
pn = p;
m_Status.SetText( ssprintf( "Checking Player %d's card for a patch..." , p + 1 ) );
return true;
}
// No cards found
- m_Status.SetText( "Please insert a USB Card containing an update." );
+ m_Patch.SetText( "Please insert a USB Card containing an update." );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextWaiting" ) );
return false;
}
sFile = ssprintf( "%s%s" , sDir.c_str() , aPatches[0].c_str() );
m_Status.SetText( ssprintf( "Patchfile found on Player %d's Card!" , pn + 1 ) );
- m_Patch.SetText( aPatches[0].c_str() );
- m_Patch.SetHidden( false );
+ m_textHelp->SetText( aPatches[0].c_str() );
bScanned = true;
SCREENMAN->Draw();
}
-// XXX: this cannot handle large patch files
+// XXX: this cannot handle large patch files, plz fix this somehow kthx --infamouspat
bool ScreenArcadePatch::CopyPatch()
{
-#if defined(LINUX)
+#ifdef ITG_ARCADE
Root = "/rootfs/tmp/" + aPatches[0];
#else
Root = "Temp/" + aPatches[0];
return true;
} else {
m_Status.SetText( "Patch copying failed!! Please re-insert your card and try again!" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
}
filesize = GetFileSizeInBytes( Root );
/////////// LOLOLOLOLOLOLOL /////////////
- GetFileContents("/Data/Patch.rsa", patchRSA);
+ GetFileContents("Data/Patch.rsa", patchRSA);
///////////////////////////////////////////////////////////
fSig = new RageFileDriverSlice( rf, filesize - 128, 128 );
if (fSig->Read(patchSig, 128) < 128) {
m_Status.SetText( "Patch signature verification failed: unexpected end of file" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
fZip = new RageFileDriverSlice( rf, 0, filesize - 128 );
if (! CryptHelpers::VerifyFile( *fZip, patchSig, patchRSA, sErr ) ) {
m_Status.SetText( ssprintf("Patch signature verification failed: %s", sErr.c_str()) );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
if (! rfdZip->Load(fScl))
{
m_Status.SetText( "Patch XML data check failed, could not load .itg file" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
if (fXml == NULL)
{
m_Status.SetText( "Patch XML data check failed, Could not open patch.xml" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
if (rNode->GetChild("Game")==NULL || rNode->GetChild("Revision")==NULL || rNode->GetChild("Message")==NULL)
{
m_Status.SetText( "Cannot proceed update, patch.xml corrupt" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
CString sGame = rNode->GetChildValue("Game");
if (sGame != "In The Groove 2" )
{
m_Status.SetText( ssprintf( "Cannot proceed update, revision is for another game (\"%s\").", rNode->GetChildValue("Game") ) );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
rNode->GetChild("Revision")->GetValue(iRevNum);
if (GetRevision() == iRevNum)
{
m_Status.SetText( "Cannot proceed update, revision on USB card is the same as the machine revision" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
if (! rfdZip->Load( Root ) )
{
m_Status.SetText( "Could not copy patch contents" );
+ m_textHelp->SetText( THEME->GetMetric( "ScreenArcadePatch", "HelpTextError" ) );
return false;
}
fCopyDest.Close();
#ifdef LINUX
+#ifdef ITG_ARCADE
sPath = "/stats/new-patch-unchecked/" + sPath;
+#else
+ sPath = "Data/new-patch-unchecked/" + sPath;
+#endif
chmod( sPath.c_str(), fi->m_iFilePermissions );
#endif
rfdZip->GetDirListing( sDirPath + "/*", patchDirs, true, true );
}
- // XXX: windows portion might need changed
-#ifdef LINUX
+#ifdef ITG_ARCADE
rename("/stats/new-patch-unchecked", "/stats/new-patch" );
#else
rename("Data/new-patch-unchecked", "Data/new-patch" );