static StyledText[] TooltipCallback(Control sender, TooltipArgs args) { var src = (InventoryItemPB)sender; var slot = src.Slot; IItemTable itemInfo; if (!src.InventoryForm._infoRequester.TryGetInfo(slot, out itemInfo)) { // The data has not been received yet - returning null will make the tooltip retry later return null; } // Data was received, so format it and return it return ItemInfoHelper.GetStyledText(itemInfo); }
/// <summary> /// Gets the default tooltip handler for a <see cref="ToolbarItem"/>. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> /// <returns>The tooltip text.</returns> StyledText[] TooltipHandler(Control sender, TooltipArgs args) { return new StyledText[] { new StyledText(ToolbarItemType.ToString()) }; }
static StyledText[] Tooltip_Button(Control sender, TooltipArgs args) { return new StyledText[] { new StyledText( "hello-hello-hello-hello-hello-hello-hello-hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello") , new StyledText("button", new Color(50, 50, 190)) }; }
static StyledText[] Tooltip_Label(Control sender, TooltipArgs args) { args.FontColor = new Color(50, 190, 50); args.RefreshRate = 100; var r = (byte)rnd.Next(100, 255); var g = (byte)rnd.Next(100, 255); var b = (byte)rnd.Next(100, 255); var c = new Color(r, g, b, 255); return new StyledText[] { new StyledText("Text for a "), new StyledText("label", c) }; }
/// <summary> /// Gets the text for the <see cref="Tooltip"/>. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> /// <returns>The text for the <see cref="Tooltip"/>.</returns> static StyledText[] TooltipCallback(Control sender, TooltipArgs args) { var src = (ShopItemPB)sender; var itemInfo = src.ItemInfo; return ItemInfoHelper.GetStyledText(itemInfo); }