Beispiel #1
0
            }                                                 // skip original method

            static void Postfix(StarmapScreen __instance)
            {
                __instance.Get(out BreakdownList rocketDetailsRange, nameof(rocketDetailsRange));
                BreakdownList list = rocketDetailsRange;

                __instance.Get(out RocketThrustWidget rocketThrustWidget, nameof(rocketThrustWidget));
                __instance.Get(out CommandModule currentCommandModule, nameof(currentCommandModule));
                RocketStatsOverhaul stats = (RocketStatsOverhaul)currentCommandModule.rocketStats;

                list.ClearRows();

                AddImportant(list, StarmapScreenOverhaul.Caption.TotalEngineThrust, stats.GetEngineThrust());
                AddImportantOxidizer(list, StarmapScreenOverhaul.Caption.TotalOxidizerEfficiency, stats.GetAverageOxidizerEfficiency(), stats.GetEfficiencyContribution());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalBoosterThrust, stats.GetBoosterThrust());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalPayload, -stats.GetModulePenalty());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalDistance, stats.GetRocketMaxDistance());
            }
Beispiel #2
0
            }                                                 // skip original method

            static void Postfix(StarmapScreen __instance)
            {
                __instance.Get(out BreakdownList rocketDetailsMass, nameof(rocketDetailsMass));
                BreakdownList list = rocketDetailsMass;

                __instance.Get(out RocketThrustWidget rocketThrustWidget, nameof(rocketThrustWidget));
                __instance.Get(out CommandModule currentCommandModule, nameof(currentCommandModule));
                RocketStatsPatches.TryLog("before cast");
                RocketStatsOverhaul stats = (RocketStatsOverhaul)currentCommandModule.rocketStats;

                RocketStatsPatches.TryLog("after1 cast");
                RocketEngineImproved engine = (RocketEngineImproved)stats.GetMainEngine();

                RocketStatsPatches.TryLog("after2 cast");
                list.SetTitle(StarmapScreenOverhaul.Caption.TotalEngineThrust);
                list.ClearRows();

                string fuelRange = StarmapScreenOverhaul.FormatDistance(engine.MinFuel, "", "kg") + " to " + StarmapScreenOverhaul.FormatDistance(engine.MaxFuel, "", "kg");

                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.EngineExhaustVelocity, StarmapScreenOverhaul.FormatDistance(engine.ExhaustVelocity, "", "m/s"));
                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.RecommendedOxidizableFuel, fuelRange);
                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.TotalOxidizableFuel, StarmapScreenOverhaul.FormatDistance(stats.GetTotalOxidizableFuel(), "", "kg"));
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalEngineThrust, stats.GetEngineThrust());
            }