# HG changeset patch # User Alys Brooks # Date 2021-12-20 01:02:28 # Node ID 2f1c0b5b9bbe33bcb8c7d4ae523e1713991b1b08 # Parent ddbbc21fb42648a030065a9881c5a47e6dbee7dc Fix style. diff --git a/isometric-park-fna/Engines/SimulationBridgeEngine.cs b/isometric-park-fna/Engines/SimulationBridgeEngine.cs --- a/isometric-park-fna/Engines/SimulationBridgeEngine.cs +++ b/isometric-park-fna/Engines/SimulationBridgeEngine.cs @@ -114,32 +114,32 @@ name = string.Format("#logging_company.capitalizeAll# {0}", this.simulation.DateTime.ToShortDateString()) }); -#region events - if (simulation.latestBudget.DateTime != default) - { + #region events + if (simulation.latestBudget.DateTime != default) + { - if (simulation.latestBudget.money < 0M - && simulation.previousBudget.money >= 0M) - { - SendMessage(new SpawnDialogMessage {Path = "EndLowFunds"}); - } - else if (simulation.latestBudget.money < 10_000M - && simulation.previousBudget.money >= 10_000M) - { - SendMessage(new SpawnDialogMessage {Path = "VeryLowFunds"}); - } - else if (simulation.latestBudget.money < 25_000M - && simulation.previousBudget.money >= 25_000M) - { - SendMessage(new SpawnDialogMessage {Path = "LowFunds"}); - } - if (simulation.map.tree_count < 400) - { - SendMessage(new SpawnDialogMessage {Path = "PoorTreeHealth"}); - } - } + if (simulation.latestBudget.money < 0M + && simulation.previousBudget.money >= 0M) + { + SendMessage(new SpawnDialogMessage {Path = "EndLowFunds"}); + } + else if (simulation.latestBudget.money < 10_000M + && simulation.previousBudget.money >= 10_000M) + { + SendMessage(new SpawnDialogMessage {Path = "VeryLowFunds"}); + } + else if (simulation.latestBudget.money < 25_000M + && simulation.previousBudget.money >= 25_000M) + { + SendMessage(new SpawnDialogMessage {Path = "LowFunds"}); + } + if (simulation.map.tree_count < 400) + { + SendMessage(new SpawnDialogMessage {Path = "PoorTreeHealth"}); + } + } -#endregion + #endregion foreach (ref readonly var entity in ReadEntities()) { diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -248,11 +248,12 @@ NewGameWindow.Initialize(this.grammar); this.Story = new Story(File.ReadAllText(@"Content/dialog.json")); - //Bindings have to + //Bindings have to Story.BindExternalFunction ("endGame", () => { - Logging.Success("endGame"); - this.imGuiWindowBridgeEngine.gameStateMessages.Add(new GameStateMessage {isPlaying = false}); - this.imGuiWindowBridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = isometricparkfna.Messages.Window.MainMenu});}); + Logging.Success("endGame"); + this.imGuiWindowBridgeEngine.gameStateMessages.Add(new GameStateMessage {isPlaying = false}); + this.imGuiWindowBridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = isometricparkfna.Messages.Window.MainMenu}); + }); Logging.Debug(this.Story.ContinueMaximally()); diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -201,9 +201,9 @@ public int dead_trees { - get { - return this.map.iterate_cells().Where(c => (c.status == CellStatus.DeadTree)).Count(); - } + get { + return this.map.iterate_cells().Where(c => (c.status == CellStatus.DeadTree)).Count(); + } } public float healthy_percent 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 @@ -143,8 +143,8 @@ private static bool ContentRemaining(DialogComponent dialogComponent) { - return !String.IsNullOrWhiteSpace(dialogComponent.CurrentDialog) - || ((dialogComponent.Options != null) && dialogComponent.Options.Count > 0); + return !String.IsNullOrWhiteSpace(dialogComponent.CurrentDialog) + || ((dialogComponent.Options != null) && dialogComponent.Options.Count > 0); } public static void RenderDialog(Entity entity, @@ -157,8 +157,8 @@ //I don't know if it's the best design, but it's possible to //get into a state where we're effectively done.but there's still an entity if (show && ContentRemaining(dialogComponent)) { - ImGui.PushFont(font); - ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; + ImGui.PushFont(font); + ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; StyleSets.defaultSet.push(); @@ -239,13 +239,13 @@ //If we're at the end, advance it and hide. if (!ContentRemaining(dialogComponent)) { - show = false; - paused = false; - bridgeEngine.dialogChoiceMessages.Add(new DialogChoiceMessage - { - Entity = entity, - Choice = -1 - }); + show = false; + paused = false; + bridgeEngine.dialogChoiceMessages.Add(new DialogChoiceMessage + { + Entity = entity, + Choice = -1 + }); } if (!paused) { diff --git a/isometric-park-fna/UI/StyleSet.cs b/isometric-park-fna/UI/StyleSet.cs --- a/isometric-park-fna/UI/StyleSet.cs +++ b/isometric-park-fna/UI/StyleSet.cs @@ -8,7 +8,6 @@ { public class StyleSet { - // public static IMFont public static void pushStyleVarSet(Dictionary style_set) { @@ -39,8 +38,7 @@ public Dictionary WindowColors {get;} public StyleSet(Dictionary windowVars, - Dictionary windowColors - ) + Dictionary windowColors) { this.WindowVars = windowVars; @@ -58,8 +56,5 @@ StyleSet.popColorSet(this.WindowColors); StyleSet.popStyleVarSet(this.WindowVars); } - - } - } diff --git a/isometric-park-fna/UI/StyleSets.cs b/isometric-park-fna/UI/StyleSets.cs --- a/isometric-park-fna/UI/StyleSets.cs +++ b/isometric-park-fna/UI/StyleSets.cs @@ -61,38 +61,38 @@ {ImGuiCol.Text, black} }; - public static Dictionary defaultWindowColorsLight = new Dictionary { - {ImGuiCol.WindowBg, lightgrey}, - {ImGuiCol.FrameBg, lightgrey}, - {ImGuiCol.FrameBgHovered, lightgrey}, - {ImGuiCol.Header, darkgrey}, - {ImGuiCol.HeaderHovered, darkgrey}, - {ImGuiCol.HeaderActive, darkgrey}, - {ImGuiCol.ButtonHovered, lightgrey}, - {ImGuiCol.ButtonActive, darkgrey}, - {ImGuiCol.SliderGrab, darkgrey}, - {ImGuiCol.SliderGrabActive, darkgrey}, + public static Dictionary defaultWindowColorsLight = new Dictionary { + {ImGuiCol.WindowBg, lightgrey}, + {ImGuiCol.FrameBg, lightgrey}, + {ImGuiCol.FrameBgHovered, lightgrey}, + {ImGuiCol.Header, darkgrey}, + {ImGuiCol.HeaderHovered, darkgrey}, + {ImGuiCol.HeaderActive, darkgrey}, + {ImGuiCol.ButtonHovered, lightgrey}, + {ImGuiCol.ButtonActive, darkgrey}, + {ImGuiCol.SliderGrab, darkgrey}, + {ImGuiCol.SliderGrabActive, darkgrey}, - {ImGuiCol.Tab, darkgrey}, - {ImGuiCol.TabHovered, darkgrey}, - {ImGuiCol.TabActive, selected}, + {ImGuiCol.Tab, darkgrey}, + {ImGuiCol.TabHovered, darkgrey}, + {ImGuiCol.TabActive, selected}, - {ImGuiCol.CheckMark, black}, + {ImGuiCol.CheckMark, black}, - {ImGuiCol.TitleBg, title_bar}, - {ImGuiCol.TitleBgActive, selected}, - {ImGuiCol.TitleBgCollapsed, title_bar}, + {ImGuiCol.TitleBg, title_bar}, + {ImGuiCol.TitleBgActive, selected}, + {ImGuiCol.TitleBgCollapsed, title_bar}, - {ImGuiCol.Border, black}, - {ImGuiCol.BorderShadow, black}, + {ImGuiCol.Border, black}, + {ImGuiCol.BorderShadow, black}, - {ImGuiCol.PopupBg, white}, + {ImGuiCol.PopupBg, white}, - {ImGuiCol.Button, grey_transparent}, - {ImGuiCol.Text, black} - }; - public static StyleSet defaultSet = new StyleSet(defaultWindowVars, defaultWindowColors); + {ImGuiCol.Button, grey_transparent}, + {ImGuiCol.Text, black} + }; + public static StyleSet defaultSet = new StyleSet(defaultWindowVars, defaultWindowColors); } }