Exemple #1
0
        private void SetupTabView()
        {
            string showingTabKey = this._tabManager.GetShowingTabKey();
            string searchKey     = showingTabKey;

            if (string.IsNullOrEmpty(showingTabKey))
            {
                if (this._mode == Mode.World)
                {
                    searchKey = "WorldTab";
                }
                else if (this._mode == Mode.Guild)
                {
                    searchKey = "GuildTab";
                }
                else if (this._mode == Mode.Friend)
                {
                    searchKey = "FriendTab";
                }
            }
            MonoGridScroller component = base.view.transform.Find("Dialog/Content/ChatList/ScrollView").GetComponent <MonoGridScroller>();

            this._tabManager.SetTab("WorldTab", base.view.transform.Find("Dialog/TabBtns/WorldBtn").GetComponent <Button>(), component.gameObject);
            this._tabManager.SetTab("FriendTab", base.view.transform.Find("Dialog/TabBtns/FriendBtn").GetComponent <Button>(), component.gameObject);
            this._tabManager.ShowTab(searchKey);
        }
Exemple #2
0
        private void UpdateFriendList(int addFriendCount)
        {
            MonoGridScroller component = base.view.transform.Find("Dialog/Content/FriendListPanel/FriendList/ScrollView").GetComponent <MonoGridScroller>();

            component.AddChildren(addFriendCount);
            component.ScrollToNextItem();
        }
Exemple #3
0
        private void SetupChatList()
        {
            MonoGridScroller component = base.view.transform.Find("Dialog/Content/ChatList/ScrollView").GetComponent <MonoGridScroller>();

            component.Init(new MonoGridScroller.OnChange(this.OnScrollChange), this.GetScrollerCount(), null);
            component.ScrollToEnd();
        }
 private void InitAnimationAndDialogManager()
 {
     this._leftPanelAnimationManager = new SequenceAnimationManager(new Action(this.OnLeftPanelAnimationsEnd), null);
     this._playerLevelUpAndAvatarNewSkillDialogManager = new SequenceDialogManager(new Action(this.OnPlayerAvatarDialogsEnd));
     this._dropPanelBGAnimationManager = new SequenceAnimationManager(new Action(this.OnDropPanelBGAniamtionEnd), null);
     this._dropNewItemDialogManager    = new SequenceDialogManager(new Action(this.OnDropNewItemDialogsEnd));
     this._dropItemAnimationManager    = new SequenceAnimationManager(new Action(this.OnItemPanelAnimationEnd), null);
     this._dropScroller            = base.view.transform.Find("RewardPanel/DropPanel/Drops/ScrollView").GetComponent <MonoGridScroller>();
     this._leftPanelAnimationsEnd  = false;
     this._playerAvatarDialogsEnd  = false;
     this._dropPanelBGAniamtionEnd = false;
 }
Exemple #5
0
        private void SetupFriendList()
        {
            MonoGridScroller component = base.view.transform.Find("Dialog/Content/FriendListPanel/FriendList/ScrollView").GetComponent <MonoGridScroller>();
            RectTransform    transform = base.view.transform.Find("Dialog/Content/FriendListPanel/FriendList").GetComponent <RectTransform>();
            int friendChatCount        = Singleton <ChatModule> .Instance.GetFriendChatCount();

            float size = Mathf.Clamp((float)((friendChatCount * 60f) + 30f), (float)215.3f, (float)351.3f);

            transform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, size);
            this._friendTabManager.Clear();
            component.Init(new MonoGridScroller.OnChange(this.OnFriendScrollChange), friendChatCount, null);
            component.ScrollToEnd();
        }
 private void SetupCurrentGetItems()
 {
     if (this.allTeamDown)
     {
         base.view.transform.Find("Dialog/Content/CurrentGetItems/UpContent/Scoin/Num").GetComponent <Text>().text = Mathf.FloorToInt(this._levelScoreManager.scoinInside).ToString();
         Transform transform = base.view.transform.Find("Dialog/Content/CurrentGetItems/Items");
         this._dropItemList = this._levelScoreManager.GetDropListToShow();
         transform.gameObject.SetActive(this._dropItemList.Count > 0);
         this._dropGridScroller = transform.Find("ScrollView").GetComponent <MonoGridScroller>();
         this._dropGridScroller.Init(new MonoGridScroller.OnChange(this.OnScrollerChange), this._dropItemList.Count, null);
         bool flag = this._dropItemList.Count > this._dropGridScroller.GetMaxItemCountWithouScroll();
         transform.Find("PrevBtn").gameObject.SetActive(flag);
         transform.Find("NextBtn").gameObject.SetActive(flag);
     }
 }
Exemple #7
0
        public void SetupView(Action onGetBtnClick = null)
        {
            this._onGetBtnClick       = onGetBtnClick;
            this._scrollViewTrans     = base.transform.Find("ScrollView");
            this._welfareDataItemList = Singleton <ShopWelfareModule> .Instance.GetWelfareDataItemList();

            MonoGridScroller component = this._scrollViewTrans.GetComponent <MonoGridScroller>();

            component.Init(new MonoGridScroller.OnChange(this.OnScrollChange), this._welfareDataItemList.Count, new Vector2(0f, 1f));
            if (this._scrollViewTrans.gameObject.activeInHierarchy)
            {
                MonoScrollerFadeManager manager = this._scrollViewTrans.GetComponent <MonoScrollerFadeManager>();
                manager.Init(component.GetItemDict(), null, new Func <RectTransform, RectTransform, bool>(this.IsWelfareDataItemEqual));
                manager.Play();
            }
        }
Exemple #8
0
 private void SetupTheRewardPanel()
 {
     if (this._signInRewardStatus == null)
     {
         LoadingWheelWidgetContext widget = new LoadingWheelWidgetContext(0x7a, null);
         Singleton <MainUIManager> .Instance.ShowWidget(widget, UIType.Any);
     }
     else
     {
         base.view.transform.Find("Dialog/Content/MonthPanel").gameObject.SetActive(true);
         base.view.transform.Find("Dialog/Content/GetRewardBtn").gameObject.SetActive(true);
         MonoGridScroller component = base.view.transform.Find("Dialog/Content/MonthPanel/ScrollView").GetComponent <MonoGridScroller>();
         int num  = ((this._daysOfMonth % 6) != 0) ? ((this._daysOfMonth / 6) + 1) : (this._daysOfMonth / 6);
         int num2 = (int)((this._signInRewardStatus.get_next_sign_in_day() - 1) / 6);
         component.Init(new MonoGridScroller.OnChange(this.OnScrollerChanged), this._signInRewardItemList.Count, new Vector2(0f, 1f - (((float)num2) / ((float)num))));
     }
 }
Exemple #9
0
        private void OnFriendScrollChange(Transform trans, int index)
        {
            if (this._mode == Mode.Friend)
            {
                int targetUid = Singleton <ChatModule> .Instance.GetSortedChatFriendList()[index];

                FriendBriefDataItem friendBriefData = Singleton <FriendModule> .Instance.TryGetFriendBriefData(targetUid);

                trans.Find("FriendBtn/Name").GetComponent <Text>().text = friendBriefData.nickName;
                MonoFriendChatInfo component = trans.GetComponent <MonoFriendChatInfo>();
                bool friendMsgNewState       = Singleton <ChatModule> .Instance.GetFriendMsgNewState(friendBriefData.uid);

                bool flag2         = friendBriefData.uid == this._talkingFriendUid;
                bool hasNewMessage = friendMsgNewState && !flag2;
                component.SetupView(friendBriefData, hasNewMessage, new ChangeTalkingFriend(this.OnChangeTalkingFriendClick));
                MonoGridScroller scroller = base.view.transform.Find("Dialog/Content/ChatList/ScrollView").GetComponent <MonoGridScroller>();
                Button           btn      = trans.Find("FriendBtn").GetComponent <Button>();
                this._friendTabManager.SetTab(friendBriefData.uid.ToString(), btn, scroller.gameObject);
            }
        }
Exemple #10
0
 private void InitAnimationAndDialogManager()
 {
     this._dropItemAnimationManager = new SequenceAnimationManager(new Action(this.OnDropItemAnimationEnd), null);
     this._dropScroller             = base.view.transform.Find("GroupPanel/Drops/ScrollView").GetComponent <MonoGridScroller>();
 }
Exemple #11
0
 private void SetupScrollView(List <ItempediaDataAdapter> dataList, MonoGridScroller scroller)
 {
        private void SetupStatusTab()
        {
            GameObject gameObject = base.view.transform.Find("Dialog/StatusTab").gameObject;
            Button     component  = base.view.transform.Find("Dialog/TabBtns/TabBtn_1").GetComponent <Button>();

            this._tabManager.SetTab("StatusTab", component, gameObject);
            this._levelScoreManager = Singleton <LevelScoreManager> .Instance;
            if ((this._levelScoreManager.isTryLevel || this._levelScoreManager.isDebugLevel) || (this._levelScoreManager.LevelType == 4))
            {
                this.SetupViewForTryOrDebugLevel();
            }
            else
            {
                string str;
                this._levelData = Singleton <LevelModule> .Instance.GetLevelById(this._levelScoreManager.LevelId);

                if (this._levelData.LevelType == 1)
                {
                    string[] textArray1 = new string[] { this._levelScoreManager.chapterTitle, " ", this._levelScoreManager.actTitle, " ", this._levelScoreManager.stageName, " ", this._levelScoreManager.LevelTitle };
                    str = string.Concat(textArray1);
                }
                else
                {
                    str = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(this._levelData.ActID).GetActitityTitle() + " " + this._levelData.Title;
                }
                base.view.transform.Find("Dialog/StatusTab/Content/Title/Text").GetComponent <Text>().text = str;
                base.view.transform.Find("Dialog/StatusTab/Content/CurrentGetItems/Scoin/Num").GetComponent <Text>().text = Mathf.FloorToInt(this._levelScoreManager.scoinInside).ToString();
                Transform transform = base.view.transform.Find("Dialog/StatusTab/Content/CurrentGetItems/Items");
                this._dropItemList = this._levelScoreManager.GetDropListToShow();
                transform.gameObject.SetActive(this._dropItemList.Count > 0);
                this._dropGridScroller = transform.Find("ScrollView").GetComponent <MonoGridScroller>();
                this._dropGridScroller.Init(new MonoGridScroller.OnChange(this.OnScrollerChange), this._dropItemList.Count, null);
                bool flag = this._dropItemList.Count > this._dropGridScroller.GetMaxItemCountWithouScroll();
                transform.Find("PrevBtn").gameObject.SetActive(flag);
                transform.Find("NextBtn").gameObject.SetActive(flag);
                Transform transform2 = base.view.transform.Find("Dialog/StatusTab/Content/ChallengePanel");
                List <LevelChallengeDataItem> list     = new List <LevelChallengeDataItem>();
                LevelScoreManager             instance = Singleton <LevelScoreManager> .Instance;
                LevelMetaData levelMetaDataByKey       = LevelMetaDataReader.GetLevelMetaDataByKey(this._levelData.levelId);
                foreach (int num in instance.configChallengeIds)
                {
                    LevelChallengeDataItem item = new LevelChallengeDataItem(num, levelMetaDataByKey, 0);
                    list.Add(item);
                }
                Dictionary <int, BaseLevelChallenge> dictionary = new Dictionary <int, BaseLevelChallenge>();
                foreach (BaseLevelChallenge challenge in Singleton <LevelManager> .Instance.levelActor.GetPlugin <LevelChallengeHelperPlugin>().challengeList)
                {
                    dictionary[challenge.challengeId] = challenge;
                }
                for (int i = 0; i < list.Count; i++)
                {
                    LevelChallengeDataItem item2 = list[i];
                    Transform child = transform2.GetChild(i);
                    child.Find("Content").GetComponent <Text>().text = item2.DisplayTarget;
                    bool flag2 = !(dictionary.ContainsKey(item2.challengeId) && !dictionary[item2.challengeId].IsFinished());
                    bool flag3 = dictionary.ContainsKey(item2.challengeId);
                    child.Find("Achieve").gameObject.SetActive(flag2);
                    child.Find("Unachieve").gameObject.SetActive(!flag2);
                    child.Find("Achieve/CompleteMark").gameObject.SetActive(!flag3);
                    child.Find("Achieve/Progress").gameObject.SetActive(flag3);
                    child.Find("Unachieve/Progress").gameObject.SetActive(flag3);
                    if (flag3)
                    {
                        string localizedText = this.GetLocalizedText(dictionary[item2.challengeId].GetProcessMsg());
                        child.Find("Achieve/Progress").GetComponent <Text>().text   = localizedText;
                        child.Find("Unachieve/Progress").GetComponent <Text>().text = localizedText;
                    }
                }
            }
        }
Exemple #13
0
 private void FetchWidget()
 {
     this._cgScroller = base.view.transform.Find("MissionList/ScrollView").GetComponent <MonoGridScroller>();
 }