Ejemplo n.º 1
0
        private void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            CharactorItem item = sender as CharactorItem;

            if (item == null)
            {
                return;
            }
            SaveData saveData = SaveData.Instance();
            uint     count    = 0;

            for (uint i = 0; i < Util.ItemCount - 1; i++)
            {
                uint address = mAddress + 0x45 + i;
                uint id      = saveData.ReadNumber(address, 1);
                if (id == 0x00)
                {
                    saveData.Swap(address, address + 1, 1);
                    id = saveData.ReadNumber(address, 1);
                }
                if (id != 0x00)
                {
                    count++;
                }
            }
            if (saveData.ReadNumber(mAddress + 0x45 + Util.ItemCount - 1, 1) != 0x00)
            {
                count++;
            }
            Util.WriteNumber(mAddress + 0x44, 1, count, 0, 12);
            CreateItem();
        }
Ejemplo n.º 2
0
 private void CreateItem()
 {
     Items.Clear();
     for (uint i = 0; i < Util.ItemCount; i++)
     {
         CharactorItem item = new CharactorItem(mAddress + 0x45 + i);
         item.PropertyChanged += Item_PropertyChanged;
         Items.Add(item);
     }
 }
Ejemplo n.º 3
0
        private void ButtonCharactorItemChange_Click(object sender, RoutedEventArgs e)
        {
            CharactorItem item = (sender as Button)?.DataContext as CharactorItem;

            if (item == null)
            {
                return;
            }
            ItemSelectWindow dlg = new ItemSelectWindow();

            dlg.ID = item.ID;
            dlg.ShowDialog();
            item.ID = dlg.ID;
        }