fix: Moves ContextMenu out of core, streamlines code, fixes bugs (#1873)
## Summary - Removes allocation of a `List<ContextMenuEntry>` every time a context menu is created. - Moves packet/context menu creation logic out of the core - Fixes tame entry ## BREAKING CHANGE > [!Important] > **Developer Note** > ```cs > public virtual void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list) > ``` > and similar functions changed to > ```cs > public virtual void GetContextMenuEntries(Mobile from, ref PooledRefList<ContextMenuEntry> list) > ```
This commit is contained in:
parent
bb24b330e1
commit
f58117a877
88 changed files with 1206 additions and 1483 deletions
|
|
@ -1,3 +1,18 @@
|
|||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright 2019-2024 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: ContextMenuEntry.cs *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.ContextMenus;
|
||||
|
|
@ -42,11 +57,6 @@ public class ContextMenuEntry
|
|||
/// </summary>
|
||||
public CMEFlags Flags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ContextMenu" /> that owns this entry.
|
||||
/// </summary>
|
||||
public ContextMenu Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the localization number containing the name of this entry.
|
||||
/// </summary>
|
||||
|
|
@ -76,7 +86,7 @@ public class ContextMenuEntry
|
|||
/// <summary>
|
||||
/// Overridable. Virtual event invoked when the entry is clicked.
|
||||
/// </summary>
|
||||
public virtual void OnClick()
|
||||
public virtual void OnClick(Mobile from, IEntity target)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue