/// <summary> /// /// </summary> /// <param name="resObj"></param> /// <param name="param"></param> void OnLoadShopSwordsMan(GameObject resObj, object param) { if (null == m_ShopSwordsManGrid) { LogModule.ErrorLog("OnLoadShopSwordsMan::m_ShopSwordsManGrid is null"); return; } if (null == m_DaXiaListPriority) { LogModule.ErrorLog("OnLoadShopSwordsMan::m_DaXiaListPriority is null"); return; } if (null == m_JuXiaListPriority) { LogModule.ErrorLog("OnLoadShopSwordsMan::m_JuXiaListPriority is null"); return; } Utils.CleanGrid(m_ShopSwordsManGrid.gameObject); if (m_CurTabPage == TAB_PAGE.TAB_PAGE_DAXIA) { for (int i = 0; i < m_DaXiaListPriority.Count; i++) { Tab_SwordsManScoreShop ShopSwordsManTable = TableManager.GetSwordsManScoreShopByID(m_DaXiaListPriority[i].GoodsId, 0); if (null == ShopSwordsManTable) { LogModule.ErrorLog("OnLoadShopSwordsMan::ShopSwordsManTable is null"); continue; } SwordsManShopItem oShopSwordsManItem = SwordsManShopItem.CreateItem(m_ShopSwordsManGrid, resObj, this); if (null == oShopSwordsManItem) { LogModule.ErrorLog("OnLoadShopSwordsMan::oShopSwordsManItem is null"); continue; } oShopSwordsManItem.SetShopSwordsMan(ShopSwordsManTable); } } else if (m_CurTabPage == TAB_PAGE.TAB_PAGE_JUXIA) { for (int i = 0; i < m_JuXiaListPriority.Count; i++) { Tab_SwordsManScoreShop ShopSwordsManTable = TableManager.GetSwordsManScoreShopByID(m_JuXiaListPriority[i].GoodsId, 0); if (null == ShopSwordsManTable) { LogModule.ErrorLog("OnLoadShopSwordsMan::ShopSwordsManTable is null"); continue; } SwordsManShopItem oShopSwordsManItem = SwordsManShopItem.CreateItem(m_ShopSwordsManGrid, resObj, this); if (null == oShopSwordsManItem) { LogModule.ErrorLog("OnLoadShopSwordsMan::oShopSwordsManItem is null"); continue; } oShopSwordsManItem.SetShopSwordsMan(ShopSwordsManTable); } } m_ShopSwordsManGrid.GetComponent <UIGrid>().repositionNow = true; m_ShopSwordsManGrid.GetComponent <UITopGrid>().recenterTopNow = true; }
void FliterSortShopItem() { if (m_DaXiaListPriority != null && m_DaXiaListPriority.Count <= 0) { Dictionary <int, List <Tab_SwordsManAttr> > allitemList = TableManager.GetSwordsManAttr(); Dictionary <int, List <Tab_SwordsManScoreShop> > ShopitemList = TableManager.GetSwordsManScoreShop(); for (int i = 0; i < allitemList.Count; i++) { if (false == ShopitemList.ContainsKey(i)) { continue; } Tab_SwordsManScoreShop ShopSwordsManTable = ShopitemList[i][0]; if (null == ShopSwordsManTable) { LogModule.ErrorLog("FliterSortShopItem::ShopSwordsManTable is null"); continue; } if (ShopSwordsManTable.Page != (int)TAB_PAGE.TAB_PAGE_DAXIA) { continue; } m_DaXiaListPriority.Add(new PriorityInfo((short)ShopSwordsManTable.Id, (short)ShopSwordsManTable.ShowPirority)); } m_DaXiaListPriority.Sort(new PriorityInfoCompare()); } if (m_JuXiaListPriority != null && m_JuXiaListPriority.Count <= 0) { Dictionary <int, List <Tab_SwordsManAttr> > allitemList = TableManager.GetSwordsManAttr(); Dictionary <int, List <Tab_SwordsManScoreShop> > ShopitemList = TableManager.GetSwordsManScoreShop(); for (int i = 0; i < allitemList.Count; i++) { if (false == ShopitemList.ContainsKey(i)) { continue; } Tab_SwordsManScoreShop ShopSwordsManTable = ShopitemList[i][0]; if (null == ShopSwordsManTable) { LogModule.ErrorLog("FliterSortShopItem::ShopSwordsManTable is null"); continue; } if (ShopSwordsManTable.Page != (int)TAB_PAGE.TAB_PAGE_JUXIA) { continue; } m_JuXiaListPriority.Add(new PriorityInfo((short)ShopSwordsManTable.Id, (short)ShopSwordsManTable.ShowPirority)); } m_JuXiaListPriority.Sort(new PriorityInfoCompare()); } }
/// <summary> /// /// </summary> /// <param name="ShopSwordsManTable"></param> public void SetShopSwordsMan(Tab_SwordsManScoreShop ShopSwordsManTable) { if (null == ShopSwordsManTable) { LogModule.ErrorLog("SetShopSwordsManShop::ShopSwordsManTable is null"); return; } Tab_SwordsManAttr SwordsManAttrTable = TableManager.GetSwordsManAttrByID(ShopSwordsManTable.Id, 0); if (null == SwordsManAttrTable) { LogModule.ErrorLog("m_SwordsManAttrTable::SwordsManAttrTable is null"); return; } m_SwordsManDataID = SwordsManAttrTable.Id; m_nPrice = ShopSwordsManTable.ScorePrice; m_strName = SwordsManAttrTable.Name; if (m_LableName != null) { m_LableName.text = SwordsManAttrTable.Name; } if (m_LabelDesc != null) { m_LabelDesc.text = SwordsManAttrTable.Tips; } if (m_LabelPrice != null) { if (GameManager.gameManager.PlayerDataPool != null && GameManager.gameManager.PlayerDataPool.SwordsManScore >= m_nPrice) { m_LabelPrice.text = ShopSwordsManTable.ScorePrice.ToString(); } else { m_LabelPrice.text = "[ff0000]" + ShopSwordsManTable.ScorePrice.ToString(); } } if (m_IconSprite != null) { m_IconSprite.spriteName = SwordsManAttrTable.Icon; } if (m_QualitySprite != null) { m_QualitySprite.spriteName = SwordsMan.GetQualitySpriteName((SwordsMan.SWORDSMANQUALITY)SwordsManAttrTable.Quality); } if (m_HightLightBkSprite != null) { m_HightLightBkSprite.SetActive(false); } }