|
@@ -1,3 +1,4 @@
|
|
|
|
+using System.Collections.Generic;
|
|
using ET;
|
|
using ET;
|
|
using FairyGUI;
|
|
using FairyGUI;
|
|
using UI.Studio;
|
|
using UI.Studio;
|
|
@@ -8,6 +9,8 @@ namespace GFGGame
|
|
public class StudioFilingView : BaseWindow
|
|
public class StudioFilingView : BaseWindow
|
|
{
|
|
{
|
|
private UI_StudioFilingUI _ui;
|
|
private UI_StudioFilingUI _ui;
|
|
|
|
+ private FilingCfg _filingCfg;
|
|
|
|
+ private List<StoryLevelCfg> _storyLevelCfgs;
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
@@ -27,6 +30,15 @@ namespace GFGGame
|
|
this.viewCom = _ui.target;
|
|
this.viewCom = _ui.target;
|
|
isfullScreen = true;
|
|
isfullScreen = true;
|
|
|
|
|
|
|
|
+ _ui.m_list.itemRenderer = RenderListItem;
|
|
|
|
+ _ui.m_list.onClickItem.Add(OnListItemClick);
|
|
|
|
+
|
|
|
|
+ _ui.m_btnBack.onClick.Add(Hide);
|
|
|
|
+ _ui.m_btnChange.onClick.Add(OnBtnChangeClick);
|
|
|
|
+ _ui.m_btnReward.onClick.Add(OnBtnRewardClick);
|
|
|
|
+ _ui.m_btnAdd.onClick.Add(OnBtnAddClick);
|
|
|
|
+ _ui.m_btnSuit.onClick.Add(OnBtnSuitClick);
|
|
|
|
+
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
@@ -36,13 +48,13 @@ namespace GFGGame
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
-
|
|
|
|
|
|
+ UpdateView();
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
-
|
|
|
|
|
|
+ ViewManager.GoBackFrom(typeof(StudioFilingView).FullName);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
@@ -50,5 +62,60 @@ namespace GFGGame
|
|
base.RemoveEventListener();
|
|
base.RemoveEventListener();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void UpdateView()
|
|
|
|
+ {
|
|
|
|
+ _filingCfg = FilingCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
|
|
|
|
+ _ui.m_txtTitle.SetVar("name", _filingCfg.name).FlushVars();
|
|
|
|
+
|
|
|
|
+ SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_filingCfg.suitId);
|
|
|
|
+ _ui.m_txtSuitName.text = suitCfg.name;
|
|
|
|
+
|
|
|
|
+ DressUpMenuSuitDataManager.GetTotalProgress(out int haveCount, out int totalCount);
|
|
|
|
+ _ui.m_txtSuitProgress.text = string.Format("({0}/{1})", haveCount, totalCount);
|
|
|
|
+
|
|
|
|
+ _storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_filingCfg.type, 0, StudioDataManager.Instance.filingChapterId);
|
|
|
|
+ _ui.m_list.numItems = _storyLevelCfgs.Count;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void RenderListItem(int index, GObject obj)
|
|
|
|
+ {
|
|
|
|
+ UI_ListLevel item = UI_ListLevel.Proxy(obj);
|
|
|
|
+ item.m_c1.selectedIndex = index % 2;
|
|
|
|
+ item.m_txtName.text = _storyLevelCfgs[index].name;
|
|
|
|
+ item.m_imgLock.visible = InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index].id);
|
|
|
|
+ item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[index].id);
|
|
|
|
+ item.target.data = _storyLevelCfgs[index];
|
|
|
|
+ UI_ListLevel.ProxyEnd();
|
|
|
|
+ }
|
|
|
|
+ private void OnListItemClick(EventContext context)
|
|
|
|
+ {
|
|
|
|
+ GObject obj = context.data as GObject;
|
|
|
|
+ StoryLevelCfg storyLevelCfg = obj.data as StoryLevelCfg;
|
|
|
|
+ if (!string.IsNullOrEmpty(storyLevelCfg.storyStartID))
|
|
|
|
+ {
|
|
|
|
+ StoryController.ShowFilingStoryDialog(storyLevelCfg.storyStartID);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ InstanceZonesController.ShowLevelView(storyLevelCfg.id, StudioDataManager.Instance.OnFinishStoryLevel);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ private void OnBtnChangeClick()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void OnBtnRewardClick()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void OnBtnAddClick()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void OnBtnSuitClick()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|