public EnemyWeakness(uint address) { var gvas = new GVAS(null); gvas.AppendValue(SaveData.Instance().FindAddress("WeaknessOpen_", address)[0]); mWeaponAddress = gvas.Key("WeaknessOpen").Address; mMagicAddress = mWeaponAddress + 1; }
public uint Calc(uint address) { for (address += 12; SaveData.Instance().ReadNumber(address, 1) != 0; address++) { ; } address += 2; mAddress = address; return(address + 8); }
private void Save() { if (SaveData.Instance().Save() == true) { MessageBox.Show(Properties.Resources.MessageSaveSuccess); } else { MessageBox.Show(Properties.Resources.MeaageSaveFail); } }
private void Save() { if (SaveData.Instance().Save() == true) { MessageBox.Show("書込成功"); } else { MessageBox.Show("File Write Failed"); } }
private void Save() { if (SaveData.Instance().Save() == true) { MessageBox.Show("書込成功"); } else { MessageBox.Show("書込失敗"); } }
public static void WriteNumber(uint address, uint size, uint value, uint min, uint max) { if (value < min) { value = min; } if (value > max) { value = max; } SaveData.Instance().WriteNumber(address, size, value); }
private void Load(bool force) { OpenFileDialog dlg = new OpenFileDialog(); if (dlg.ShowDialog() == false) { return; } SaveData.Instance().Open(dlg.FileName); Init(); MessageBox.Show(Properties.Resources.MessageLoadSuccess); }
private void Load(bool force) { OpenFileDialog dlg = new OpenFileDialog(); if (dlg.ShowDialog() == false) { return; } SaveData.Instance().Open(dlg.FileName); Init(); MessageBox.Show("File Opened Successfully"); }
private uint AppendValue(uint address) { uint length = 1; for (; SaveData.Instance().ReadNumber(address + length, 1) != 0; length++) { ; } String key = SaveData.Instance().ReadText(address, length); key = key.Substring(0, key.IndexOf("_")); if (key == "Accessory") { String option = "1"; if (mValues.ContainsKey("Accessory1")) { option = "2"; } key += option; } address += length + 5; length = 1; for (; SaveData.Instance().ReadNumber(address + length, 1) != 0; length++) { ; } String type = SaveData.Instance().ReadText(address, length); address += length + 1; IGVASValue value = null; switch (type) { case "IntProperty": value = new GVASIntValue(); break; case "ArrayProperty": value = new GVASArrayValue(); break; } if (value != null) { address = value.Calc(address); mValues.Add(key, value); } return(address); }
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; } SaveData.Instance().Open(files[0]); Init(); MessageBox.Show(Properties.Resources.MessageLoadSuccess); }
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(Properties.Resources.MessageSaveSuccess); } else { MessageBox.Show(Properties.Resources.MeaageSaveFail); } }
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("File Written Successfully"); } else { MessageBox.Show("File Write Failed"); } }
public CharactorGVAS(uint address) { for (int i = 0; i < 9; i++) { address = AppendValue(address); } address = SaveData.Instance().FindAddress("Sword_", address)[0]; for (int i = 0; i < 11; i++) { address = AppendValue(address); } address = SaveData.Instance().FindAddress("HP_", address)[0]; for (int i = 0; i < 12; i++) { address = AppendValue(address); } }
public DataContext() { SaveData save = SaveData.Instance(); foreach (var address in save.FindAddress("CharacterID_", 0)) { var chara = new Charactor(address); if (chara.ID < 0 || chara.ID > 8) { continue; } Charactors.Add(chara); } foreach (var address in save.FindAddress("ItemID_", 0)) { Items.Add(new Item(address)); } mMoneyAddress = save.FindAddress("Money", 0)[0] + 0x42; }
public DataContext() { SaveData save = SaveData.Instance(); foreach (var address in save.FindAddress("CharacterID_", 0)) { var chara = new Charactor(address); if (chara.ID < 0 || chara.ID > 8) { continue; } Charactors.Add(chara); } foreach (var address in save.FindAddress("ItemID_", 0)) { Items.Add(new Item(address)); } var gvas = new GVAS(null); gvas.AppendValue(save.FindAddress("MainMemberID_", 0)[0]); for (uint i = 0; i < 4; i++) { MainParty.Add(new Member(gvas.Key("MainMemberID_" + i.ToString()).Address)); } gvas = new GVAS(null); gvas.AppendValue(save.FindAddress("SubMissionOrder", 0)[0]); for (uint i = 0; i < 200; i++) { MissionIDs.Add(new MissionID(gvas.Key("SubMissionOrder_" + i.ToString()))); } var missionStates = save.FindAddress("MissionState_", 0); var clearIndex = save.FindAddress("ClearIndex_", 0); if (missionStates.Count == clearIndex.Count) { for (int i = 0; i < missionStates.Count; i++) { var stateGvas = new GVAS(null); stateGvas.AppendValue(missionStates[i]); var clearGvas = new GVAS(null); clearGvas.AppendValue(clearIndex[i]); var mission = new CountryMission() { Country = Info.Instance().Countris[i].Name }; for (int j = 0; j < 100; j++) { mission.Missions.Add(new Mission(stateGvas.Key("MissionState_" + j.ToString()), clearGvas.Key("ClearIndex_" + j.ToString()))); } Countris.Add(mission); } } gvas = new GVAS(null); gvas.AppendValue(save.FindAddress("VisitedMap", 0)[0]); uint id = 0; for (uint i = 0; i < 10; i++) { GVASData data = gvas.Key("VisitedMap_" + i.ToString()); for (uint size = 0; size < data.Size; size++) { for (uint bit = 0; bit < 8; bit++) { var place = new Place(data.Address + size, bit); NameValueInfo info = Info.Instance().Search(Info.Instance().Places, id); if (info != null) { place.Name = info.Name; } Places.Add(place); id++; } } } gvas = new GVAS(null); uint tame = save.FindAddress("TameMonsterData", 0)[0]; for (uint i = 0; i < 10; i++) { uint enemyAddress = save.FindAddress("EnemyID_", tame)[0]; TameMonsters.Add(new TameMonster(enemyAddress)); tame = enemyAddress + 1; } uint weaks = save.FindAddress("EnemyInfoData", 0)[0]; System.Console.WriteLine(save.FindAddress("IsAnalyse_", 0).Count); foreach (uint i in save.FindAddress("IsAnalyse_", 0)) { EnemyWeaknesses.Add(new EnemyWeakness(i)); } gvas = new GVAS(null); gvas.AppendValue(save.FindAddress("Money_", 0)[0]); mMoneyAddress = gvas.Key("Money").Address; gvas = new GVAS(null); gvas.AppendValue(save.FindAddress("FirstSelectCharacterID", 0)[0]); mHeroAddress = gvas.Key("FirstSelectCharacterID").Address; }
public uint AppendValue(uint address) { // length address -= 4; uint length = SaveData.Instance().ReadNumber(address, 4); // key address += 4; String key = SaveData.Instance().ReadText(address, length); if (key.IndexOf("_") > 0) { key = key.Substring(0, key.IndexOf("_")); } if (mRename != null) { key = mRename.Rename(key); } address += length; length = SaveData.Instance().ReadNumber(address, 4); address += 4; String type = SaveData.Instance().ReadText(address, length); address += length; switch (type) { case "IntProperty": mValues.Add(key, new GVASData() { Address = address + 9, Size = 4 }); address += 17; break; case "BoolProperty": mValues.Add(key, new GVASData() { Address = address + 10, Size = 1 }); address += 17; break; case "ArrayProperty": address += 8; length = SaveData.Instance().ReadNumber(address, 4); address += 4; type = SaveData.Instance().ReadText(address, length); address += length + 1; uint count = SaveData.Instance().ReadNumber(address, 4); address += 4; uint size = 4; switch (type) { case "BoolProperty": case "ByteProperty": size = 1; break; } for (uint i = 0; i < count; i++) { mValues.Add(key + "_" + i.ToString(), new GVASData() { Address = address, Size = size }); address += size; } address += size; break; default: address += 4; address += AppendValue(address); break; } return(address); }