Basic work on score saving code
authorCameron Ball <cameron@getapproved.com.au>
Thu, 12 Feb 2015 08:59:45 +0000 (16:59 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Thu, 12 Feb 2015 08:59:45 +0000 (16:59 +0800)
src/CodeDetector.cpp
src/CodeDetector.h
src/GameState.cpp
src/GameState.h
src/ScreenEvaluation.cpp

index 6aab0f5..c667493 100644 (file)
@@ -50,6 +50,7 @@ const CString CodeNames[] = {
        "NextBannerGroup2",
        "SaveScreenshot1",
        "SaveScreenshot2",
+       "SaveSong",
        "CancelAllPlayerOptions",
        "BackInEventMode",
        "OptionsListOpen1",
index c3adde7..d1d14a7 100644 (file)
@@ -45,6 +45,7 @@ enum Code {
        CODE_BW_NEXT_GROUP2,
        CODE_SAVE_SCREENSHOT1,
        CODE_SAVE_SCREENSHOT2,
+       CODE_SAVE_SONG,
        CODE_CANCEL_ALL_PLAYER_OPTIONS,
        CODE_BACK_IN_EVENT_MODE,
        CODE_OPTIONS_LIST_OPEN1,
index 2596fec..c0f0561 100644 (file)
@@ -22,6 +22,7 @@
 #include "Steps.h"
 #include "LuaReference.h"
 #include "StepMania.h"
+#include "RageUtil.h"
 
 #include <ctime>
 #include <set>
@@ -305,6 +306,13 @@ void GameState::SetSongInProgress( const CString &sWriteOut )
        f.Close();
 }
 
+void GameState::CreateSymlinkFavourite( const CString &sSongDir )
+{
+       LOG->Debug("GameState::CreateSymlinkFavourite( %s )", sSongDir.c_str());
+       CString sPath = GetCwd();
+       LOG->Debug("what %s", sPath.c_str());
+}
+
 /*
  * Game flow:
  *
index 76b122e..4580e4e 100644 (file)
@@ -43,6 +43,7 @@ public:
        void SaveCurrentSettingsToProfile( PlayerNumber pn ); // called at the beginning of each stage
 
        void SetSongInProgress( const CString &sWriteOut );
+       void CreateSymlinkFavourite( const CString &sSongDir );
 
        void Update( float fDelta );
 
index ecef9ee..bce8626 100644 (file)
@@ -1306,6 +1306,12 @@ void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType t
                PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
                HighScore &hs = m_HighScore[pn];
 
+               if( CodeDetector::EnteredCode(GameI.controller, CODE_SAVE_SONG) )
+               {
+                       SCREENMAN->SystemMessage( "Nice Meme!" );
+                       GAMESTATE->CreateSymlinkFavourite( GAMESTATE->m_pCurSong->GetSongDir() );
+               }
+
 
                if( CodeDetector::EnteredCode(GameI.controller, CODE_SAVE_SCREENSHOT1) ||
                        CodeDetector::EnteredCode(GameI.controller, CODE_SAVE_SCREENSHOT2) )