コード例 #1
0
 private static void Postfix(Valve __instance, ValveBase ___valveBase)
 {
     if (FluidWarpMod_Utils.IsWarpGate(___valveBase))
     {
         WarpSpaceManager.OnWarpGateChannelChange(___valveBase);
     }
 }
コード例 #2
0
 private static bool Prefix(ValveBase __instance, float dt, int ___inputCell, int ___outputCell)
 {
     if (FluidWarpMod_Utils.IsWarpGate(__instance))
     {
         __instance.UpdateAnim();
         return(false);
     }
     return(true);
 }
コード例 #3
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Logger.LogFormat(" === FluidWarpMod_ValveSideScreen_SetTarget Postfix === ");
            var valveBase = FluidWarpMod_Utils.GetValveBaseFromScreen(__instance);

            if (FluidWarpMod_Utils.IsWarpGate(valveBase))
            {
                ((LocText)minFlowLabelFI.GetValue(__instance)).text = "-Channel";
                ((LocText)maxFlowLabelFI.GetValue(__instance)).text = "+Channel";
            }
        }
コード例 #4
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Logger.LogFormat(" === FluidWarpMod_ValveSideScreen_SetTarget Postfix === ");

            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if (type == LiquidWarpConfig.CONDUIT_TYPE || type == GasWarpConfig.CONDUIT_TYPE)
            {
                ((LocText)minFlowLabelFI.GetValue(__instance)).text = "-Channel";
                ((LocText)maxFlowLabelFI.GetValue(__instance)).text = "+Channel";
            }
        }
コード例 #5
0
 private static bool Prefix(Valve __instance, object data)
 {
     if (FluidWarpMod_Utils.IsWarpGate(__instance.GetValveBase()))
     {
         GameObject gameObject = (GameObject)data;
         Valve      component  = gameObject.GetComponent <Valve>();
         if (component != null && FluidWarpMod_Utils.IsWarpGate(component.GetValveBase()))
         {
             __instance.ChangeFlow(component.GetValveBase().CurrentFlow);
         }
         return(false);
     }
     return(true);
 }
コード例 #6
0
 private static void Postfix(ValveSideScreen __instance, float newValue)
 {
     if (FluidWarpMod_Utils.IsWarpGate(FluidWarpMod_Utils.GetValveBaseFromScreen(__instance)))
     {
         if (newValue == 10f)
         {
             ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.OFF_LABEL;
         }
         else
         {
             ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.CHANNEL_LABEL;
         }
     }
 }
コード例 #7
0
        private static void Postfix(ValveSideScreen __instance, float newValue)
        {
            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if ((type == LiquidWarpConfig.CONDUIT_TYPE || type == GasWarpConfig.CONDUIT_TYPE))
            {
                if (newValue == 10f)
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.OFF_LABEL;
                }
                else
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.CHANNEL_LABEL;
                }
            }
        }
コード例 #8
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Logger.LogFormat(" === FluidWarpMod_ValveSideScreen_OnSpawn Postfix === ");

            if (FluidWarpMod_Utils.IsWarpGate(FluidWarpMod_Utils.GetValveBaseFromScreen(__instance)))
            {
                if ((float)((KNumberInputField)numberInputFI.GetValue(__instance)).currentValue == 10f)
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.OFF_LABEL;
                }
                else
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.CHANNEL_LABEL;
                }
            }
        }
コード例 #9
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Logger.LogFormat(" === FluidWarpMod_ValveSideScreen_OnSpawn Postfix === ");

            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if (type == LiquidWarpConfig.CONDUIT_TYPE || type == GasWarpConfig.CONDUIT_TYPE)
            {
                if ((float)((KNumberInputField)numberInputFI.GetValue(__instance)).currentValue == 10f)
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.OFF_LABEL;
                }
                else
                {
                    ((LocText)unitsLabelFI.GetValue(__instance)).text = FluidWarpMod_Utils.CHANNEL_LABEL;
                }
            }
        }
コード例 #10
0
 public static bool Prefix(ValveBase __instance)
 {
     if (FluidWarpMod_Utils.IsWarpGate(__instance))
     {
         var   controller  = ((KBatchedAnimController)controllerFI.GetValue(__instance));
         float averageRate = Game.Instance.accumulators.GetAverageRate(__instance.AccumulatorHandle);
         if (averageRate <= 0f)
         {
             controller.Play("off", KAnim.PlayMode.Once, 1f, 0f);
         }
         else
         {
             controller.Play("hi", (averageRate > 0f ? KAnim.PlayMode.Loop : KAnim.PlayMode.Once), 1f, 0f);
         }
         return(false);
     }
     return(true);
 }
コード例 #11
0
        private static bool Prefix(SideScreenContent __instance, ref string __result)
        {
            Logger.LogFormat(" === FluidWarpMod_SideScreenContent_GetTitle Postfix === ");

            if (!(__instance is ValveSideScreen))
            {
                return(true);
            }

            if (FluidWarpMod_Utils.IsWarpGate(FluidWarpMod_Utils.GetValveBaseFromScreen((ValveSideScreen)__instance)))
            {
                __result = "Channel";
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #12
0
        private static bool Prefix(SideScreenContent __instance, ref string __result)
        {
            Logger.LogFormat(" === FluidWarpMod_SideScreenContent_GetTitle Postfix === ");

            if (!(__instance is ValveSideScreen))
            {
                return(true);
            }

            ConduitType type = FluidWarpMod_Utils.GetConduitType((ValveSideScreen)__instance);

            if (type == LiquidWarpConfig.CONDUIT_TYPE || type == GasWarpConfig.CONDUIT_TYPE)
            {
                __result = "Channel";
                return(false);
            }
            else
            {
                return(true);
            }
        }