From 82c735fcb9b3f0b31b13003081f1d18929dfaa27 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sat, 18 May 2019 17:32:27 +0300 Subject: [PATCH] (72ae6ed22) Use display name (translated) instead of room name. --- .../GameModes/Tutorials/DoctorTutorial.cs | 6 +-- .../BarotraumaShared/Source/GameSettings.cs | 48 +++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs index 3045bdc5c..f5259472d 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs @@ -235,7 +235,7 @@ namespace Barotrauma.Tutorials patient1.CanSpeak = true; var newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), patient1.CurrentHull, null, orderGiver: patient1); GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime); - patient1.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.RoomName, givingOrderToSelf: false), ChatMessageType.Order); + patient1.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order); patient1.AIController.Enabled = true; while (doctor.CurrentHull != patient1.CurrentHull) @@ -319,7 +319,7 @@ namespace Barotrauma.Tutorials patient2.CanSpeak = true; newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), patient2.CurrentHull, null, orderGiver: patient2); GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime); - patient2.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.RoomName, givingOrderToSelf: false), ChatMessageType.Order); + patient2.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order); patient2.AIController.Enabled = true; patient2.Oxygen = -50; CoroutineManager.StartCoroutine(KeepPatientAlive(patient2), "KeepPatient2Alive"); @@ -381,7 +381,7 @@ namespace Barotrauma.Tutorials newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), subPatients[i].CurrentHull, null, orderGiver: subPatients[i]); GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime); - string message = newOrder.GetChatMessage("", subPatients[i].CurrentHull?.RoomName, givingOrderToSelf: false); + string message = newOrder.GetChatMessage("", subPatients[i].CurrentHull?.DisplayName, givingOrderToSelf: false); if (subPatients[i].CanSpeak) { subPatients[i].Speak(message, ChatMessageType.Order); diff --git a/Barotrauma/BarotraumaShared/Source/GameSettings.cs b/Barotrauma/BarotraumaShared/Source/GameSettings.cs index d6722b111..64b8a8358 100644 --- a/Barotrauma/BarotraumaShared/Source/GameSettings.cs +++ b/Barotrauma/BarotraumaShared/Source/GameSettings.cs @@ -821,6 +821,54 @@ namespace Barotrauma VoiceSetting = voiceSetting; } } + if (!SelectedContentPackages.Any()) + { + var availablePackage = ContentPackage.List.FirstOrDefault(cp => cp.IsCompatible() && cp.CorePackage); + if (availablePackage != null) + { + SelectedContentPackages.Add(availablePackage); + } + } + + //save to get rid of the invalid selected packages in the config file + if (missingPackagePaths.Count > 0 || incompatiblePackages.Count > 0) { SaveNewPlayerConfig(); } + } + #endregion + + #region Save DefaultConfig + private void SaveNewDefaultConfig() + { + XDocument doc = new XDocument(); + + if (doc.Root == null) + { + doc.Add(new XElement("config")); + } + + doc.Root.Add( + new XAttribute("language", TextManager.Language), + new XAttribute("masterserverurl", MasterServerUrl), + new XAttribute("autocheckupdates", AutoCheckUpdates), + new XAttribute("musicvolume", musicVolume), + new XAttribute("soundvolume", soundVolume), + new XAttribute("voicechatvolume", voiceChatVolume), + new XAttribute("verboselogging", VerboseLogging), + new XAttribute("savedebugconsolelogs", SaveDebugConsoleLogs), + new XAttribute("enablesplashscreen", EnableSplashScreen), + new XAttribute("usesteammatchmaking", useSteamMatchmaking), + new XAttribute("quickstartsub", QuickStartSubmarineName), + new XAttribute("requiresteamauthentication", requireSteamAuthentication), + new XAttribute("aimassistamount", aimAssistAmount)); + + if (!ShowUserStatisticsPrompt) + { + doc.Root.Add(new XAttribute("senduserstatistics", sendUserStatistics)); + } + + if (WasGameUpdated) + { + doc.Root.Add(new XAttribute("wasgameupdated", true)); + } useSteamMatchmaking = doc.Root.GetAttributeBool("usesteammatchmaking", useSteamMatchmaking); requireSteamAuthentication = doc.Root.GetAttributeBool("requiresteamauthentication", requireSteamAuthentication);