Пример #1
0
    /// <summary>
    /// 设置面板模式
    /// </summary>
    /// <param name="mode"></param>
    private void SetConsignmentMode(ConsignmentPanelPageEnum mode, ConsignmentItemMode topTab = ConsignmentItemMode.Buy)
    {
//         if (m_em_mode == mode && m_saleUIToggle == topTab)
//         {
//             return;
//         }
        m_em_mode = mode;
        bool value = mode == ConsignmentPanelPageEnum.Page_Coin;

        m_trans_CurrencyContent.gameObject.SetActive(value);
        m_trans_ItemContent.gameObject.SetActive(!value);
        UITabGrid tab         = null;
        int       topTabIndex = (int)topTab - 1;

        if (value)
        {
            tab = tabCreator.GetGrid <UITabGrid>(topTabIndex);
        }
        else
        {
            tab = m_ctor_Toggles.GetGrid <UITabGrid>(topTabIndex);
        }
        if (tab != null)
        {
            tab.gameObject.SendMessage("OnClick", tab.gameObject, UnityEngine.SendMessageOptions.RequireReceiver);
        }
    }
Пример #2
0
 void ResetArrow(ConsignmentItemMode type)
 {
     if (type == ConsignmentItemMode.Buy)
     {
         m_sprite_sellspr.transform.localEulerAngles = new Vector3(0, 0, 0);
         m_sprite_buyspr.transform.localEulerAngles  = new Vector3(0, 0, -180);
     }
     else if (type == ConsignmentItemMode.Sell)
     {
         m_sprite_sellspr.transform.localEulerAngles = new Vector3(0, 0, -180);
         m_sprite_buyspr.transform.localEulerAngles  = new Vector3(0, 0, 0);
     }
 }
Пример #3
0
 void ShowUIByToggle(ConsignmentItemMode type)
 {
     m_ctor_SellItemPriceList.SetVisible(false);
     m_saleUIToggle = type;
     if (type == ConsignmentItemMode.Buy)
     {
         m_trans_CommonContent.gameObject.SetActive(true);
         m_trans_BuyMoneyContent.gameObject.SetActive(true);
         m_trans_SellMoneyContent.gameObject.SetActive(false);
         m_trans_AccountContent.gameObject.SetActive(false);
         ResetArrow(type);
         InitText();
         if (mSecondTabCreator != null)
         {
             UICtrTypeGrid grid = mSecondTabCreator.GetGrid <UICtrTypeGrid>(0);
             if (grid != null)
             {
                 grid.SetName("我的关注");
             }
         }
     }
     else if (type == ConsignmentItemMode.Sell)
     {
         m_trans_CommonContent.gameObject.SetActive(true);
         m_trans_BuyMoneyContent.gameObject.SetActive(false);
         m_trans_SellMoneyContent.gameObject.SetActive(true);
         m_trans_AccountContent.gameObject.SetActive(false);
         ResetArrow(type);
         InitText();
     }
     else if (type == ConsignmentItemMode.Account)
     {
         m_trans_CommonContent.gameObject.SetActive(false);
         m_trans_BuyMoneyContent.gameObject.SetActive(false);
         m_trans_SellMoneyContent.gameObject.SetActive(false);
         m_trans_AccountContent.gameObject.SetActive(true);
     }
     else if (type == ConsignmentItemMode.ShowItem)
     {
         if (mSecondTabCreator != null)
         {
             UICtrTypeGrid grid = mSecondTabCreator.GetGrid <UICtrTypeGrid>(0);
             if (grid != null)
             {
                 grid.SetName("所有公示");
             }
         }
     }
 }
Пример #4
0
    void SetLeftTopTabModel(UITabGrid tab)
    {
        ConsignmentItemMode type = (ConsignmentItemMode)tab.Data;

        if (m_em_mode == ConsignmentPanelPageEnum.Page_Item)
        {
            SetConsignmentItemMode(type);
            OnClickItemPageTab(type);
        }
        else if (m_em_mode == ConsignmentPanelPageEnum.Page_Coin)
        {
            if (type == ConsignmentItemMode.Buy)
            {
                onClick_BuyMoney_Btn();
            }
            else if (type == ConsignmentItemMode.Sell)
            {
                onClick_SellMoney_Btn();
            }
            else if (type == ConsignmentItemMode.ShowItem)
            {
                onClick_ShowItem_Btn();
            }
            else
            {
                onClick_Account_Btn();
            }
        }
        if (previous == null)
        {
            previous = tab;
        }
        else
        {
            previous.SetHightLight(false);
        }
        if (tab != null)
        {
            tab.SetHightLight(true);
            previous = tab;
        }
    }
Пример #5
0
 void OnClickItemPageTab(ConsignmentItemMode mode)
 {
     ShowUIByToggle(mode);
 }
Пример #6
0
    protected override void OnJump(UIPanelBase.PanelJumpData jumpData)
    {
        base.OnJump(jumpData);
        if (null == jumpData)
        {
            jumpData = new PanelJumpData();
        }
        int firstTabData = -1;

        int secondTabData = -1;

        if (null != jumpData.Tabs && jumpData.Tabs.Length > 0)
        {
            firstTabData = jumpData.Tabs[0];
            if (jumpData.Tabs.Length > 1)
            {
                m_saleUIToggle = (ConsignmentItemMode)jumpData.Tabs[1];
            }
        }
        else
        {
            firstTabData = 1;
        }
        UIFrameManager.Instance.OnCilckTogglePanel(this.PanelId, 1, firstTabData);
        if (jumpData.Param is uint && m_saleUIToggle == ConsignmentItemMode.Buy)
        {
            uint itemID = (uint)jumpData.Param;
            ConsignmentCanSellItem table     = GameTableManager.Instance.GetTableItem <ConsignmentCanSellItem>(itemID);
            ItemDataBase           itemTable = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemID);
            if (table != null)
            {
                uint m_firstType  = table.FirstType;
                uint m_secondType = table.SecondTyoe;
                if (m_firstType != 0 && m_secondType != 0)
                {
                    SetSelectFirstType(m_firstType, true);
                    SetSelectSecondType(m_secondType, true);
                    mSecondTabCreator.FocusData(mlstFirstTabIds.IndexOf(m_firstType), m_uintDic[m_firstType].IndexOf(m_secondType));
                    ReturnBackUIMsg data = new ReturnBackUIMsg();
                    if (itemTable != null)
                    {
                        data.param = itemTable.itemName;
                        DataManager.Manager <UIPanelManager>().SendMsg(PanelID.ConsignmentPanel, UIMsgID.eShowUI, data);
                    }
                }
                else
                {
                    Engine.Utility.Log.Error("寄售表格中的物品ID为{0}的大类ID或小类ID有误", itemID);
                }
            }
        }
        else if (jumpData.Param is uint && m_saleUIToggle == ConsignmentItemMode.Sell && canConsignItemList.Count > 0)
        {
            int index = 0;
            for (int i = 0; i < canConsignItemList.Count; i++)
            {
                if (canConsignItemList[i] == (uint)jumpData.Param)
                {
                    index = i;
                }
            }
            UIItemGrid itemGrid = m_ctor_ItemGridScrollView.GetGrid <UIItemGrid>(index);
            if (itemGrid != null)
            {
                SetSelectSellItem(itemGrid);
            }
        }
    }