void OnChooseSelectFood() { if (RestaurantController.Instance() == null) { return; } if (curSelectFoodItem == null) { MessageBoxLogic.OpenOKBox(3049, 1000); return; } Tab_RestaurantFood curTabFood = TableManager.GetRestaurantFoodByID(curSelectFoodItem.FoodID, 0); if (null == curTabFood) { LogModule.ErrorLog("cur food id is not defined in table"); return; } if (curTabFood.OpenLevel > RestaurantController.Instance().CurRestaurant().m_RestaurantLevel) { // 此菜品将在等级{0}开启 MessageBoxLogic.OpenOKBox(StrDictionary.GetClientDictionaryString("#{1989}", curTabFood.OpenLevel)); return; } RestaurantController.Instance().OnChooseFoodFinish(curSelectFoodItem.FoodID); curSelectFoodItem = null; }
public void OnFoodItemClick(RestaurantFoodItem curItem) { curSelectFoodItem = curItem; for (int i = 0; i < m_FoodItemSelectBG.Length; i++) { m_FoodItemSelectBG[i].SetActive(false); } if (curItem.Index < m_FoodItemSelectBG.Length) { m_FoodItemSelectBG[curItem.Index].SetActive(true); } OnChooseSelectFood(); }
void OnCloseClick() { if (m_FoodList != null) { m_FoodList.Clear(); } curSelectFoodItem = null; for (int i = 0; i < m_FoodItemSelectBG.Length; i++) { m_FoodItemSelectBG[i].SetActive(false); } RestaurantController.Instance().CloseFoodWindow(); }
void UpdateFood() { if (null == m_FoodListGrid) { LogModule.ErrorLog("m_FoodListGrid is null"); return; } for (int i = 0; i < PageFoodMax && i < m_FoodItemWindow.Length; i++) { m_FoodItemWindow[i].Clear(); } int nBeginIndex = m_nCurPage * PageFoodMax; for (int i = 0; i < PageFoodMax && i < m_FoodItemWindow.Length; i++) { int nIndex = nBeginIndex + i; if (nIndex < m_FoodList.Count) { Tab_RestaurantFood oFood = m_FoodList[nIndex]; m_FoodItemWindow[i].SetData(this, oFood); m_FoodItemWindow[i].Index = i; } } m_FoodListGrid.Reposition(); if (m_PageLable != null) { m_PageLable.text = (m_nCurPage + 1).ToString() + "/" + m_nMaxPageNum.ToString(); } curSelectFoodItem = null; for (int i = 0; i < m_FoodItemSelectBG.Length; i++) { m_FoodItemSelectBG[i].SetActive(false); } for (int i = 0; i < m_FoodItemBG.Length; i++) { m_FoodItemBG[i].SetActive(true); } for (int i = 0; i < m_FoodItemWindow.Length && i < m_FoodList.Count; i++) { Tab_RestaurantFood oFood = m_FoodList[i]; if (oFood != null && RestaurantData.m_PlayerRestaurantInfo != null) { if (oFood.OpenLevel <= RestaurantData.m_PlayerRestaurantInfo.m_RestaurantLevel) { m_FoodItemWindow[i].OnItemClick(); break; } } } }