Exemplo n.º 1
0
        public EquipmentWeaponViewModel(ItemSlots slot, IBaseMemoryOffset baseOffset)
            : base(slot, baseOffset)
        {
            this.memory               = baseOffset.GetMemory(slot == ItemSlots.MainHand ? Offsets.Main.MainHand : Offsets.Main.OffHand);
            this.memory.Name          = slot.ToString();
            this.memory.ValueChanged += this.Memory_ValueChanged;

            this.modelSet     = this.memory.Value.Set;
            this.modelBase    = this.memory.Value.Base;
            this.modelVariant = this.memory.Value.Variant;
            this.dyeId        = this.memory.Value.Dye;

            if (this.HasWeapon)
            {
                this.scaleMem               = baseOffset.GetMemory(slot == ItemSlots.MainHand ? Offsets.Main.MainHandScale : Offsets.Main.OffhandScale);
                this.scaleMem.Name          = slot + "_Scale";
                this.scaleMem.ValueChanged += this.ScaleMem_ValueChanged;

                this.colorMem               = baseOffset.GetMemory(slot == ItemSlots.MainHand ? Offsets.Main.MainHandColor : Offsets.Main.OffhandColor);
                this.colorMem.Name          = slot + "_Color";
                this.colorMem.ValueChanged += this.ColorMem_ValueChanged;

                this.scale = this.scaleMem.Value;
                this.color = this.colorMem.Value;
            }

            this.Item = this.GetItem();
            this.Dye  = this.GetDye();
        }
Exemplo n.º 2
0
        public static string ToDisplayName(this ItemSlots self)
        {
            switch (self)
            {
            case ItemSlots.MainHand: return("Main Hand");

            case ItemSlots.OffHand: return("Off Hand");

            case ItemSlots.RightRing: return("Right Ring");

            case ItemSlots.LeftRing: return("Left Ring");
            }

            return(self.ToString());
        }
Exemplo n.º 3
0
        public static BitmapImage GetIcon(this ItemSlots self)
        {
            BitmapImage logo = new BitmapImage();

            logo.BeginInit();
            logo.UriSource = new Uri("pack://application:,,,/Anamnesis;component/Assets/Slots/" + self.ToString() + ".png");
            logo.EndInit();

            return(logo);
        }