# HG changeset patch # User Alys Brooks # Date 2021-11-07 06:18:46 # Node ID dee18095905fd3dc8e9fc339a169e38e023a377d # Parent 9bfcc3df2ffba493ac90b9032b1be163ba4eeecb Fix a bunch of warnings. diff --git a/isometric-park-fna/Engines/DialogEngine.cs b/isometric-park-fna/Engines/DialogEngine.cs --- a/isometric-park-fna/Engines/DialogEngine.cs +++ b/isometric-park-fna/Engines/DialogEngine.cs @@ -48,14 +48,12 @@ { case ProfanityLevel.Uncensored: return s; - break; case ProfanityLevel.Minced: foreach (var item in replacements) { s = s.Replace(item.Key, item.Value); } return s; - break; case ProfanityLevel.Removed: return Regex.Replace(s, "(?i)((?<=d)amn|(?<=f)uck|(?<=D)amn|(?<=F)uck)", "------"); } diff --git a/isometric-park-fna/Engines/PolicyEngine.cs b/isometric-park-fna/Engines/PolicyEngine.cs --- a/isometric-park-fna/Engines/PolicyEngine.cs +++ b/isometric-park-fna/Engines/PolicyEngine.cs @@ -40,7 +40,8 @@ EnforcementLevel.Unspecified => 0, EnforcementLevel.NoEnforcement => 0, EnforcementLevel.EnforcedWithWarnings => 100, - EnforcementLevel.EnforcedWithFines => 100 + EnforcementLevel.EnforcedWithFines => 100, + _ => 0 //C# enums can take on non-declared vaues. Sigh. }; SetComponent(entity, diff --git a/isometric-park-fna/ImageMap.cs b/isometric-park-fna/ImageMap.cs --- a/isometric-park-fna/ImageMap.cs +++ b/isometric-park-fna/ImageMap.cs @@ -64,8 +64,8 @@ } Debug.Assert(ImageMapTexture != null); - Debug.Assert(tileHeight != null); - Debug.Assert(tileWidth != null); + // Debug.Assert(tileHeight != null); + // Debug.Assert(tileWidth != null); Logging.Info("Constructed ImageMap."); diff --git a/isometric-park-fna/UI/Dialog.cs b/isometric-park-fna/UI/Dialog.cs --- a/isometric-park-fna/UI/Dialog.cs +++ b/isometric-park-fna/UI/Dialog.cs @@ -120,7 +120,7 @@ public static bool hadFocus = false; - public static ImGuiImageMap map; + public static ImGuiImageMap? map; private static IntPtr _imGuiTexture; public static void LoadContent(ImGuiRenderer _imGuiRenderer, @@ -157,10 +157,18 @@ ImGui.Columns(2); ImGui.SetColumnWidth(0, 120); + + if (DialogInterface.map != null) + { var metadata = DialogInterface.map.Metadata[imageIndex]; String Tooltip = String.Format("{0}\n\nSource: {1}", metadata.Description, metadata.Source); + Widgets.MapImageTooltip(DialogInterface.map, new Num.Vector2(111, 148), imageIndex, DialogInterface.map.Metadata[imageIndex].Description); - Widgets.MapImageTooltip(DialogInterface.map, new Num.Vector2(111, 148), imageIndex, DialogInterface.map.Metadata[imageIndex].Description); + } + else + { + Logging.Error("Portrait ImageMap not initialized."); + } ImGui.NextColumn(); diff --git a/isometric-park-fna/UI/ForestWindow.cs b/isometric-park-fna/UI/ForestWindow.cs --- a/isometric-park-fna/UI/ForestWindow.cs +++ b/isometric-park-fna/UI/ForestWindow.cs @@ -14,7 +14,6 @@ { public static bool hadFocus = false; - private static bool enforceTresspassing1 = false; private static string enforceTresspassing2 = "Unspecified"; public static void Render(ImFontPtr font, Simulation sim, ImGuiWindowBridgeEngine engine)