public BARISAppTrackingView() : base("Blah", DialogWidth, DialogHeight) { WindowTitle = Localizer.Format(BARISScenario.AppFlightViewTitle); Resizable = false; }
public VehicleIntegrationStatusView() : base("Blah", DialogWidth, DialogHeight) { WindowTitle = Localizer.Format(BARISScenario.EditorViewTitle); Resizable = false; }
protected void drawTigerTeamRepairs(UnloadedQualitySummary qualitySummary) { bool canAffordScience = true; bool canAffordFunds = true; bool commNetEnabled = true; //Do we have a repair entry? If so, draw the progress. BARISRepairProject repairProject = BARISScenario.Instance.GetRepairProject(qualitySummary.vessel); if (repairProject != null) { GUILayout.Label("<color=white><b>" + Localizer.Format(BARISScenario.RepairTimeProgress) + "</b>" + string.Format("{0:f3}", repairProject.RepairProgress) + "%</color>"); return; } //Calculate repair costs qualitySummary.CalculateRepairCosts(); //If we don't then draw the repair costs and buttons. //Science cost to upgrade flight experience. GUILayout.BeginHorizontal(); if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER || HighLogic.CurrentGame.Mode == Game.Modes.SCIENCE_SANDBOX) { canAffordScience = ResearchAndDevelopment.CanAfford(qualitySummary.repairCostScience); if (canAffordScience) { GUILayout.Label("<color=white><b>" + Localizer.Format(BARISScenario.TestBenchScienceCost) + "</b>" + string.Format("{0:n2}", qualitySummary.repairCostScience) + "</color>"); } else { GUILayout.Label("<color=red><b>" + Localizer.Format(BARISScenario.TestBenchScienceCost) + "</b>" + string.Format("{0:n2}", qualitySummary.repairCostScience) + "</color>"); } } //Funds cost to upgrade flight experience. if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER) { canAffordFunds = Funding.CanAfford(qualitySummary.repairCostFunds); if (canAffordFunds) { GUILayout.Label("<color=white><b>" + Localizer.Format(BARISScenario.TestBenchFundsCost) + "</b>" + string.Format("{0:n2}", qualitySummary.repairCostFunds) + "</color>"); } else { GUILayout.Label("<color=red><b>" + Localizer.Format(BARISScenario.TestBenchFundsCost) + "</b>" + string.Format("{0:n2}", qualitySummary.repairCostFunds) + "</color>"); } } //CommNet status if (CommNet.CommNetScenario.CommNetEnabled) { commNetEnabled = qualitySummary.vessel.connection.IsConnectedHome; } //Time to attempt repair GUILayout.Label("<color=white><b>" + Localizer.Format(BARISScenario.RepairTimeCost) + "</b>" + string.Format("{0:n2}", qualitySummary.repairCostTime) + " " + Localizer.Format(BARISScenario.RepairTimeDays) + "</color>"); //Repair button if (GUILayout.Button(wrenchIcon, buttonOptions)) { //Can we afford the funds? if (!canAffordFunds) { BARISScenario.Instance.LogPlayerMessage(Localizer.Format(BARISScenario.TigerTeamNoFunds)); GUILayout.EndHorizontal(); return; } //Can we afford the science? else if (!canAffordScience) { GUILayout.EndHorizontal(); BARISScenario.Instance.LogPlayerMessage(Localizer.Format(BARISScenario.TigerTeamNoScience)); return; } //Do we have a CommNet connection? else if (!commNetEnabled) { GUILayout.EndHorizontal(); BARISScenario.Instance.LogPlayerMessage(Localizer.Format(BARISScenario.TigerTeamNoComm)); return; } //Deduct the costs if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER) { Funding.Instance.AddFunds(-qualitySummary.repairCostFunds, TransactionReasons.Any); } if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER || HighLogic.CurrentGame.Mode == Game.Modes.SCIENCE_SANDBOX) { ResearchAndDevelopment.Instance.AddScience(-qualitySummary.repairCostScience, TransactionReasons.Any); } //Register the new project registerRepairProject(qualitySummary); } GUILayout.EndHorizontal(); }