private static void Postfix(Valve __instance, ValveBase ___valveBase) { if (FluidWarpMod_Utils.IsWarpGate(___valveBase)) { WarpSpaceManager.OnWarpGateChannelChange(___valveBase); } }
private static bool Prefix(ValveBase __instance, float dt, int ___inputCell, int ___outputCell) { if (FluidWarpMod_Utils.IsWarpGate(__instance)) { __instance.UpdateAnim(); return(false); } return(true); }
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) { 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 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); }
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, 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 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); }
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); } }
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); } }