Ejemplo n.º 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());
            }
Ejemplo n.º 2
0
            }                                                 // skip original method

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

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

                list.SetTitle(StarmapScreenOverhaul.Caption.TotalOxidizerEfficiency);
                list.SetIcon(__instance.rocketDetailsOxidizerIcon);
                list.gameObject.name = nameof(rocketDetailsStorage);
                list.ClearRows();

                stats.GetOxidizerAmounts(out float oxyrockAmount, out float loxAmount, out float mixedAmount);
                float totalEfficiency = stats.GetAverageOxidizerEfficiency();

                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.OxyRock, StarmapScreenOverhaul.FormatDistance(oxyrockAmount, "", "kg"));
                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.LiquidOxygen, StarmapScreenOverhaul.FormatDistance(loxAmount, "", "kg"));
                list.AddRow().ShowData(StarmapScreenOverhaul.Caption.Mixed, StarmapScreenOverhaul.FormatDistance(mixedAmount, "", "kg"));

                AddImportantOxidizer(list, StarmapScreenOverhaul.Caption.TotalOxidizerEfficiency, totalEfficiency, stats.GetEfficiencyContribution());
            }