Пример #1
0
        private void Menu_ItemSelected(ContextMenuItemSelectedArgs e)
        {
            //Hand Options
            if (e.Type == ContextInfoTypes.Cast)
            {
                Card card = (Card)e.Info.Args[0];
                attemptCastCard(card);
            }
            else if (e.Type == ContextInfoTypes.DevoteUp)
            {
                Card card = (Card)e.Info.Args[0];
                attemptDevoteCard(card, false);
            }
            else if (e.Type == ContextInfoTypes.DevoteDown)
            {
                Card card = (Card)e.Info.Args[0];
                attemptDevoteCard(card, true);
            }

            //Elysium Options
            if (e.Type == ContextInfoTypes.ElysiumTurnFaceUp)
            {
                gameState.PlayerOne.TryTurnElysiumCardUp((Card)e.Info.Args[0]);
            }

            //Battlefield Options
            if (e.Type == ContextInfoTypes.Ability)
            {
                attemptActivateAbility((Card)e.Info.Args[0], (Ability)e.Info.Args[1]);
            }
        }
Пример #2
0
        private void AddToVoidList(ContextMenuItemSelectedArgs args)
        {
            var world = Plugin.PluginInterface.Data.GetExcelSheet <World>()
                        .SingleOrDefault(x => x.RowId == args.ActorWorld);

            if (world == null)
            {
                return;
            }

            Plugin.VoidPlayer("ContextMenu", $"{args.Text} {world.Name}");
        }
Пример #3
0
        private void RemoveFromWhitelist(ContextMenuItemSelectedArgs args)
        {
            var entry = Plugin.PluginConfiguration.Whitelist.SingleOrDefault(x =>
                                                                             x.Name == args.Text?.TextValue && x.HomeworldId == args.ActorWorld);

            if (entry == null)
            {
                return;
            }

            var message = Encoding.UTF8.GetString(new SeString(new Payload[]
            {
                new TextPayload("Whitelist: " + entry.Name),
                new IconPayload(BitmapFontIcon.CrossWorld),
                new TextPayload(entry.HomeworldName + " has been removed."),
            }).Encode());

            Plugin.PluginConfiguration.Whitelist.Remove(entry);
            Plugin.PluginConfiguration.Save();
            Plugin.Print(message);
        }
    private void ToggleWindowPositionLock(ContextMenuItemSelectedArgs args)
    {
        if (!Enabled)
        {
            return;
        }
        if (args.ParentAddonName == null)
        {
            return;
        }
        if (string.IsNullOrWhiteSpace(args.ParentAddonName))
        {
            return;
        }

        if (Config.LockedWindows.Contains(args.ParentAddonName))
        {
            Config.LockedWindows.Remove(args.ParentAddonName);
        }
        else
        {
            Config.LockedWindows.Add(args.ParentAddonName);
        }
    }