Esempio n. 1
0
        public void OnPointerClick(PointerEventData eventData)
        {
            //将该书籍的真传和手抄属性进行切换
            int gongFaID = int.Parse(DateFile.instance.GetItemDate(_itemid, 32, false));
            int isPirate = int.Parse(DateFile.instance.GetItemDate(_itemid, 35, false));
            //int itemTrueID = int.Parse(DateFile.instance.GetItemDate(_itemid, 999, false));
            int newItemTrueID = GongFaDict.Get_GongFa_ID(gongFaID, 1 - isPirate);

            if (newItemTrueID == -1)
            {
                Main.Logger.Error("We fail to get the GongFa ID:" + _text.text);
            }
            else
            {
                // DateFile.instance.itemsDate[_itemid][999] = newItemTrueID.ToString();
                GameData.Items.SetItemProperty(_itemid, 999, newItemTrueID.ToString());
            }
            // DateFile.instance.ChangItemDate(_itemid, 999, newItemTrueID, true);

            DateFile.instance.GetItem(_actorid, _itemid, 1, false, 0, 0);
            // GameData.Items.GetItem(_itemid);

            Main.Logger.Log("We may complete the book switch.");

            // ActorMenu.instance.UpdateItemInformation(_itemid);
            //if (isPirate > 0)
            //    DateFile.instance.itemsDate[_itemid][999] = (itemTrueID - 200000).ToString();
            //else
            //    DateFile.instance.itemsDate[_itemid][999] = (itemTrueID + 200000).ToString();
        }
Esempio n. 2
0
 static void Postfix()
 {
     if (Main.enabled)
     {
         if (!GongFaDict.IsDictLoaded)
         {
             if (DateFile.instance != null)
             {
                 //建立功法ID的索引
                 int iterNum = 0;
                 foreach (KeyValuePair <int, Dictionary <int, string> > item in DateFile.instance.presetitemDate)
                 {
                     iterNum += 1;
                     //确认该物品为图纸或图书
                     if (int.Parse(item.Value[4]) == 5)
                     {
                         //确认该物品为图书
                         if (int.Parse(item.Value[5]) == 21)
                         {
                             //确认该物品为功法书
                             if (int.Parse(item.Value[506]) >= 20)
                             {
                                 //将其加入功法词典
                                 GongFaDict.Add_new_GongFa(int.Parse(item.Value[32]),
                                                           int.Parse(item.Value[35]), int.Parse(item.Value[999]));
                             }
                         }
                     }
                 }
                 GongFaDict.IsDictLoaded = true;
                 Main.Logger.Log("GongFaDict Loaded with size: " + GongFaDict.Size().ToString());
                 Main.Logger.Log("Totally find itemsDate with size: " + iterNum);
                 Main.Logger.Log("Dict of itemsDate with size: " + DateFile.instance.presetitemDate.Count().ToString());
             }
             else
             {
                 Main.Logger.Error("GongFaDict already Loaded?");
             }
         }
         else
         {
             Main.Logger.Error("We fail to load the GongFaDict!");
         }
     }
 }
Esempio n. 3
0
        public void OnPointerClick(PointerEventData eventData)
        {
            //将该书籍的真传和手抄属性进行切换
            int gongFaID = int.Parse(DateFile.instance.GetItemDate(_itemid, 32, false));
            int isPirate = int.Parse(DateFile.instance.GetItemDate(_itemid, 35, false));
            //int itemTrueID = int.Parse(DateFile.instance.GetItemDate(_itemid, 999, false));
            int newItemTrueID = GongFaDict.Get_GongFa_ID(gongFaID, 1 - isPirate);

            if (newItemTrueID == -1)
            {
                Main.Logger.Error("We fail to get the GongFa ID:" + _text.text);
            }
            else
            {
                DateFile.instance.itemsDate[_itemid][999] = newItemTrueID.ToString();
            }

            //if (isPirate > 0)
            //    DateFile.instance.itemsDate[_itemid][999] = (itemTrueID - 200000).ToString();
            //else
            //    DateFile.instance.itemsDate[_itemid][999] = (itemTrueID + 200000).ToString();
        }