private void Voyage_Render(int index, GObject item) { Dictionary <string, object> data = (Dictionary <string, object>)list[index]; int index_ = Convert.ToInt32(data["name"]); if (index_ == -1) { return; } object[] dc = (object[])data[index_ + ""]; GTextField textTitle = item.asCom.GetChild("n1").asTextField; GLoader load = item.asCom.GetChild("n2").asLoader; GTextField group = item.asCom.GetChild("n5").asTextField; GTextField rankScore = item.asCom.GetChild("n94").asTextField; GTextField rankLevel = item.asCom.GetChild("n3").asTextField; GTextField rankLevelValue = item.asCom.GetChild("n4").asTextField; if ((int)dc[1] > rankMax) { rankLevelValue.text = rankMax + Tools.GetMessageById("13129"); } else { rankLevelValue.text = dc[1].ToString(); } textTitle.text = Tools.GetMessageById("31079", new string[] { (index_ + "").ToString() }); load.url = userModel.GetRankImg((int)dc[0], 0, true); group.text = Tools.getRankGroup((int)dc[0]);//大师组 rankScore.text = dc[0].ToString(); rankLevel.text = Tools.GetMessageById("13085"); }
public void SetData(object rankScore, string replaceName = null) { if (replaceName != null) { loader.url = Tools.GetResourceUrl(replaceName); } else { loader.url = userModel.GetRankImg(Convert.ToInt32(rankScore)); } text.text = rankScore.ToString(); }
private void MatchTeam() { if (statementType.Equals(ModelFight.FIGHT_MATCHTEAM) || statementType.Equals(ModelFight.FIGHT_FREEMATCH2))//排位 { addRankScore.visible = true; rankScoreBg.visible = true; rankScore.visible = true; if (statementType.Equals(ModelFight.FIGHT_MATCHTEAM)) { Dictionary <string, object> info = (Dictionary <string, object>)((object[])figthUserInfo["0"])[2]; object[] matchReward = (object[])rank_reward[(Convert.ToInt32(info["rank_lv"])).ToString()]; rankScoreValue.text = userModel.rank_score.ToString(); rankScoreBg.url = userModel.GetRankImg(userModel.rank_score); rankImg.url = userModel.GetRankImg(userModel.rank_score); rankScoreStart = userModel.rank_score; rankScoreEnd = (int)user["rank_score"]; num = Math.Abs(rankScoreStart - rankScoreEnd); if (rankScoreStart > rankScoreEnd) { addRankScore.text = "-" + num; } else if (rankScoreStart > rankScoreEnd) { addRankScore.text = "+" + num; } else { if ((int)fightModel.fightData["battle_result"] == 1)//胜利 { addRankScore.text = "+" + num; } else { addRankScore.text = "-" + num; } } if ((int)fightModel.fightData["battle_result"] == 1)//胜利 { if ((bool)info["is_mvp"]) { effectType1 = Config.EFFECT_WIN; animateType1 = null; animateDir1 = null; isMvp = true; rewardName = Tools.GetFightRewardID(matchReward[2].ToString()); effectType2 = rewardName; //animateType2 = matchReward[2].ToString(); animateDir2 = null; } else { effectType1 = Config.EFFECT_WIN; animateType1 = "mvp1"; animateDir1 = "win_/icon"; rewardName = Tools.GetFightRewardID(matchReward[0].ToString()); effectType2 = rewardName; //animateType2 = matchReward[0].ToString(); animateDir2 = null; } } else { //userModel.rank_score = (int)info["rank_score"]; if ((bool)info["is_mvp"]) { effectType1 = Config.EFFECT_LOSE; animateType1 = null; animateDir1 = null; isMvp = true; rewardName = Tools.GetFightRewardID(matchReward[2].ToString()); effectType2 = rewardName; //animateType2 = matchReward[2].ToString(); animateDir2 = null; } else { effectType1 = Config.EFFECT_LOSE; animateType1 = "normal"; animateDir1 = "los/lose_"; rewardName = Tools.GetFightRewardID(matchReward[1].ToString()); effectType2 = rewardName; //animateType2 = matchReward[1].ToString(); animateDir2 = null; } } initQueue.Init(new List <Action> { Effect1, Effect2, Effect3, Effect4, Effect5, Effect6 }); } else { viewFight.visible = false; Dictionary <string, object> info = (Dictionary <string, object>)((object[])figthUserInfo["0"])[2]; if ((int)fightModel.fightData["battle_result"] == 1)//胜利 { if ((bool)info["is_mvp"]) { effectType1 = Config.EFFECT_WIN; animateType1 = null; animateDir1 = null; isMvp = true; } else { effectType1 = Config.EFFECT_WIN; animateType1 = "mvp1"; animateDir1 = "win_/icon"; } } else { //userModel.rank_score = (int)info["rank_score"]; if ((bool)info["is_mvp"]) { effectType1 = Config.EFFECT_LOSE; animateType1 = null; animateDir1 = null; isMvp = true; } else { effectType1 = Config.EFFECT_LOSE; animateType1 = "normal"; animateDir1 = "los/lose_"; } } initQueue.Init(new List <Action> { Effect1, Effect7 }); } } }
private void OnRender(int index, GObject item) { GComponent start = item.asCom.GetChild("n8").asCom; GLoader change = item.asCom.GetChild("n9").asLoader; GTextField num = item.asCom.GetChild("n1").asTextField; GButton head = item.asCom.GetChild("n2").asCom.GetChild("n0").asButton; GTextField name = item.asCom.GetChild("n4").asTextField; GTextField guild = item.asCom.GetChild("n5").asTextField; GTextField lv = item.asCom.GetChild("n2").asCom.GetChild("n2").asTextField; GTextField rank = item.asCom.GetChild("n12").asCom.GetChild("n2").asTextField; GLoader achieve = item.asCom.GetChild("n12").asCom.GetChild("n1").asLoader; GButton mask = item.asCom.GetChild("n11").asButton; GImage bg_ = item.asCom.GetChild("itemBg_").asImage; bg_.visible = false; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); //GLoader item_bg = item.asCom.GetChild("n0").asLoader; // if (d1["uid"].ToString().Equals(userModel.uid)) // { // item_bg.url = Tools.GetResourceUrl("Image:bg_zidichen7"); // } // else // { // item_bg.url = Tools.GetResourceUrl("Image:bg_zidichen3"); // } //if (index % 2 == 0) { // item_bg.url = "";//Tools.GetResourceUrl("Image2:n_bg_tanban6"); //} else { // item_bg.url = Tools.GetResourceUrl("Image2:n_bg_tanban6"); //} bool isVisible = SetListCSS(item, listData.ToArray(), index); if (isVisible) { Dictionary <string, object> d1 = (Dictionary <string, object>)listData[index]; if (d1["uid"].ToString().Equals(userModel.uid)) { bg_.visible = true; } string headurl = ((Dictionary <string, object>)d1["head"])["use"].ToString(); // try{ Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(headurl)); // }catch(Exception eeee){ // Debug.LogError (d1["uid"].ToString() +" || "+headurl); // } mask.RemoveEventListeners(); mask.onClick.Add(() => { roleModel.SetTempData(listData, new int[] { list.GetFirstChildInView() }); string fuid = d1["uid"] + ""; string uid = userModel.uid; if (fuid != uid) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, d1["uid"], roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); if ((int)d1["rank_diff"] == 0) { change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua3"); num.text = ""; } else if ((int)d1["rank_diff"] > 0) { change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua1"); num.text = Tools.GetMessageColor("[0]" + d1["rank_diff"] + "[/0]", new string[] { "4db10c" }); } else { change.url = Tools.GetResourceUrl("Image2:n_icon_bianhua2"); num.text = Tools.GetMessageColor("[0]" + d1["rank_diff"] + "[/0]", new string[] { "d23823" }); } Tools.StartSetValue(start, (index + 1).ToString(), ""); if (d1["uname"] != null) { name.text = (string)d1["uname"]; } else { name.text = d1["uid"] + ""; } if (d1["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = d1["guild_name"] + ""; } lv.text = d1["lv"].ToString(); achieve.url = userModel.GetRankImg((int)d1["like_num"]); rank.text = d1["like_num"] + ""; } }
private void InitView() { fightTime = GetChild("n5").asTextField; GComponent rank = GetChild("n4").asCom; GComponent fightNum = GetChild("n6").asCom; GComponent winRate = GetChild("n0").asCom; GComponent mvp = GetChild("n7").asCom; GComponent kill = GetChild("n93").asCom; GTextField cupNum = GetChild("n8").asTextField; GTextField cupNum_ = GetChild("n96").asTextField; GLoader loader = GetChild("n85").asLoader; GImage bg = GetChild("n95").asImage; loader.url = userModel.GetRankImg(userModel.rank_score); //timetext=fightTime.GetChild("n0").asTextField; //time = fightTime.GetChild("n1").asTextField; //rank.GetChild("n0").asTextField.text = Tools.GetMessageById("13022"); //rank.GetChild("n1").asTextField.text = data["rank_score"].ToString(); string rankText1 = "[size=15]" + Tools.GetMessageById("13022") + "[/size]"; string rankText2 = "[size=22]" + data["rank_score"].ToString() + "[/size]"; Debug.Log(rankText1 + rankText2); rank.GetChild("n0").asTextField.text = rankText1; rank.GetChild("n1").asTextField.text = rankText2; //rank.text = rankText1 + rankText2; fightNum.GetChild("n0").asTextField.text = Tools.GetMessageById("13023"); fightNum.GetChild("n1").asTextField.text = data["fight_num"].ToString(); double num = Convert.ToDouble(data["win_rate"]) * 100; winRate.GetChild("n0").asTextField.text = Tools.GetMessageById("13024"); winRate.GetChild("n1").asTextField.text = (int)num + "%"; mvp.GetChild("n0").asTextField.text = Tools.GetMessageById("13025"); mvp.GetChild("n1").asTextField.text = data["mvp_num"].ToString(); kill.GetChild("n0").asTextField.text = Tools.GetMessageById("13158"); kill.GetChild("n1").asTextField.text = data["kill_num"].ToString(); //GComponent start = GetChild("n9").asCom; //GTextField text = start.GetChild("n4").asTextField; //text.text= Tools.GetMessageById("24223"); //GLoader mvp_ = start.GetChild("n1").asLoader; //Tools.GetResourceUrlForMVP(mvp_, "mvp"); //Tools.SetTextFieldStrokeAndShadow(text, "#46149f", new Vector2(0, 0)); //GImage cupIcon = GetChild("n88").asImage; if ((int)data["king_score"] == 0) { bg.visible = false; cupNum.visible = false; cupNum_.visible = false; } else { bg.visible = true; cupNum.visible = true; cupNum_.visible = true; } //bg.visible = true; //cupNum.visible = true; //cupNum_.visible = true; //cupNum.GetChild("n0").asTextField.text = Tools.GetMessageById("13026"); //cupNum.GetChild("n1").asTextField.text = data["king_score"].ToString(); //string cupNum1 = "[size=16]" + Tools.GetMessageById("13026") + "[/size]"; //string cupNum2 = "[size=30]" + data["king_score"].ToString() + "[/size]"; // Debug.Log(cupNum1 + cupNum2); cupNum.text = Tools.GetMessageById("13026"); cupNum_.text = data["king_score"].ToString(); //this.GetChild("n3").asLoader.url = Tools.GetResourceUrl("Image2:n_icon_luobo_"); Time_Tick(0); TimerManager.inst.Add(1f, 0, Time_Tick); }
private void SearchRender(int index, GObject item) { Dictionary <string, object> dc = (Dictionary <string, object>)listData[index]; GButton photo = item.asCom.GetChild("n1").asCom.GetChild("n0").asButton; GTextField name = item.asCom.GetChild("n3").asTextField; GTextField guild = item.asCom.GetChild("n4").asTextField; GLoader achieve = item.asCom.GetChild("n21").asCom.GetChild("n1").asLoader; GTextField status = item.asCom.GetChild("n9").asTextField; GButton mask_btn = item.asCom.GetChild("n8").asButton; GButton btn_attention = item.asCom.GetChild("n7").asButton; GTextField attention_text = btn_attention.GetChild("title").asTextField; GLoader btn_image = btn_attention.asCom.GetChild("n1").asLoader; //btn_image.visible = true; GObject reletion = item.asCom.GetChild("n2"); GTextField rankScore = item.asCom.GetChild("n21").asCom.GetChild("n2").asTextField; GButton more = item.asCom.GetChild("n10").asButton; GTextField lv = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField; GLoader bg = item.asCom.GetChild("n32").asLoader; bg.visible = false; more.visible = false; rankScore.visible = true; reletion.visible = false; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); btn_attention.RemoveEventListeners(); btn_attention.onClick.Add(() => { string uid_ = dc["uid"] + ""; if (!uid_.Equals(userModel.uid)) { Dictionary <string, object> dd = new Dictionary <string, object>(); dd["fuid"] = dc["uid"]; NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) => { if ((bool)vo.data == true) { roleModel.AddAttentionFight(dc["uid"].ToString()); ((Dictionary <string, object>)listData[index])["if_friend"] = true; Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); btn_attention.touchable = false; // btn_image.url = Tools.GetResourceUrl("Image:btn_page3"); btn_attention.RemoveEventListeners(); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13120")); } }); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); if ((bool)dc["if_black"]) {//是否拉黑 Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0); type = 1; btn_attention.touchable = false; // btn_image.url = Tools.GetResourceUrl("Image:btn_page3"); } else if ((bool)dc["if_follow"]) { //是否已关注 Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); type = 2; btn_attention.touchable = false; // btn_image.url = Tools.GetResourceUrl("Image:btn_page3"); } else { Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor); btn_attention.touchable = true; // btn_image.url = Tools.GetResourceUrl("Image:btn_9"); } achieve.url = userModel.GetRankImg((int)dc["rank_score"]); mask_btn.RemoveEventListeners(); mask_btn.onClick.Add(() => { roleModel.SetTempData(listData, new int[] { index }); string uid_ = dc["uid"] + ""; if (!uid_.Equals(userModel.uid)) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); lv.text = dc["lv"].ToString(); string uname = dc["uname"] + ""; if (uname.Equals("")) { name.text = dc["uid"] + ""; } else { name.text = uname; } string dc_ = (string)dc["head_use"]; Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_)); if (dc["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = dc["guild_name"] + ""; } if (dc.ContainsKey("status")) { switch ((int)dc["status"]) { case 0: //离线 // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt3"); status.text = Tools.GetMessageById("19957"); Tools.SetRootTabTitleStrokeColor(status, "#646EA9", 1); break; case 1: //在线 // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt1"); status.text = Tools.GetMessageById("19958"); Tools.SetRootTabTitleStrokeColor(status, "#63A969", 1); break; case 2: //ing // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt2"); Tools.SetRootTabTitleStrokeColor(status, "#A55A76", 1); status.text = Tools.GetMessageById("19959"); break; } } rankScore.text = dc["rank_score"] + ""; }
private void OnRenderer(int index, GObject item) { GButton btn = item.asCom.GetChild("n11").asButton; //Tools.Btn_Change(btn, "Image:btn_10", "13018"); btn.touchable = false; //} // else // { // btnAtr.selectedIndex = 0; // ButtonChange(); // //Tools.Btn_Change(btn, "Image:btn_16", "13013"); //} // if (info.ContainsKey("is_black")) { // if ((bool)info["is_black"]) // {//是否拉黑 // //Tools.Btn_Change(btn, "Image:btn_10", "13032"); object[] data = (object[])listData[index]; Dictionary <string, object> info = (Dictionary <string, object>)data[2]; //userinfo 【1】uid object[] fightData = (object[])data[1]; //战斗数据 GTextField lv = item.asCom.GetChild("n3").asCom.GetChild("n2").asTextField; GGroup group = item.asCom.GetChild("n3").asCom.GetChild("n3").asGroup; GComponent start = item.asCom.GetChild("n8").asCom; GButton head = item.asCom.GetChild("n3").asCom.GetChild("n0").asButton; GTextField uname = item.asCom.GetChild("n4").asTextField; GTextField guild = item.asCom.GetChild("n10").asTextField; GTextField core = item.asCom.GetChild("n7").asTextField; GTextField core_type = item.asCom.GetChild("n5").asTextField; GLoader fight_group = item.asCom.GetChild("n41").asLoader; GTextField group_name = item.asCom.GetChild("n42").asTextField; GComponent com = item.asCom.GetChild("n35").asCom; GComponent start_ = item.asCom.GetChild("n40").asCom; GButton dreamAttention = item.asCom.GetChild("n45").asButton; dreamAttention.text = Tools.GetMessageById("13147"); dreamAttention.onClick.Add(() => { if ((int)data[0] <= 0) { ViewManager.inst.ShowText(Tools.GetMessageById("24228")); } else { Dictionary <string, object> data1 = new Dictionary <string, object>(); data1["fuid"] = data[0]; NetHttp.inst.Send(NetBase.HTTP_FOLLOW, data1, (VoHttp vo) => { if ((bool)vo.data == true) { roleModel.AddAttentionFight(data[0].ToString()); Dictionary <string, object> dataMy = (Dictionary <string, object>)data[2]; dataMy["is_friend"] = true; ViewManager.inst.ShowText(Tools.GetMessageById("13045")); //Tools.SetButtonBgAndColor(btn, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); //btn.touchable = false; dreamAttention.visible = false; } else { ViewManager.inst.ShowText(Tools.GetMessageById("13120")); } }); } }); //GGraph icon_start = item.asCom.GetChild("n31").asGraph; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); if (info["lv"] != null) { lv.text = info["lv"].ToString(); } if (info["name"] != null) { uname.text = info["name"].ToString(); } else { uname.text = info["uid"].ToString(); } if (info["guild_name"] != null) { if (info["guild_name"].ToString().Equals("")) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = info["guild_name"].ToString(); } } else { guild.text = Tools.GetMessageById("19955"); } object[] type = null; List <object> userFightData = new List <object>(); if (data[0].ToString().Equals(userModel.uid)) { mydata = (object[])fightModel.fightData["my_data"]; List <object> userData = fightModel.GetUserData(data_all, mydata, statementType); for (int i = 0; i < 5; i++) { Dictionary <string, object> dd = new Dictionary <string, object>(); dd["data"] = mydata[i]; dd["rank"] = (int)userData[i]; dd["index"] = i; userFightData.Insert(i, dd); } Tools.Sort(userFightData, new string[] { "rank:int:0" }); Dictionary <string, object> my = (Dictionary <string, object>)userFightData[0]; type = new object[] { my["index"], my["data"] }; } else { type = fightModel.GetUserMaxData(index, data_all, info["uid"].ToString(), fightDataTypeChange); } if (statementType.Equals(ModelFight.FIGHT_MATCH) || statementType.Equals(ModelFight.FIGHT_FREEMATCH1)) { fight_group.visible = false; group_name.visible = false; start.visible = true; start_.visible = false; com.visible = false; Tools.StartSetValue(start, (index + 1).ToString(), ((int)myRank["1"] + 1).ToString(), info["uid"].ToString()); //if (index == 0) //{ // GameObject g = EffectManager.inst.AddPrefab(Config.EFFECT_LIGHT, icon_start); // GameObjectScaler.Scale(g, 0.8f); // g.transform.localScale *= 0.8f; //} } else { fight_group.visible = true; group_name.visible = true; start.visible = false; start_.visible = true; if (statementType.Equals(ModelFight.FIGHT_FREEMATCH2)) { com.visible = false; if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3) { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2"); Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2); group_name.text = Tools.GetMessageById("24229"); } else { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1"); Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2); group_name.text = Tools.GetMessageById("24230"); } } else { com.visible = true; GLoader rankIcon = com.GetChild("n1").asLoader; GTextField rankScore = com.GetChild("n2").asTextField; rankIcon.url = userModel.GetRankImg((int)info["rank_score"]); rankScore.text = info["rank_score"].ToString(); Dictionary <string, object> userInfo = (Dictionary <string, object>)user[2]; if ((int)userInfo["rankLevel"] <= 4) { if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3) { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2"); Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2); group_name.text = Tools.GetMessageById("24229"); } else { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1"); Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2); group_name.text = Tools.GetMessageById("24230"); } } else { if ((int)info["rankLevel"] >= 0 && (int)info["rankLevel"] <= 3) { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui1"); Tools.SetRootTabTitleStrokeColor(group_name, "#9A42AA", 2); group_name.text = Tools.GetMessageById("24230"); } else { fight_group.url = Tools.GetResourceUrl("Image2:n_icon_dui2"); Tools.SetRootTabTitleStrokeColor(group_name, "#424F9E", 2); group_name.text = Tools.GetMessageById("24229"); } } } if ((bool)info["is_mvp"]) { //Tools.StartSetValue(start_, Tools.GetMessageById("24223")); Tools.GetResourceUrlForMVP(start_.GetChild("n1").asLoader, "mvp"); } else { start_.visible = false; } } if (index == 0) { core_type.text = fight_tag["0"].ToString(); core.text = fightData[0].ToString(); fightDataTypeChange.Remove(0); } else { if (!fight_tag[type[0].ToString()].ToString().Equals(fight_tag["5"].ToString())) { core_type.text = fight_tag[type[0].ToString()].ToString(); core.text = fightData[Convert.ToInt32(type[0])].ToString(); } else { core_type.text = fight_tag["0"].ToString(); core.text = fightData[0].ToString(); } fightDataTypeChange.Remove((int)type[0]); } //平均分、是否是新记录 GComponent obj = item.asCom.GetChild("n38").asCom; GImage new_mark_bg = obj.GetChild("n0").asImage; GTextField new_mark = obj.GetChild("n1").asTextField; obj.visible = false; if (!statementType.Equals(ModelFight.FIGHT_FREEMATCH1) && !statementType.Equals(ModelFight.FIGHT_FREEMATCH2)) { if (data[0].ToString().Equals(userModel.uid)) { if (type.Length != 0) { object[] userType = (object[])myData[Convert.ToUInt32(type[0])]; if ((int)userType[2] != 0) { obj.visible = true; new_mark.text = Tools.GetMessageById("24218"); } } } group.visible = true; if ((int)info["uid"] > 0) { if (info["head"] != null) { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)info["head"])["use"].ToString())); } } else { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(info["name"].ToString(), false, true)); } } else { group.visible = false; if ((int)info["uid"] > 0) { if (info["head"] != null) { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(((Dictionary <string, object>)info["head"])["use"].ToString())); } } else { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl("icon_diannao")); } } btn.touchable = true; btn.RemoveEventListeners(); GLoader bg1 = item.asCom.GetChild("n2").asLoader; bg1.url = Tools.GetResourceUrl("Image2:n_bg_tanban1"); //GLoader bg = item.asCom.GetChild("n39").asLoader; if (data[0].ToString().Equals(userModel.uid)) { Tools.SetButtonBgAndColor(btn, btnBgUp, "24216", "", textBtnColor, textBtnStrokeColor); //bg.visible = true; btn.visible = true; btn.onClick.Add(() => { ViewManager.inst.ShowScene <MediatorUserDataStatemnet>(); }); } else { Debug.Log(info["uid"] + "is_friend:" + info["is_friend"] + " ..........request_sign" + (bool)info["request_sign"] + ".................is_black" + (bool)info["is_black"]); //bg.visible = false; if ((bool)info["is_friend"]) { //Tools.SetButtonBgAndColor(btn, btnBgDo, textAttentiond, fontSize, textBtnColor, "",0); //btn.touchable = false; if ((bool)info["request_sign"]) { dreamAttention.visible = false; } } else { if (info.ContainsKey("is_black")) { if (!(bool)info["is_black"]) { if ((bool)info["request_sign"]) { dreamAttention.visible = true; } } else { //Tools.SetButtonBgAndColor(btn, btnBgDo, textShieldd, fontSize, textBtnColor, "",0); //btn.touchable = false; } } //Tools.SetButtonBgAndColor(btn, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor); } //btn.onClick.Add(() => //{ //}); } }
private void OnRendere(int index, GObject item) { GComponent g = item.asCom; GObject reletion = g.GetChild("n3"); GButton head = g.GetChild("n2").asCom.GetChild("n0").asButton; GTextField name = g.GetChild("n4").asTextField; GTextField guild = g.GetChild("n5").asTextField; GLoader achieve = g.GetChild("n29").asCom.GetChild("n1").asLoader; GTextField rankScore = g.GetChild("n29").asCom.GetChild("n2").asTextField; GTextField msg = g.GetChild("n6").asTextField; GTextField status = g.GetChild("n7").asTextField; GButton mask_btn = g.GetChild("n9").asButton; GButton btn_ = g.GetChild("n0").asButton; btn_.visible = false; GLoader bg = g.GetChild("n32").asLoader; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); bool isVisible = SetListCSS(item, listData.ToArray(), index); if (isVisible) { bg.visible = false; reletion.visible = false; GTextField lv = g.GetChild("n2").asCom.GetChild("n2").asTextField; Dictionary <string, object> dc = (Dictionary <string, object>)listData[index]; int fans_count = userModel.Get_NoticeState(ModelUser.RED_FANS); if ((bool)dc["is_new"]) { userModel.Add_Notice(g, new UnityEngine.Vector2(72, -1), 0, false); } else { userModel.Remove_Notice(g); } achieve.url = userModel.GetRankImg((int)dc["rank_score"]); mask_btn.RemoveEventListeners(); mask_btn.onClick.Add(() => { roleModel.SetTempData(null, new int[] { m_PageIndexS, m_PageIndex }); string uid = dc["uid"] + ""; if (!uid.Equals(userModel.uid)) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); lv.text = dc["lv"].ToString(); string uname = dc["uname"] + ""; if (uname.Equals("")) { name.text = dc["uid"] + ""; } else { name.text = uname; } string dc_ = (string)dc["head_use"]; Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_)); if (dc["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = dc["guild_name"] + ""; } Dictionary <string, object> dynamic = (Dictionary <string, object>)dc["dynamic"]; if (dynamic.Count != 0) { Tools.DataTimeFormat(msg, (DateTime)dynamic["time"], 0); switch (dynamic["type"].ToString()) { case "lv_up": msg.text = Tools.GetMessageById("19937", new object[] { msg.text, dynamic["lv"].ToString() }); break; case "elv_up": msg.text = Tools.GetMessageById("19938", new object[] { msg.text, Tools.GetEffortName((int)dynamic["elv"]) }); break; case "match_team": if ((bool)dynamic["if_win"]) { if ((bool)dynamic["if_mvp"]) { msg.text = Tools.GetMessageById("19939", new object[] { msg.text }); } else { msg.text = Tools.GetMessageById("19940", new object[] { msg.text }); } } else { if ((bool)dynamic["if_mvp"]) { msg.text = Tools.GetMessageById("19941", new object[] { msg.text }); } else { msg.text = Tools.GetMessageById("19942", new object[] { msg.text }); } } break; case "match": msg.text = Tools.GetMessageById("19943", new object[] { msg.text, dynamic["sort"].ToString(), dynamic["kill_num"].ToString() }); break; case "up_head": msg.text = Tools.GetMessageById("19970", new object[] { msg.text }); break; case "choose_head": msg.text = Tools.GetMessageById("19971", new object[] { msg.text }); break; } } else { msg.text = ""; } if (dc.ContainsKey("status")) { switch ((int)dc["status"]) { case 0: // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt3"); status.text = Tools.GetMessageById("19957"); Tools.SetRootTabTitleStrokeColor(status, "#646EA9", 1); break; case 1: // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt1"); status.text = Tools.GetMessageById("19958"); Tools.SetRootTabTitleStrokeColor(status, "#63A969", 1); break; case 2: // bg.url = Tools.GetResourceUrl("Image2:n_bg_zt2"); Tools.SetRootTabTitleStrokeColor(status, "#A55A76", 1); status.text = Tools.GetMessageById("19959"); break; } } rankScore.text = dc["rank_score"] + ""; } }
// private void Quit_Click () // { // Quit_Team (); // } private void ItemRender(int index, GObject item) { GComponent g = item.asCom; Controller c = g.GetController("c1"); GComponent bg = g.GetChild("n0").asCom; bg.RemoveEventListeners(); //lht g.GetChild("n13").visible = false; g.GetChild("n17").visible = false; // if (index % 2 == 0) { bg.GetChild("n0").visible = ((index % 2) != 0); // Debug.LogError (bg.GetChild ("n0").visible); if (index > fightModel.team1.Length - 1) { // g.GetChild ("n13").visible = false; c.selectedIndex = 2; if (fightModel.isLeader) { g.GetChild("n12").text = Tools.GetMessageById("25035"); bg.onClick.Add(() => { if (fightModel.team1.Length == 4) { ViewManager.inst.ShowText(Tools.GetMessageById("25048")); return; } fightModel.InviteRequest(); }); } else { g.GetChild("n12").text = Tools.GetMessageById("25047"); } if (fightModel.isMatch) { g.GetChild("n12").text = Tools.GetMessageById("25057"); } return; } Dictionary <string, object> data = (Dictionary <string, object>)fightModel.team1 [index]; // if (fightModel.isLeader) // { // if (data ["uid"].ToString () == userModel.uid) // g.GetChild ("n13").visible = true; // else // g.GetChild ("n13").visible = false; //// } // else // g.GetChild ("n13").visible = false; // g.GetChild ("n4").asLoader.url = Tools.GetSexUrl (data ["sex"]); // } g.GetChild("n5").text = ModelUser.GetUname(data ["uid"], data ["name"]); g.GetChild("n6").text = data ["guild_name"] == null?Tools.GetMessageById("25034") : data ["guild_name"].ToString(); GLoader img = g.GetChild("n11").asCom.GetChild("n1").asLoader; GTextField txt = g.GetChild("n11").asCom.GetChild("n2").asTextField; img.url = userModel.GetRankImg(data ["rank_score"]); txt.text = data ["rank_score"].ToString(); GButton head = g.GetChild("n3").asButton; head.GetChild("n2").text = data ["lv"].ToString(); //Tools.SetLoaderButtonUrl (head.GetChild ("n0").asButton, ModelUser.GetHeadUrl (Tools.Analysis (data, "head.use").ToString ())); if ((int)data["uid"] > 0) { Tools.SetLoaderButtonUrl(head.GetChild("n0").asButton, ModelUser.GetHeadUrl(Tools.Analysis(data, "head.use").ToString())); } else { Tools.SetLoaderButtonUrl(head.GetChild("n0").asButton, ModelUser.GetHeadUrl(data["name"].ToString(), false, true)); } GButton btn = g.GetChild("n8").asButton; btn.text = Tools.GetMessageById("20119"); if (fightModel.isLeader) { if (data ["uid"].ToString() == userModel.uid) { c.selectedIndex = 0; } else { c.selectedIndex = 1; } } else { c.selectedIndex = 0; } btn.RemoveEventListeners(); if (fightModel.isMatch) { btn.enabled = false; } else { btn.enabled = true; } btn.onClick.Add(() => { ViewManager.inst.ShowAlert(Tools.GetMessageById("25049"), (int id) => { if (id == 1) { NetSocket.inst.AddListener(NetBase.SOCKET_QUITTEAM, (VoSocket vo) => { //踢出队员成功提示,未配置上 25014 ViewManager.inst.ShowText(Tools.GetMessageById("25014")); NetSocket.inst.RemoveListener(NetBase.SOCKET_QUITTEAM); Log.debug("踢出队员 - " + vo.data.ToString()); // ViewManager.inst.ShowText (Tools.GetMessageById ("25014")); }); Dictionary <string, object> da = new Dictionary <string, object> (); da ["uid"] = data ["uid"].ToString(); NetSocket.inst.Send(NetBase.SOCKET_QUITTEAM, da); } }, true); }); }
private void OnRendere(int index, GObject item) { GComponent g = item.asCom; GObject reletion = g.GetChild("n3"); GButton headBtn = g.GetChild("n2").asButton; GButton head = g.GetChild("n2").asCom.GetChild("n0").asButton; GTextField name = g.GetChild("n4").asTextField; GTextField guild = g.GetChild("n5").asTextField; GLoader achieve = g.GetChild("n29").asCom.GetChild("n1").asLoader; GTextField rankScore = g.GetChild("n29").asCom.GetChild("n2").asTextField; GTextField msg = g.GetChild("n6").asTextField; GTextField status = g.GetChild("n7").asTextField; GButton mask_btn = g.GetChild("n9").asButton; GButton btn_ = g.GetChild("n0").asButton; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); bool isVisible = SetListCSS(item, listData.ToArray(), index); if (isVisible) { btn_.visible = true; //mask_btn.SetSize(622, 71); btn_.text = Tools.GetMessageById("19911"); reletion.visible = false; msg.visible = false; status.visible = false; GTextField lv = g.GetChild("n2").asCom.GetChild("n2").asTextField; Dictionary <string, object> dc = (Dictionary <string, object>)listData[index]; btn_.GetChild("n1").asLoader.url = Tools.GetResourceUrl("Image2:n_btn_4"); Tools.SetRootTabTitleStrokeColor(btn_.GetChild("title").asTextField, "#dd8680", 2); btn_.RemoveEventListeners(); btn_.onClick.Add(() => { Dictionary <string, object> dd = new Dictionary <string, object>(); dd["fuid"] = dc["uid"]; NetHttp.inst.Send(NetBase.HTTP_CANCLESHIELDING, dd, (VoHttp vo) => { if ((bool)vo.data == true) { SendNetMesage(""); ViewManager.inst.ShowText(Tools.GetMessageById("19913")); } }); }); achieve.url = userModel.GetRankImg((int)dc["rank_score"]); mask_btn.RemoveEventListeners(); mask_btn.onClick.Add(() => { roleModel.SetTempData(null, new int[] { m_PageIndexS, m_PageIndex }); string uid = dc["uid"] + ""; if (!uid.Equals(userModel.uid)) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); lv.text = dc["lv"].ToString(); string uname = dc["uname"] + ""; if (uname.Equals("")) { name.text = dc["uid"] + ""; } else { name.text = uname; } string dc_ = (string)dc["head_use"]; Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_)); if (dc["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = dc["guild_name"] + ""; } //msg.text = "23小时前成就等级提升至99级"; rankScore.text = dc["rank_score"] + ""; } else { btn_.visible = false; } }
private void ItemRender(int index, GObject item) { GComponent g = item.asCom; GLoader img = g.GetChild("n14").asCom.GetChild("n1").asLoader; GTextField txt = g.GetChild("n14").asCom.GetChild("n2").asTextField; GButton head = g.GetChild("n1").asButton; // head.GetChild("n0").asButton.GetChild("n2").asImage.visible = false;//隐藏邀请界面头像圈 GButton btn = g.GetChild("n6").asButton; GButton btn_mask = g.GetChild("n9").asButton; bool IsVisible = SetListCSS(item, fightModel.curInvite, index); Log.debug("IsVisible" + IsVisible + "," + fightModel.curInvite.Length + "ddd" + index); if (IsVisible) { Dictionary <string, object> data = (Dictionary <string, object>)fightModel.curInvite[index]; g.GetChild("n3").text = ModelUser.GetUname(data["uid"], data["name"]); // g.GetChild ("n4").text = data ["guild_name"] == null ? Tools.GetMessageById ("25034") : data ["guild_name"].ToString (); // g.GetChild ("n13").text = data ["lv"].ToString (); // g.GetChild ("n2").asLoader.url = Tools.GetSexUrl (data ["sex"]); // Controller c1 = g.GetController ("c1"); //g.GetChild("n0").visible = ((index % 2) != 0); if (tabC1.selectedIndex == 0) { g.GetChild("n7").text = Tools.GetNearDistance(data["dis"]); } else { string state = data["state"].ToString(); if (state == "0") { g.GetChild("n7").text = Tools.GetMessageById("25029"); } else if (state == "1") { if (fightModel.isTeam(data["uid"].ToString())) { g.GetChild("n7").text = Tools.GetMessageById("25052"); } else { g.GetChild("n7").text = Tools.GetMessageById("25030"); } } else if (state == "2") { g.GetChild("n7").text = Tools.GetMessageById("25051"); } } img.url = userModel.GetRankImg(data["rank_score"]); txt.text = data["rank_score"].ToString(); head.GetChild("n2").text = data["lv"].ToString(); Tools.SetLoaderButtonUrl(head.GetChild("n0").asButton, ModelUser.GetHeadUrl(Tools.Analysis(data, "head.use").ToString())); btn.selected = Convert.ToBoolean(data["check"]); btn.RemoveEventListeners(); btn.onClick.Add(() => { btn.selected = !btn.selected; data["check"] = btn.selected; this.GetChild("n7").text = Tools.GetMessageById("25036", new string[] { fightModel.GetCheck().ToString() }); bool isok = fightModel.GetInviteSelectAll(tabC1.selectedIndex); check.selected = isok; }); btn_mask.RemoveEventListeners(); btn_mask.onClick.Add(() => { btn.selected = !btn.selected; data["check"] = btn.selected; this.GetChild("n7").text = Tools.GetMessageById("25036", new string[] { fightModel.GetCheck().ToString() }); bool isok = fightModel.GetInviteSelectAll(tabC1.selectedIndex); check.selected = isok; }); } }
public override void Init() { base.Init(); this.Create(Config.VIEW_FIGHTSEASON, false, Tools.GetMessageById("25053")); // this.GetChild ("n5").text = Tools.GetMessageById ("25054"); this.GetChild("n8").text = Tools.GetMessageById("25055"); this.GetChild("n10").text = Tools.GetMessageById("25056"); this.GetChild("n13").asTextField.text = Tools.GetMessageById("25054"); // // this.GetChild("n14").asTextField.text = data[1]+""; mLastT = this.GetChild("n19").asTextField; mChangeT = this.GetChild("n20").asTextField; //.text = data [2]+""; cup = this.GetChild("n18"); cupY = cup.y; // userModel = ModelManager.inst.userModel; rank = this.GetChild("rank").asLoader; rankY = rank.y; rank.url = userModel.GetRankImg((int)data [0]); // rank1 = this.GetChild ("n12").asCom as ComRankScore; // rank2 = this.GetChild ("n0").asCom as ComRankScore; // Tools.StartSetValue(this.GetChild ("n7").asCom, data[1]+"", ""); // this.GetChild ("n7").asCom.GetChild ("n4").visible = false; GLoader rankBg = this.GetChild("n22").asLoader; int rankNum = Convert.ToInt32(data[1]); this.GetChild("n14").asTextField.text = Tools.StartValueTxt(rankNum); switch (rankNum) { case 1: rankBg.url = Tools.GetResourceUrl("Image2:n_icon_paiming6"); //n_icon_paiming6 break; case 2: rankBg.url = Tools.GetResourceUrl("Image2:n_icon_paiming7"); break; case 3: rankBg.url = Tools.GetResourceUrl("Image2:n_icon_paiming8"); break; default: rankBg.url = Tools.GetResourceUrl("Image2:n_icon_paiming5"); break; } // eff = EffectManager.inst.RotationLight(this.GetChild("light").asImage); // mLast = Convert.ToInt32(data [0]); mChange = Convert.ToInt32(data [2]); mTotal = mLast + mChange; // if (mChange > 10) { mAddValEnd = mChange % 10; mAddVal = (int)Math.Floor((float)(mChange / 10)); mLastT_clip_times = mAddValEnd; mChangeT_clip_times = mAddValEnd; } else { mAddVal = 1; mAddValEnd = 0; } // Debug.LogError(mLast + " || " +mChange); // mLastT.text = mTotal + ""; // clipList = new List <SeasonClipObj>(); TimerManager.inst.Add(0.03f, 0, UpdateClip); // if (mChange > 0) { clip1 = true; // Play_mLastT(); } else { mLastT.text = mLast + ""; mChangeT.text = mChange + ""; } }
private void Record_Render_fight(int index, GObject item) { GComponent start = item.asCom.GetChild("n2").asCom; GLoader bg = start.GetChild("n1").asLoader; start.GetChild("n4").asTextField.text = ""; GTextField rank_lv = start.GetChild("n4").asTextField; GTextField killNum = item.asCom.GetChild("n4").asTextField; GTextField score = item.asCom.GetChild("n3").asTextField; GComponent rankScore = item.asCom.GetChild("n7").asCom; bool isVisible = SetListCSS(item, roleRecord, index); if (isVisible) { object[] dc = (object[])roleRecord[index]; object[] userData = null; int type = (int)dc[0]; foreach (object[] data in (object[])dc[3]) { if (data[0].ToString().Equals(roleModel.otherInfo["uid"].ToString())) { userData = data; } } if (type == 1) { rankScore.visible = false; rank_lv.visible = true; List <object> data_all = new List <object>((object[])dc[3]); ModelFight.Sort(data_all, 1, 2);//根据战斗积分排序 Dictionary <string, object> myRank = fightModel.GetFightUser(data_all, roleModel.otherInfo["uid"].ToString()); Tools.StartSetValue(start, ((int)myRank["1"] + 1).ToString()); score.visible = true; score.asTextField.text = Tools.GetMessageById("24226") + ((object[])userData[5])[0].ToString(); } else { if ((bool)userData[6]) { if ((bool)userData[7]) { //rank_lv.text = Tools.GetMessageById("24223"); //bg.url = Tools.GetResourceUrl("Image:icon_starmvp"); //Tools.SetTextFieldStrokeAndShadow(rank_lv, "#46149f", new Vector2(0, 0)); Tools.GetResourceUrlForMVP(bg, "mvp"); } else { Tools.GetResourceUrlForMVP(bg, "win"); } } else { if ((bool)userData[7]) { //rank_lv.text = Tools.GetMessageById("24223"); //bg.url = Tools.GetResourceUrl("Image:icon_starmvp"); //Tools.SetTextFieldStrokeAndShadow(rank_lv, "#46149f", new Vector2(0, 0)); Tools.GetResourceUrlForMVP(bg, "mvp"); } else { Tools.GetResourceUrlForMVP(bg, "lose"); } } score.visible = false; rankScore.visible = true; rankScore.GetChild("n2").asTextField.text = userData[8].ToString(); rankScore.GetChild("n1").asLoader.url = userModel.GetRankImg(userData[8]); } //string kill=Tools.GetMessageColor("[0]" + Tools.GetMessageById("24225")+"[/0]", new string[] { "0D55AA" }); //string kill_= Tools.GetMessageColor("[0]" + ((object[])userData[5])[1].ToString() + "[/0]", new string[] { "00478a" }); //killNum.text = kill+kill_; killNum.text = Tools.GetMessageById("24225") + ((object[])userData[5])[1].ToString(); GButton watch_fight = item.asCom.GetChild("n0").asButton; watch_fight.text = Tools.GetMessageById("24224"); watch_fight.visible = true; watch_fight.RemoveEventListeners(); watch_fight.onClick.Add(() => { fightModel.recordIndex = index; //roleModel.SetTabSelect(ModelRole.ROLEVIEW); if (type == 1) { ViewManager.inst.ShowView <MediatorFightDataShowMatch>(); } else { ViewManager.inst.ShowView <MediatorFightDataShowRank>(); } }); GTextField date = item.asCom.GetChild("n6").asTextField;/*.text = ((DateTime)dc[3]).ToString("yyyy-MM-dd HH:mm");*/ DateTime time = (DateTime)dc[2]; Tools.DataTimeFormat(date, time, 0); } }
private void TasteRander(int index, GObject item) { Dictionary <string, object> dc = (Dictionary <string, object>)listData [index]; GButton photo = item.asCom.GetChild("n1").asCom.GetChild("n0").asButton; GTextField name = item.asCom.GetChild("n3").asTextField; GTextField guild = item.asCom.GetChild("n4").asTextField; GLoader achieve = item.asCom.GetChild("n21").asCom.GetChild("n1").asLoader; GTextField status = item.asCom.GetChild("n9").asTextField; GButton mask_btn = item.asCom.GetChild("n8").asButton; GButton btn_attention = item.asCom.GetChild("n7").asButton; GTextField attention_text = btn_attention.GetChild("title").asTextField; GLoader btn_image = btn_attention.asCom.GetChild("n1").asLoader; btn_image.visible = true; GObject reletion = item.asCom.GetChild("n2"); GTextField rankScore = item.asCom.GetChild("n21").asCom.GetChild("n2").asTextField; GTextField lv = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField; reletion.visible = false; btn_attention.visible = true; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); btn_attention.RemoveEventListeners(); btn_attention.onClick.Add(() => { //关注的实现 Dictionary <string, object> dd = new Dictionary <string, object> (); dd ["fuid"] = dc ["uid"]; NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) => { if ((bool)vo.data == true) { roleModel.AddAttentionFight(dc["uid"].ToString()); ((Dictionary <string, object>)listData[index])["if_follow"] = true; Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); btn_attention.touchable = false; } else { ViewManager.inst.ShowText(Tools.GetMessageById("13120")); } }); }); if ((bool)dc ["if_black"]) { //是否拉黑 Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0); type = 1; btn_attention.touchable = false; } else if ((bool)dc["if_follow"]) { //是否已关注 Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); type = 2; btn_attention.touchable = false; } else { Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor); btn_attention.touchable = true; } achieve.url = userModel.GetRankImg((int)dc["rank_score"]); mask_btn.RemoveEventListeners(); mask_btn.onClick.Add(() => { roleModel.SetTempData(listData, new int[] { index }); string uid_ = dc ["uid"] + ""; if (!uid_.Equals(userModel.uid)) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } }); lv.text = dc ["lv"].ToString(); if (Tools.IsNullEmpty(dc["uname"])) { name.text = dc ["uid"] + ""; } else { name.text = dc["uname"].ToString(); } string dc_ = (string)dc ["head_use"]; Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_)); if (dc["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = dc["guild_name"] + ""; } switch (dc["type"].ToString()) { case "redbag": status.text = Tools.GetMessageById("19963"); break; case "battle_man": status.text = Tools.GetMessageById("19964"); break; case "elv_lv": status.text = Tools.GetMessageById("19965"); break; } rankScore.text = dc ["rank_score"] + ""; }
private void SearchRander(int index, GObject item) { GComponent comPhoto = item.asCom.GetChild("n1").asCom; GButton photo = comPhoto.GetChild("n0").asButton; GTextField name = item.asCom.GetChild("n3").asTextField; GTextField guild = item.asCom.GetChild("n4").asTextField; GObject rank = item.asCom.GetChild("n21"); GTextField rankScore = rank.asCom.GetChild("n2").asTextField; GLoader achieve = rank.asCom.GetChild("n1").asLoader; GTextField status = item.asCom.GetChild("n9").asTextField; GButton mask_btn = item.asCom.GetChild("n8").asButton; GButton btn_attention = item.asCom.GetChild("n7").asButton; GTextField attention_text = btn_attention.GetChild("title").asTextField; GLoader btn_image = btn_attention.asCom.GetChild("n1").asLoader; GObject reletion = item.asCom.GetChild("n2"); GButton more = item.asCom.GetChild("n10").asButton; GTextField lv = item.asCom.GetChild("n1").asCom.GetChild("n2").asTextField; GGroup itemBtn = item.asCom.GetChild("item").asGroup; //GImage bg = item.asCom.GetChild("n0").asImage; more.text = Tools.GetMessageById("13078"); bool isVisible = SetListCSS(item, listData.ToArray(), index); if (isVisible) { Dictionary <string, object> dc = (Dictionary <string, object>)listData[index]; more.visible = false; rankScore.visible = true; reletion.visible = false; rank.visible = true; int uid = (int)dc["uid"]; if (uid == -1) { // bg.visible = false; lv.visible = false; comPhoto.visible = false; name.visible = false; guild.visible = false; achieve.visible = false; status.visible = false; //mask_btn.visible = false; more.visible = true; btn_attention.visible = false; rank.visible = false; more.onClick.Add(() => { if (Convert.ToInt32(dc["type"]) == 1) { ViewManager.inst.ShowText(Tools.GetMessageById("13043")); } else { GetNearData(1, item); } }); } else { lv.visible = true; comPhoto.visible = true; name.visible = true; guild.visible = true; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); achieve.visible = true; status.visible = true; //mask_btn.visible = true; btn_attention.visible = true; more.visible = false; btn_attention.RemoveEventListeners(); btn_attention.onClick.Add(() => { //关注的实现 Dictionary <string, object> dd = new Dictionary <string, object>(); dd["fuid"] = dc["uid"]; NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dd, (VoHttp vo) => { if ((bool)vo.data == true) { roleModel.AddAttentionFight(dc["uid"].ToString()); //ViewManager.inst.ShowText(Tools.GetMessageById("13045")); ((Dictionary <string, object>)listData[index])["if_follow"] = true; Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); btn_attention.touchable = false; // btn_image.url = Tools.GetResourceUrl("Image:btn_page3"); btn_attention.RemoveEventListeners(); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13120")); } }); }); if ((bool)dc["if_black"]) {//是否拉黑 Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textShieldd, fontSize, textBtnColor, "", 0); type = 1; btn_attention.touchable = false; } else if ((bool)dc["if_follow"]) { Tools.SetButtonBgAndColor(btn_attention, btnBgDo, textAttentiond, fontSize, textBtnColor, "", 0); type = 2; btn_attention.touchable = false; // btn_image.url = Tools.GetResourceUrl("Image:btn_page3"); } else { Tools.SetButtonBgAndColor(btn_attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor); btn_attention.touchable = true; } achieve.url = userModel.GetRankImg((int)dc["rank_score"]); status.text = Tools.GetNearDistance((int)dc["dis"]); mask_btn.RemoveEventListeners(); mask_btn.onClick.Add(() => { if (!more.visible) { roleModel.SetTempData(listData, new int[] { list.GetFirstChildInView(), tag_n, dataPreNum }); string uid_ = dc["uid"] + ""; if (!uid_.Equals(userModel.uid)) { this.DispatchGlobalEvent(new MainEvent(MainEvent.SHOW_USER, new object[] { null, uid_, roleModel.tab_CurSelect1, roleModel.tab_CurSelect2, roleModel.tab_CurSelect3 })); } else { ViewManager.inst.ShowText(Tools.GetMessageById("13106")); } } }); lv.text = dc["lv"].ToString(); string uname = dc["uname"] + ""; if (uname.Equals("")) { name.text = dc["uid"] + ""; } else { name.text = uname; } string dc_ = (string)dc["head_use"]; Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(dc_)); if (dc["guild_name"] == null) { guild.text = Tools.GetMessageById("19955"); } else { guild.text = dc["guild_name"] + ""; } rankScore.text = dc["rank_score"] + ""; } } else { btn_attention.visible = false; } }