|
@@ -9,11 +9,17 @@ namespace GFGGame
|
|
public class StudioFilingView : BaseWindow
|
|
public class StudioFilingView : BaseWindow
|
|
{
|
|
{
|
|
private UI_StudioFilingUI _ui;
|
|
private UI_StudioFilingUI _ui;
|
|
|
|
+ private ValueBarController _valueBarController;
|
|
private StudioCfg _filingCfg;
|
|
private StudioCfg _filingCfg;
|
|
private List<StoryLevelCfg> _storyLevelCfgs;
|
|
private List<StoryLevelCfg> _storyLevelCfgs;
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ if (_valueBarController != null)
|
|
|
|
+ {
|
|
|
|
+ _valueBarController.Dispose();
|
|
|
|
+ _valueBarController = null;
|
|
|
|
+ }
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
@@ -29,6 +35,7 @@ namespace GFGGame
|
|
_ui = UI_StudioFilingUI.Create();
|
|
_ui = UI_StudioFilingUI.Create();
|
|
this.viewCom = _ui.target;
|
|
this.viewCom = _ui.target;
|
|
isfullScreen = true;
|
|
isfullScreen = true;
|
|
|
|
+ _valueBarController = new ValueBarController(_ui.m_comValueBar);
|
|
|
|
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
_ui.m_list.onClickItem.Add(OnListItemClick);
|
|
_ui.m_list.onClickItem.Add(OnListItemClick);
|
|
@@ -39,7 +46,6 @@ namespace GFGGame
|
|
_ui.m_btnAdd.onClick.Add(OnBtnAddClick);
|
|
_ui.m_btnAdd.onClick.Add(OnBtnAddClick);
|
|
_ui.m_btnSuit.onClick.Add(OnBtnSuitClick);
|
|
_ui.m_btnSuit.onClick.Add(OnBtnSuitClick);
|
|
|
|
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tc_bjbj");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
@@ -55,12 +61,16 @@ namespace GFGGame
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
+ _valueBarController.OnShown();
|
|
|
|
+
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
|
|
+ _valueBarController.OnHide();
|
|
|
|
+
|
|
ViewManager.GoBackFrom(typeof(StudioFilingView).FullName);
|
|
ViewManager.GoBackFrom(typeof(StudioFilingView).FullName);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -80,8 +90,8 @@ namespace GFGGame
|
|
StudioData studioData = StudioDataManager.Instance.GetStudioDataById(StudioDataManager.Instance.filingChapterId);
|
|
StudioData studioData = StudioDataManager.Instance.GetStudioDataById(StudioDataManager.Instance.filingChapterId);
|
|
|
|
|
|
_filingCfg = StudioCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
|
|
_filingCfg = StudioCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
|
|
- _ui.m_txtTitle.SetVar("name", _filingCfg.name).FlushVars();
|
|
|
|
- _ui.m_loaNpc.url = ResPathUtil.GetNpcPicFPath(_filingCfg.res);
|
|
|
|
|
|
+ _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(_filingCfg.res);
|
|
|
|
+ _ui.m_btnChange.title = _filingCfg.name;
|
|
_ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", studioData.TotalPlayTimes - studioData.PlayTimes, _filingCfg.num);
|
|
_ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", studioData.TotalPlayTimes - studioData.PlayTimes, _filingCfg.num);
|
|
|
|
|
|
SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_filingCfg.suitId);
|
|
SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_filingCfg.suitId);
|
|
@@ -98,15 +108,19 @@ namespace GFGGame
|
|
|
|
|
|
private void RenderListItem(int index, GObject obj)
|
|
private void RenderListItem(int index, GObject obj)
|
|
{
|
|
{
|
|
- int _index = _storyLevelCfgs.Count - index - 1;
|
|
|
|
- UI_ListLevel item = UI_ListLevel.Proxy(obj);
|
|
|
|
- item.m_c1.selectedIndex = _index % 2;
|
|
|
|
- item.m_txtName.text = _storyLevelCfgs[_index].name;
|
|
|
|
- item.m_imgLock.visible = _index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[_index - 1].id);
|
|
|
|
- item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[_index].id);
|
|
|
|
- item.target.data = _index;// _storyLevelCfgs[_index];
|
|
|
|
- UI_ListLevel.ProxyEnd();
|
|
|
|
|
|
+ // int _index = _storyLevelCfgs.Count - index - 1;
|
|
|
|
+ UI_ListLevelItem item = UI_ListLevelItem.Proxy(obj);
|
|
|
|
+ item.m_c1.selectedIndex = index % 2 == 0 ? 0 : 1;
|
|
|
|
+ item.m_txtName.text = _storyLevelCfgs[index].name;
|
|
|
|
+ string resBg = string.IsNullOrEmpty(_storyLevelCfgs[index].storyStartID) ? "cyjd_di_1" : "cyjd_di_2";
|
|
|
|
+ item.m_loaBg.url = string.Format("ui://Studio/{0}", resBg);
|
|
|
|
+ item.m_loaIcon.url = string.Format("ui://Studio/{0}_{1}", _filingCfg.res, index);
|
|
|
|
+ item.m_grpLock.visible = index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id);
|
|
|
|
+ item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[index].id);
|
|
|
|
+ item.target.data = index;// _storyLevelCfgs[_index];
|
|
|
|
+ UI_ListLevelItem.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
+
|
|
private void OnListItemClick(EventContext context)
|
|
private void OnListItemClick(EventContext context)
|
|
{
|
|
{
|
|
GObject obj = context.data as GObject;
|
|
GObject obj = context.data as GObject;
|