Ejemplo n.º 1
0
        public static ConduitType GetConduitType(ValveSideScreen __instance)
        {
            FieldInfo fi1 = AccessTools.Field(typeof(ValveSideScreen), "targetValve");
            FieldInfo fi2 = AccessTools.Field(typeof(Valve), "valveBase");

            ConduitType type = ((ValveBase)fi2.GetValue(fi1.GetValue(__instance))).conduitType;

            return(type);
        }
Ejemplo n.º 2
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";
            }
        }
Ejemplo n.º 3
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Debug.Log(" === FluidWarpMod_ValveSideScreen_OnSpawn Postfix === ");

            FieldInfo   fi0  = AccessTools.Field(typeof(ValveSideScreen), "unitsLabel");
            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if (type == (ConduitType)100 || type == (ConduitType)101)
            {
                ((LocText)fi0.GetValue(__instance)).text = "Ch.";
            }
        }
Ejemplo n.º 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";
            }
        }
Ejemplo n.º 5
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;
         }
     }
 }
Ejemplo n.º 6
0
        private static void Postfix(ValveSideScreen __instance)
        {
            Debug.Log(" === FluidWarpMod_ValveSideScreen_SetTarget Postfix === ");

            FieldInfo fi3 = AccessTools.Field(typeof(ValveSideScreen), "minFlowLabel");
            FieldInfo fi4 = AccessTools.Field(typeof(ValveSideScreen), "maxFlowLabel");

            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if (type == (ConduitType)100 || type == (ConduitType)101)
            {
                ((LocText)fi3.GetValue(__instance)).text = "Ch.";
                ((LocText)fi4.GetValue(__instance)).text = "Ch.";
            }
        }
Ejemplo n.º 7
0
        private static bool Prefix(ValveSideScreen __instance, ref string __result)
        {
            Debug.Log(" === FluidWarpMod_ValveSideScreen_GetTitle Postfix === ");

            ConduitType type = FluidWarpMod_Utils.GetConduitType(__instance);

            if (type == (ConduitType)100 || type == (ConduitType)101)
            {
                __result = "Channel";
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 8
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;
                }
            }
        }
Ejemplo n.º 9
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;
                }
            }
        }
Ejemplo n.º 10
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;
                }
            }
        }
Ejemplo n.º 11
0
        public static ConduitType GetConduitType(ValveSideScreen __instance)
        {
            ConduitType type = ((ValveBase)valveValveBaseFI.GetValue(valveSideScreenTargetValveFI.GetValue(__instance))).conduitType;

            return(type);
        }
Ejemplo n.º 12
0
 public static ValveBase GetValveBaseFromScreen(ValveSideScreen __instance)
 {
     return((ValveBase)valveValveBaseFI.GetValue(valveSideScreenTargetValveFI.GetValue(__instance)));
 }