diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp index 820fcee5..18e0aedd 100644 --- a/SaveLoadScreen.cpp +++ b/SaveLoadScreen.cpp @@ -40,6 +40,10 @@ #include "connect.h" +#include "FileMan.h" +#include +#include + #ifdef JA2UB #include "Strategic Movement.h" @@ -151,6 +155,9 @@ UINT32 guiSaveLoadExitScreen = SAVE_LOAD_SCREEN; //Contains the array of valid save game locations BOOLEAN gbSaveGameArray[ NUM_SAVE_GAMES ]; +// anv: read times of modification to show them later +SYSTEMTIME gstSaveGameCreationTimeArray[ NUM_SAVE_GAMES ]; + BOOLEAN gfDoingQuickLoad = FALSE; BOOLEAN gfFailedToSaveGameWhenInsideAMessageBox = FALSE; @@ -441,7 +448,7 @@ void InitMSysButtons(BOOLEAN delRegion) UINT8 i; CHAR16 zString[512]; CHAR16 zString2[512]; - + CHAR16 zString3[512]; if ( delRegion == TRUE ) { for(i=0; i_getRealPath(vfsPath); + string str = vfsPath.to_string(); + LPCSTR lpSaveGamePath = str.c_str(); + // get file handle + HANDLE hFile = CreateFile( lpSaveGamePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); + // read time attributes + FILETIME ftCreationTime, ftLastAccessedTime, ftLastWriteTime; + SYSTEMTIME stSystemTime; + GetFileTime( hFile, &ftCreationTime, &ftLastAccessedTime, &ftLastWriteTime ); + // remember time + FileTimeToSystemTime( &ftLastWriteTime, &stSystemTime ); + SystemTimeToTzSpecificLocalTime( NULL, &stSystemTime, &gstSaveGameCreationTimeArray[VAL_SLOT_START + cnt] ); + // close + CloseHandle( hFile ); + rfile->close(); +#endif + } } else gbSaveGameArray[VAL_SLOT_START + cnt] = FALSE; @@ -1553,15 +1603,15 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID ) swprintf( zDifString, L"%s %s", gzGIOScreenText[ GIO_EASY_TEXT + SaveGameHeader.sInitialGameOptions.ubDifficultyLevel - 1 ], zSaveLoadText[ SLG_DIFF ] ); //make a string containing the extended options - swprintf( zMouseHelpTextString, L"%20ls %d %d %22ls %22ls", zDifString, + swprintf( zMouseHelpTextString, L"%s %d %d %22ls %22ls %22ld", zDifString, SaveGameHeader.sInitialGameOptions.ubBobbyRayQuality, SaveGameHeader.sInitialGameOptions.ubBobbyRayQuantity, SaveGameHeader.sInitialGameOptions.fGunNut ? zSaveLoadText[ SLG_ADDITIONAL_GUNS ] : zSaveLoadText[ SLG_NORMAL_GUNS ], - SaveGameHeader.sInitialGameOptions.ubGameStyle == STYLE_SCIFI ? zSaveLoadText[ SLG_SCIFI ] : (SaveGameHeader.sInitialGameOptions.ubGameStyle == STYLE_PLATINUM ? zSaveLoadText[ SLG_PLATINUM ]: zSaveLoadText[ SLG_REALISTIC ]) ); + SaveGameHeader.sInitialGameOptions.ubGameStyle == STYLE_SCIFI ? zSaveLoadText[ SLG_SCIFI ] : (SaveGameHeader.sInitialGameOptions.ubGameStyle == STYLE_PLATINUM ? zSaveLoadText[ SLG_PLATINUM ]: zSaveLoadText[ SLG_REALISTIC ]), + SaveGameHeader.uiSavedGameVersion ); //The date - DrawTextToScreen( zMouseHelpTextString, (UINT16)(usPosX+SLG_DATE_OFFSET_X), (UINT16)(usPosY+SLG_DATE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - } + DrawTextToScreen( zMouseHelpTextString, (UINT16)(usPosX+SLG_DATE_OFFSET_X), (UINT16)(usPosY+SLG_DATE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); } else { //Create the string for the Data