static bool Prefix(EnchantmentMenu __instance) { var myLogSource = BepInEx.Logging.Logger.CreateLogSource("RemoveEnchantLimit"); myLogSource.LogInfo(__instance.m_refItemInChest.Name); Equipment equipment = __instance.m_refItemInChest as Equipment; myLogSource.LogInfo(equipment.ActiveEnchantments); myLogSource.LogInfo(equipment.ActiveEnchantments.Count); myLogSource.LogInfo((bool)(UnityEngine.Object)__instance.m_refItemInChest); if ((bool)(UnityEngine.Object)__instance.m_refItemInChest) { int enchantmentId = __instance.GetEnchantmentID(); myLogSource.LogInfo(enchantmentId); myLogSource.LogInfo(__instance.m_refEnchantmentStation.Name); if (enchantmentId != -1) { __instance.m_refEnchantmentStation.StartEnchanting(enchantmentId); __instance.UpdateProgressVisibility(0.0f); } else { __instance.m_characterUI.ShowInfoNotificationLoc("Notification_Enchantment_NoMatchingRecipe"); } } else { __instance.m_characterUI.ShowInfoNotificationLoc("Notification_Enchantment_EmptyTable"); } BepInEx.Logging.Logger.Sources.Remove(myLogSource); return(false); }
private void OpenEnchantUI() { EnchantmentMenu.SetActive(npc.Center + new Vector2(0, -300), this); //ZoomHandler.SetZoomAnimation(2.5f, 60); Main.LocalPlayer.GetModPlayer <StarlightPlayer>().ScreenMoveTarget = npc.Center + new Vector2(0, -300); Main.LocalPlayer.GetModPlayer <StarlightPlayer>().ScreenMoveTime = 120; Main.LocalPlayer.GetModPlayer <StarlightPlayer>().ScreenMoveHold = true; Main.LocalPlayer.talkNPC = -1; enchanting = true; UILoader.GetUIState <RichTextBox>().Visible = false; }