Saving times and map seeds are displayed correctly in the "load game" menu
This commit is contained in:
@@ -334,10 +334,12 @@ namespace Barotrauma
|
|||||||
new XElement("Gamesession"));
|
new XElement("Gamesession"));
|
||||||
|
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
doc.Root.Add(new XAttribute("savetime", now.Hour + ":" + now.Minute + ", " + now.ToShortDateString()));
|
doc.Root.Add(new XAttribute("savetime", now.ToShortTimeString() + ", " + now.ToShortDateString()));
|
||||||
|
|
||||||
doc.Root.Add(new XAttribute("submarine", submarine==null ? "" : submarine.Name));
|
doc.Root.Add(new XAttribute("submarine", submarine==null ? "" : submarine.Name));
|
||||||
|
|
||||||
|
doc.Root.Add(new XAttribute("mapseed", Map.Seed));
|
||||||
|
|
||||||
((SinglePlayerMode)gameMode).Save(doc.Root);
|
((SinglePlayerMode)gameMode).Save(doc.Root);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -417,16 +417,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
string saveTime = ToolBox.GetAttributeString(doc.Root, "savetime", "unknown");
|
string saveTime = ToolBox.GetAttributeString(doc.Root, "savetime", "unknown");
|
||||||
|
|
||||||
XElement modeElement = null;
|
string mapseed = ToolBox.GetAttributeString(doc.Root, "mapseed", "unknown");
|
||||||
foreach (XElement element in doc.Root.Elements())
|
|
||||||
{
|
|
||||||
if (element.Name.ToString().ToLowerInvariant() != "gamemode") continue;
|
|
||||||
|
|
||||||
modeElement = element;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
string mapseed = ToolBox.GetAttributeString(modeElement, "mapseed", "unknown");
|
|
||||||
|
|
||||||
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 230), Color.Black*0.4f, GUI.Style, menuTabs[(int)Tab.LoadGame]);
|
GUIFrame saveFileFrame = new GUIFrame(new Rectangle((int)(saveList.Rect.Width + 20), 0, 200, 230), Color.Black*0.4f, GUI.Style, menuTabs[(int)Tab.LoadGame]);
|
||||||
saveFileFrame.UserData = "savefileframe";
|
saveFileFrame.UserData = "savefileframe";
|
||||||
|
|||||||
Reference in New Issue
Block a user