public AvailableMapsScrollController(AvailableMapsView mapsView)
        {
            this.mapsView = mapsView;

            lastMouse = Mouse.GetState();

            ControllerGroupId = new HashSet <int>();
            Enabled           = true;
        }
Example #2
0
        public SelectMapScreen()
        {
            //MapManager.LoadMap(MapManager.CreateMap(MapManager.Maps[0], Game1.Graphics));
            AvailableMapsView mapsView      = new AvailableMapsView();
            ButtonManager     buttonManager = new ButtonManager();

            // Controllers.
            controllers.Add(new AvailableMapsScrollController(mapsView));
            controllers.Add(new SelectMapController(mapsView, buttonManager));
            controllers.Add(buttonManager);

            // Views.
            views.Add(mapsView);
            views.Add(buttonManager);
        }
Example #3
0
        public SelectMapController(AvailableMapsView mapsView, ButtonManager buttonManager)
        {
            this.mapsView      = mapsView;
            this.buttonManager = buttonManager;

            buttons = new List <Button>();
            for (int i = 0; i < MapManager.TotalLoadedMaps; i++)
            {
                buttons.Add(new Button(Vector2.Zero, mapsView.ThumbnailSize.ToVector2())
                {
                    AttachedObject = i,
                    Visible        = false
                });
                buttons[i].OnClicked += OnButtonClicked;
            }
            buttonManager.AddButtons(buttons);

            ControllerGroupId = new HashSet <int>();
            Enabled           = true;
        }