修改提交shop修改
This commit is contained in:
@@ -19,31 +19,14 @@ namespace NBF
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
InputManager.Instance.On(this);
|
||||
ItemList.List.OnClickItem += OnClickItem;
|
||||
InputManager.OnUICanceled += OnUICanceled;
|
||||
|
||||
List<TabItemData> tabItemList = GoodsConfigHelper.TabItemList;
|
||||
|
||||
ItemList.SetPanel(this);
|
||||
ItemList.SetData(tabItemList, true, true);
|
||||
}
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
{
|
||||
if (!IsTop) return;
|
||||
if (action == InputDef.UI.SubPrev)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.SubNext)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.Up)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.Down)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickItem(object item)
|
||||
{
|
||||
@@ -52,11 +35,69 @@ namespace NBF
|
||||
// ItemDetailsPanel.Show(bagItem.ItemInfo);
|
||||
ShopDetailsPanel.Show(gearItem.Config);
|
||||
}
|
||||
|
||||
|
||||
#region UI事件
|
||||
|
||||
[InputInvoke(InputDef.UI.Prev, UIInputButtonShowMode.MenuLeft)]
|
||||
private void OnPrev()
|
||||
{
|
||||
ItemList.Menu.OnClickBtnPrev();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Next, UIInputButtonShowMode.MenuRight)]
|
||||
private void OnNext()
|
||||
{
|
||||
ItemList.Menu.OnClickBtnNext();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Left, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnLeft()
|
||||
{
|
||||
ItemList.List.Selector.Left();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Right, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnRight()
|
||||
{
|
||||
ItemList.List.Selector.Right();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Up, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnUp()
|
||||
{
|
||||
ItemList.List.Selector.Up();
|
||||
// ChangeListSelected();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Down, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnDown()
|
||||
{
|
||||
ItemList.List.Selector.Down();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Enter, UIInputButtonShowMode.BottomLeft, "查看")]
|
||||
private void OnApplySettings()
|
||||
{
|
||||
var selectedItem = ItemList.List.Selector.SelectedItem;
|
||||
if (selectedItem != null)
|
||||
{
|
||||
ItemList.List.InvokeClickItem(selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[InputInvoke(InputDef.UI.Back, UIInputButtonShowMode.BottomRight)]
|
||||
private void OnBack()
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
InputManager.OnUICanceled -= OnUICanceled;
|
||||
ItemList.List.OnClickItem -= OnClickItem;
|
||||
InputManager.Instance.Off(this);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
|
||||
@@ -10,6 +10,45 @@ namespace NBF
|
||||
protected override void OnShow()
|
||||
{
|
||||
// Model.SetData(ItemInfo);
|
||||
InputManager.Instance.On(this);
|
||||
}
|
||||
|
||||
#region UI输入事件
|
||||
|
||||
[InputInvoke(InputDef.UI.Up, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnUp()
|
||||
{
|
||||
// ItemList.List.Selector.Up();
|
||||
// ChangeListSelected();
|
||||
}
|
||||
|
||||
[InputInvoke(InputDef.UI.Down, UIInputButtonShowMode.BottomLeft)]
|
||||
private void OnDown()
|
||||
{
|
||||
// ItemList.List.Selector.Down();
|
||||
}
|
||||
[InputInvoke(InputDef.UI.Enter, UIInputButtonShowMode.BottomLeft, "购买")]
|
||||
private void OnApplySettings()
|
||||
{
|
||||
// var selectedItem = ItemList.List.Selector.SelectedItem;
|
||||
// if (selectedItem != null)
|
||||
// {
|
||||
// ItemList.List.InvokeClickItem(selectedItem);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
[InputInvoke(InputDef.UI.Back, UIInputButtonShowMode.BottomRight)]
|
||||
private void OnBack()
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
InputManager.Instance.Off(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user