コード例 #1
0
ファイル: DataContext.cs プロジェクト: cualquiercosa327/DQ7
        private void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName != "ID")
            {
                return;
            }
            BagItem item = sender as BagItem;

            if (item == null)
            {
                return;
            }
            if (item.ID != 0)
            {
                return;
            }
            BagItem next = item.Next;

            if (next == null || next.ID == 0)
            {
                return;
            }
            item.Count = next.Count;
            item.ID    = next.ID;
            next.Count = 0;
            next.ID    = 0;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: turtle-insect/DQ7
        private void ButtonBagItem_Click(object sender, RoutedEventArgs e)
        {
            BagItem item = (sender as Button)?.DataContext as BagItem;

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

            dlg.ID = item.ID;
            dlg.ShowDialog();
            item.Count = dlg.ID == 0 ? 0 : 1U;
            item.ID    = dlg.ID;
        }
コード例 #3
0
ファイル: DataContext.cs プロジェクト: cualquiercosa327/DQ7
        public DataContext()
        {
            for (uint i = 0; i < 6; i++)
            {
                Charactors.Add(new Charactor(0x0C80 + i * 0x01EC));
            }

            BagItem item = null;

            for (uint i = Util.BagItemCount - 1; (int)i >= 0; i--)
            {
                item = new BagItem(0x0544 + i * 2, 0x09D4 + i, item);
                item.PropertyChanged += Item_PropertyChanged;
                Bag.Insert(0, item);
            }

            foreach (var place in Info.Instance().Places)
            {
                Places.Add(new Place(place.Value)
                {
                    Name = place.Name
                });
            }

            foreach (var monster in Info.Instance().Monsters)
            {
                if (monster.ID != 0)
                {
                    Monsters.Add(new MonsterBook(0x1854 + (monster.ID - 1) * 8)
                    {
                        Name = monster.Name
                    });
                }
                if (monster.Passing)
                {
                    PassingSlateMonsters.Add(monster);
                }
                if (monster.Stamp)
                {
                    StampMonsters.Add(monster);
                }
            }

            for (uint i = 0; i < Util.MonsterStampCount; i++)
            {
                MonsterStamps.Add(new MonsterStamp(0x2E06 + i * 2));
            }

            foreach (var place in Info.Instance().ParkPlaces)
            {
                MonsterParkPlaces.Add(new MonsterParkPlace(0x00AC, place.Value)
                {
                    Name = place.Name
                });
            }

            for (uint i = 0; i < Util.MonsterParkDormitoryCount; i++)
            {
                MonsterParkDormitorys.Add(new MonsterParkDormitory(0x04BC + i * 4, 0x3180 + i));
            }

            for (uint i = 0; i < Util.PartyMemberCount; i++)
            {
                Party.Add(new PartyMember(0x0510 + i * 4));
            }

            for (uint i = 0; i < Util.PassingSlateCount; i++)
            {
                uint address = 0x32D0 + i * 44;
                if (SaveData.Instance().ReadNumber(address, 1) == 0)
                {
                    break;
                }
                PassingSlates.Add(new PassingSlate(address));
            }

            foreach (var monster in Info.Instance().TownMonsters)
            {
                TownMonsters.Add(new TownMonster(0x01E9, monster.Value)
                {
                    Name = monster.Name
                });
            }
        }
コード例 #4
0
ファイル: BagItem.cs プロジェクト: turtle-insect/DQ7
 public BagItem(uint id, uint count, BagItem next)
 {
     mIDAddress    = id;
     mCountAddress = count;
     Next          = next;
 }