Skip to content

Commit

Permalink
show info about item
Browse files Browse the repository at this point in the history
  • Loading branch information
SpGerg committed Apr 18, 2024
1 parent 5a0f4ba commit 8023f52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions UncomplicatedCustomItems/Events/Internal/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ public static void Register()
{
EventSource.UsingItem += CancelUsingCustomItemOnUsingItem;
EventSource.Hurting += SetDamageFromCustomWeaponOnHurting;
EventSource.ItemAdded += ShowItemInfoOnItemAdded;
}

public static void Unregister()
{
EventSource.UsingItem -= CancelUsingCustomItemOnUsingItem;
EventSource.Hurting -= SetDamageFromCustomWeaponOnHurting;
EventSource.ItemAdded -= ShowItemInfoOnItemAdded;
}

public static void ShowItemInfoOnItemAdded(ItemAddedEventArgs ev)
{
if (!Plugin.API.TryGet(ev.Item.Serial, out var result))
{
return;
}

ev.Player.ShowHint(result.Name);
}

public static void SetDamageFromCustomWeaponOnHurting(HurtingEventArgs ev)
Expand Down

0 comments on commit 8023f52

Please sign in to comment.