ScriptedEvent debug logging, saving VerboseLogging option, using the first loaded contentpackage if no contentpackage has been selected

This commit is contained in:
Regalis
2016-04-23 17:28:11 +03:00
parent 14ef736176
commit 1a96159bdb
5 changed files with 25 additions and 5 deletions
@@ -11,6 +11,11 @@ namespace Barotrauma
private int state; private int state;
public override string ToString()
{
return "ScriptedEvent (" + (itemPrefab==null ? "null" : itemPrefab.Name) + ")";
}
public ArtifactEvent(XElement element) public ArtifactEvent(XElement element)
: base(element) : base(element)
{ {
+5
View File
@@ -14,6 +14,11 @@ namespace Barotrauma
private bool spawnDeep; private bool spawnDeep;
public override string ToString()
{
return "ScriptedEvent (" + characterFile + ")";
}
public MonsterEvent(XElement element) public MonsterEvent(XElement element)
: base (element) : base (element)
{ {
@@ -64,6 +64,11 @@ namespace Barotrauma
get { return difficulty; } get { return difficulty; }
} }
public override string ToString()
{
return "ScriptedEvent ("+name+")";
}
public ScriptedEvent(XElement element) public ScriptedEvent(XElement element)
{ {
name = ToolBox.GetAttributeString(element, "name", ""); name = ToolBox.GetAttributeString(element, "name", "");
+1
View File
@@ -65,6 +65,7 @@ namespace Barotrauma
while (tries < 5) while (tries < 5)
{ {
ScriptedEvent scriptedEvent = ScriptedEvent.LoadRandom(rand); ScriptedEvent scriptedEvent = ScriptedEvent.LoadRandom(rand);
DebugConsole.Log("Created scripted event "+scriptedEvent.ToString());
if (scriptedEvent==null || scriptedEvent.Difficulty > totalDifficulty) if (scriptedEvent==null || scriptedEvent.Difficulty > totalDifficulty)
{ {
tries++; tries++;
+7 -3
View File
@@ -120,7 +120,7 @@ namespace Barotrauma
MasterServerUrl = ""; MasterServerUrl = "";
SelectedContentPackage = new ContentPackage(""); SelectedContentPackage = ContentPackage.list.Any() ? ContentPackage.list[0] : new ContentPackage("");
return; return;
} }
@@ -138,7 +138,10 @@ namespace Barotrauma
//FullScreenEnabled = ToolBox.GetAttributeBool(graphicsMode, "fullscreen", true); //FullScreenEnabled = ToolBox.GetAttributeBool(graphicsMode, "fullscreen", true);
var windowModeStr = ToolBox.GetAttributeString(graphicsMode, "displaymode", "Fullscreen"); var windowModeStr = ToolBox.GetAttributeString(graphicsMode, "displaymode", "Fullscreen");
if (Enum.TryParse<WindowMode>(windowModeStr, out windowMode)); if (!Enum.TryParse<WindowMode>(windowModeStr, out windowMode))
{
windowMode = WindowMode.Fullscreen;
}
MasterServerUrl = ToolBox.GetAttributeString(doc.Root, "masterserverurl", ""); MasterServerUrl = ToolBox.GetAttributeString(doc.Root, "masterserverurl", "");
@@ -218,7 +221,8 @@ namespace Barotrauma
new XAttribute("masterserverurl", MasterServerUrl), new XAttribute("masterserverurl", MasterServerUrl),
new XAttribute("autocheckupdates", AutoCheckUpdates), new XAttribute("autocheckupdates", AutoCheckUpdates),
new XAttribute("musicvolume", musicVolume), new XAttribute("musicvolume", musicVolume),
new XAttribute("soundvolume", soundVolume)); new XAttribute("soundvolume", soundVolume),
new XAttribute("verboselogging", VerboseLogging));
if (WasGameUpdated) if (WasGameUpdated)
{ {