feat: SimpleRadial menu support for sprite-view and more extensibility (#39223)
This commit is contained in:
@@ -132,12 +132,12 @@ public sealed class EmotesUIController : UIController, IOnStateChanged<GameplayS
|
||||
_menu = null;
|
||||
}
|
||||
|
||||
private IEnumerable<RadialMenuOption> ConvertToButtons(IEnumerable<EmotePrototype> emotePrototypes)
|
||||
private IEnumerable<RadialMenuOptionBase> ConvertToButtons(IEnumerable<EmotePrototype> emotePrototypes)
|
||||
{
|
||||
var whitelistSystem = EntitySystemManager.GetEntitySystem<EntityWhitelistSystem>();
|
||||
var player = _playerManager.LocalSession?.AttachedEntity;
|
||||
|
||||
Dictionary<EmoteCategory, List<RadialMenuOption>> emotesByCategory = new();
|
||||
Dictionary<EmoteCategory, List<RadialMenuOptionBase>> emotesByCategory = new();
|
||||
foreach (var emote in emotePrototypes)
|
||||
{
|
||||
if(emote.Category == EmoteCategory.Invalid)
|
||||
@@ -157,19 +157,19 @@ public sealed class EmotesUIController : UIController, IOnStateChanged<GameplayS
|
||||
|
||||
if (!emotesByCategory.TryGetValue(emote.Category, out var list))
|
||||
{
|
||||
list = new List<RadialMenuOption>();
|
||||
list = new List<RadialMenuOptionBase>();
|
||||
emotesByCategory.Add(emote.Category, list);
|
||||
}
|
||||
|
||||
var actionOption = new RadialMenuActionOption<EmotePrototype>(HandleRadialButtonClick, emote)
|
||||
{
|
||||
Sprite = emote.Icon,
|
||||
IconSpecifier = RadialMenuIconSpecifier.With(emote.Icon),
|
||||
ToolTip = Loc.GetString(emote.Name)
|
||||
};
|
||||
list.Add(actionOption);
|
||||
}
|
||||
|
||||
var models = new RadialMenuOption[emotesByCategory.Count];
|
||||
var models = new RadialMenuOptionBase[emotesByCategory.Count];
|
||||
var i = 0;
|
||||
foreach (var (key, list) in emotesByCategory)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public sealed class EmotesUIController : UIController, IOnStateChanged<GameplayS
|
||||
|
||||
models[i] = new RadialMenuNestedLayerOption(list)
|
||||
{
|
||||
Sprite = tuple.Sprite,
|
||||
IconSpecifier = RadialMenuIconSpecifier.With(tuple.Sprite),
|
||||
ToolTip = Loc.GetString(tuple.Tooltip)
|
||||
};
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user