123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using System.Collections.Generic;
- using ET;
- using FairyGUI;
- using UI.MatchingCompetition;
- using UnityEngine;
- namespace GFGGame
- {
- class MatchingCompetitionWorksListView : BaseWindow
- {
- private UI_MatchingCompetitionWorkListUI _ui;
- private int _seasonIndex = 0;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- }
- _ui = null;
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_MatchingCompetitionWorkListUI.PACKAGE_NAME;
- _ui = UI_MatchingCompetitionWorkListUI.Create();
- this.viewCom = _ui.target;
- isReturnView = true;
- isfullScreen = true;
- _ui.m_workList.itemRenderer = RenderRankList;
- _ui.m_BtnBack.onClick.Add(OnClickBtnBack);
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _ui.m_bg.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
- _ui.m_titleText.text = JudgingRoundOpenCfgArray.Instance.dataArray[MatchingCompetitionDataManager.Instance.MatchingCompetitionSeason - 1].Name;
- _seasonIndex = (int)this.viewData;
- UpdateView();
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void UpdateView()
- {
- _ui.m_workList.numItems = MatchingCompetitionDataManager.Instance._BeforeRankList.Count;
- }
- private void RenderRankList(int index, GObject obj)
- {
- UI_Component6 item = UI_Component6.Proxy(obj);
- if((index +1) >=1 && (index + 1)<=3)
- {
- item.m_c1.selectedIndex = index + 1;
- }
- else
- {
- item.m_c1.selectedIndex = 0;
- }
- MatchingPhotoWorksData otherdata = MatchingCompetitionDataManager.Instance._BeforeRankList[index];
- JudgingRoundRoleInfo otherInfo = otherdata.JudgingInfo;
- otherInfo.Rank = index;
- RoleInfoManager.Instance.UpdateHead(item.m_head, otherInfo.HeadItemId, otherInfo.HeadBorderItemId);
- item.m_nameText.text = otherInfo.RoleName.ToString();
- item.m_countText.text = otherInfo.Score.ToString();
- if (item.target.data == null)
- {
- item.target.onClick.Add(OnClickBtnItem);
- }
- item.target.data = index;
- UI_Component6.ProxyEnd();
- }
- private void OnClickBtnItem(EventContext context)
- {
- GObject item = context.sender as GObject;
- int index = (int)item.data;
- MatchingPhotoWorksData otherInfo = MatchingCompetitionDataManager.Instance._BeforeRankList[index];
- List<int> AllIdList = new List<int>();
- foreach(var info in otherInfo.JudgingInfo.CollocationInfoList)
- {
- AllIdList.Add(info.ItemId);
- }
- MatchingCompetitionDataManager.Instance.DetailNtexture = otherInfo.Ntexture;
- ViewManager.Show<MatchingCompetitionDetailView>(AllIdList);
- }
- private void OnClickBtnBack()
- {
- ViewManager.GoBackFrom(typeof(MatchingCompetitionWorksListView).FullName);
- }
- }
- }
|