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); }
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"; } }
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."; } }
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"; } }
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; } } }
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."; } }
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); } }
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; } } }
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; } } }
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; } } }
public static ConduitType GetConduitType(ValveSideScreen __instance) { ConduitType type = ((ValveBase)valveValveBaseFI.GetValue(valveSideScreenTargetValveFI.GetValue(__instance))).conduitType; return(type); }
public static ValveBase GetValveBaseFromScreen(ValveSideScreen __instance) { return((ValveBase)valveValveBaseFI.GetValue(valveSideScreenTargetValveFI.GetValue(__instance))); }