Exemplo n.º 1
0
        public static string GetWords(Int32 id)
        {
            string words = "";

            if (id > 0)
            {
                LanguageType type = LanguageManger.GetMe().GetLangType();
                Tab_Language lang = TableManager.GetLanguageByID(id);
                if (lang == null)
                {
                    return("");
                }

                switch (type)
                {
                case LanguageType.LANGUAGE_CHINESE:
                    words = lang.Chinese;
                    break;

                case LanguageType.LANGUAGE_ENGLISH:
                    words = lang.English;
                    break;

                default:
                    break;
                }
            }
            return(words);
        }
Exemplo n.º 2
0
 public void AddNotification(bool addNote)
 {
     if (addNote)
     {
         foreach (DictionaryEntry de in TableManager.GetPush())
         {
             Tab_Push tp = de.Value as Tab_Push;
             if (tp == null)
             {
                 continue;
             }
             Tab_Language _body = TableManager.GetLanguageByID(tp.Text);
             if (_body == null)
             {
                 continue;
             }
             DateTime _fireDay = Now2Week(tp.Week, tp.Time);
             bool     _dayloop = false;
             if (tp.Week == 0)
             {
                 _dayloop = true;
             }
             Add("", _body.Chinese, _fireDay, _dayloop);
         }
     }
     else
     {
         ClearNotifications();
     }
 }
Exemplo n.º 3
0
    void OnEnable()
    {
        if (mainUILogicObj == null)
        {
            mainUILogicObj = GameObject.Find("/MainUILogic");
        }
        //新PVP说明
        Tab_Language language = TableManager.GetLanguageByID(100088);

        if (language != null &&
            instructionLabel != null)
        {
            instructionLabel.text = language.Chinese;
        }
    }
Exemplo n.º 4
0
    private void CreateCopyList(CopyType type)
    {
        GameObject prompt = activeBtn.transform.FindChild("PromptAni").gameObject;

        prompt.SetActive(false);

        GameObject parent = GridNormal;

        if (type == CopyType.ACTIVITY)
        {
            parent = GridActivity;
        }

        int count = parent.transform.childCount;

        for (int i = count - 1; i >= 0; i--)
        {
            Destroy(parent.transform.GetChild(i).gameObject);
        }
        parent.GetComponent <UIGrid>().repositionNow = true;

        if (type == CopyType.NORMAL)
        {
            for (int i = normalCopys.Count - 1; i >= 0; i--)
            {
                bool canOpen = false;
                if (normalCopys[i].copyState == CopyState.UNOPEN)
                {
                    if (i == 0)
                    {
                        canOpen = true;
                    }
                    else if (normalCopys[i - 1].copyState == CopyState.PASSED)
                    {
                        canOpen = true;
                    }
                    //mainCopy.subCopys[i].copyState = CopyState.OPENED;
                }
                else if (normalCopys[i].copyState == CopyState.PASSED)
                {
                    canOpen = true;
                }
                //				bool isNewOpen = false;
                //				if(normalCopys[i].copyState == CopyState.UNOPEN)
                //				{
                //					isNewOpen = true;
                //					normalCopys[i].copyState = CopyState.OPENED;
                //				}
                normalCopys[i].listOrder = i;
                if (canOpen)
                {
                    GameObject new_item = ResourceManager.Instance.loadWidget(mainCopyNormalItem);
                    new_item.transform.parent        = parent.transform;
                    new_item.transform.localPosition = Vector3.zero;
                    new_item.transform.localScale    = Vector3.one;
                    new_item.transform.name          = normalCopys[i].listOrder.ToString();

                    //副本缩略图
                    UISprite coypIcon = new_item.transform.FindChild("Sprite-bg").GetComponent <UISprite>();
                    string   iconName = TableManager.GetCopyByID(normalCopys[i].copyId).Thumb;
                    coypIcon.spriteName = iconName;
                    //掉落描述
                    UILabel dropDesc = new_item.transform.FindChild("Labels/DropDescribe").GetComponent <UILabel>();
                    dropDesc.gameObject.SetActive(false);

                    //name
                    UILabel label_name = new_item.transform.FindChild("Labels/Label-Name-Value").GetComponent <UILabel>();
                    label_name.text = LanguageManger.GetWords(normalCopys[i].tblCopy.Copyname);

                    //设置名字为"无量山遇险"的item为clone obj
                    Debug.Log("name:" + normalCopys[i].tblCopy.Copyname);
                    if (normalCopys[i].tblCopy.Copyname == 11000)
                    {
                        if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_1 ||
                            GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_2 ||
                            GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_3 ||
                            GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_4 ||
                            GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY1_5)
                        {
                            this.guideItem = new_item;
                        }
                    }
                    else if (normalCopys[i].tblCopy.Copyname == 11001)
                    {
                        if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.COPY2_1)
                        {
                            this.guideItem = new_item;
                        }
                    }

                    //state
                    UILabel label_state = new_item.transform.FindChild("Labels/Label-State-Value").GetComponent <UILabel>();
                    if (normalCopys[i].copyState == CopyState.PASSED)
                    {
                        label_state.text = "[d4a106]已通关[000000]";
                    }
                    else
                    {
                        label_state.text = "[89ca88]新开启[000000]";
                    }

                    //level
                    GameObject goLev       = new_item.transform.FindChild("Level").gameObject;
                    UILabel    label_level = goLev.transform.FindChild("Label-Level-Value").GetComponent <UILabel>();
                    GameObject lockTip     = new_item.transform.FindChild("Sprite-CanOpen").gameObject;
                    if (normalCopys[i].tblCopy.PlayerLevel > 0)
                    {
                        if (Obj_MyselfPlayer.GetMe().level < normalCopys[i].tblCopy.PlayerLevel)
                        {
                            label_level.text = normalCopys[i].tblCopy.PlayerLevel.ToString();
                            goLev.transform.localPosition = closeLevPo;
                            lockTip.SetActive(true);
                        }
                        else
                        {
                            label_level.text = normalCopys[i].tblCopy.PlayerLevel.ToString();
                            goLev.transform.localPosition = openLevPo;
                            lockTip.SetActive(false);
                        }
                        goLev.SetActive(true);
                    }
                    else
                    {
                        goLev.SetActive(false);
                    }

                    //time
                    UILabel label_time = new_item.transform.FindChild("Labels/Label-Time").GetComponent <UILabel>();
                    label_time.gameObject.SetActive(false);
                    label_time = new_item.transform.FindChild("Labels/Label-Time-Value").GetComponent <UILabel>();
                    label_time.gameObject.SetActive(false);
                    GameObject name_bg = new_item.transform.FindChild("Sprite").gameObject;
                    if (Obj_MyselfPlayer.GetMe().level >= normalCopys[i].tblCopy.PlayerLevel)
                    {
                        label_name.text = "[F1ECCF]" + LanguageManger.GetWords(normalCopys[i].tblCopy.Copyname) + "[000000]";
                        label_state.gameObject.SetActive(true);
                        label_name.transform.localPosition     = new Vector3(-160, -15, -20);
                        name_bg.transform.localPosition        = new Vector3(-105, -14, -2);
                        UIEventListener.Get(new_item).onClick += OnSelectMainCopy;
                    }
                    else
                    {
                        label_name.text = "[7F7F7F]" + LanguageManger.GetWords(normalCopys[i].tblCopy.Copyname) + "[000000]";
                        label_state.gameObject.SetActive(false);
                        label_name.transform.localPosition = new Vector3(-160, -5, -20);
                        name_bg.transform.localPosition    = new Vector3(-105, -5, -2);
                        Destroy(new_item.GetComponent <UIImageButton>());
                    }
                    openNormalCount++;
                }
                //				if(isNewOpen)
                //				{
                //					break;
                //				}
            }
        }
        else
        {
            activityCopys.Sort(ActiveCompareTo);
            for (int i = 0; i < activityCopys.Count; i++)
            {
                if (activityCopys[i].clostTime == 0)
                {
                    continue;
                }
                activityCopys[i].listOrder = i;

                GameObject new_item = ResourceManager.Instance.loadWidget(mainCopyNormalItem);
                new_item.transform.parent        = parent.transform;
                new_item.transform.localPosition = Vector3.zero;
                new_item.transform.localScale    = Vector3.one;
                new_item.transform.name          = activityCopys[i].listOrder.ToString();

                //副本缩略图
                UISprite coypIcon = new_item.transform.FindChild("Sprite-bg").GetComponent <UISprite>();
                string   iconName = TableManager.GetCopyByID(activityCopys[i].copyId).Thumb;
                coypIcon.spriteName = iconName;

                //name
                UILabel label_name = new_item.transform.FindChild("Labels/Label-Name-Value").GetComponent <UILabel>();
                //label_name.text = LanguageManger.GetWords(activityCopys[i].tblCopy.Copyname);

                //state
                UILabel label_state = new_item.transform.FindChild("Labels/Label-State-Value").GetComponent <UILabel>();
                if (activityCopys[i].startTime == 0)
                {
                    label_state.text = "[89ca88]开启中[000000]";
                    foreach (SubCopy sub in activityCopys[i].subCopys)
                    {
                        int copyCount = TableManager.GetCopydetailByID(sub.subCopyID).CopyLimit - sub.count;
                        if (copyCount > 0)
                        {
                            prompt.SetActive(true);
                            break;
                        }
                    }
                }
                else if (activityCopys[i].clostTime == 0)
                {
                    label_state.text = "[c83809]未开启[000000]";
                }

                //level
                GameObject goLev       = new_item.transform.FindChild("Level").gameObject;
                UILabel    label_level = goLev.transform.FindChild("Label-Level-Value").GetComponent <UILabel>();
                GameObject lockTip     = new_item.transform.FindChild("Sprite-CanOpen").gameObject;
                if (activityCopys[i].tblCopy.PlayerLevel > 0)
                {
                    if (Obj_MyselfPlayer.GetMe().level < activityCopys[i].tblCopy.PlayerLevel)
                    {
                        label_level.text = activityCopys[i].tblCopy.PlayerLevel.ToString();
                        goLev.transform.localPosition = closeLevPo;
                        lockTip.SetActive(true);
                    }
                    else
                    {
                        label_level.text = activityCopys[i].tblCopy.PlayerLevel.ToString();
                        goLev.transform.localPosition = openLevPo;
                        lockTip.SetActive(false);
                    }
                    goLev.SetActive(true);
                }
                else
                {
                    goLev.SetActive(false);
                }
                //time
                UILabel label_time       = new_item.transform.FindChild("Labels/Label-Time").GetComponent <UILabel>();
                UILabel label_time_value = new_item.transform.FindChild("Labels/Label-Time-Value").GetComponent <UILabel>();
                if (activityCopys[i].startTime == 0)
                {
                    label_time.text       = "关闭剩余:";
                    label_time_value.text = ConvertSecond(activityCopys[i].clostTime);
                    UIEventListener.Get(new_item).onClick += OnSelectMainCopy;
                }
                else if (activityCopys[i].clostTime == 0)
                {
                    label_time.text       = "开启剩余:";
                    label_time_value.text = ConvertSecond(activityCopys[i].startTime);
                    //new_item.GetComponent<UIImageButton>().enabled=false;
                    Destroy(new_item.GetComponent <UIImageButton>());
                }

                //掉落描述
                UILabel dropDesc = new_item.transform.FindChild("Labels/DropDescribe").GetComponent <UILabel>();
                int     dropID   = activityCopys[i].tblCopy.Drop;
                if (dropID != -1)
                {
                    UILabel      level    = new_item.transform.FindChild("Labels/DropDescribe").GetComponent <UILabel>();
                    Tab_Language language = TableManager.GetLanguageByID(dropID);
                    level.text = language.Chinese;
                }
                GameObject name_bg = new_item.transform.FindChild("Sprite").gameObject;
                if (Obj_MyselfPlayer.GetMe().level >= activityCopys[i].tblCopy.PlayerLevel)
                {
                    label_name.text = "[F1ECCF]" + LanguageManger.GetWords(activityCopys[i].tblCopy.Copyname) + "[000000]";
                    label_state.gameObject.SetActive(true);
                    label_time.gameObject.SetActive(true);
                    label_time_value.gameObject.SetActive(true);
                    dropDesc.gameObject.SetActive(true);
                    label_name.transform.localPosition = new Vector3(-160, -15, -20);
                    name_bg.transform.localPosition    = new Vector3(-105, -14, -2);
                }
                else
                {
                    label_name.text = "[7F7F7F]" + LanguageManger.GetWords(activityCopys[i].tblCopy.Copyname) + "[000000]";
                    label_state.gameObject.SetActive(false);
                    label_time.gameObject.SetActive(false);
                    label_time_value.gameObject.SetActive(false);
                    dropDesc.gameObject.SetActive(false);
                    label_name.transform.localPosition = new Vector3(-160, -5, -20);
                    name_bg.transform.localPosition    = new Vector3(-105, -5, -2);
                    if (new_item.GetComponent <UIImageButton>() != null)
                    {
                        Destroy(new_item.GetComponent <UIImageButton>());
                        UIEventListener.Get(new_item).onClick -= OnSelectMainCopy;
                    }
                }
                openActiveCount++;
            }
        }
        parent.GetComponent <UIGrid>().repositionNow = true;
    }