|
@@ -9,7 +9,10 @@ namespace GFGGame
|
|
|
public class StudioPropertyView : StudioBaseView
|
|
|
{
|
|
|
// private GList _listProperty;
|
|
|
-
|
|
|
+ private GComponent com;
|
|
|
+ private GLoader _bg0;
|
|
|
+ private GLoader _bg1;
|
|
|
+ private GLoader _btnChageLine;
|
|
|
private Controller _croProperty;
|
|
|
private int _propertySelectIndex = 0;
|
|
|
private int firstOpenProperty = -1;//第一个开放的副本(打开界面时,如未选择副本,则默认选中第一个开启的副本)
|
|
@@ -25,15 +28,26 @@ namespace GFGGame
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
// _ui.m_listProperty.itemRenderer = ListPropertyItemRender;
|
|
|
// _ui.m_listProperty.onClickItem.Add(OnClickListProperty);
|
|
|
+ com = UIPackage.CreateObject(UI_StudioUI.PACKAGE_NAME, "ComProperty").asCom;
|
|
|
+ //AddChildCom(com, false);
|
|
|
+ //list.itemRenderer = ListItemRender;
|
|
|
+ _croProperty = com.GetController("c1");
|
|
|
+
|
|
|
+ _bg0 = com.GetChild("bg0").asLoader;
|
|
|
+ _bg1 = com.GetChild("bg1").asLoader;
|
|
|
+ _btnChageLine = com.GetChild("btnChageLine").asLoader;
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
- GComponent com = UIPackage.CreateObject(UI_StudioUI.PACKAGE_NAME, "ComProperty").asCom;
|
|
|
- this.AddChildCom(com);
|
|
|
- _croProperty = com.GetController("c1");
|
|
|
+ AddChildCom(com, false);
|
|
|
+ list.itemRenderer = ListItemRender;
|
|
|
_croProperty.onChanged.Add(OnControllerChange);
|
|
|
|
|
|
+ _bg0.url = ResPathUtil.GetBgImgPath("bg_fhl");
|
|
|
+ _bg1.url = "ui://Studio/lm_db_chang_2";
|
|
|
+ _btnChageLine.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
|
|
|
+
|
|
|
_propertySelectIndex = this.viewData == null ? 0 : (int)this.viewData;
|
|
|
|
|
|
StudioDataManager.Instance.VIEW_NAME = typeof(StudioPropertyView).FullName;
|
|
@@ -58,8 +72,10 @@ namespace GFGGame
|
|
|
list.ScrollToView(curIndex);
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
- base.OnShown();
|
|
|
|
|
|
+
|
|
|
+ base.OnShown();
|
|
|
+ _ui.m_loaBg.visible = false;
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -125,5 +141,30 @@ namespace GFGGame
|
|
|
GuideController.TryCompleteGuideIndex(ConstGuideId.STUDIO_PROPERTY, 6);
|
|
|
GuideController.TryCompleteGuide(ConstGuideId.STUDIO_PROPERTY, 6);
|
|
|
}
|
|
|
+ protected override void ListItemRender(int index, GObject obj)
|
|
|
+ {
|
|
|
+ UI_PropertyItem item = UI_PropertyItem.Proxy(obj);
|
|
|
+ StudioDataManager.Instance.IsCanFight(storyLevelCfgs, index, out bool canFight, out string content);
|
|
|
+
|
|
|
+ ItemData itemData = StoryBonusDataCache.GetBonusData(storyLevelCfgs[index].id).bonusBase[0];
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
|
|
|
+ item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
+ item.m_star.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(storyLevelCfgs[index].id);
|
|
|
+ item.m_imgLock.visible = canFight ? false : true;
|
|
|
+ item.m_lock.visible = canFight ? false : true;
|
|
|
+ item.m_txtTitle.text = canFight ? storyLevelCfgs[index].name : content;
|
|
|
+ if (canFight) curIndex = index;
|
|
|
+ if (item.m_loaIcon.data == null)
|
|
|
+ {
|
|
|
+ item.m_loaIcon.onClick.Add(OnLoaItemClick);
|
|
|
+ }
|
|
|
+ item.m_loaIcon.data = index;
|
|
|
+ if (item.m_loaBg.data == null)
|
|
|
+ {
|
|
|
+ item.m_loaBg.onClick.Add(OnCliclListItem);
|
|
|
+ }
|
|
|
+ item.m_loaBg.data = index;
|
|
|
+ UI_PropertyItem.ProxyEnd();
|
|
|
+ }
|
|
|
}
|
|
|
}
|