mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-10 06:41:36 +00:00
Merge branch 'master' of https://github.com/DrBeef/Doom3Quest
This commit is contained in:
commit
429ad68966
3 changed files with 22 additions and 5 deletions
|
@ -1227,6 +1227,21 @@ idStr idSessionLocal::GetAutoSaveName( const char *mapName ) const {
|
|||
return va( "^3AutoSave:^0 %s", mapName );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
idSessionLocal::GetAutoSaveName
|
||||
===============
|
||||
*/
|
||||
idStr idSessionLocal::GetSaveMapName( const char *mapName ) const {
|
||||
const idDecl *mapDecl = declManager->FindType( DECL_MAPDEF, mapName, false );
|
||||
const idDeclEntityDef *mapDef = static_cast<const idDeclEntityDef *>( mapDecl );
|
||||
if ( mapDef ) {
|
||||
mapName = common->GetLanguageDict()->GetString( mapDef->dict.GetString( "name", mapName ) );
|
||||
}
|
||||
// Fixme: Localization
|
||||
return mapName;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
idSessionLocal::MoveToNewMap
|
||||
|
|
|
@ -161,6 +161,7 @@ public:
|
|||
|
||||
void ScrubSaveGameFileName( idStr &saveFileName ) const;
|
||||
idStr GetAutoSaveName( const char *mapName ) const;
|
||||
idStr GetSaveMapName( const char *mapName ) const;
|
||||
|
||||
bool LoadGame(const char *saveName);
|
||||
// DG: added saveFileName so we can set a sensible filename for autosaves (see comment in MoveToNewMap())
|
||||
|
|
|
@ -337,10 +337,11 @@ const char *TimeStampToFilename( ) {
|
|||
idStr out;
|
||||
|
||||
// english gets "month/day/year hour:min" + "am" or "pm"
|
||||
out = "Save: ";
|
||||
out += va( "%d", time->tm_year + 1900 );
|
||||
out += va( "%02d", time->tm_mon + 1 );
|
||||
out += va( "%02d", time->tm_mday );
|
||||
//out = "Save: ";
|
||||
out = "-";
|
||||
//out += va( "%d", time->tm_year + 1900 );
|
||||
//out += va( "%02d", time->tm_mon + 1 );
|
||||
//out += va( "%02d", time->tm_mday );
|
||||
out += va( "%02d", time->tm_hour );
|
||||
out += va( "%02d", time->tm_min );
|
||||
out += va( "%02d", time->tm_sec );
|
||||
|
@ -367,7 +368,7 @@ bool idSessionLocal::HandleSaveGameMenuCommand( idCmdArgs &args, int &icmd ) {
|
|||
}
|
||||
|
||||
if ( !idStr::Icmp( cmd, "createNewName" ) ) {
|
||||
guiActive->SetStateString( "saveGameName", TimeStampToFilename() );
|
||||
guiActive->SetStateString( "saveGameName", "Save: " + GetSaveMapName( mapSpawnData.serverInfo.GetString("si_map")) + TimeStampToFilename() );
|
||||
guiActive->StateChanged( com_frameTime );
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue