forked from LeFauxMatt/StardewMods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IToolbarIconsApi.cs
31 lines (27 loc) · 1.07 KB
/
IToolbarIconsApi.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
namespace StardewMods.Common.Integrations.ToolbarIcons;
using System;
using Microsoft.Xna.Framework;
using StardewValley.Menus;
/// <summary>
/// Public api to add icons above or below the toolbar.
/// </summary>
public interface IToolbarIconsApi
{
/// <summary>
/// Event triggered when a toolbar icon is pressed.
/// </summary>
public event EventHandler<string> ToolbarIconPressed;
/// <summary>
/// Adds an icon next to the <see cref="Toolbar" />.
/// </summary>
/// <param name="id">A unique identifier for the icon.</param>
/// <param name="texturePath">The path to the texture icon.</param>
/// <param name="sourceRect">The source rectangle of the icon.</param>
/// <param name="hoverText">Text to appear when hovering over the icon.</param>
public void AddToolbarIcon(string id, string texturePath, Rectangle? sourceRect, string? hoverText);
/// <summary>
/// Removes an icon.
/// </summary>
/// <param name="id">A unique identifier for the icon.</param>
public void RemoveToolbarIcon(string id);
}