FOOTER_MENU_TYPE ConvertCategoryToFooterMenuType(MAINMENU_CATEGORY category) { FOOTER_MENU_TYPE type = FOOTER_MENU_TYPE.NONE; switch (category) { case MAINMENU_CATEGORY.UNIT: //type = FOOTER_MENU_TYPE.UNITS; break; case MAINMENU_CATEGORY.SHOP: //type = FOOTER_MENU_TYPE.SHOP; break; case MAINMENU_CATEGORY.HOME: type = FOOTER_MENU_TYPE.HOME; break; case MAINMENU_CATEGORY.GACHA: type = FOOTER_MENU_TYPE.SCRATCH; break; case MAINMENU_CATEGORY.QUEST: type = FOOTER_MENU_TYPE.QUEST; break; } return(type); }
public MainMenuFooterButtonModel AddCategory(MAINMENU_CATEGORY category) { if (!m_categories.Contains(category)) { m_categories.Add(category); } return(this); }
public void setupMenuList(MAINMENU_CATEGORY _category) { MenuTitle = _category.ToString(); MasterMenuButtonItem[] masterArray = Resources.LoadAll <MasterMenuButtonItem>("MasterData/MenuButtonItem"); //List<MenuButtonContext> newList = new List<MenuButtonContext>(); Menulist.Clear(); foreach (MasterMenuButtonItem _item in masterArray) { if (_item.categoryType == _category) { MenuButtonContext newContext = new MenuButtonContext(); newContext.Dto = _item; Menulist.Add(newContext); } } //menuList = newList; }
private void UpdateButtonSelected(MAINMENU_CATEGORY category) { bool anyButtonsNotSelected = true; foreach (var eachButton in m_buttons) { eachButton.isSelected = eachButton.IsCategoryOf(category); if (eachButton.isSelected) { anyButtonsNotSelected = false; } } if (anyButtonsNotSelected) { m_buttons[0].isSelected = true; } }
public void setup(MAINMENU_CATEGORY _category) { m_Category = _category; MasterMenuButtonItem[] masterArray = Resources.LoadAll <MasterMenuButtonItem>("MasterData/MenuButtonItem"); TitleImage = ResourceManager.Instance.Load(titleImageNameArray[(int)_category]); List <MasterMenuButtonItem> tmpList = new List <MasterMenuButtonItem>(); foreach (MasterMenuButtonItem _item in masterArray) { if (_item.categoryType != _category) { continue; } #if BUILD_TYPE_DEBUG if (_item.buttonType == MAINMENU_BUTTON.HELP_DEBUG && DebugOption.Instance.disalbeDebugMenu == true) { continue; } #else if (_item.buttonType == MAINMENU_BUTTON.HELP_DEBUG) { continue; } #endif tmpList.Add(_item); } //ソート tmpList.Sort((a, b) => b.sortindex - a.sortindex); ItemList.Clear(); int index = 0; foreach (MasterMenuButtonItem _item in tmpList) { var model = new ListItemModel((uint)index++); FooterSubMenuItem newItem = new FooterSubMenuItem(model); newItem.buttonType = _item.buttonType; newItem.switchSeqType = _item.switchSeqType; newItem.IconImage = ResourceManager.Instance.Load(_item.iconImageName); newItem.TextImage = ResourceManager.Instance.Load(_item.textImageName); newItem.IsViewFlag = false; //強化イベントチェック if (_item.buttonType == MAINMENU_BUTTON.UNIT_BUILDUP && MainMenuParam.m_BlendBuildEventSLV != 0) { newItem.IsViewFlag = true; newItem.FlagImage = ResourceManager.Instance.Load("flag_skill"); switch (MainMenuParam.m_BlendBuildEventSLV) { case GlobalDefine.SLV_EVENT_ID_x0150: newItem.FlagRate = "1.5"; break; case GlobalDefine.SLV_EVENT_ID_x0200: newItem.FlagRate = "2"; break; case GlobalDefine.SLV_EVENT_ID_x0250: newItem.FlagRate = "2.5"; break; case GlobalDefine.SLV_EVENT_ID_x0300: newItem.FlagRate = "3"; break; case GlobalDefine.SLV_EVENT_ID_x0400: newItem.FlagRate = "4"; break; case GlobalDefine.SLV_EVENT_ID_x0500: newItem.FlagRate = "5"; break; case GlobalDefine.SLV_EVENT_ID_x1000: newItem.FlagRate = "10"; break; default: break; } } ItemList.Add(newItem); m_buttons.Add(model); model.OnClicked += () => { OnSelectButton(newItem); }; } #if BUILD_TYPE_DEBUG int debugIndex = 0; //デバッグメニューボタン追加 if (_category == MAINMENU_CATEGORY.SHOP && DebugOption.Instance.disalbeDebugMenu == false) { var model = new ListItemModel((uint)debugIndex++); FooterSubMenuItem newItem = new FooterSubMenuItem(model); newItem.buttonType = MAINMENU_BUTTON.HELP_DEBUG; newItem.switchSeqType = MAINMENU_SEQ.SEQ_DEBUG_MENU; newItem.IconImage = ResourceManager.Instance.Load("btn_zukan"); newItem.TextImage = ResourceManager.Instance.Load("debug"); ItemList.Add(newItem); m_buttons.Add(model); model.OnClicked += () => { if (MainMenuManager.Instance.CheckMenuControlNG() || MainMenuManager.Instance.IsPageSwitch()) { return; } OnSelectButton(newItem); }; } #endif }
public bool IsCategoryOf(MAINMENU_CATEGORY category) { return(m_categories.Contains(category)); }
private void openSubMenu(FOOTER_MENU_TYPE _type, MAINMENU_CATEGORY _category) { if (m_FooterSubMenu != null) { MAINMENU_CATEGORY _prevCategory = m_FooterSubMenu.Category; closeSubMenu(); if (_prevCategory == _category) { return; } } if (m_SubMenuObject == null) { if (_type != FOOTER_MENU_TYPE.UNITS) { m_SubMenuObject = Resources.Load("Prefab/MainMenu/FooterSubMenu") as GameObject; } else { m_SubMenuObject = Resources.Load("Prefab/MainMenu/FooterSubMenuDouble") as GameObject; } if (m_SubMenuObject == null) { return; } } //ユニットのときはスキルアップイベントのチェック if (_category == MAINMENU_CATEGORY.UNIT) { CheckSkillUpEvent(); } GameObject _insObj = Instantiate(m_SubMenuObject); if (_insObj == null) { return; } _insObj.transform.SetParent(ButtonList[(int)_type].transform, false); _insObj.transform.SetParent(subRoot.transform, true); m_FooterSubMenu = _insObj.GetComponent <FooterSubMenu>(); m_FooterSubMenu.setup(_category); m_FooterSubMenu.DidSelectClose = () => { closeSubMenu(); }; m_FooterSubMenu.DidSelectCancel = () => { closeSubMenu(); }; m_FooterSubMenu.Show(); foreach (var eachButton in m_buttons) { eachButton.isSelected = eachButton.IsCategoryOf(_category); } AndroidBackKeyManager.Instance.StackPush(m_FooterSubMenu.gameObject, OnSelectBackKey); }