private void SetDispositionListViewData() { //根据该英雄本地是否有修改过配置ID显示不同子界面 int nHeroID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION); int DispositionID = -1; bool bShowSubView01 = true; if (nHeroID > 0) { PlayerLocalHeroConfig.Instance.GetIntData(ELocalHero.ELH_GoodsDispositionID, nHeroID, out DispositionID); } //增加物品推荐配置列表数据 UWarGoodsStoreDispositionItem disposition = null; DispositionListView.DataSource = new ObservableList <string>(); DispositionListView.DataSource.BeginUpdate(); for (int i = 0; i < WarMobaGoodsDataManager.Instance.HeroDispositionList.Count; ++i) { disposition = WarMobaGoodsDataManager.Instance.HeroDispositionList[i]; string item = disposition.DispositionName + disposition.DispositionTitle; if (disposition.DispositionID == DispositionID) { DispositionIndex = i; } DispositionListView.DataSource.Add(item); } DispositionListView.DataSource.EndUpdate(); DispositionListView.OnSelectString.AddListener(OnDispositionSelect); //处理子界面显示 bShowSubView01 = (DispositionID <= 0); SwitchSubView(bShowSubView01); if (bShowSubView01) { DispositionListView.Select(0); } else { string str = ULocalizationService.Instance.Get("UIView", "GoodsDispositionView", "GoodsDispositionView") + DispositionListView.DataSource[DispositionIndex]; DispositionNameTxt.text = str; } TimerManager.SetTimer(this, 0, 1, 10); m_wnd.SetVisible(true); }
public void SetData(UWarGoodsStoreDispositionItem _item) { DispositionNameTxt.text = _item.DispositionName; }