public PurchaseCompleteState(Window guiWindow, Hangout.Shared.Action backToStoreSelector)
     : base(guiWindow)
 {
     mPurchaseCompleteFrame = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/PurchaseCompleteFrame");
     mOkButton = GuiWindow.SelectSingleElement <Button>("MainFrame/PurchaseCompleteFrame/OkButton");
     mOkButton.AddOnPressedAction(delegate()
     {
         backToStoreSelector();
     });
 }
Beispiel #2
0
        public StoreSelectionState(Window guiWindow, Action <string> openStore, Hangout.Shared.Action closeInventoryGui)
            : base(guiWindow)
        {
            mOpenStore = openStore;

            mStoreSelectorFrame = guiWindow.SelectSingleElement <GuiFrame>("MainFrame/StoreSelector");
            mCategorySideBar    = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/CategorySideBarFrame");
            mStoreSelectorGrid  = guiWindow.SelectSingleElement <GridView>("MainFrame/StoreSelector/StoreSelectorGrid");
            //mShopLabel = guiWindow.SelectSingleElement<Label>("MainFrame/StoreSelector/ShopLabel");
            mStoreButton = GuiWindow.SelectSingleElement <Button>("MainFrame/StoreSelector/StoreSelectorGrid/StoreButton");
            mStoreSelectorGrid.RemoveChildWidget(mStoreButton);
            mCloseInventoryGuiButton = guiWindow.SelectSingleElement <Button>("MainFrame/StoreSelector/CancelButton");
            //mCloseInventoryGui = closeInventoryGui;
            mCloseInventoryGuiButton.AddOnPressedAction(closeInventoryGui);
        }
        public StoreDisplayState(Window guiWindow, Window overlayWindow, Hangout.Shared.Action closeInventoryGui)
            : base(guiWindow)
        {
            mCloseInventoryGui = closeInventoryGui;


            mItemDisplayFrame = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/ItemDisplayFrame");

            // Item grid display
            mItemDisplayGrid     = GuiWindow.SelectSingleElement <GridView>("MainFrame/ItemDisplayFrame/ItemDisplayGrid");
            mItemGridButtonFrame = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/ItemDisplayFrame/ItemDisplayGrid/GridButtonFrame");

            // Item Info Detail Panel
            mItemInfoFrame             = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/ItemDisplayFrame/InfoFrame");
            mItemInfoTitleLabel        = mItemInfoFrame.SelectSingleElement <Label>("DescriptionScrollFrame/TitleLabel");
            mItemInfoExpirationLabel   = mItemInfoFrame.SelectSingleElement <Label>("ExpirationLabel");
            mItemInfoDescriptionLabel  = mItemInfoFrame.SelectSingleElement <Label>("DescriptionScrollFrame/DescriptionLabel");
            mItemInfoNumAvailableLabel = mItemInfoFrame.SelectSingleElement <Label>("NumAvailableLabel");

            // Tab Sidebar
            mCategorySideBar = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/CategorySideBarFrame");

            // Close button
            mCloseInventoryGuiButton = GuiWindow.SelectSingleElement <Button>("MainFrame/ItemDisplayFrame/CloseInventoryButton");
            mCloseInventoryGuiButton.AddOnPressedAction(delegate()
            {
                mCloseInventoryGui();
            });


            // Item Info Overlay
            mOverlayWindow = overlayWindow;
            GuiFrame overlayFrame = mOverlayWindow.SelectSingleElement <GuiFrame>("MainFrame/OverlayFrame");

            mItemOverlayActionButton = overlayFrame.SelectSingleElement <Button>("GridButtonTopBar/Action");
            mItemOverlayPrice        = overlayFrame.SelectSingleElement <Label>("GridButtonTopBar/PriceFrame/Price");
            mItemOverlayCoinIcon     = overlayFrame.SelectSingleElement <Image>("GridButtonTopBar/PriceFrame/CoinIcon");
            mItemOverlayCashIcon     = overlayFrame.SelectSingleElement <Image>("GridButtonTopBar/PriceFrame/CashIcon");
            //mItemOverlayOwnedImage = overlayFrame.SelectSingleElement<Image>("Owned");
            mItemOverlayImage  = overlayFrame.SelectSingleElement <Image>("Image");
            mRemoveButton      = overlayFrame.SelectSingleElement <Button>("RemoveButton");
            mRemoveButton.Text = Translation.REMOVEIT;

            mRealMoneyIcon    = (Texture)Resources.Load(InventoryGlobals.CashIconPath);
            mGameCurrencyIcon = (Texture)Resources.Load(InventoryGlobals.CoinIconPath);

            mItemOverlayActionButton.Text = Translation.PURCHASE;

            mOverlayWindow.Showing = false;

            // Page forward/back panel
            mPaginationFrame    = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/ItemDisplayFrame/PaginationFrame");
            mNextPageButton     = GuiWindow.SelectSingleElement <Button>("MainFrame/ItemDisplayFrame/PaginationFrame/PaginationControlFrame/NextPageButton");
            mPreviousPageButton = GuiWindow.SelectSingleElement <Button>("MainFrame/ItemDisplayFrame/PaginationFrame/PaginationControlFrame/PreviousPageButton");
            mPaginationLabel    = GuiWindow.SelectSingleElement <Label>("MainFrame/ItemDisplayFrame/PaginationFrame/PaginationControlFrame/PaginationLabel");
            mNextPageButton.AddOnPressedAction(delegate()
            {
                NextPage();
            });
            mPreviousPageButton.AddOnPressedAction(delegate()
            {
                PreviousPage();
            });
            mLastPageButton  = GuiWindow.SelectSingleElement <Button>("MainFrame/ItemDisplayFrame/PaginationFrame/PaginationControlFrame/LastPageButton");
            mFirstPageButton = GuiWindow.SelectSingleElement <Button>("MainFrame/ItemDisplayFrame/PaginationFrame/PaginationControlFrame/FirstPageButton");
            mLastPageButton.Disable();
            mLastPageButton.AddOnPressedAction(delegate()
            {
                LastPage();
            });
            mFirstPageButton.Disable();
            mFirstPageButton.AddOnPressedAction(delegate()
            {
                FirstPage();
            });

            //          mBackToStoreSelectorButton = GuiWindow.SelectSingleElement<Button>("MainFrame/ItemDisplayFrame/PaginationFrame/BackToStoreSelectorButton");
            //          mBackToStoreSelectorButton.AddOnPressedAction(delegate()
            //                                                          {
            //                                                              mBackToStoreSelectorCallback();
            //                                                          });
            mItemDisplayGrid.RemoveChildWidget(mItemGridButtonFrame);
        }
Beispiel #4
0
        public PlayerInventoryState(Window guiWindow, Window overlayWindow, Hangout.Shared.Action closeInventoryGui, Hangout.Shared.Action backToStoreSelectorCallback)
            : base(guiWindow)
        {
            mCloseInventoryGui = closeInventoryGui;
            //mBackToStoreSelectorCallback = backToStoreSelectorCallback;

            mPlayerInventoryFrame = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/PlayerInventoryFrame");
            mItemDisplayGrid      = GuiWindow.SelectSingleElement <GridView>("MainFrame/PlayerInventoryFrame/ItemDisplayGrid");
            // Item Info Detail Panel
            mItemInfoFrame      = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/PlayerInventoryFrame/InfoFrame");
            mItemInfoTitleLabel = mItemInfoFrame.SelectSingleElement <Label>("DescriptionScrollFrame/TitleLabel");
            //mItemInfoExpirationLabel = mItemInfoFrame.SelectSingleElement<Label>("ExpirationLabel");
            mItemInfoDescriptionLabel = mItemInfoFrame.SelectSingleElement <Label>("DescriptionScrollFrame/DescriptionLabel");
            //mItemInfoNumAvailableLabel = mItemInfoFrame.SelectSingleElement<Label>("NumAvailableLabel");

            mCategorySideBar = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/CategorySideBarFrame");

            mItemGridButtonFrame     = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/PlayerInventoryFrame/ItemDisplayGrid/GridButtonFrame");
            mCloseInventoryGuiButton = GuiWindow.SelectSingleElement <Button>("MainFrame/PlayerInventoryFrame/CloseInventoryGuiButton");
            mCloseInventoryGuiButton.AddOnPressedAction(delegate()
            {
                mCloseInventoryGui();
            });

            // Item Info Overlay
            mOverlayWindow = overlayWindow;
            GuiFrame overlayFrame = mOverlayWindow.SelectSingleElement <GuiFrame>("MainFrame/OverlayFrame");

            mOverlayRemoveButton    = overlayFrame.SelectSingleElement <Button>("Action");
            mItemOverlayImage       = overlayFrame.SelectSingleElement <Image>("Image");
            mItemOverlayCloseButton = overlayFrame.SelectSingleElement <Button>("CloseButton");
            mItemOverlayCloseButton.AddOnPressedAction(delegate()
            {
                mOverlayWindow.Showing = false;
            });
            mPaginationFrame    = GuiWindow.SelectSingleElement <GuiFrame>("MainFrame/PlayerInventoryFrame/PaginationFrame");
            mNextPageButton     = GuiWindow.SelectSingleElement <Button>("MainFrame/PlayerInventoryFrame/PaginationFrame/PaginationControlFrame/NextPageButton");
            mPreviousPageButton = GuiWindow.SelectSingleElement <Button>("MainFrame/PlayerInventoryFrame/PaginationFrame/PaginationControlFrame/PreviousPageButton");
            mPaginationLabel    = GuiWindow.SelectSingleElement <Label>("MainFrame/PlayerInventoryFrame/PaginationFrame/PaginationControlFrame/PaginationLabel");
            mNextPageButton.AddOnPressedAction(delegate()
            {
                NextPage();
            });
            mPreviousPageButton.AddOnPressedAction(delegate()
            {
                PreviousPage();
            });
            mLastPageButton  = GuiWindow.SelectSingleElement <Button>("MainFrame/PlayerInventoryFrame/PaginationFrame/PaginationControlFrame/LastPageButton");
            mFirstPageButton = GuiWindow.SelectSingleElement <Button>("MainFrame/PlayerInventoryFrame/PaginationFrame/PaginationControlFrame/FirstPageButton");
            mLastPageButton.Disable();
            mLastPageButton.AddOnPressedAction(delegate()
            {
                LastPage();
            });
            mFirstPageButton.Disable();
            mFirstPageButton.AddOnPressedAction(delegate()
            {
                FirstPage();
            });
            mItemDisplayGrid.RemoveChildWidget(mItemGridButtonFrame);

            //mTitleLabel = mItemInfoFrame.SelectSingleElement<Label>("TitleLabel");

            mOverlayWindow.Showing = false;
            mItemInfoFrame.Showing = false;
        }