void OpenScene() { SceneNode scene = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(mapid != 0 ? mapid : 102); if (null == scene) { Debug.Log("No configuration is read : " + mapid); return; } Control.HideGUI(UIPanleID.UIMoney); TfMapContainer.gameObject.SetActive(true); TfWorldMap.GetComponent <UIWorldMap>().OnMapBtnClick(scene.bigmap_id); if (scene.Type == 2 && TfMapContainer.GetComponent <UIMapContainer>().isOpenElite) { TfMapContainer.GetComponent <UIMapContainer>().ChangeDifficultyToElite(); } Dictionary <int, int[]> mapInfo = new Dictionary <int, int[]>(); if (!GameLibrary.mapOrdinary.TryGetValue(scene.bigmap_id, out mapInfo)) { return; } if (mapInfo.ContainsKey(mapid) && mapid != 0) { if (Globe.GetStar(mapInfo[mapid]) >= 0) { TfMapContainer.GetComponent <UIMapContainer>().ShowSceneEntry(scene); } } }
void UpdateStar(Dictionary <string, object> item, int mapid) { if (null != item && item.Count > 0) { Dictionary <int, int[]> dungeon; if (GameLibrary.mapOrdinary.TryGetValue(mapid, out dungeon)) { dungeon = GameLibrary.mapOrdinary[mapid]; } else { dungeon = new Dictionary <int, int[]>(); } List <string> heroKey = new List <string>(item.Keys); heroKey.Sort(); for (int j = 0; j < heroKey.Count; j++) { if (int.Parse(heroKey[j]) == 0) { continue; } if (j == (heroKey.Count - 1) && Globe.GetStar((int[])(item[heroKey[j]])) > 0) { int nextMapId = mapid + 100; if (!playerData.GetInstance().CanEnterMap.Contains(nextMapId) && playerData.GetInstance().worldMap.Contains(nextMapId) && FunctionOpenMng.GetInstance().GetValu(nextMapId / 100)) { playerData.GetInstance().CanEnterMap.Add(nextMapId); } } int[] stat = (int[])item[heroKey[j]]; if (dungeon.ContainsKey(int.Parse(heroKey[j]))) { //if (Globe.GetStar(dungeon[int.Parse(heroKey[j])]) < Globe.GetStar(stat)) //{ dungeon[int.Parse(heroKey[j])] = stat; //} } else { dungeon.Add(int.Parse(heroKey[j]), stat); } } if (!GameLibrary.mapOrdinary.ContainsKey(mapid)) { GameLibrary.mapOrdinary.Add(mapid, dungeon); } else { GameLibrary.mapOrdinary[mapid] = dungeon; } } }
public override void Info(object obj) { //Debug.Log(((SceneNode)obj).SceneName); sceneNode = (SceneNode)obj; if (((SceneNode)obj).SceneName == "简单") { DifficLabel.text = "[83FFC0FF]" + ((SceneNode)obj).SceneName; } else if (((SceneNode)obj).SceneName == "普通") { DifficLabel.text = "[51ABE8FF]" + ((SceneNode)obj).SceneName; } else if (((SceneNode)obj).SceneName == "困难") { DifficLabel.text = "[B256DFFF]" + ((SceneNode)obj).SceneName; } else if (((SceneNode)obj).SceneName == "大师") { DifficLabel.text = "[F65F5FFF]" + ((SceneNode)obj).SceneName; } //Icon.spriteName = UIActivity.instance.ModulIcon(((SceneNode)obj).bigmap_id); Icon.spriteName = TypeIcon(((SceneNode)obj).SceneName); titleBg.spriteName = TypeTitleBg(((SceneNode)obj).SceneName); mapID = ((SceneNode)obj).bigmap_id; star = GameLibrary.eventsList[(((SceneNode)obj).bigmap_id - 30000) / 100]; sceneStar = Globe.GetStar(star[sceneNode.SceneId - sceneNode.bigmap_id - 1]); if (((SceneNode)obj).isOpened) { sceneID = ((SceneNode)obj).SceneId; DesLabel.gameObject.SetActive(false); Icon.color = new Color(1, 1, 1); for (int i = 0; i < starList.Count; i++) { starList[i].enabled = true; starList[i].spriteName = i + 1 <= sceneStar ? "xing" : "xing-hui"; } isDisplay = true; } else { DesLabel.gameObject.SetActive(true); DesLabel.text = "战队等级" + ((SceneNode)obj).pass_lv + "开启"; Icon.color = new Color(0, 0, 0); for (int i = 0; i < starList.Count; i++) { starList[i].enabled = false; } isDisplay = false; } }
void SetCleanoutBtnState() { if (type == OpenSourceType.Dungeons) { //BtnCleanout5State(); if (!GameLibrary.mapOrdinary.TryGetValue(scene.bigmap_id, out Dungeons)) { return; } if (!Dungeons.ContainsKey(scene.SceneId)) { return; } if (Globe.GetStar(Dungeons[scene.SceneId]) >= 3) { SetBtnCleanoutState(true); } else { SetBtnCleanoutState(false); } } else { int count = GameLibrary.eventdList[(scene.bigmap_id - 30000) / 100]; eventStar = GameLibrary.eventsList[(scene.bigmap_id - 30000) / 100]; if (count <= 0) { SetBtnCleanoutState(false); } else { if (Globe.GetStar(eventStar[(scene.SceneId - scene.bigmap_id) - 1]) >= 3) { SetBtnCleanoutState(true); } else { SetBtnCleanoutState(false); } } //BtnCleanout5.text = string.Format(Localization.Get("UILevelBtnCleanout5"), count == 0 ? 2 : count); //BtnCleanout5Number = count; } }
//精英副本开放条件判断 bool CheckElite(MapNode map) { Dictionary <int, int[]> dungeonStar = MapStar(map, 1); isOpenElite = true; List <int> dungeonStarKey = new List <int>(dungeonStar.Keys); for (int i = 0; i < dungeonStarKey.Count; i++) { if (Globe.GetStar(dungeonStar[dungeonStarKey[i]]) <= 0) { return(false); } } return(true); }
public void RefreshUI(MapNode map) { itemRankList.Clear(); SceneNode scene = null; if (map != null) { List <int[]> star = GameLibrary.eventsList[(map.MapId - 30000) / 100]; for (int i = 0; i < map.ordinary.Length; i++) { scene = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(map.ordinary[i]); int a = 0; if (i > 0) { a = i - 1; } if (Globe.GetStar(star[a]) >= 0 && scene.pass_lv <= playerData.GetInstance().selfData.level) { //DifficSelectData.Instance().mapID.Add(map.MapId + i + 1, false); scene.isOpened = true; } else { scene.isOpened = false; //DifficSelectData.Instance().mapID.Add(map.MapId + i + 1, false); } itemRankList.Add(scene); } } BackBtn.transform.Find("Label").GetComponent <UILabel>().text = map.MapName; switch ((map.MapId - 30000) / 100) { case 1: PromptLabel.text = "此模式下只能使用男性英雄"; break; case 2: PromptLabel.text = "此模式下只能使用女性英雄"; break; case 3: PromptLabel.text = "此模式下只能使用力量英雄"; break; case 4: PromptLabel.text = "此模式下只能使用敏捷英雄"; break; case 5: PromptLabel.text = "此模式下只能使用智力英雄"; break; } DifficMultList.InSize(map.ordinary.Length, map.ordinary.Length); DifficMultList.Info(itemRankList.ToArray()); }
public bool RefreshUI(MapNode map, Dictionary <int, int[]> dungeonStar, int types = 1) { InitHide(); MapData = map; gameObject.SetActive(true); isSetEffect = true; if (null != itemEffect) { itemEffect.SetActive(false); } int star = 0; int sceneIndex = 0; int lastIndex = 0; for (int i = (MapData.MapId + types); i <= (MapData.MapId + map.ordinary.Length * 2); i += 2) { if (!dungeonStar.ContainsKey(i)) { continue; } star = i; SceneButtons[sceneIndex].gameObject.SetActive(true); if (null != dungeonStar && dungeonStar.Count > 0) { if (Globe.GetStar(dungeonStar[star]) >= 0) { if (null == SceneButtons[sceneIndex].GetComponent <ClickItem>().ClickGo) { SceneButtons[sceneIndex].GetComponent <ClickItem>().ClickGo += OnClickSceneBtn; } } SceneButtons[sceneIndex].RefreshUI(FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(star), Globe.GetStar(dungeonStar[star])); if (Globe.GetStar(dungeonStar[star]) == 0) { SetItemEffect(SceneButtons[sceneIndex].Icon.enabled ? SceneButtons[sceneIndex].Icon : SceneButtons[sceneIndex].BgIcon); } } else { SceneButtons[sceneIndex].RefreshUI(FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(star)); } lastIndex = star; sceneIndex++; } return(star != 0 && null != dungeonStar && Globe.GetStar(dungeonStar[star]) > 0); }
void ShowDungeonType(int type) { types = type; totalStar = 0; dungeonStar = MapStar(map, type); List <int> dungStarKey = new List <int>(dungeonStar.Keys); for (int i = 0; i < dungStarKey.Count; i++) { if (Globe.GetStar(dungeonStar[dungStarKey[i]]) > 0) { totalStar += Globe.GetStar(dungeonStar[dungStarKey[i]]); } } SetNormalOrEliteBtnEffect(type == 1 ? BtnNormal.GetComponent <UISprite>() : BtnElite.GetComponent <UISprite>()); RefreshMap(map, dungeonStar); }
void CheckMaxMapID(long[] map, MapNode mapNode, ref int maxID) { for (int i = 0; i < map.Length; i++) { if (GameLibrary.mapOrdinary.ContainsKey(mapNode.MapId) && GameLibrary.mapOrdinary[mapNode.MapId].ContainsKey((int)map[i])) { if (Globe.GetStar(GameLibrary.mapOrdinary[mapNode.MapId][(int)map[i]]) <= -1) { maxID = (int)map[i - 1]; break; } else { maxID = (int)map[i]; } } } }
public override void Info(object obj) { if (obj != null) { id = int.Parse(obj.ToString()); bossIcon.gameObject.SetActive(false); if (99 < id && id < 30000)//副本 { if (FSDataNodeTable <SceneNode> .GetSingleton().DataNodeList.ContainsKey(id)) { sceneNode = FSDataNodeTable <SceneNode> .GetSingleton().DataNodeList[id]; if (id % 2 == 0) { wayName.text = sceneNode.SceneName + "(精英)"; } else { wayName.text = sceneNode.SceneName; } //daguanSprite.spriteName = SceneIcon(sceneNode.game_type); //if (null != sceneNode.icon_name && sceneNode.icon_name != "0") //{ // bossIcon.gameObject.SetActive(true); // bossIcon.spriteName = sceneNode.icon_name; //} //else //{ // bossIcon.gameObject.SetActive(false); //} daguanSprite.spriteName = "maoxian"; //获得关卡是够已经开启 int bigmapID = sceneNode.bigmap_id;//大关id if (GameLibrary.mapOrdinary.ContainsKey(bigmapID)) { if (GameLibrary.mapOrdinary[bigmapID].ContainsKey(id)) { if (FunctionOpenMng.GetInstance().GetFunctionOpen(bigmapID / 100)) { if (Globe.GetStar(GameLibrary.mapOrdinary[bigmapID][id]) < 0)//通过小关星级判断是否开启 -1不开启 { isOpened = false; } else { isOpened = true; } } else { isOpened = false; } } } } } if (30000 < id)//试练 { if (FSDataNodeTable <SceneNode> .GetSingleton().DataNodeList.ContainsKey(id)) { sceneNode = FSDataNodeTable <SceneNode> .GetSingleton().DataNodeList[id]; wayName.text = sceneNode.SceneName; int bigmapID = sceneNode.bigmap_id;//大关id //daguanSprite.spriteName = SceneIcon(sceneNode.game_type); daguanSprite.spriteName = "shijian"; if (GameLibrary.eventsList.ContainsKey(bigmapID)) { List <int[]> temarr = GameLibrary.eventsList[bigmapID]; string temStr = id.ToString(); int temcount = int.Parse(temStr.Substring(temStr.Length - 1, 1));//截取试练id的最后一位 然后去取相对应的星级 if (temcount > 1 && temarr.Count >= temcount) { if (Globe.GetStar(temarr[temcount - 1]) < 0) { isOpened = false; } else { isOpened = true; } } } } } if (!isOpened) { isOpen.gameObject.SetActive(true); openSprite.gameObject.SetActive(false); isOpen.text = "[ff0000]未开放[-]"; } else { isOpen.gameObject.SetActive(false); openSprite.gameObject.SetActive(true); } //打开面板 if (id == 3)//祭坛 { wayName.text = "祭坛"; daguanSprite.spriteName = "jitan"; HidePng(); } //打开面板 if (id == 4)//远征商店 { wayName.text = "角斗场商店"; daguanSprite.spriteName = "shangdian"; HidePng(); } if (id == 5)//竞技场商店 { wayName.text = "竞技场商店"; daguanSprite.spriteName = "shangdian"; HidePng(); } if (id == 6)//公会商店 { wayName.text = "公会商店"; daguanSprite.spriteName = "shangdian"; HidePng(); } } }
protected override void ShowHandler() { if (this.isMoba) { bg.enabled = false; mobaBG.enabled = true; if (isWin) { Result.spriteName = "shenglibiao"; resultFB.gameObject.SetActive(false); sprite.gameObject.SetActive(true); } else { Result.spriteName = "shibaibiao"; resultFB.gameObject.SetActive(false); sprite.gameObject.SetActive(false); } } else { bg.enabled = true; mobaBG.enabled = false; sceneNode = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(GameLibrary.dungeonId); if (this.isWin) { Result.spriteName = "shenglibiao"; resultFB.gameObject.SetActive(true); sprite.gameObject.SetActive(false); effWinBg_1.gameObject.SetActive(true); effWinBg_2.gameObject.SetActive(true); int star = Globe.GetStar(GameLibrary.star); StartCoroutine(Delays(star)); StartCoroutine(DelayStar()); int index = 0; foreach (bool item in GameLibrary.meetStar.Values) { if (item) { bannerList[index].spriteName = "hongtiao"; bannerList[index].transform.Find("Tween/Star").GetComponent <UISprite>().spriteName = "xingxing"; } else { bannerList[index].spriteName = "heitiao"; bannerList[index].transform.Find("Tween/Star").GetComponent <UISprite>().spriteName = "huisexingxing"; } if (bannerList.Count > index && bannerList[index] != null && bannerList[index].transform.Find("Tween/Label") != null) { bannerList[index].transform.Find("Tween/Label").GetComponent <UILabel>().text = sceneNode.star_describe[index]; } index++; } } else { Result.spriteName = "shibaibiao"; sprite.gameObject.SetActive(false); effDefeat.gameObject.SetActive(true); FailedPanel.gameObject.SetActive(true); } } //弹出失败or成功面板 关闭副本对话框(避免穿透) Control.Hide(UIPanleID.UIFubenTaskDialogue); }