Beispiel #1
0
        /// <summary>
        /// 釣った魚の更新
        /// </summary>
        /// <param name="iFishName">魚名</param>
        /// <param name="iCaught">釣ったか否か</param>
        public void CaughtFishesUpdate(string iFishName, bool iCaught)
        {
            bool foundFlg = false;

            for (int i = 0; i < this.CaughtFishes.Fishes.Count; i++)
            {
                if (this.CaughtFishes.Fishes[i].FishName == iFishName)
                {
                    foundFlg = true;
                    this.CaughtFishes.Fishes[i].Caught = iCaught;
                    break;
                }
            }
            if (!foundFlg)
            {
                SettingsPlayerCaughtFishModel fish = new SettingsPlayerCaughtFishModel();
                fish.FishName = iFishName;
                fish.Caught   = iCaught;
                this.CaughtFishes.Fishes.Add(fish);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 釣った魚の更新
 /// </summary>
 /// <param name="iFishName">魚名</param>
 /// <param name="iCaught">釣ったか否か</param>
 public void CaughtFishesUpdate(string iFishName, bool iCaught)
 {
     bool foundFlg = false;
     for (int i = 0; i < this.CaughtFishes.Fishes.Count; i++)
     {
         if (this.CaughtFishes.Fishes[i].FishName == iFishName)
         {
             foundFlg = true;
             this.CaughtFishes.Fishes[i].Caught = iCaught;
             break;
         }
     }
     if (!foundFlg)
     {
         SettingsPlayerCaughtFishModel fish = new SettingsPlayerCaughtFishModel();
         fish.FishName = iFishName;
         fish.Caught = iCaught;
         this.CaughtFishes.Fishes.Add(fish);
     }
 }
Beispiel #3
0
        public List<SettingsPlayerCaughtFishModel> GetCaughtFishes()
        {
            List<SettingsPlayerCaughtFishModel> ret = new List<SettingsPlayerCaughtFishModel>();

            setMessage("釣った魚の初期化中");
            setFishingStatus(FishingStatusKind.Normal);
            setRunningStatus(RunningStatusKind.Running);

            //Katsunagaの近くかチェック
            if (fface.Player.Zone != FFACETools.Zone.Mhaura ||
                (fface.NPC.Distance(NPCID_KATSUNAGA) != 0f && fface.NPC.Distance(NPCID_KATSUNAGA) > 6))
            {
                setMessage("マウラのKatsunagaの近くで実行してください");
                setFishingStatus(FishingStatusKind.Error);
                setRunningStatus(RunningStatusKind.Stop);
                return ret;
            }
            //メニュー開いていたら閉じる
            if (!control.CloseDialog(10))
            {
                setMessage("エラー:会話を終了させてから実行してください");
                setFishingStatus(FishingStatusKind.Error);
                setRunningStatus(RunningStatusKind.Stop);
                return ret;
            }
            //メニューを開く
            while (!fface.Menu.IsOpen)
            {
                //ターゲット設定
                control.SetTargetFromId(NPCID_KATSUNAGA);
                Thread.Sleep(settings.Global.WaitBase);//Wait
                fface.Windower.SendKeyPress(FFACETools.KeyCode.EnterKey);
            }
            control.WaitOpenDialog("何を教えてもらおう?", false);
            control.SetDialogOptionIndex(0, true);
            control.WaitOpenDialog(REGEX_FISHEDLIST_DIALOG, false);
            if (fface.Menu.IsOpen &&
                MiscTool.IsRegexString(fface.Menu.GetDialogText().Question, REGEX_FISHEDLIST_DIALOG))
            {
                int pageCurrent = 0;
                int pageMax = 99;
                for (int i = 0; i < Constants.MAX_LOOP_COUNT; i++)
                {
                    control.WaitOpenDialog(REGEX_FISHEDLIST_DIALOG, false);
                    List<string> oArgs = MiscTool.GetRegexString(fface.Menu.GetDialogText().Question, REGEX_FISHEDLIST_DIALOG);
                    pageCurrent = int.Parse(oArgs[1]);
                    pageMax = int.Parse(oArgs[2]);
                    string[] options = fface.Menu.GetDialogText().Options;
                    for (int j = 1; j < 17 - (19 - fface.Menu.DialogOptionCount); j++)
                    {
                        if (MiscTool.IsRegexString(options[j], REGEX_FISHEDLIST_OPTIONS))
                        {
                            List<string> oArgs2 = MiscTool.GetRegexString(options[j], REGEX_FISHEDLIST_OPTIONS);
                            SettingsPlayerCaughtFishModel fished = new SettingsPlayerCaughtFishModel();
                            fished.Caught = (oArgs2[0] == "★");
                            fished.FishName = oArgs2[1];
                            ret.Add(fished);
                        }
                    }
                    if (pageCurrent == pageMax) break;
                    //改ページ
                    control.SetDialogOptionIndex(18, true);
                    Thread.Sleep(settings.Global.WaitBase);
                }
            }
            //メニュー閉じる
            control.CloseDialog(10);

            setFishingStatus(FishingStatusKind.Normal);
            setRunningStatus(RunningStatusKind.Stop);
            return ret;
        }