private void txtFileName_MouseHover(object sender, EventArgs e) { if (chkBoxKeepFilenames.Checked == false) { CustomTooltip.DisplayTooltip("Files get number suffixes when exporting multiple files. Ex: image_1.jpg, image_2.jpg...", txtFileName, 600); } }
private void txtFileName_MouseLeave(object sender, EventArgs e) { if (chkBoxKeepFilenames.Checked == false) { CustomTooltip.Dispose(); } }
private void txtFileName_MouseEnter(object sender, EventArgs e) { if (chkBoxKeepFilenames.Checked == false) { CustomTooltip.DisplayTooltip("Image files get number suffixes if multiple files get converted. Ex: image_1.jpg, image_2.jpg...", txtFileName, 600); } }
void OnTooltip(bool show) { if (show == true) { //CustomTooltip.Show(tooltipText); CustomTooltip.Show(localizeKey, true); return; } UITooltip.Hide(); }
public static void InvInterface_HideCursorText(InvInterface __instance) { CustomItem custom = __instance.mainGUI.targetItem?.GetHook <CustomItem>(); if (custom is IItemTargetable targetable) { CustomTooltip tooltip = targetable.TargetCursorText(null); __instance.cursorTextCanvas3.enabled = !string.IsNullOrEmpty(tooltip.Text); __instance.cursorTextString3.text = tooltip.Text ?? string.Empty; __instance.cursorTextString3.color = tooltip.Color ?? Color.white; } }
public static void InvSlot_LateUpdate(InvSlot __instance, Text ___itemText) { CustomItem custom = __instance.item?.GetHook <CustomItem>(); if (custom != null) { ___itemText.enabled = true; CustomTooltip tooltip = custom.GetCountString(); ___itemText.text = tooltip.Text ?? string.Empty; ___itemText.color = tooltip.Color ?? Color.white; } }
void Awake() { if (mInstance == null) { mInstance = this; } else if (mInstance != this) { Destroy(gameObject); } DontDestroyOnLoad(this); }
public static void EquippedItemSlot_LateUpdateEquippedItemSlot(EquippedItemSlot __instance) { CustomItem custom = __instance.item?.GetHook <CustomItem>(); if (custom != null) { __instance.countText.enabled = true; __instance.countText.rectTransform.localScale = new Vector3(0.2f, 0.2f, 1f); CustomTooltip tooltip = custom.GetCountString(); __instance.countText.text = tooltip.Text ?? string.Empty; __instance.countText.color = tooltip.Color ?? Color.white; } }
public static void InvInterface_ShowTarget(InvInterface __instance, InvItem item) { __instance.cursorTextString3.color = Color.white; if (item.itemType != ItemTypes.Combine) { CustomItem custom = item.GetHook <CustomItem>(); if (custom is IItemTargetable targetable) { CustomTooltip tooltip = targetable.TargetCursorText(item.agent.target.playfieldObject); __instance.cursorTextCanvas3.enabled = !string.IsNullOrEmpty(tooltip.Text); __instance.cursorTextString3.text = tooltip.Text ?? string.Empty; __instance.cursorTextString3.color = tooltip.Color ?? Color.white; } } }
private void OnElementPointerEntered(object sender, PointerRoutedEventArgs e) { if (null != popup) { return; } var tooltip = CustomTooltipService.GetTooltip(Element); var placement = PlacementMode.Bottom;// CustomTooltipService.GetPlacement(Element); var host = tooltip as CustomTooltip; if (null == host) { host = new CustomTooltip { Content = tooltip }; } popup = new Popup { Child = host, IsOpen = true, IsLightDismissEnabled = true }; host.SetBinding( FrameworkElement.DataContextProperty, new Binding { Path = new PropertyPath("DataContext"), Source = Element }); UIElement placementTarget = null; if (placement != PlacementMode.Mouse) { placementTarget = CustomTooltipService.GetPlacementTarget(Element) ?? (sender as UIElement); } PerformPlacement(popup, placement, placementTarget, e.GetCurrentPoint(Window.Current.Content)); }
private void checkBoxSubFolders_MouseHover(object sender, EventArgs e) { CustomTooltip.DisplayTooltip("Scans all subfolders when importing a folder.", checkBoxSubFolders, 600); }
private void checkBoxAutocastDisabled_MouseHover(object sender, EventArgs e) { CustomTooltip.DisplayTooltip("Disabled Autocast", checkBoxAutocastDisabled, 600); }
private void checkBoxPassiveDisabled_MouseHover(object sender, EventArgs e) { CustomTooltip.DisplayTooltip("Disabled Passive", checkBoxPassiveDisabled, 600); }
private void checkBoxButtonDisabled_MouseHover(object sender, EventArgs e) { CustomTooltip.DisplayTooltip("Disabled Button", checkBoxButtonDisabled, 600); }
public static void InvInterface_TargetAnywhere(InvInterface __instance, Vector2 myPos, bool pressedButton) { __instance.cursorTextString3.color = Color.white; bool debug = RogueFramework.IsDebugEnabled(DebugFlags.Items); InvItem invItem = __instance.mainGUI.targetItem; if (invItem != null) { CustomItem custom = invItem.GetHook <CustomItem>(); __instance.cursorHighlightTargetObjects = custom is IItemTargetable; if (custom is IItemTargetableAnywhere targetable) { if (debug && pressedButton) { RogueFramework.LogDebug($"Targeting {custom} ({invItem.invItemName}) anywhere:"); } bool filter = targetable.TargetFilter(myPos); __instance.cursorHighlight = filter; __instance.cursorHighlightTargetAnywhere = filter; __instance.mainGUI.agent.targetImage.tr.localScale = Vector3.one; CustomTooltip tooltip = targetable.TargetCursorText(myPos); __instance.cursorTextCanvas3.enabled = !string.IsNullOrEmpty(tooltip.Text); __instance.cursorTextString3.text = tooltip.Text ?? string.Empty; __instance.cursorTextString3.color = tooltip.Color ?? Color.white; if (pressedButton) { OnItemTargetingAnywhereArgs args = new OnItemTargetingAnywhereArgs(invItem, myPos, invItem.agent); if (InventoryChecks.onItemTargetingAnywhere.Raise(args, custom?.ItemInfo.IgnoredChecks)) { myPos = args.Target; using (AgentSwapper swapper = new AgentSwapper(invItem, args.User)) { bool success = targetable.TargetPosition(myPos); if (debug) { RogueFramework.LogDebug($"---- Targeting {(success ? "was successful" : "failed")}."); } if (success) { new ItemFunctions().UseItemAnim(invItem, invItem.agent); } if (custom.Count < 1 || !custom.Inventory.InvItemList.Contains(custom.Item) && InventoryChecks.IsCheckAllowed(custom, "StopOnZero")) { if (debug) { RogueFramework.LogDebug("---- Triggered \"StopOnZero\" inventory check."); } __instance.HideDraggedItem(); __instance.HideTarget(); } } } else { if (debug) { RogueFramework.LogDebug("---- Targeting was prevented by an inventory check."); } } } } } }
private void listFileEntries_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e) { CustomTooltip.DisplayTooltip(e.Item.Tag.ToString(), listFileEntries, 600); }
public static void InvSlot_SetColor(InvSlot __instance) { // set default color __instance.toolbarNumText.color = new Color32(255, 237, 0, 255); InvItem combiner = __instance.mainGUI.targetItem ?? __instance.database.invInterface.draggedInvItem; if (combiner is null) { return; } InvItem combinee = __instance.curItemList[__instance.slotNumber]; CustomItem custom = combiner.GetHook <CustomItem>(); if (!(custom is IItemCombinable combinable)) { return; } if (__instance.slotType == "Player" || __instance.slotType == "Toolbar" || __instance.slotType == "Chest" || __instance.slotType == "NPCChest") { if (combinee.invItemName != null && combiner.itemType == ItemTypes.Combine) { if (combiner.CombineItems(combinee, __instance.slotNumber, string.Empty, __instance.agent) && __instance.slotType != "NPCChest") { __instance.myImage.color = new Color32(0, __instance.br, __instance.br, __instance.standardAlpha); __instance.itemImage.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); __instance.myImage.sprite = __instance.invBoxCanUse; } else if ((__instance.slotType != "Toolbar" || __instance.mainGUI.openedInventory) && __instance.slotType != "NPCChest") { __instance.myImage.color = new Color32(__instance.br, 0, __instance.br, __instance.standardAlpha); __instance.itemImage.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, __instance.fadedItemAlpha); __instance.myImage.sprite = __instance.invBoxNormal; __instance.toolbarNumTextGo.SetActive(false); } if (__instance.slotType != "NPCChest" && __instance.slotType != "Chest") { CustomTooltip tooltip = combinable.CombineTooltip(combinee); __instance.toolbarNumTextGo.SetActive(true); __instance.toolbarNumText.text = tooltip.Text ?? string.Empty; __instance.toolbarNumText.color = tooltip.Color ?? new Color32(255, 237, 0, 255); } } else if (__instance.slotType != "NPCChest" && (combinee.invItemName != null || combiner.itemType != ItemTypes.Combine)) { __instance.myImage.color = __instance.overSlot ? (Color) new Color32(0, __instance.br, __instance.br, __instance.standardAlpha) : (Color) new Color32(__instance.br, __instance.br, __instance.br, __instance.standardAlpha); __instance.itemImage.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); __instance.myImage.sprite = __instance.invBoxNormal; if (__instance.slotType == "Toolbar") { __instance.toolbarNumTextGo.SetActive(false); } } if (__instance.mainGUI.curSelected == __instance.mySelectable && __instance.agent.controllerType != "Keyboard") { __instance.invInterface.OnSelectionBox(__instance.slotType, __instance.tr.position); } } }