private void RedUpdate(MainEvent e) { if (tabC2.selectedIndex == 0) { int fans_count = userModel.Get_NoticeState(ModelUser.RED_FANS); if (fans_count > 0) { userModel.Add_Notice(frind_left_tab_1, new UnityEngine.Vector2(150, 0), fans_count, false); } else { userModel.Remove_Notice(frind_left_tab_1); } int follow_count = userModel.Get_NoticeState(ModelUser.RED_FOLLOW); if (follow_count > 0) { userModel.Add_Notice(frind_left_tab_0, new UnityEngine.Vector2(150, 0), follow_count, false); } else { userModel.Remove_Notice(frind_left_tab_0); } } else if (tabC2.selectedIndex == 1) { userModel.Remove_Notice(frind_left_tab_1); userModel.Remove_Notice(frind_left_tab_0); } }
private void ViewUpdata(MainEvent e) { int count = userModel.Get_NoticeState(ModelUser.RED_GIFTMSG); if (count > 0) { userModel.Add_Notice(tab_root_1, new UnityEngine.Vector2(175, -15), count, false); } }
private void List_Render(int index, GObject ss) { ComCard go = ss.asCom.GetChild("n0") as ComCard; go.ClearTime(); go.onClick.Clear(); ss.pivot = new Vector2(0.5f, 0.5f); Dictionary <string, object> card = cardModel.myCard [index] as Dictionary <string, object>; if ((int)card ["new"] == 1) { userModel.Add_Notice(go.asCom, new Vector2(125, 0)); } else { userModel.Remove_Notice(go.asCom); } string id = card ["id"].ToString(); go.SetData(id); go.onClick.Add(() => { this.onListItemClick(index, go, (int)card ["new"]); v2 = Stage.inst.touchPosition; }); }
private void FindObject() { list = this.GetChild("n1").asList; share = this.GetChild("n7").asButton; userModel.GetUnlcok(Config.UNLOCK_SHARD, share); share.GetChild("title").asTextField.textFormat.size = 30; share.text = Tools.GetMessageById("24219"); if (shareModel.isShareRed()) { userModel.Add_Notice(share, new Vector2(145, -10)); } else { userModel.Remove_Notice(share); } share.onClick.Add(() => { string share_bitmap = ""; userModel.GetUnlcok(Config.UNLOCK_SHARD, null, true); //shareModel.viewX = this.x+this.width/2-232; shareModel.viewY = this.y + share.y - 200; MediatorAd.typeAd = ModelShare.SHARE_FIGHT; shareModel.type = ModelShare.SHARE_FIGHT; // ViewManager.inst.ShowView<MediatorAd>(false,false); ViewManager.inst.ShowView <MediatorShareBtn>(true, false); }); back = this.GetChild("n3").asButton; back.text = Tools.GetMessageById("24111"); back.onClick.Add(() => { //DispatchManager.inst.Dispatch(new MainEvent(MainEvent.FIGHT_DATA_END, new object[] { (Dictionary<string, object>)fightModel.fightData["gifts"] })); ViewManager.inst.CloseScene(); }); }
private void RedUpdate(MainEvent e) { if (otherRole["uid"].ToString().Equals(userModel.uid)) { if (tabC2.selectedIndex == 0) { int count = userModel.Get_NoticeState(ModelUser.RED_MSGBOARD); if (count > 0) { userModel.Add_Notice(btn, new UnityEngine.Vector2(145, -12), count, false); } else { userModel.Remove_Notice(btn); } } else { userModel.Remove_Notice(btn); } //if(tabC2.selectedIndex == 0 && tabC1.selectedIndex == 2) //{ // userModel.Remove_Notice(btn); //} } }
private void RED_CHATUPDATE(MainEvent e) { ///////////////////////////////////////////////////////公会 int top = chatModel.redPoint [0].Count; int bottom = chatModel.redPoint [1].Count; if (top > 0) { GComponent com = userModel.Add_Notice(this.gTop, new Vector2(-10, 0), top, false, true); com.GetController("c1").selectedIndex = 1; com.onClick.Add(() => { List <int> red = chatModel.redPoint [0]; if (red.Count != 0) { int index = red [red.Count - 1]; list.ScrollToView(index, true); } }); } else { userModel.Remove_Notice(this.gTop); } if (bottom > 0) { GComponent com = userModel.Add_Notice(this.gBottom, new Vector2(-10, 0), bottom, false, true); com.onClick.Add(() => { List <int> red = chatModel.redPoint [1]; if (red.Count != 0) { int index = red [0]; list.ScrollToView(index, true); } }); } else { userModel.Remove_Notice(this.gBottom); } }
private void RED_CHATUPDATE(MainEvent e) { ///////////////////////////////////////////////////////公会 int count = chatModel.GetChatRedCount(); if (count > 0) { userModel.Add_Notice(this.GetChild("bar0").asCom, new Vector2(150, 0), count); } else { userModel.Remove_Notice(this.GetChild("bar0").asCom); } }
public override void Init() { base.Init(); this.Create(Config.VIEW_REDPACKAGE, false); todayUpTime = Convert.ToInt64(Tools.GetSystemSecond()) + (0); userModel = ModelManager.inst.userModel; redbagCfg = DataManager.inst.redbag; n20 = this.GetChild("n20").asTextField; btn_Rob = this.GetChild("n13").asButton; btn_Give = this.GetChild("n12").asButton; l_TimeInfo = this.GetChild("n8").asTextField; l_redcoin = this.GetChild("n10").asTextField; n26 = this.GetChild("n26").asTextField; n26.text = Tools.GetMessageById("13155"); // GameObject asd = EffectManager.inst.AddEffect (Config.EFFECT_MAILBOX,"stand", this.GetChild ("n1").asGraph); // GameObjectScaler.ScaleParticles (asd, 0); // EffectManager.inst.StopAnimation (asd); // TimerManager.inst.Add (0.01f, 1, (float obj) => { // EffectManager.inst.StopAnimation (asd); // }); // view.GetChild ("n10").asTextField.text = Tools.GetMessageById ("12014"); ViewManager.inst.AddTouchTip("GButton", this.GetChild("n11").asButton, new Dictionary <string, object> { { Config.ASSET_REDBAGCOIN, 1 } }); // view.GetChild ("n15").asTextField.text = Tools.GetMessageById ("12022", new object[]{ redbagCfg ["exp"] }); btn_Give.text = Tools.GetMessageById("12024"); btn_Rob.text = Tools.GetMessageById("12025"); n26.visible = false; this.GetChild("n24").visible = false; btn_Rob.onClick.Add(OnRobRedViewHandler); btn_Give.onClick.Add(OnGiveRedViewHandler); n20.text = ""; l_TimeInfo.text = ""; OnUpdataHandler(); if ((int)(ModelManager.inst.userModel.records ["redbag_coin"]) < 1) { btn_Give.text = Tools.GetMessageById("12018"); n26.visible = true; userModel.Remove_Notice(btn_Give); } else { this.GetChild("n24").visible = true; //btn_Give.GetChild ("title").y -= 15; this.GetChild("n22").asTextField.text = Tools.GetMessageById("12022", new object[] { (int)redbagCfg ["exp"] * (int)userModel.records ["redbag_coin"] + "" }); if ((int)userModel.records ["redbag_coin"] > (int)DataManager.inst.redbag ["redpoint"]) { userModel.Add_Notice(btn_Give, new Vector2(130, -10)); } else { userModel.Remove_Notice(btn_Give); } } TimerManager.inst.Add(1f, 0, Time_Tick); Time_Tick(0f); // view.GetChild ("n18").asButton.onClick.Add (() => { // ViewManager.inst.CloseView(this); // }); this.AddGlobalListener(MainEvent.RED_GIFT, OnUpdataHandler); }
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 InitDate() { Tools.UpdataHeadTime(); //addrDiction = (Dictionary<string, object>)DataManager.inst.systemSimple["area_config"]; storyNum = (int)DataManager.inst.systemSimple["story_num"]; friend_like_s = (Dictionary <string, object>)DataManager.inst.systemSimple["friend_like"]; need_coin = (object[])friend_like_s["need_coin"]; gift_coin = (object[])friend_like_s["gift_coin"]; fuid = roleModel.fuid; otherInfo = roleModel.otherInfo; uid.text = Tools.GetMessageById("13028") + otherInfo["uid"]; if (otherInfo["uid"].ToString().Equals(userModel.uid)) { if (isBtnMicro) { btnMicro.visible = true; //是否是第一次的 if (!ModelRole.isHasMicro) { userModel.Add_Notice(btnMicro, new Vector2(40, 0), 0, false, false, true); } else { btnOpenMicro.visible = true; userModel.Remove_Notice(btnMicro); } } editImage.visible = true; graph.visible = false; attention.visible = false; watch.visible = false; shield.visible = false; guild.visible = false; InitBaseView(); InitBaseList(); } else { if (isBtnMicro) { if (false) { } else { btnOpenMicro.visible = true; btnMicro.visible = true; btnMicro.touchable = false; } } i_like_num = (int)otherInfo["ilike_num"]; graph.visible = true; photoCom.touchable = false; attention.visible = true; watch.visible = true; shield.visible = true; guild.visible = true; userModel.GetUnlcok(Config.UNLOCK_GUILD, guild); //save_btn.visible = false; //save_img.visible = false; if ((bool)otherInfo["if_black"]) { //是拉黑的关系 Tools.SetButtonBgAndColor(attention, btnBgUp, textAttention, fontSize, textBtnColor, textBtnStrokeColor); Tools.SetButtonBgAndColor(shield, btnBgDo, textShieldd, fontSize, textBtnColor, textBtnStrokeColor1); typeShield = true; } else { Tools.SetButtonBgAndColor(shield, btnBgUp, textShield, fontSize, textBtnColor, textBtnStrokeColor); typeShield = false; } InitBaseView(); InitBaseList(); } fans_name = new string[] { }; fun2_player = new string[] { Tools.GetMessageById("13014"), Tools.GetMessageById("13015"), Tools.GetMessageById("13016") }; fun2 = new string[] { Tools.GetMessageById("13017") }; fun1_player = new string[] { Tools.GetMessageById("13018") }; }
private void FindObject() { GButton btn = this.GetChild("n100").asButton; btn.text = Tools.GetMessageById("13132"); GButton callBack = this.GetChild("n104").asButton; callBack.onClick.Add(CallBack); title1 = this.GetChild("n2").asTextField; title2 = this.GetChild("n13").asTextField; text1 = this.GetChild("n10").asTextField; text2 = this.GetChild("n11").asTextField; text3 = this.GetChild("n14").asTextField; text4 = this.GetChild("n15").asTextField; url = this.GetChild("n8").asTextInput; btn_Copy = this.GetChild("n110").asButton; erBg = this.GetChild("n3").asLoader; btn_share = this.GetChild("n5").asButton; tabShare = GetChild("bar0").asButton; if (shareModel.isShareRed()) { userModel.Add_Notice(btn_share, new Vector2(145, -10)); } else { userModel.Remove_Notice(btn_share); } btn_yaoqing = this.GetChild("n12").asButton; btn_yaoqing.GetChild("title").asTextField.textFormat.size = 25; //fenGeXian = this.GetChild("n9").asImage; list = GetChild("n60").asList; num1 = GetChild("n66").asTextField; num2 = GetChild("n64").asTextField; tabC1 = GetController("c1"); textContext = this.GetChild("n90").asTextField; input = this.GetChild("n0").asCom.GetChild("n1").asTextInput; btn_ok = this.GetChild("n84").asButton; image = this.GetChild("n99").asImage; btn_weixin = this.GetChild("n91").asButton; weiChatGroup = this.GetChild("n106").asGroup; btn_weixin.text = ""; bool ok = userModel.GetUnlcok(Config.UNLOCK_WEICHAT, weiChatGroup); if (!ok) { btn_ok.x = 527; } GetChild("n72").asTextField.text = Tools.GetMessageById("13136"); btn_ok.text = Tools.GetMessageById("31002"); //GetChild("n105").asTextField.text=Tools.GetMessageById("13145",new string[] { userModel.uid}); InitTopBar(new string[] { Tools.GetMessageById("13134"), Tools.GetMessageById("13133"), Tools.GetMessageById("13127") }); tabC1.onChanged.Add(OnChange); OnChange(); if (!Tools.IsNullEmpty(isUid)) { btn_yaoqing.touchable = false; btn_yaoqing.grayed = true; } else { btn_yaoqing.visible = true; } share_bitmap = ""; GetER();//获取二维码 SetData(); }