Exemple #1
0
        protected void ButtonChange_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Item   item      = Item.Instance();
            int    itemCount = item.Tools.Count;
            Button button    = sender as Button;

            if (button == null)
            {
                return;
            }
            uint i = (uint)button.Tag;

            i += (uint)mPage.SelectedIndex * OnePageCount;
            SaveData saveData = SaveData.Instance();
            uint     id       = saveData.ReadNumber(mAddress + i * 4, 2);

            ItemSelectWindow window = new ItemSelectWindow();

            window.ID   = id;
            window.Type = mType;
            window.ShowDialog();
            if (window.ID == item.None.ID)
            {
                ButtonDelete_Click(sender, e);
            }
            else
            {
                saveData.WriteNumber(mAddress + i * 4, 2, window.ID);
                saveData.WriteNumber(mAddress + i * 4 + 2, 1, 1);
                mItems.ForEach(x => x.Open());
            }
        }
        private void ButtonCharItemChange_Click(object sender, RoutedEventArgs e)
        {
            CharItem item = (sender as Button)?.DataContext as CharItem;

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

            window.ID = item.ID;
            window.ShowDialog();
            item.ID = window.ID;
        }
        private void ButtonYochiWeaponChange_Click(object sender, RoutedEventArgs e)
        {
            Yochi yochi = ListBoxYochi.SelectedItem as Yochi;

            if (yochi == null)
            {
                return;
            }
            ItemSelectWindow window = new ItemSelectWindow();

            window.Type = ItemSelectWindow.eType.Equipment;
            window.ID   = yochi.Weapon;
            window.ShowDialog();
            yochi.Weapon = window.ID;
        }