|
@@ -1,3 +1,4 @@
|
|
|
+using System;
|
|
|
using System.Collections.Generic;
|
|
|
using ET;
|
|
|
using FairyGUI;
|
|
@@ -12,6 +13,7 @@ namespace GFGGame
|
|
|
{
|
|
|
private UI_LeagueSkillUpUI _ui;
|
|
|
private ValueBarController _valueBarController;
|
|
|
+ private int _pageCount;
|
|
|
private int _type;
|
|
|
public override void Dispose()
|
|
|
{
|
|
@@ -40,6 +42,8 @@ namespace GFGGame
|
|
|
_ui.m_listScore.itemRenderer = RenderListScoreItem;
|
|
|
_ui.m_list.itemRenderer = RenderListItem;
|
|
|
_ui.m_list.SetVirtual();
|
|
|
+ _ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
|
+ _ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
_valueBarController = new ValueBarController(_ui.m_comValue);
|
|
|
|
|
@@ -60,6 +64,7 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
|
}
|
|
|
+ // _pageCount = Math.Ceiling((double)(_ui.m_list.scrollPane.contentWidth / _ui.m_list.scrollPane.viewWidth));
|
|
|
UpdateView();
|
|
|
}
|
|
|
|
|
@@ -79,15 +84,32 @@ namespace GFGGame
|
|
|
{
|
|
|
ViewManager.GoBackFrom(typeof(LeagueSkillUpView).FullName);
|
|
|
}
|
|
|
+ private void OnBtnRightClick()
|
|
|
+ {
|
|
|
+ int index = _ui.m_list.GetFirstChildInView();
|
|
|
+ int curPage = index / _ui.m_list.lineCount;
|
|
|
+ int nextPage = curPage + 1;
|
|
|
+ if (nextPage * _ui.m_list.lineCount > _ui.m_list.numItems) return;
|
|
|
+ _ui.m_list.ScrollToView(nextPage * _ui.m_list.lineCount);
|
|
|
+ }
|
|
|
+ private void OnBtnLeftClick()
|
|
|
+ {
|
|
|
+ int index = _ui.m_list.GetFirstChildInView();
|
|
|
+ int curPage = index / _ui.m_list.lineCount;
|
|
|
+ int lastPage = curPage - 1;
|
|
|
+ if (lastPage * _ui.m_list.lineCount < 0) return;
|
|
|
+ _ui.m_list.ScrollToView(lastPage * _ui.m_list.lineCount);
|
|
|
+ }
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
_ui.m_listScore.numItems = 4;
|
|
|
_ui.m_list.RefreshVirtualList();
|
|
|
- _ui.m_comSkillType.m_txtTitle.text = "茶艺-" + LeagueSkillCountCfgArray.Instance.GetCfg(_type).name;
|
|
|
- UI_ListSkillTypeItem item = UI_ListSkillTypeItem.Proxy(_ui.m_comSkillType.target);
|
|
|
+ _ui.m_txtTitle.text = "茶艺-" + LeagueSkillCountCfgArray.Instance.GetCfg(_type).name;
|
|
|
+ // UI_ListSkillTypeItem item = UI_ListSkillTypeItem.Proxy(_ui.m_comSkillType.target);
|
|
|
double progress = LeagueDataManager.Instance.GetSkillProgressByType(_type);
|
|
|
- item.m_txtProgress.text = string.Format("进度{0}%", progress);
|
|
|
- UI_ListSkillTypeItem.ProxyEnd();
|
|
|
+ // _ui.m_txtProgress.text = string.Format("进度{0}%", progress);
|
|
|
+ _ui.m_txtProgress.SetVar("value", progress.ToString()).FlushVars();
|
|
|
+ // UI_ListSkillTypeItem.ProxyEnd();
|
|
|
}
|
|
|
private void RenderListScoreItem(int index, GObject obj)
|
|
|
{
|