Example #1
0
            public Screen(PackagePickingScreen proxy)
                : base(proxy)
            {
                this.proxy = proxy;

                Game.UI.LoadLayoutToElement(MenuUIManager.MenuRoot, Game.ResourceCache, "UI/PackagePickingLayout.xml");

                window         = (Window)MenuUIManager.MenuRoot.GetChild("PackagePickingWindow");
                window.Visible = false;

                listView = (ListView)window.GetChild("ListView");

                addButton           = (Button)window.GetChild("AddButton", true);
                addButton.Released += AddButtonReleased;

                removeButton           = (Button)window.GetChild("RemoveButton", true);
                removeButton.Released += RemoveButtonReleased;
                removeButton.Enabled   = false;

                selectButton           = (Button)window.GetChild("SelectButton", true);
                selectButton.Released += SelectButtonReleased;
                selectButton.Enabled   = false;


                backButton           = (Button)window.GetChild("BackButton", true);
                backButton.Released += BackButtonReleased;

                foreach (var pack in Game.PackageManager.AvailablePacks)
                {
                    AddItem(pack);
                }

                window.Visible = true;
            }
Example #2
0
        protected MenuUIManager(IMenuController menuController)
        {
            MenuRoot = UI.Root;
            MenuRoot.SetDefaultStyle(Game.PackageManager.GetXmlFile("UI/MainMenuStyle.xml", true));

            this.MenuController = menuController;

            MainMenu             = new MainMenu(this);
            OptionsScreen        = new OptionsScreen(this);
            PauseMenu            = new PauseMenu(this);
            LoadingScreen        = new LoadingScreen(this);
            SaveGameScreen       = new SaveGameScreen(this);
            LoadGameScreen       = new LoadGameScreen(this);
            PackagePickingScreen = new PackagePickingScreen(this);
            LevelPickingScreen   = new LevelPickingScreen(this);
            LevelSettingsScreen  = new LevelSettingsScreen(this);
            LevelCreationScreen  = new LevelCreationScreen(this);
            SaveAsScreen         = new SaveAsScreen(this);
            EndScreen            = new EndScreen(this);
            AboutScreen          = new AboutScreen(this);
            FileBrowsingPopUp    = new FileSystemBrowsingPopUp(this);
            ConfirmationPopUp    = new ConfirmationPopUp(this);
            ErrorPopUp           = new ErrorPopUp(this);

            PreviousScreens = new Stack <MenuScreen>();
        }