示例#1
0
        private static void AttachZetAspectsConvertHandler(EquipmentIcon icon)
        {
            if (icon.GetComponent <ZetAspectsConvertHandler>() != null)
            {
                return;
            }

            ZetAspectsConvertHandler handler = icon.transform.gameObject.AddComponent <ZetAspectsConvertHandler>();

            handler.GetInventory = () => icon.targetInventory;
            handler.GetPCMC      = () => icon.playerCharacterMasterController;
        }
示例#2
0
        internal static void HandleConvertPointerClick(ZetAspectsConvertHandler handler)
        {
            if (!Configuration.AspectEquipmentConversion.Value)
            {
                return;
            }

            Inventory inventory = handler.GetInventory();

            if (!inventory)
            {
                return;
            }
            if (!inventory.hasAuthority)
            {
                return;
            }

            ItemIndex itemIndex = Catalog.ItemizeEliteEquipment(inventory.currentEquipmentIndex);

            if (itemIndex != ItemIndex.None)
            {
                PlayerCharacterMasterController pcmc = handler.GetPCMC();
                if (!pcmc)
                {
                    return;
                }
                NetworkUser netUser = pcmc.networkUser;
                if (!netUser)
                {
                    return;
                }

                RoR2.Console.instance.SubmitCmd(netUser, "say \"" + "ConvertAspect" + "\"", false);
            }
        }