示例#1
0
 private void Save()
 {
     if (SaveData.Instance().Save() == true)
     {
         MessageBox.Show("書込成功");
     }
     else
     {
         MessageBox.Show("書込失敗");
     }
 }
示例#2
0
        private void Load(bool force)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (dlg.ShowDialog() == false)
            {
                return;
            }

            if (SaveData.Instance().Open(dlg.FileName, force) == false)
            {
                MessageBox.Show("読込失敗");
                return;
            }
            Init();
            MessageBox.Show("読込成功");
        }
示例#3
0
        private void MenuItemFileSaveAs_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            if (dlg.ShowDialog() == false)
            {
                return;
            }

            if (SaveData.Instance().SaveAs(dlg.FileName) == true)
            {
                MessageBox.Show("書込成功");
            }
            else
            {
                MessageBox.Show("書込失敗");
            }
        }
示例#4
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            String[] files = e.Data.GetData(DataFormats.FileDrop) as String[];
            if (files == null)
            {
                return;
            }
            if (!System.IO.File.Exists(files[0]))
            {
                return;
            }

            if (SaveData.Instance().Open(files[0], false) == false)
            {
                MessageBox.Show("読込失敗");
                return;
            }
            Init();
            MessageBox.Show("読込成功");
        }
示例#5
0
        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
                });
            }
        }