| System/MainInterfacePanel/MainRedDot.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/BossFirstBloodCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/BossFirstBloodModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/BossFirstBloodWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/MainInterfacePanel/MainRedDot.cs
@@ -105,6 +105,9 @@ public readonly Redpoint fairyActivityRedpoint = new Redpoint(218); #endregion // boss首杀 public const int REDPOINT_BOSSFIRSTKILL = 600; public void Register() { RedpointCenter.Instance.redpointValueChangeEvent -= OnRedpointChange; System/OpenServerActivity/BossFirstBloodCell.cs
@@ -8,9 +8,23 @@ { public class BossFirstBloodCell : CellView { [SerializeField] Image m_Select; [SerializeField] Image m_NPCIcon; [SerializeField] ImageEx m_NPCIcon; [SerializeField] Button m_FuncBtn; [SerializeField] Image m_KillImg; [SerializeField] RedpointBehaviour redPonint; [SerializeField] Image m_NPCMask; //图标置灰后,scroll下移动会显示,改用图片盖住 BossFirstBloodModel model { get { return ModelCenter.Instance.GetModel<BossFirstBloodModel>(); } } public Button funcBtn { get @@ -18,6 +32,7 @@ return m_FuncBtn; } } public void Display(int index) { @@ -30,6 +45,23 @@ m_NPCIcon.SetActive(true); var npcConfig = NPCConfig.Get(_npcId); m_NPCIcon.SetSprite(npcConfig.HeadPortrait); redPonint.redpointId = BossFirstBloodModel.Redpoint_BossKillRank * 100 + BOSSFirstKillConfig.Get(_npcId).Sort; var state = model.GetPersonalKillAwardState(_npcId); if (state == 0) { m_KillImg.SetActive(false); m_NPCMask.SetActive(false); } else { m_KillImg.SetActive(true); m_NPCMask.SetActive(true); } model.UpdateRedPoint(_npcId, state == 1 ? RedPointState.Simple : RedPointState.None); } System/OpenServerActivity/BossFirstBloodModel.cs
@@ -30,6 +30,9 @@ Dictionary<int, int> FirstKillStateInfo = new Dictionary<int, int>(); // 击杀奖励状态 public Dictionary<int, FirstKillTimeInfo> firstKillTimeInfo = new Dictionary<int, FirstKillTimeInfo>(); // 首杀名和时间 private Dictionary<int, Redpoint> m_Redpoints = new Dictionary<int, Redpoint>(); private Dictionary<int, Redpoint> m_RedPackRedpoints = new Dictionary<int, Redpoint>(); public List<string> npcIDConfig; public bool IsOpen { @@ -49,12 +52,30 @@ } } public const int Redpoint_BossKillRank = 25900; public Redpoint rankRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENRANK, Redpoint_BossKillRank); public bool IsAdvance { get { return false; } } public void UpdateAllRedPoint() { foreach (var _key in m_Redpoints.Keys) { UpdateRedPoint(_key, GetPersonalKillAwardState(_key) == 1 ? RedPointState.Simple : RedPointState.None); } } public void UpdateRedPoint(int npcID, RedPointState state) { var _redpoint = m_Redpoints[npcID]; _redpoint.state = m_RedPackRedpoints[npcID].state == RedPointState.None ? state : m_RedPackRedpoints[npcID].state; } @@ -89,7 +110,40 @@ if (!WindowCenter.Instance.IsOpen<BossFirstBloodWin>() && OnFirstKillInfo != null) OnFirstKillInfo(npcID); } UpdateAllRedPackPoint(); UpdateAllRedPoint(); } } public int GetBossKillAwardState(int npcID) { //0 未击杀 1 可领取 2 已领取 if (firstKillTimeInfo.ContainsKey(npcID) && !string.IsNullOrEmpty(firstKillTimeInfo[npcID].name)) { //无数据为可领取 if (!FirstKillStateInfo.ContainsKey(npcID)) return 1; int state = FirstKillStateInfo[npcID]; if (state/10 % 10 == 0) return 1; else return 2; } return 0; } public void UpdateAllRedPackPoint() { foreach (var _key in m_RedPackRedpoints.Keys) { UpdateRedPackPoint(_key); } } public void UpdateRedPackPoint(int npcID) { var state = GetBossKillAwardState(npcID) == 1 ? RedPointState.Simple : RedPointState.None; m_RedPackRedpoints[npcID].state = state; } @@ -113,11 +167,27 @@ var infoY = BOSSFirstKillConfig.Get(y); return infoX.Sort.CompareTo(infoY.Sort); }); foreach (var key in npcIDConfig) { var npcID = int.Parse(key); var infoX = BOSSFirstKillConfig.Get(key); m_Redpoints.Add(npcID, new Redpoint(Redpoint_BossKillRank, Redpoint_BossKillRank * 100 + infoX.Sort)); m_RedPackRedpoints.Add(npcID, new Redpoint(Redpoint_BossKillRank * 100 + infoX.Sort, (Redpoint_BossKillRank * 100 + infoX.Sort)*10)); } } public int GetNPCRedPackPointID(int npcID) { var infoX = BOSSFirstKillConfig.Get(npcID); return (Redpoint_BossKillRank * 100 + infoX.Sort) * 10; } public override void UnInit() { DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo -= OnGetUniversalGameInfo; } public event Action<int> UpdatePersonnalKillEvent; public void BossFirstKillStateInfo(HAB01_tagMCBossFirstKillStateInfo package) @@ -128,6 +198,8 @@ if (UpdatePersonnalKillEvent != null) UpdatePersonnalKillEvent((int)package.FirstKillStateList[i].NPCID); } UpdateAllRedPackPoint(); UpdateAllRedPoint(); } public int GetPersonalKillAwardState(int npcID) System/OpenServerActivity/BossFirstBloodWin.cs
@@ -19,6 +19,9 @@ [SerializeField] Text m_NPCNameLV; [SerializeField] Text m_PlayerName; [SerializeField] Text m_KillTime; [SerializeField] UIEffect m_Effect; [SerializeField] Button m_RedPack; [SerializeField] RedpointBehaviour redPonint; BossFirstBloodModel model { @@ -152,7 +155,33 @@ m_NPCNameLV.text = npcConfig.charName + " LV." + npcConfig.NPCLV; //首杀 未击杀红包正常亮,已击杀未领取显示特效红点,已领取置灰 redPonint.redpointId = model.GetNPCRedPackPointID(npcID); model.UpdateRedPackPoint(npcID); ShowKillInfo(npcID); m_RedPack.RemoveAllListeners(); m_RedPack.AddListener(() => { ClickRedPack(npcID); }); } private void ClickRedPack(int npcID) { var state = model.GetBossKillAwardState(npcID); if (state == 1) { SendGetAward(npcID, 0); return; } var npcConfig = NPCConfig.Get(npcID); if (state == 0) SysNotifyMgr.Instance.ShowTip("NoBossFirstKill", npcConfig.charName); else if (state == 2) SysNotifyMgr.Instance.ShowTip("GetBossFirstKillAwardYet", npcConfig.charName); } public void ShowKillInfo(int npcID) @@ -255,6 +284,24 @@ }); } } // 红包状态 var state = model.GetBossKillAwardState(npcID); if (state == 0) { m_RedPack.SetColorful(null, true); m_Effect.Stop(); } else if (state == 1) { m_RedPack.SetColorful(null, true); m_Effect.Play(); } else if (state == 2) { m_RedPack.SetColorful(null, false); m_Effect.Stop(); } } protected override void BindController() {