Example #1
0
    protected override void OnViewShow()
    {
        //bind buttons
        for (int idx = 0; idx < m_TabButtonsNames.Length; ++idx)
        {
            int pageIdx = idx;
            RegisterButtonDelegate(m_TabButtonsNames[pageIdx],
                                   () =>
            {
                if (CurrentPageIndex != pageIdx)
                {
                    GotoPage(pageIdx);
                }
            },
                                   null);
        }

        //RegisterButtonDelegate(FREEGOLD_BUTTON, OnFreeGoldTouch, null);

        //setup button callback and text (this may be moved into separate pages if function will different)
        m_BuyButton.RegisterReleaseDelegate(OnBuyButton);
        m_Buy_Premium_Button.RegisterReleaseDelegate(OnBuyPremiumButton);

        //set label (this may be updated by page)
        m_Buy_Button_Label.SetNewText(2030020);         //buy text

        m_ShopScroller.InitGui();
        m_ShopScroller.RegisterOnSelectionDelegate(OnSelectionChange);

        m_ShopScroller.Show();

        //Flurry.logEvent(AnalyticsTag.Shop, true);

        base.OnViewShow();
    }
Example #2
0
    public void InitGui()
    {
        GUIBase_Pivot pivot = MFGuiManager.Instance.GetPivot("EquipMenu");

        m_Layout       = pivot.GetLayout("Main_Layout");
        m_Equip_Button = GuiBaseUtils.RegisterButtonDelegate(m_Layout, "Equip_Button", null, OnEquipButton);
        m_Equip_Label  = GuiBaseUtils.PrepareLabel(m_Layout, "Equip_Label");

        m_Buy_Button = GuiBaseUtils.RegisterButtonDelegate(m_Layout, "Buy_Button", null, OnBuyButton);
        m_Cost       = new GuiShopFunds(GuiBaseUtils.PrepareSprite(m_Layout, "Cost_Sprite"));

        m_ItemScroller.InitGui();
        m_ItemScroller.RegisterOnSelectionDelegate(OnSelectionChange);

        m_IsInitialized = true;
    }