public void SelectFirstLockIcon() { sdUILapBossLockIcon icon = null; foreach (DictionaryEntry item in rkItemList) { icon = item.Value as sdUILapBossLockIcon; break; } m_SelectUUID = UInt64.MaxValue; OnHideBossUI(); if (btnUnlock) { btnUnlock.SetActive(false); } if (icon != null) { if (icon.GetId() != UInt64.MaxValue) { icon.SetSelect(true); SAbyssLockInfo info = sdActGameMgr.Instance.GetLockInfo(icon.GetId()); if (info != null) { m_SelectUUID = icon.GetId(); OnSelectBossSetUI(info); if (btnUnlock) { btnUnlock.SetActive(true); } } } } }
public void SetLapBossEnterAckInfo(CliProto.SC_ABYSS_OPEN_ACK msg) { CliProto.SC_ABYSS_OPEN_ACK refMSG = msg; UInt64 uuDBID = refMSG.m_Info.m_AbyssInfo.m_ActDBID; if (uuDBID != UInt64.MaxValue) { if (m_LapBossEnterInfo[uuDBID] != null) { ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_ActDBID = refMSG.m_Info.m_AbyssInfo.m_ActDBID; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_ActTmpId = refMSG.m_Info.m_AbyssInfo.m_ActTmpId; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Blood = refMSG.m_Info.m_AbyssInfo.m_Blood; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Roleid = refMSG.m_Info.m_AbyssInfo.m_Roleid; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_RoleName = System.Text.Encoding.UTF8.GetString(refMSG.m_Info.m_AbyssInfo.m_Rolename); int iCount = (int)refMSG.m_Info.m_AbyssInfo.m_Atkcount; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Atkcount = iCount; for (int i = 0; i < iCount; i++) { ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Atklist[i] = refMSG.m_Info.m_AbyssInfo.m_Atklist[i]; } ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Status = refMSG.m_Info.m_AbyssInfo.m_Status; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Tritime = refMSG.m_Info.m_AbyssInfo.m_Tritime; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Opentime = refMSG.m_Info.m_AbyssInfo.m_Opentime; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_Killtime = refMSG.m_Info.m_AbyssInfo.m_Killtime; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_EntranceExistTime = refMSG.m_Info.m_AbyssInfo.m_EntranceExistTime; ((SAbyssLockInfo)m_LapBossEnterInfo[uuDBID]).m_AbyssExistTime = refMSG.m_Info.m_AbyssInfo.m_AbyssExistTime; } else { SAbyssLockInfo info = new SAbyssLockInfo(); info.m_ActDBID = refMSG.m_Info.m_AbyssInfo.m_ActDBID; info.m_ActTmpId = refMSG.m_Info.m_AbyssInfo.m_ActTmpId; info.m_Blood = refMSG.m_Info.m_AbyssInfo.m_Blood; info.m_Roleid = refMSG.m_Info.m_AbyssInfo.m_Roleid; info.m_RoleName = System.Text.Encoding.UTF8.GetString(refMSG.m_Info.m_AbyssInfo.m_Rolename); int iCount = (int)refMSG.m_Info.m_AbyssInfo.m_Atkcount; info.m_Atkcount = iCount; for (int i = 0; i < iCount; i++) { info.m_Atklist[i] = refMSG.m_Info.m_AbyssInfo.m_Atklist[i]; } info.m_Status = refMSG.m_Info.m_AbyssInfo.m_Status; info.m_Tritime = refMSG.m_Info.m_AbyssInfo.m_Tritime; info.m_Opentime = refMSG.m_Info.m_AbyssInfo.m_Opentime; info.m_Killtime = refMSG.m_Info.m_AbyssInfo.m_Killtime; info.m_EntranceExistTime = refMSG.m_Info.m_AbyssInfo.m_EntranceExistTime; info.m_AbyssExistTime = refMSG.m_Info.m_AbyssInfo.m_AbyssExistTime; m_LapBossEnterInfo[uuDBID] = info; } //深渊入口列表中的要删除.. if (m_LapBossLockInfo.ContainsKey(uuDBID)) { m_LapBossLockInfo.Remove(uuDBID); } } }
public void SelectEnterIcon(bool bFirst, UInt64 uuID) { m_SelectUUID = UInt64.MaxValue; OnHideBossUI(); if (btnEnter) { btnEnter.SetActive(false); } sdUILapBossEnterIcon icon = null; if (bFirst == true) { foreach (DictionaryEntry item in lbItemList) { icon = item.Value as sdUILapBossEnterIcon; break; } } else { if (uuID != UInt64.MaxValue) { foreach (DictionaryEntry item in lbItemList) { sdUILapBossEnterIcon iconTemp = item.Value as sdUILapBossEnterIcon; if (iconTemp.GetId() == uuID) { icon = iconTemp; break; } } } } if (icon != null) { if (icon.GetId() != UInt64.MaxValue) { icon.SetSelect(true); SAbyssLockInfo info = sdActGameMgr.Instance.GetEnterInfo(icon.GetId()); if (info != null) { m_SelectUUID = icon.GetId(); OnSelectBossSetUI(info); if (btnEnter) { btnEnter.SetActive(true); } } } } }
public void SetIdAndReflashUI(UInt64 id) { if (id == UInt64.MaxValue) { actUUID = UInt64.MaxValue; gameObject.SetActive(false); iTime = 0; return; } gameObject.SetActive(true); actUUID = id; bSelect = false; ReflashSelectUI(); SAbyssLockInfo item = sdActGameMgr.Instance.GetEnterInfo(actUUID); if (item != null) { iTime = (Int64)item.m_AbyssExistTime; Hashtable info = sdConfDataMgr.Instance().GetLapBossTemplate(item.m_ActTmpId.ToString()); if (info != null) { if (lbName) { lbName.GetComponent <UILabel>().text = info["AbyName"].ToString(); } if (lbDesc) { lbDesc.GetComponent <UILabel>().text = info["AbyDes"].ToString(); } if (lbFindV) { lbFindV.GetComponent <UILabel>().text = item.m_RoleName; } if (lbTimeV) { lbTimeV.GetComponent <UILabel>().text = "00:00:00"; } } } }
void OnClick() { if (gameObject) { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd bossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (bossWnd) { bossWnd.SetAllRKItemUnSelected(); bSelect = true; ReflashSelectUI(); bossWnd.m_SelectUUID = actUUID; SAbyssLockInfo item = sdActGameMgr.Instance.GetLockInfo(actUUID); if (item != null) { bossWnd.OnSelectBossSetUI(item); } } } } }
public void ResetLapBossEnterInfo(CliProto.SC_GET_ABYSS_OPEN_LIST_ACK msg) { m_LapBossEnterInfo.Clear(); CliProto.SC_GET_ABYSS_OPEN_LIST_ACK refMSG = msg; int iCount = (int)refMSG.m_Info.m_AbyssCount; for (int i = 0; i < iCount; i++) { UInt64 uuDBID = refMSG.m_Info.m_AbyssInfo[i].m_ActDBID; if (uuDBID != UInt64.MaxValue) { SAbyssLockInfo info = new SAbyssLockInfo(); info.m_ActDBID = refMSG.m_Info.m_AbyssInfo[i].m_ActDBID; info.m_ActTmpId = refMSG.m_Info.m_AbyssInfo[i].m_ActTmpId; info.m_Blood = refMSG.m_Info.m_AbyssInfo[i].m_Blood; info.m_Roleid = refMSG.m_Info.m_AbyssInfo[i].m_Roleid; info.m_RoleName = System.Text.Encoding.UTF8.GetString(refMSG.m_Info.m_AbyssInfo[i].m_Rolename); int iAtkcount = (int)refMSG.m_Info.m_AbyssInfo[i].m_Atkcount; info.m_Atkcount = iAtkcount; for (int j = 0; j < iAtkcount; j++) { info.m_Atklist[j] = refMSG.m_Info.m_AbyssInfo[i].m_Atklist[j]; } info.m_Status = refMSG.m_Info.m_AbyssInfo[i].m_Status; info.m_Tritime = refMSG.m_Info.m_AbyssInfo[i].m_Tritime; info.m_Opentime = refMSG.m_Info.m_AbyssInfo[i].m_Opentime; info.m_Killtime = refMSG.m_Info.m_AbyssInfo[i].m_Killtime; info.m_EntranceExistTime = refMSG.m_Info.m_AbyssInfo[i].m_EntranceExistTime; info.m_AbyssExistTime = refMSG.m_Info.m_AbyssInfo[i].m_AbyssExistTime; m_LapBossEnterInfo[uuDBID] = info; } } }
void OnClick() { if (gameObject.name == "TabPlayList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(1); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_OPEN_LIST_REQ(); } } else if (gameObject.name == "TabLockList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(2); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_TRIGGER_LIST_REQ(); } } else if (gameObject.name == "TabLogList") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(3); lapBossWnd.OnHideBossUI(); } sdActGameMsg.Send_CS_GET_ABYSS_OPEN_REC_REQ(); } } else if (gameObject.name == "TabDesc") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (lapBossWnd) { lapBossWnd.SetShowPanelType(4); lapBossWnd.OnHideBossUI(); } } } else if (gameObject.name == "wndClose") { if (sdActGameControl.m_UILapBossWnd != null) { sdActGameControl.Instance.CloseGameWnd(sdActGameControl.m_UILapBossWnd); } } else if (gameObject.name == "btnEnter") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd bossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (bossWnd) { if (bossWnd.m_SelectUUID == UInt64.MaxValue) { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } else { SAbyssLockInfo info = sdActGameMgr.Instance.GetEnterInfo(bossWnd.m_SelectUUID); if (info != null) { int iTmpID = (int)info.m_ActTmpId; string strLevelID = sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "AbyssLevelID"); int iLevelID = int.Parse(strLevelID); bool bSelf = false; //string strName = sdGameLevel.instance.mainChar.GetProperty()["Name"].ToString(); UInt64 uuMyID = UInt64.Parse(sdGameLevel.instance.mainChar.GetProperty()["DBID"].ToString()); if (uuMyID == info.m_Roleid) { bSelf = true; } if (bSelf) { int iEP = int.Parse(sdGameLevel.instance.mainChar.GetBaseProperty()["EP"].ToString()); int iNeedEP = int.Parse(sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "CostEP")); if (iNeedEP > iEP) { sdUICharacter.Instance.ShowOkMsg("您的体力值不足", null); return; } } else { int iAP = int.Parse(sdGameLevel.instance.mainChar.GetBaseProperty()["AP"].ToString()); int iNeedAP = int.Parse(sdConfDataMgr.Instance().GetLapBossTemplateValueByStringKey(iTmpID, "CostAP")); if (iNeedAP > iAP) { sdUICharacter.Instance.ShowOkMsg("您的协助点数不足", null); return; } } if (info.m_AbyssExistTime == 0) { sdUICharacter.Instance.ShowOkMsg("该深渊已经过期", null); return; } //发送协议 CliProto.CS_LEVEL_REQ refMSG = new CliProto.CS_LEVEL_REQ(); refMSG.m_LevelBattleType = (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS; refMSG.m_LevelID = (uint)iLevelID; sdLevelInfo.SetCurLevelId((int)refMSG.m_LevelID); refMSG.m_BuffID = 0; refMSG.m_AbyssDBID = info.m_ActDBID; SDNetGlobal.SendMessage(refMSG); // 通知宠物管理器.. sdNewPetMgr.Instance.OnEnterLevel(); sdUICharacter.Instance.iCurrentLevelID = iLevelID; sdUICharacter.Instance.bCampaignLastLevel = false; bossWnd.m_LevelID = (uint)iLevelID; sdNewInfoMgr.Instance.ClearNewInfo(NewInfoType.Type_LapBoss); } else { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } } } } } else if (gameObject.name == "btnUnlock") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUILapBossWnd bossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>(); if (bossWnd) { if (bossWnd.m_SelectUUID == UInt64.MaxValue) { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } else { SAbyssLockInfo info = sdActGameMgr.Instance.GetLockInfo(bossWnd.m_SelectUUID); if (info != null) { if (info.m_EntranceExistTime == 0) { sdUICharacter.Instance.ShowOkMsg("该深渊入口已经过期", null); } else { sdActGameMsg.Send_CS_ABYSS_OPEN_REQ(bossWnd.m_SelectUUID); } } else { sdUICharacter.Instance.ShowOkMsg("请选择合适的深渊", null); } } sdNewInfoMgr.Instance.ClearNewInfo(NewInfoType.Type_LapBoss); } } } }
public void OnSelectBossSetUI(SAbyssLockInfo slInfo) { Hashtable info = sdConfDataMgr.Instance().GetLapBossTemplate(slInfo.m_ActTmpId.ToString()); if (propPanel) { propPanel.SetActive(true); if (info != null) { Hashtable kMonsterProperty = sdConfDataMgr.Instance().GetTable("MonsterProperty"); Hashtable kTable = kMonsterProperty[int.Parse(info["MonsterTemplateID"].ToString())] as Hashtable; if (kTable != null) { string strTemp = kTable["Name"].ToString(); if (lbName) { lbName.GetComponent <UILabel>().text = strTemp; } int iMaxHp = (int)kTable["MaxHP"]; int iHpNum = (int)kTable["HPBarNum"]; int iPerHp = iMaxHp / iHpNum; int iNowHp = (int)slInfo.m_Blood; int iNowHpNum = 0; int iLineHp = 0; if (iNowHp == iMaxHp) { iNowHpNum = iHpNum; iLineHp = iPerHp; } else { if (iNowHp > iPerHp) { int iNum = iNowHp / iPerHp; iLineHp = iNowHp % iPerHp; if (iLineHp > 0) { iNowHpNum = iNum + 1; } else { iNowHpNum = iNum; } } else { iLineHp = iNowHp; iNowHpNum = 1; } } float fPer = (float)iLineHp / (float)iPerHp; if (hpBar) { hpBar.GetComponent <UISlider>().value = fPer; } if (lbHp) { lbHp.GetComponent <UILabel>().text = "x" + iNowHpNum.ToString(); } if (iNowHpNum > 1) { if (Background) { Background.GetComponent <UISprite>().spriteName = "bl5"; } } else { if (Background) { Background.GetComponent <UISprite>().spriteName = "bl4"; } } if (lbV0) { lbV0.GetComponent <UILabel>().text = info["AbyLevel"].ToString(); } if (lbV1) { int iTemp = (int)kTable["AtkDmgMax"]; lbV1.GetComponent <UILabel>().text = iTemp.ToString(); } if (lbV2) { int iTemp = (int)kTable["Def"]; lbV2.GetComponent <UILabel>().text = iTemp.ToString(); } if (lbV3) { lbV3.GetComponent <UILabel>().text = iNowHp.ToString(); } } LoadBossModel(info["BossTex"].ToString()); } } // if (texBoss!=null && info!=null) // { // texBoss.SetActive(true); // ResLoadParams param = new ResLoadParams(); // string strTex = info["BossTex"].ToString(); // if( strTex != "" ) // sdResourceMgr.Instance.LoadResource("UI/LapBossTex/$LBT_"+strTex+".png",LoadTexCallback,param,typeof(Texture)); // } }