From 4dba76710a47cb8c83c5cf7f7b96702c702c5039 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期二, 25 九月 2018 20:20:54 +0800
Subject: [PATCH] 3833 【前端】坐骑、灵宠红点优化
---
System/MainInterfacePanel/PlayerTaskDatas.cs | 105 ++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 77 insertions(+), 28 deletions(-)
diff --git a/System/MainInterfacePanel/PlayerTaskDatas.cs b/System/MainInterfacePanel/PlayerTaskDatas.cs
index 90a1e6f..579e58a 100644
--- a/System/MainInterfacePanel/PlayerTaskDatas.cs
+++ b/System/MainInterfacePanel/PlayerTaskDatas.cs
@@ -121,13 +121,15 @@
public int currentMission { get; private set; }
public int currentMissionState { get; private set; }
- public int GetNowTaskID { get; set; }
+ public int GetNowTaskID { get; set; }//鑾峰彇褰撳墠閫変腑鏉$殑浠诲姟ID
private bool AutomaticityBool = false;//鎺у埗鏄惁鑷姩杩涜鑷姩浠诲姟
private int retainTaskID = 0;
private float BossDelayTimeint = 0;
private List<int> FaBaoNPCIdList = new List<int>();//鐢ㄤ簬鑾峰彇闇�瑕佹秷澶辩殑娉曞疂NPCID锛�
public Vector3 UIeffectFabaoVec = new Vector3();//娉曞疂NPC娑堝け鏃惰幏鍙栫殑鍧愭爣
+
+
PlayerPackModel _playerPack;
PlayerPackModel playerPack
{
@@ -183,8 +185,12 @@
public void OnPlayerLoginOk()
{
+ GlobalTimeEvent.Instance.secondEvent -= secondEvent;
+ GlobalTimeEvent.Instance.secondEvent += secondEvent;
AutomaticityBool = true;
}
+
+
private void onStageLoadFinish()//鍦板浘鍒囨崲鏃惰皟鐢�
{
@@ -203,6 +209,10 @@
{
try
{
+ if (AutomaticityBool && MissionState!=3)
+ {
+ TaskupToDate = MissionID;
+ }
var pytaskM = Config.Instance.Get<PyTaskConfig>(MissionID);
if (pytaskM == null)
{
@@ -219,6 +229,7 @@
if (allMissionDict.ContainsKey(MissionID))
{
+ int missionState = allMissionDict[MissionID].MissionState;
if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool)
{
if (CompletionOfTaskEvent != null)
@@ -228,10 +239,21 @@
}
TaskChanges(MissionID, MissionState, DiscriptionIndex);//浠诲姟鐨勭姸鎬佷慨鏀�
- if (Event_TaskRefreshes != null)//鍒锋柊浠诲姟
+ if (missionState == 0 && (MissionState == 1 || MissionState==2))
{
- Event_TaskRefreshes(MissionID);
+ if (Event_TaskToAdd != null)//浠诲姟娣诲姞锛堢敤浜庡瓨鍌ㄤ簬韬笂鐨勬湭鎺ュ彇浠诲姟鐨勭壒娈婂鐞嗭級
+ {
+ Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
+ }
}
+ else
+ {
+ if (Event_TaskRefreshes != null)//鍒锋柊浠诲姟
+ {
+ Event_TaskRefreshes(MissionID);
+ }
+ }
+
}
else
{
@@ -264,7 +286,7 @@
}
catch (Exception ex)
{
- DebugEx.Log(ex);
+ DebugEx.Log(ex.StackTrace);
}
}
@@ -286,6 +308,10 @@
void DefaultDialogue()//鍏充簬鎵撳紑榛樿瀵硅瘽鐣岄潰
{
+ if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
+ {
+ return;
+ }
bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>();
if (!WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>() && IsOpenMain)
{
@@ -455,7 +481,7 @@
SideQuestsType17 = 17,//鏀嚎17-21鏂板
SideQuestsType18 = 18,
SideQuestsType19 = 19,
- SideQuestsType20 = 20,
+ SideQuestsType20 = 20,//(鍚庣鐗规畩澶勭悊锛屾殏瀹氫笉璁╀娇鐢�)
SideQuestsType21 = 21,
}
@@ -844,9 +870,14 @@
{
if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null && _DictValue == 0)
{
+
+ if (IsGetOnBool)
+ {
+ GetNowTaskID = _MissionId;
+ }
MainCardLevelChange(_MissionId);
+
}
-
}
}
else
@@ -860,9 +891,16 @@
{
CardLevelChange(_MissionId);
}
- if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null)
- {
- MainCardLevelChange(_MissionId);
+ if (MainTaskDic.ContainsKey(_MissionId))
+ {
+ if (IsGetOnBool)
+ {
+ GetNowTaskID = _MissionId;
+ }
+ if (MainCardLevelChange != null)
+ {
+ MainCardLevelChange(_MissionId);
+ }
}
}
}
@@ -982,15 +1020,6 @@
}
}
}
-
- //if (_NpcID == allMissionDict[key].LightList.NpcId)
- //{
- // if (allMissionDict[key].LightList.StateLight > Light)
- // {
- // Light = allMissionDict[key].LightList.StateLight;
- // }
-
- //}
}
return Light;
@@ -1009,7 +1038,6 @@
return;
}
}
-
}
if (FairyAuDic.Count != 0)
{
@@ -1023,8 +1051,6 @@
}
}
}
-
-
}
public void DailyBountyMove()//鏃ュ父璧忛噾浠诲姟
{
@@ -1039,7 +1065,6 @@
return;
}
}
-
}
if (BountyDic.Count != 0)
{
@@ -1053,7 +1078,6 @@
}
}
}
-
}
@@ -1076,7 +1100,6 @@
}
}
}
-
}
private int Autotasking(int taskID)
@@ -1140,7 +1163,6 @@
return;
}
}
-
}
else if (FairyAuDic.ContainsKey(_taskID))//浠欑洘浠诲姟
{
@@ -1244,7 +1266,6 @@
{
break;
}
-
if (MapTransferUtility.Instance.MapTransferDoType != MapTransferUtility.E_MapTransferDoType.None)
{
break;
@@ -1367,7 +1388,6 @@
GA_NpcFunc.SetNpcFuncVisible(Npcid, true);
}
}
-
}
}
@@ -1489,7 +1509,6 @@
{
return -1;
}
-
}
public int GetQuestState(int _taskId)
@@ -1503,5 +1522,35 @@
return -1;
}
}
+ //--------涓昏鐢ㄤ簬璁板綍浠诲姟鍒楄〃閫変腑鏉$殑鏅鸿兘鎬� 锛�-_-||锛�
+ public int TaskupToDate = 0;//鑾峰彇鏈�鏂颁换鍔D
+ public int GetOnTaskId = 0;
+ public bool IsGetOnBool = false;
+ private int NeedTime = 10;
+ private DateTime dateTimeA;
+ public void GetTaskGetOnNow(int TaskID, string DictKey)//璁板綍涓嬩俊鎭瓧鍏哥殑ID
+ {
+ string key1Str = "on_kill_" + TaskID;
+ string key2Str = "get_byid_" + TaskID;
+ if (TaskID > 1 && (key1Str== DictKey || key2Str== DictKey))
+ {
+ GetOnTaskId = TaskID;
+ dateTimeA =DateTime.Now;
+ }
+ }
+ private void secondEvent()
+ {
+ TimeSpan timeS =DateTime.Now- dateTimeA;
+ int timeSend = timeS.Seconds;
+ if (timeSend >= NeedTime)
+ {
+ IsGetOnBool = true;
+ GetOnTaskId = GetNowTaskID;//鑾峰彇褰撳墠閫変腑鐨処D
+ }
+ else
+ {
+ IsGetOnBool = false;
+ }
+ }
}
--
Gitblit v1.8.0