public static void OnRecipePickerReturn_Prefix(UIAssemblerWindow __instance, RecipeProto recipe) { if (SimulatedWorld.Initialized) { LocalPlayer.SendPacketToLocalStar(new AssemblerRecipeEventPacket(GameMain.data.localPlanet.factoryIndex, __instance.assemblerId, recipe.ID)); } }
public static void OnProductIcon1Click_Prefix(UIAssemblerWindow __instance) { if (SimulatedWorld.Initialized) { LocalPlayer.SendPacketToLocalStar(new AssemblerUpdateProducesPacket(1, __instance.factorySystem.assemblerPool[__instance.assemblerId].produced[1], GameMain.data.localPlanet.factoryIndex, __instance.assemblerId)); } }
public static void OnProductIcon1Click_Postfix(UIAssemblerWindow __instance) { if (Multiplayer.IsActive) { Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerUpdateProducesPacket(1, __instance.factorySystem.assemblerPool[__instance.assemblerId].produced[1], GameMain.data.localPlanet.id, __instance.assemblerId)); } }
public static void OnRecipeResetClick_Prefix(UIAssemblerWindow __instance) { if (SimulatedWorld.Initialized) { LocalPlayer.SendPacketToLocalStar(new AssemblerRecipeEventPacket(GameMain.data.localPlanet.id, __instance.assemblerId, 0)); } }
public static void OnRecipePickerReturn_Postfix(UIAssemblerWindow __instance, RecipeProto recipe) { if (Multiplayer.IsActive) { Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerRecipeEventPacket(GameMain.data.localPlanet.id, __instance.assemblerId, recipe.ID)); } }
public static void OnIncSwitchClick_Postfix(UIAssemblerWindow __instance) { if (Multiplayer.IsActive) { // Notify others about production switch Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerRecipeEventPacket(GameMain.data.localPlanet.id, __instance.assemblerId, -1)); } }
public static void OnAssemblerIdChange_Prefix(UIAssemblerWindow __instance) { int[] update = new int[__instance.factorySystem.assemblerPool[__instance.assemblerId].served.Length]; StorageComponent assemblerStorage = (StorageComponent)AccessTools.Field(typeof(UIAssemblerWindow), "servingStorage").GetValue(__instance); for (int i = 0; i < update.Length; i++) { update[i] = assemblerStorage.grids[i].count; } LocalPlayer.SendPacketToLocalPlanet(new AssemblerUpdateStoragePacket(update, GameMain.data.localPlanet.factoryIndex, __instance.assemblerId)); }
public static void OnUIUpdate(UIAssemblerWindow __instance) { if (__instance.assemblerId == 0 || __instance.factory == null) { return; } AssemblerComponent assemblerComponent = __instance.factorySystem.assemblerPool[__instance.assemblerId]; if (!assemblerComponent.recipeIsLocked) { __instance.stateText.text = "recipeLockedWarn".Translate(); __instance.stateText.color = __instance.workStoppedColor; } }
public static void OnRecipePickerReturnPatch(UIAssemblerWindow __instance) { if (__instance.assemblerId == 0 || __instance.factory == null) { return; } AssemblerComponent assemblerComponent = __instance.factorySystem.assemblerPool[__instance.assemblerId]; if (assemblerComponent.id != __instance.assemblerId) { return; } SyncAssemblerFunctions(__instance.factorySystem, __instance.player.package, __instance.assemblerId); }
public static void OnManualServingContentChange_Postfix(UIAssemblerWindow __instance) { if (!Multiplayer.IsActive) { return; } int[] served = new int[__instance.factorySystem.assemblerPool[__instance.assemblerId].served.Length]; int[] incServed = new int[served.Length]; StorageComponent assemblerStorage = __instance.servingStorage; for (int i = 0; i < served.Length; i++) { served[i] = assemblerStorage.grids[i].count; incServed[i] = assemblerStorage.grids[i].inc; } Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerUpdateStoragePacket(GameMain.data.localPlanet.id, __instance.assemblerId, served, incServed)); }
public static void OnProductIcon0Click_Prefix(UIAssemblerWindow __instance) { LocalPlayer.SendPacketToLocalPlanet(new AssemblerUpdateProducesPacket(0, __instance.factorySystem.assemblerPool[__instance.assemblerId].produced[0], GameMain.data.localPlanet.factoryIndex, __instance.assemblerId)); }
public static void OnRecipeResetClick_Prefix(UIAssemblerWindow __instance) { LocalPlayer.SendPacketToLocalPlanet(new AssemblerRecipeEventPacket(GameMain.data.localPlanet.factoryIndex, __instance.assemblerId, 0)); }