public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            uint tmp = Info.Instance().CharaNames[(int)value].Value;

            if (tmp != uint.MaxValue)
            {
                tmp--;
            }
            return(tmp);
        }
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     for (int i = 0; i < Info.Instance().Jobs.Count; i++)
     {
         if (Info.Instance().Jobs[i].Value == (uint)value)
         {
             return(i);
         }
     }
     return(-1);
 }
Ejemplo n.º 3
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            for (uint i = 0; i < Info.Instance().TameMonsters.Count; i++)
            {
                if (Info.Instance().TameMonsters[(int)i].Value == (int)value)
                {
                    return(Info.Instance().TameMonsters[(int)i].Value);
                }
            }

            return(0xFFFFFFFF);
        }
Ejemplo n.º 4
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var infos = Info.Instance().CharaNames;

            for (uint i = 0; i < infos.Count; i++)
            {
                if (infos[(int)i].Value == (uint)value)
                {
                    return(i);
                }
            }
            return(-1);
        }
        private void CreateItemList(String filter)
        {
            ListBoxItem.Items.Clear();
            List <NameValueInfo> items = Info.Instance().Equipments;

            if (Type == eType.item)
            {
                items = Info.Instance().Items;
            }

            foreach (var item in items)
            {
                if (String.IsNullOrEmpty(filter) || item.Name.IndexOf(filter) >= 0)
                {
                    ListBoxItem.Items.Add(item);
                }
            }
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            uint tmp = (uint)value;

            if (tmp != uint.MaxValue)
            {
                tmp++;
            }
            for (int i = 0; i < Info.Instance().CharaNames.Count; i++)
            {
                if (Info.Instance().CharaNames[i].Value == tmp)
                {
                    return(i);
                }
            }

            return(-1);
        }
Ejemplo n.º 7
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(Info.Instance().CharaNames[(int)value].Value);
 }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(Info.Instance().Search(Info.Instance().Items, (uint)value)?.Name);
 }