From 699663267865322c4dc108a8016f28b1a5992e37 Mon Sep 17 00:00:00 2001 From: Alessandro Arantes Date: Sun, 1 Dec 2024 01:23:45 -0300 Subject: [PATCH 1/2] new budget report window, balance fixes, bug fixes --- Bureaucracy/Budget/BudgetEvent.cs | 19 ++++ Bureaucracy/Budget/BudgetManager.cs | 4 +- Bureaucracy/Budget/BudgetReport.cs | 22 ++-- Bureaucracy/Budget/Costs.cs | 3 + Bureaucracy/Crew/CrewManager.cs | 2 +- Bureaucracy/Facilities/BureaucracyFacility.cs | 7 +- Bureaucracy/Facilities/FacilityManager.cs | 2 +- Bureaucracy/Manager.cs | 2 +- Bureaucracy/Science/ResearchManager.cs | 2 +- Bureaucracy/Science/ScienceReport.cs | 4 +- Bureaucracy/UI/UIController.cs | 105 +++++++++++++++--- Bureaucracy/Utilities.cs | 3 +- 12 files changed, 140 insertions(+), 35 deletions(-) diff --git a/Bureaucracy/Budget/BudgetEvent.cs b/Bureaucracy/Budget/BudgetEvent.cs index 2e0796e..e05852b 100644 --- a/Bureaucracy/Budget/BudgetEvent.cs +++ b/Bureaucracy/Budget/BudgetEvent.cs @@ -1,6 +1,7 @@ using System; using System.Linq; +using System.Text; using UnityEngine; namespace Bureaucracy @@ -57,11 +58,29 @@ public override void OnEventCompleted() InternalListeners.OnBudgetAwarded.Fire(funding, facilityDebt); Costs.Instance.ResetLaunchCosts(); repDecay.ApplyRepDecay(Bureaucracy.Instance.settings.RepDecayPercent); + + + //stringbuilder for budget report + if (!Utilities.Instance.IsBootstrapBudgetCycle) + { + StringBuilder reportBuilder = new StringBuilder(); for (int i = 0; i < Bureaucracy.Instance.registeredManagers.Count; i++) { Manager m = Bureaucracy.Instance.registeredManagers.ElementAt(i); m.ThisMonthsBudget = Utilities.Instance.GetNetBudget(m.Name); + + // build cycle report for the manager + var r = m.GetReport(); + reportBuilder.AppendLine(r.ReportTitle.ToUpper().Replace("REPORT", "DETAILS")); + reportBuilder.AppendLine("=================================="); + reportBuilder.AppendLine(r.ReportBody()); + reportBuilder.AppendLine(String.Empty); } + + // show budget cycle window + UiController.Instance.BudgetCycleReportWindow(reportBuilder.ToString()); + } + InformParent(); } diff --git a/Bureaucracy/Budget/BudgetManager.cs b/Bureaucracy/Budget/BudgetManager.cs index f06900b..b24a6d6 100644 --- a/Bureaucracy/Budget/BudgetManager.cs +++ b/Bureaucracy/Budget/BudgetManager.cs @@ -19,7 +19,7 @@ public BudgetManager() Debug.Log("[Bureaucracy]: Budget Manager is ready"); } - protected override Report GetReport() + public override Report GetReport() { return new BudgetReport(); } @@ -49,6 +49,7 @@ public void OnLoad(ConfigNode cn) if (managerNode != null) { bool.TryParse(managerNode.GetValue("IsBootstrapBudgetCycle"), out Utilities.Instance.IsBootstrapBudgetCycle); + double.TryParse(managerNode.GetValue("InitialFunds"), out Utilities.Instance.InitialFunds); float.TryParse(managerNode.GetValue("FundingAllocation"), out FundingAllocation); double.TryParse(managerNode.GetValue("nextBudget"), out nextBudgetTime); CreateNewBudget(nextBudgetTime); @@ -89,6 +90,7 @@ public void OnSave(ConfigNode cn) Debug.Log("[Bureaucracy]: Budget Manager: OnSave"); ConfigNode managerNode = new ConfigNode("BUDGET_MANAGER"); managerNode.SetValue("IsBootstrapBudgetCycle", Utilities.Instance.IsBootstrapBudgetCycle, true); + managerNode.SetValue("InitialFunds", Utilities.Instance.InitialFunds, true); managerNode.SetValue("FundingAllocation", FundingAllocation, true); if (NextBudget != null) managerNode.SetValue("nextBudget", NextBudget.CompletionTime, true); cn.AddNode(managerNode); diff --git a/Bureaucracy/Budget/BudgetReport.cs b/Bureaucracy/Budget/BudgetReport.cs index 69ff894..08619b5 100644 --- a/Bureaucracy/Budget/BudgetReport.cs +++ b/Bureaucracy/Budget/BudgetReport.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Bureaucracy { @@ -12,22 +12,22 @@ public BudgetReport() public override string ReportBody() { ReportBuilder.Clear(); - ReportBuilder.AppendLine("Gross Budget: " + Utilities.Instance.GetGrossBudget()); - ReportBuilder.AppendLine("Staff Wages: " + Costs.Instance.GetWageCosts()); - ReportBuilder.AppendLine("Facility Maintenance Costs: " + Costs.Instance.GetFacilityMaintenanceCosts()); - ReportBuilder.AppendLine("Launch Costs: " + Costs.Instance.GetLaunchCosts()); - ReportBuilder.AppendLine("Total Maintenance Costs: " + Costs.Instance.GetTotalMaintenanceCosts()); - ReportBuilder.AppendLine("Mission Bonuses: " + CrewManager.Instance.LastBonus); - ReportBuilder.AppendLine("Construction Department: " + FacilityManager.Instance.GetAllocatedFunding()); - ReportBuilder.AppendLine("Research Department: " + ResearchManager.Instance.GetAllocatedFunding()); + ReportBuilder.AppendLine($"Gross Budget: {Utilities.Instance.FundsSymbol}{Utilities.Instance.GetGrossBudget()}"); + ReportBuilder.AppendLine($"Staff Wages: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetWageCosts()}"); + ReportBuilder.AppendLine($"Facility Maintenance Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetFacilityMaintenanceCosts()}"); + ReportBuilder.AppendLine($"Launch Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetLaunchCosts()}"); + ReportBuilder.AppendLine($"Total Maintenance Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetTotalMaintenanceCosts()}"); + ReportBuilder.AppendLine($"Mission Bonuses: {Utilities.Instance.FundsSymbol}{CrewManager.Instance.LastBonus}"); + ReportBuilder.AppendLine($"Construction Department: {Utilities.Instance.FundsSymbol}{FacilityManager.Instance.GetAllocatedFunding()}"); + ReportBuilder.AppendLine($"Research Department: {Utilities.Instance.FundsSymbol}{ResearchManager.Instance.GetAllocatedFunding()}"); double netBudget = Utilities.Instance.GetNetBudget("Budget"); - ReportBuilder.AppendLine("Net Budget: " + Math.Max(0, netBudget)); + ReportBuilder.AppendLine($"Net Budget: {Utilities.Instance.FundsSymbol}{Math.Max(0, netBudget)}"); if (netBudget > 0 && netBudget < Funding.Instance.Funds) ReportBuilder.AppendLine("We can't justify extending your funding"); // ReSharper disable once InvertIf if (netBudget < 0) { ReportBuilder.AppendLine("The budget didn't fully cover your space programs costs."); - ReportBuilder.Append("A penalty of " + Math.Round(netBudget, 0) + " will be applied"); + ReportBuilder.Append($"A penalty of {Utilities.Instance.FundsSymbol}{Math.Round(netBudget, 0)} will be applied"); } return ReportBuilder.ToString(); } diff --git a/Bureaucracy/Budget/Costs.cs b/Bureaucracy/Budget/Costs.cs index 1936ab9..affec6b 100644 --- a/Bureaucracy/Budget/Costs.cs +++ b/Bureaucracy/Budget/Costs.cs @@ -65,6 +65,9 @@ public double GetLaunchCosts() public double GetWageCosts() { + // if it's the initial cycle, return 0 (kerbal just been hired!) + if (Utilities.Instance.IsBootstrapBudgetCycle) return 0; + List crew = CrewManager.Instance.Kerbals.Values.ToList(); double wage = 0; for (int i = 0; i < crew.Count; i++) diff --git a/Bureaucracy/Crew/CrewManager.cs b/Bureaucracy/Crew/CrewManager.cs index bc3522d..2671c9e 100644 --- a/Bureaucracy/Crew/CrewManager.cs +++ b/Bureaucracy/Crew/CrewManager.cs @@ -24,7 +24,7 @@ public int LastBonus } } - protected override Report GetReport() + public override Report GetReport() { return new CrewReport(); } diff --git a/Bureaucracy/Facilities/BureaucracyFacility.cs b/Bureaucracy/Facilities/BureaucracyFacility.cs index eba7d01..22e7c84 100644 --- a/Bureaucracy/Facilities/BureaucracyFacility.cs +++ b/Bureaucracy/Facilities/BureaucracyFacility.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using JetBrains.Annotations; @@ -37,8 +37,7 @@ public void CloseFacility() public bool Upgrading { get; private set; } - public int MaintenanceCost => upkeepCost * GetFacilityLevel(); - + public int MaintenanceCost => upkeepCost * (GetFacilityLevel() - 1) + (upkeepCost / 3 * 2); public string Name { get; } public BureaucracyFacility(SpaceCenterFacility spf) @@ -150,7 +149,7 @@ public string GetProgressReport(FacilityUpgradeEvent upgrade) { // ReSharper disable once BuiltInTypeReferenceStyleForMemberAccess if (!Upgrading && !recentlyUpgraded) return String.Empty; - if (!recentlyUpgraded) return Name + ": $" + (upgrade.OriginalCost-upgrade.RemainingInvestment) + " / " + upgrade.OriginalCost; + if (!recentlyUpgraded) return Name + ": " + Utilities.Instance.FundsSymbol + (upgrade.OriginalCost-upgrade.RemainingInvestment) + " / " + upgrade.OriginalCost; recentlyUpgraded = false; return Name + ": Upgrade completed successfully"; } diff --git a/Bureaucracy/Facilities/FacilityManager.cs b/Bureaucracy/Facilities/FacilityManager.cs index d15e6f7..acabfff 100644 --- a/Bureaucracy/Facilities/FacilityManager.cs +++ b/Bureaucracy/Facilities/FacilityManager.cs @@ -48,7 +48,7 @@ public override double GetAllocatedFunding() return Math.Round(Utilities.Instance.GetNetBudget(Name), 0); } - protected override Report GetReport() + public override Report GetReport() { return new FacilityReport(); } diff --git a/Bureaucracy/Manager.cs b/Bureaucracy/Manager.cs index 120d2f4..acdc23a 100644 --- a/Bureaucracy/Manager.cs +++ b/Bureaucracy/Manager.cs @@ -39,6 +39,6 @@ public virtual void ProgressTask() { } public virtual void OnEventCompletedManagerActions(BureaucracyEvent eventCompleted) { } - protected virtual Report GetReport() { return new Report(); } + public virtual Report GetReport() { return new Report(); } } } \ No newline at end of file diff --git a/Bureaucracy/Science/ResearchManager.cs b/Bureaucracy/Science/ResearchManager.cs index 19c3c4d..1af26d8 100644 --- a/Bureaucracy/Science/ResearchManager.cs +++ b/Bureaucracy/Science/ResearchManager.cs @@ -41,7 +41,7 @@ public override void ProgressTask() RemoveCompletedEvents(); } - protected override Report GetReport() + public override Report GetReport() { return new ScienceReport(); } diff --git a/Bureaucracy/Science/ScienceReport.cs b/Bureaucracy/Science/ScienceReport.cs index 203bb7a..e56bed1 100644 --- a/Bureaucracy/Science/ScienceReport.cs +++ b/Bureaucracy/Science/ScienceReport.cs @@ -26,7 +26,9 @@ public override string ReportBody() ReportBuilder.AppendLine(se.UiName + ": " + Math.Round(processedScience, 1) + "/" + Math.Round(se.OriginalScience, 1)); } ResearchManager.Instance.CompletedEvents.Clear(); - return ReportBuilder.ToString(); + string report = ReportBuilder.ToString(); + if (String.IsNullOrEmpty(report)) report = "No Research updates to report"; + return report; } } } \ No newline at end of file diff --git a/Bureaucracy/UI/UIController.cs b/Bureaucracy/UI/UIController.cs index cdf6b1d..608ec09 100644 --- a/Bureaucracy/UI/UIController.cs +++ b/Bureaucracy/UI/UIController.cs @@ -1,7 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; +using System.Text; using JetBrains.Annotations; using KSP.UI.Screens; using UnityEngine; @@ -30,6 +32,8 @@ public class UiController : MonoBehaviour private PopupDialog researchWindow; public PopupDialog allocationWindow; public PopupDialog crewWindow; + public PopupDialog cycleReportWindow; + [UsedImplicitly] public PopupDialog errorWindow; private int padding; private const int PadFactor = 10; @@ -217,7 +221,7 @@ private PopupDialog DrawBudgetAllocationUi() private string ShowFunding(Manager manager) { - return "$"+Math.Round(Utilities.Instance.GetNetBudget(manager.Name),0).ToString(CultureInfo.CurrentCulture); + return Utilities.Instance.FundsSymbol + Math.Round(Utilities.Instance.GetNetBudget(manager.Name),0).ToString(CultureInfo.CurrentCulture); } private string SetAllocation(string managerName, string passedString) @@ -248,6 +252,11 @@ private void DismissAllWindows() if(crewWindow != null) crewWindow.Dismiss(); } + private void DismissCycleReport() + { + cycleReportWindow.Dismiss(); + } + private PopupDialog DrawMainUi() { padding = 0; @@ -258,20 +267,20 @@ private PopupDialog DrawMainUi() { innerElements.Add(new DialogGUISpace(10)); innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Next Budget: " + Utilities.Instance.ConvertUtToKspTimeStamp(BudgetManager.Instance.NextBudget.CompletionTime), false))); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Gross Budget: $" + Utilities.Instance.GetGrossBudget(), false))); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Wage Costs: $" + Costs.Instance.GetWageCosts(), false))); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Facility Maintenance Costs: $" + Costs.Instance.GetFacilityMaintenanceCosts(), false))); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Launch Costs: $"+Costs.Instance.GetLaunchCosts(), false))); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Mission Bonuses: $" + GetBonusesToPay(), false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Gross Budget: {Utilities.Instance.FundsSymbol}{Utilities.Instance.GetGrossBudget()}", false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Wage Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetWageCosts()}", false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Facility Maintenance Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetFacilityMaintenanceCosts()}", false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Launch Costs: {Utilities.Instance.FundsSymbol}{Costs.Instance.GetLaunchCosts()}", false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Mission Bonuses: {Utilities.Instance.FundsSymbol}{GetBonusesToPay()}", false))); for (int i = 0; i < Bureaucracy.Instance.registeredManagers.Count; i++) { Manager m = Bureaucracy.Instance.registeredManagers.ElementAt(i); if (m.Name == "Budget") continue; double departmentFunding = Math.Round(Utilities.Instance.GetNetBudget(m.Name), 0); if (departmentFunding < 0.0f) continue; - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel(m.Name + " Department Funding: $" + departmentFunding, false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel(m.Name + " Department Funding: " + Utilities.Instance.FundsSymbol + departmentFunding, false))); } - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("Net Budget: $"+Utilities.Instance.GetNetBudget("Budget"), false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"Net Budget: {Utilities.Instance.FundsSymbol}{Utilities.Instance.GetNetBudget("Budget")}", false))); DialogGUIVerticalLayout vertical = new DialogGUIVerticalLayout(innerElements.ToArray()); vertical.AddChild(new DialogGUIContentSizer(widthMode: ContentSizeFitter.FitMode.Unconstrained, heightMode: ContentSizeFitter.FitMode.MinSize)); dialogElements.Add(new DialogGUIScrollList(new Vector2(300, 300), false, true, vertical)); @@ -289,7 +298,7 @@ private PopupDialog DrawMainUi() DialogGUIBase[] buttons = new DialogGUIBase[2]; buttons[0] = GetTopBoxes("main"); buttons[1] = GetBottomBoxes("main"); - dialogElements.Add(new DialogGUIVerticalLayout(350, 0, buttons)); + dialogElements.Add(new DialogGUIVerticalLayout(300, 0, buttons)); } return PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new MultiOptionDialog("BureaucracyMain", "", "Bureaucracy: Budget", UISkinManager.GetSkin("MainMenuSkin"), @@ -298,7 +307,13 @@ private PopupDialog DrawMainUi() private Rect GetRect(List dialogElements) { - return new Rect(0.5f, 0.5f, 390, 265) {height = 150 + 50 * dialogElements.Count, width = Math.Max(padding, 370)}; + return new Rect(0.5f, 0.5f, 350, 265) {height = 150 + 50 * dialogElements.Count, width = Math.Max(padding, 320)}; + } + + // Cycle Report is a bit wider than other windows to accomodate research labels + private Rect GetCycleReportRect(List dialogElements) + { + return new Rect(0.5f, 0.5f, 410, 265) { height = 150 + 50 * dialogElements.Count, width = Math.Max(padding, 370) }; } private DialogGUIBase[] PaddedLabel(string stringToPad, bool largePrint) @@ -320,6 +335,7 @@ private UIStyle MessageStyle(bool largePrint, bool crewMessage = false) UIStyle style = new UIStyle { fontSize = 12, + fontStyle = FontStyle.Bold, alignment = crewMessage ? TextAnchor.LowerLeft : TextAnchor.LowerCenter, stretchWidth = crewMessage ? false : true, @@ -352,7 +368,7 @@ private PopupDialog DrawFacilityUi() innerElements.Add(new DialogGUISpace(10)); float investmentNeeded = 0; innerElements.Add(new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true)); - innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel("This Month's Budget: $"+Math.Round(FacilityManager.Instance.ThisMonthsBudget, 0), false))); + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel($"This Month's Budget: {Utilities.Instance.FundsSymbol}{Math.Round(FacilityManager.Instance.ThisMonthsBudget, 0)}", false))); for (int i = 0; i < FacilityManager.Instance.Facilities.Count; i++) { BureaucracyFacility bf = FacilityManager.Instance.Facilities.ElementAt(i); @@ -367,7 +383,7 @@ private PopupDialog DrawFacilityUi() DialogGUIVerticalLayout vertical = new DialogGUIVerticalLayout(innerElements.ToArray()); dialogElements.Add(new DialogGUIScrollList(new Vector2(300, 300), false, true, vertical)); DialogGUIBase[] horizontal = new DialogGUIBase[3]; - horizontal[0] = new DialogGUILabel("Total Investment Needed: $"+investmentNeeded); + horizontal[0] = new DialogGUILabel($"Total Investment Needed: {Utilities.Instance.FundsSymbol}{investmentNeeded}"); horizontal[1] = new DialogGUILabel("|"); horizontal[2] = new DialogGUILabel("Chance of Fire: "+Math.Round(FacilityManager.Instance.FireChance*100, 0)+"%"); dialogElements.Add(new DialogGUIHorizontalLayout(horizontal)); @@ -517,6 +533,69 @@ public PopupDialog KctError() return PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new MultiOptionDialog("KCTError", "", "KCT Detected!", UISkinManager.GetSkin("MainMenuSkin"), new Rect(0.5f, 0.5f, 400,100), dialogElements.ToArray()), false, UISkinManager.GetSkin("MainMenuSkin")); } + // budget report window, shown at the end of each budget cycle + public PopupDialog BudgetCycleReportWindow(string report) + { + padding = 0; + List dialogElements = new List(); + List innerElements = new List(); + if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER) innerElements.Add(new DialogGUILabel("Bureaucracy is only available in Career Games")); + else + { + // display report contents + var reportLines = ("\r\n" + report.Replace("\r\n\r\n\r\n", "\r\n\r\n")).Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); + innerElements.Add(new DialogGUISpace(7)); + for (int i = 1; i < reportLines.Length; i++) + { + if (String.IsNullOrEmpty(reportLines[i])) + { + innerElements.Add(new DialogGUISpace(15)); + } + else + { + innerElements.Add(new DialogGUIHorizontalLayout(PaddedLabel(reportLines[i], false))); + } + } + + DialogGUIVerticalLayout vertical = new DialogGUIVerticalLayout(innerElements.ToArray()) { anchor = TextAnchor.UpperLeft }; + vertical.AddChild(new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true)); + var contentsScrollList = new DialogGUIScrollList(new Vector2(400, 300), false, true, vertical); + dialogElements.Add(contentsScrollList); + + // allocations footer + DialogGUIBase[] horizontal = new DialogGUIBase[7]; + horizontal[0] = new DialogGUISpace(2); + horizontal[1] = new DialogGUILabel("Allocations: "); + horizontal[2] = new DialogGUILabel("Funds: " + GetAllocation(BudgetManager.Instance) + "%"); + horizontal[3] = new DialogGUILabel("|"); + horizontal[4] = new DialogGUILabel("Construction: " + GetAllocation(FacilityManager.Instance) + "%"); + horizontal[5] = new DialogGUILabel("|"); + horizontal[6] = new DialogGUILabel("Research: " + GetAllocation(ResearchManager.Instance) + "%"); + dialogElements.Add(new DialogGUIHorizontalLayout(horizontal)); + + // close button + var closeBbutton = new DialogGUIButton("Close", DismissCycleReport, false); + dialogElements.Add(new DialogGUIHorizontalLayout(380, 30, closeBbutton) { stretchWidth = true }); + } + cycleReportWindow = PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), + new MultiOptionDialog("BureaucracyMain", "", + $"Bureaucracy: Budget Cycle Report - {KSPUtil.PrintDate(Planetarium.GetUniversalTime(), includeTime: false)}", + UISkinManager.GetSkin("MainMenuSkin"), GetCycleReportRect(dialogElements), dialogElements.ToArray()), false, + UISkinManager.GetSkin("MainMenuSkin"), false); + + + Invoke("SetCycleBudgetScroll", 0.1f); + + + return cycleReportWindow; + } + + private void SetCycleBudgetScroll() + { + var contentScrollRect = GameObject.Find("_UIMaster/DialogCanvas/BureaucracyMain dialog handler/UIScrollViewPrefab(Clone)/ScrollList/"); + contentScrollRect.GetComponent().verticalNormalizedPosition = 1f; + } + private void OnDestroy() { GameEvents.onGUIApplicationLauncherReady.Remove(SetupToolbarButton); diff --git a/Bureaucracy/Utilities.cs b/Bureaucracy/Utilities.cs index 8afee15..68c40f1 100644 --- a/Bureaucracy/Utilities.cs +++ b/Bureaucracy/Utilities.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Random = System.Random; @@ -12,6 +12,7 @@ public class Utilities public readonly Random Randomise = new Random(); public double InitialFunds; // for processing of initial cycle public bool IsBootstrapBudgetCycle; // master flag to control behavior of cycle processing. + public string FundsSymbol = "V"; public Utilities() { From a2972338e6e2115a4deefc75598c0a4932e926f8 Mon Sep 17 00:00:00 2001 From: Alessandro Arantes Date: Sun, 1 Dec 2024 01:26:35 -0300 Subject: [PATCH 2/2] new .csproj --- Bureaucracy/Bureaucracy.csproj | 254 ++++----------------------------- 1 file changed, 25 insertions(+), 229 deletions(-) diff --git a/Bureaucracy/Bureaucracy.csproj b/Bureaucracy/Bureaucracy.csproj index b6c14a5..b09027c 100644 --- a/Bureaucracy/Bureaucracy.csproj +++ b/Bureaucracy/Bureaucracy.csproj @@ -34,52 +34,13 @@ - H:\KSP1123\KSP_x64_Data\Managed\Assembly-CSharp.dll + D:\KSPDebug\KSP_x64_Data\Managed\Assembly-CSharp.dll - H:\KSP1123\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll + D:\KSPDebug\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll - H:\KSP1123\GameData\FlightTracker\FlightTracker.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.CJK.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.MidEast.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.Other.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.Rare.dll - - - H:\KSP1123\KSP_x64_Data\Managed\I18N.West.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Ionic.Zip.dll - - - H:\KSP1123\KSP_x64_Data\Managed\KSPAssets.dll - - - H:\KSP1123\KSP_x64_Data\Managed\KSPAssets.XmlSerializers.dll - - - H:\KSP1123\KSP_x64_Data\Managed\KSPTrackIR.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Mono.Cecil.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Mono.Posix.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Mono.Security.dll + ..\..\..\..\Desktop\UABE\FlightTracker.dll H:\KSP1123\KSP_x64_Data\Managed\mscorlib.dll @@ -94,206 +55,26 @@ H:\KSP1123\KSP_x64_Data\Managed\System.Security.dll - - H:\KSP1123\KSP_x64_Data\Managed\Unity.Analytics.DataPrivacy.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.Analytics.StandardEvents.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.Analytics.Tracker.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll - - - H:\KSP1123\KSP_x64_Data\Managed\Unity.Timeline.dll - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AccessibilityModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AIModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AndroidJNIModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AssetBundleModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.AudioModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ClothModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ClusterInputModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ClusterRendererModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.AssetBundleModule.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.CrashReportingModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.DirectorModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.DSPGraphModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.GameCenterModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.GridModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.HotReloadModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ImageConversionModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.InputModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.JSONSerializeModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.LocalizationModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ParticleSystemModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.PerformanceReportingModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.Physics2DModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.PhysicsModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ProfilerModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.ScreenCaptureModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.SharedInternalsModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.SpriteMaskModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.SpriteShapeModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.StreamingModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.SubstanceModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.SubsystemsModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TerrainModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TerrainPhysicsModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TextCoreModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TilemapModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.TLSModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UI.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UIElementsModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.UI.dll - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UIModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UmbraModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UNETModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityAnalyticsModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityConnectModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityTestProtocolModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityWebRequestModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.VehiclesModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.VFXModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.VideoModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.VRModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.WindModule.dll - - - H:\KSP1123\KSP_x64_Data\Managed\UnityEngine.XRModule.dll + D:\KSPDebug\KSP_x64_Data\Managed\UnityEngine.UIModule.dll @@ -341,6 +122,21 @@ + + echo Running debug post-build event... + +xcopy /Y "$(TargetDir)$(ProjectName).dll" "D:\KSPDebug\GameData\Bureaucracy\" + +if exist "$(TargetDir)$(ProjectName).pdb" ( + xcopy /Y "$(TargetDir)$(ProjectName).pdb" "D:\KSPDebug\GameData\Bureaucracy\" +) else ( + echo Target file does not exist. Skipping copy. +) + +if "$(ConfigurationName)" == "Release" ( + xcopy /Y "$(TargetDir)$(ProjectName).dll" "D:\SteamLibrary\steamapps\common\Kerbal Space Program\GameData" +) +