Пример #1
0
    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);
        }
    }
Пример #2
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);
        }
    }
Пример #3
0
    public int GetChatRedCount()
    {
        ModelUser userModel = ModelManager.inst.userModel;

        if (redCount == -1)
        {
            redCount  = 0;
            redCount += userModel.Get_NoticeState(ModelUser.RED_REDBAGNUM);
            redCount += userModel.Get_NoticeState(ModelUser.RED_SUPPORTNUM);
            redCount += userModel.Get_NoticeState(ModelUser.RED_GUILDAPPLYNUM);
            redCount += userModel.Get_NoticeState(ModelUser.RED_GUILDJOIN);
            redCount += userModel.Get_NoticeState(ModelUser.RED_GUILDEXIT);
        }
        return(redCount);
    }
Пример #4
0
 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);
         //}
     }
 }
Пример #5
0
    private void GetMsg(VoHttp vo)
    {
        int kefu = userModel.Get_NoticeState(ModelUser.RED_BUGMSG);

        if (kefu > 0)
        {
            userModel.Del_Notice(ModelUser.RED_BUGMSG);
        }
        dic = new object[100];
        int index = 0;

        object[] ddd = (object[])vo.data;
        for (int i = 0; i < ddd.Length; i++)
        {
            if ((int)((Dictionary <string, object>)ddd [i]) ["st"] < 2)
            {
                dic [index] = ddd [i];
                index++;
            }
        }
        list.numItems = index;
        if (index >= 1)
        {
            list.ScrollToView(index - 1);
        }
    }
Пример #6
0
 public override void Init()
 {
     base.Init();
     this.Create(Config.VIEW_ROLEGUESTBOOK);
     FindObject();
     InitDate();
     if (otherInfo["uid"].ToString().Equals(userModel.uid))
     {
         if (userModel.Get_NoticeState(ModelUser.RED_MSGBOARD) > 0)
         {
             userModel.Del_Notice(ModelUser.RED_MSGBOARD);
         }
     }
 }
Пример #7
0
    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"] + "";
        }
    }