public ActionResult Edit(int id)
        {
            ScreenComponent ScreenComponentEdit = context.ScreenComponent.FirstOrDefault(s => s.ID == id);

            IEnumerable <Screen> screen = context.Screens.ToList();

            ViewBag.screenList = screen;

            IEnumerable <InputType> inputTypes = context.InputTypes.ToList();

            ViewBag.inputTypesList = inputTypes;

            IEnumerable <FieldType> fieldTypes = context.FieldTypes.ToList();

            ViewBag.fieldTypesList = fieldTypes;

            IEnumerable <ScreenComponent> screenComponentList1 = context.ScreenComponent.Where(e => e.FieldTypeID == 1);

            ViewBag.screenComponentList1 = screenComponentList1;

            IEnumerable <ScreenComponent> screenComponentList2 = context.ScreenComponent.Where(e => e.FieldTypeID == 2 || e.FieldTypeID == 3 || e.FieldTypeID == 4 || e.FieldTypeID == 5);

            ViewBag.screenComponentList2 = screenComponentList2;

            return(View(ScreenComponentEdit));
        }
Beispiel #2
0
        public NetworkScreen(ScreenComponent manager) : base(manager, new Point(400, 300))
        {
            Controls.Add(new Panel(manager)
            {
                Position = new Rectangle(20, 20, 360, 40)
            });
            Controls.Add(new Label(manager)
            {
                Text = "Netzwerk", Position = new Rectangle(40, 30, 0, 0)
            });
            Controls.Add(menu = new MenuList(manager)
            {
                Position = new Rectangle(20, 70, 360, 200)
            });

            if (manager.Game.Server.ServerFeatureAvailable)
            {
                menu.Items.Add(serverItem);
            }
            if (manager.Game.Client.ClientFeatureAvailable)
            {
                menu.Items.Add(clientItem);
            }
            menu.Items.Add(cancelItem);

            menu.SelectedItem = menu.Items.First();

            menu.OnInteract += OnInteract;
        }
Beispiel #3
0
        public ServerScreen(ScreenComponent manager)
            : base(manager, new Point(400, 300))
        {
            Controls.Add(new Panel(manager)
            {
                Position = new Rectangle(20, 20, 360, 40)
            });
            Controls.Add(new Label(manager)
            {
                Text = "Server", Position = new Rectangle(40, 30, 0, 0)
            });
            Controls.Add(new LoadingIcon(manager)
            {
                Position = new Rectangle(330, 30, 32, 24)
            });

            Controls.Add(counter = new Label(manager)
            {
                Position = new Rectangle(40, 80, 0, 0)
            });

            DialogButtons buttons = new DialogButtons(manager)
            {
                Position = new Rectangle(20, 300 - 70, 360, 50)
            };

            buttons.Items.Add(cancelItem);
            buttons.Items.Add(startItem);
            Controls.Add(buttons);

            buttons.SelectedItem = cancelItem;

            buttons.OnInteract += OnInteract;
        }
Beispiel #4
0
        public GameScreen(ScreenComponent manager) : base(manager)
        {
            DefaultMouseMode = MouseMode.Captured;

            Manager = manager;
            Padding = Border.All(0);

            scene = new SceneControl(manager);
            scene.HorizontalAlignment = HorizontalAlignment.Stretch;
            scene.VerticalAlignment   = VerticalAlignment.Stretch;
            Controls.Add(scene);

            debug = new DebugControl(manager);
            debug.HorizontalAlignment = HorizontalAlignment.Stretch;
            debug.VerticalAlignment   = VerticalAlignment.Stretch;
            Controls.Add(debug);

            compass = new CompassControl(manager);
            compass.HorizontalAlignment = HorizontalAlignment.Center;
            compass.VerticalAlignment   = VerticalAlignment.Top;
            compass.Width  = 300;
            compass.Height = 30;
            Controls.Add(compass);

            toolbar = new ToolbarControl(manager);
            toolbar.HorizontalAlignment = HorizontalAlignment.Stretch;
            toolbar.VerticalAlignment   = VerticalAlignment.Bottom;
            toolbar.Height = 100;
            Controls.Add(toolbar);

            minimap = new MinimapControl(manager, scene);
            minimap.HorizontalAlignment = HorizontalAlignment.Right;
            minimap.VerticalAlignment   = VerticalAlignment.Bottom;
            minimap.Width  = 128;
            minimap.Height = 128;
            minimap.Margin = Border.All(5);
            Controls.Add(minimap);

            crosshair = new CrosshairControl(manager);
            crosshair.HorizontalAlignment = HorizontalAlignment.Center;
            crosshair.VerticalAlignment   = VerticalAlignment.Center;
            crosshair.Width  = 8;
            crosshair.Height = 8;
            Controls.Add(crosshair);

            Title = "Game";

            //Register Action
            manager.Game.KeyMapper.AddAction("octoawesome:forward", type =>
            {
                if (type == KeyMapper.KeyType.Down)
                {
                    pressedMoveUp = true;
                }
                else if (type == KeyMapper.KeyType.Up)
                {
                    pressedMoveUp = false;
                }
            });
        }
Beispiel #5
0
        public MainMenuScreen(ScreenComponent manager) : base(manager, new Point(400, 300))
        {
            Controls.Add(new Panel(manager)
            {
                Position = new Rectangle(20, 20, 360, 40)
            });
            Controls.Add(new Label(manager)
            {
                Text = "Hauptmenue", Position = new Rectangle(40, 30, 0, 0)
            });
            Controls.Add(menu = new MenuList(manager)
            {
                Position = new Rectangle(20, 70, 360, 200)
            });

            // Sichtbarkeiten anhand der Server/Client Stati ermitteln
            newGameItem.Visible    = manager.Game.Server.State == ServerState.Closed && manager.Game.Client.State == ClientState.Closed;
            networkItem.Visible    = manager.Game.Server.State == ServerState.Closed && manager.Game.Client.State == ClientState.Closed;
            stopServerItem.Visible = manager.Game.Server.State != ServerState.Closed;
            stopClientItem.Visible = manager.Game.Client.State != ClientState.Closed;

            menu.Items.Add(newGameItem);
            if (manager.Game.Server.ServerFeatureAvailable || manager.Game.Client.ClientFeatureAvailable)
            {
                menu.Items.Add(networkItem);
            }
            menu.Items.Add(stopServerItem);
            menu.Items.Add(stopClientItem);
            menu.Items.Add(optionsItem);
            menu.Items.Add(exitItem);

            menu.SelectedItem = menu.Items.First(i => i.Visible && i.Enabled);

            menu.OnInteract += OnInteract;
        }
        public MainScreen(ScreenComponent manager) : base(manager)
        {
            StackPanel stack = new StackPanel(manager);

            Controls.Add(stack);

            Button startButton = Button.TextButton(manager, "Start");

            startButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            startButton.LeftMouseClick     += (s, e) =>
            {
                manager.NavigateToScreen(new GameScreen(manager));
            };
            stack.Controls.Add(startButton);

            Button optionButton = Button.TextButton(manager, "Options");

            optionButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            optionButton.MinWidth            = 200;
            stack.Controls.Add(optionButton);

            Button exitButton = Button.TextButton(manager, "Exit");

            exitButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            exitButton.LeftMouseClick     += (s, e) => { manager.Exit(); };
            stack.Controls.Add(exitButton);
        }
Beispiel #7
0
        public ToolbarControl(ScreenComponent screenManager)
            : base(screenManager)
        {
            Player       = screenManager.Player;
            toolTextures = new Dictionary <string, Texture2D>();

            activeToolLabel = new Label(screenManager);
            activeToolLabel.VerticalAlignment   = VerticalAlignment.Top;
            activeToolLabel.HorizontalAlignment = HorizontalAlignment.Center;
            activeToolLabel.Background          = new BorderBrush(Color.Black * 0.3f);
            activeToolLabel.TextColor           = Color.White;
            activeToolLabel.Visible             = false;
            Controls.Add(activeToolLabel);

            // toolTextures = new Texture2D[Player.Tools.Length];
            // int index = 0;
            foreach (var item in DefinitionManager.Instance.GetItemDefinitions())
            {
                using (MemoryStream stream = new MemoryStream())
                {
                    System.Drawing.Bitmap bitmap = item.Icon;
                    bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                    stream.Seek(0, SeekOrigin.Begin);

                    toolTextures.Add(item.GetType().FullName, Texture2D.FromStream(ScreenManager.GraphicsDevice, stream));
                }
            }
        }
        public TradeScreen(ScreenComponent manager, IInventory trader, IInventory player)
            : base(manager, new Point(400, 300))
        {
            this.trader = trader;
            this.player = player;

            Controls.Add(new Panel(manager)
            {
                Position = new Rectangle(20, 20, 360, 40)
            });
            Controls.Add(new Label(manager)
            {
                Text = "Shop", Position = new Rectangle(40, 30, 0, 0)
            });

            // Verkaufbare Items des Trader-Inventars auf die Liste setzen
            list = new TraderList(manager)
            {
                Position = new Rectangle(20, 70, 360, 210)
            };
            list.OnInteract += OnInteract;
            foreach (var item in trader.Inventory.Where(i => i.Value.HasValue).OrderBy(i => i.Value))
            {
                list.Items.Add(new TradingItem()
                {
                    Tag   = item,
                    Text  = item.Name,
                    Icon  = item.Icon,
                    Value = item.Value.Value
                });
            }
            Controls.Add(list);
            CheckAvailability();
        }
Beispiel #9
0
        private void toggleFocus(ScreenComponent c, bool reset)
        {
            if (reset)
            {
                focusedMenus.ForEach(m => m.IsFocused = true);
                focusedMenus = null;
                return;
            }
            else if (focusedMenus == null)
            {
                focusedMenus = new List <MenuList>();
            }

            if (c is MenuList)
            {
                MenuList m = (MenuList)c;

                if (m.IsFocused)
                {
                    focusedMenus.Add(m);
                    m.IsFocused = false;
                }
            }

            if (c is Container)
            {
                ((Container)c).Children.ToList()
                .ForEach(child => toggleFocus(child, reset));
            }
        }
        public InventoryScreen(ScreenComponent manager)
            : base(manager, new Point(400, 300))
        {
            Controls.Add(new Panel(manager)
            {
                Position = new Rectangle(20, 20, 360, 40)
            });
            Controls.Add(new Label(manager)
            {
                Text = "Rucksack", Position = new Rectangle(40, 30, 0, 0)
            });

            InventoryList list = new InventoryList(manager)
            {
                Position = new Rectangle(20, 70, 360, 200)
            };

            foreach (var itemGroup in manager.Game.Local.Player.Inventory.GroupBy(i => i.GetType()))
            {
                list.Items.Add(new InventoryItem()
                {
                    Text  = itemGroup.First().Name,
                    Icon  = itemGroup.First().Icon,
                    Count = itemGroup.Count()
                });
            }
            Controls.Add(list);
        }
Beispiel #11
0
        public GameState(IntPtr nativePtr)
            : base(nativePtr)
        {
            _scene = new CombatScene(0, this);

            _scene.AddSystem <CharacterCameraSystem>();
            var playerCtrlSystem = _scene.AddSystem <PlayerControllerSystem>();

            //    ControllerSystem ctrlSystem =_scene.AddSystem<ControllerSystem>();

            _entityBase = _scene.CreateEntity();

            _cameraRender = (CameraRenderable)_entityBase.Assign_Component(new CameraRenderable());
            _camera       = (CameraFree)_entityBase.Assign_Component(new CameraFree(_entityBase, _cameraRender));

            _controller = (Controller)_entityBase.Assign_Component(new Controller(_entityBase));
            _player     = (PlayerComponent)_entityBase.Assign_Component(new PlayerComponent(_entityBase));

            _entityBase.Assign_Component(new NetIdComponent(_entityBase));

            _player.PlayerSetActionMap(_controller);
            _screen = _entityBase.Assign_ScreenComponent(_cameraRender);

            playerCtrlSystem.SetBasicInputEvents(_controller);
            //   CtrlSetBasicInputEvents(_controller.CPointer, "E:\\Projekte\\coop\\XEngine\\data\\Test\\XETController\\Controller.cfg");

            _screen.AddUIState(_entityBase);


            _NetObserver = new NetObserver(this);
        }
Beispiel #12
0
 public DemoGame()
 {
     _graphics                       = new GraphicsDeviceManager(this);
     Content.RootDirectory           = "Content";
     IsMouseVisible                  = true;
     Components.Add(_screenComponent = new ScreenComponent(this));
 }
Beispiel #13
0
        public MainScreen(ScreenComponent manager) : base(manager)
        {
            Padding = new Border(0, 0, 0, 0);

            Background = new TextureBrush(manager.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/background.png", manager.GraphicsDevice), TextureBrushMode.Stretch);

            StackPanel stack = new StackPanel(manager);

            Controls.Add(stack);

            Button startButton = Button.TextButton(manager, Languages.OctoClient.Start);

            startButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            startButton.Margin          = new Border(0, 0, 0, 10);
            startButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateToScreen(new LoadScreen(manager));
            };
            stack.Controls.Add(startButton);

            Button optionButton = Button.TextButton(manager, Languages.OctoClient.Options);

            optionButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            optionButton.Margin          = new Border(0, 0, 0, 10);
            optionButton.MinWidth        = 300;
            optionButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateToScreen(new OptionsScreen(manager));
            };
            stack.Controls.Add(optionButton);

            Button creditsButton = Button.TextButton(manager, Languages.OctoClient.CreditsCrew);

            creditsButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            creditsButton.Margin          = new Border(0, 0, 0, 10);
            creditsButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateToScreen(new CreditsScreen(manager));
            };
            stack.Controls.Add(creditsButton);

            Button webButton = Button.TextButton(manager, "Octoawesome.net");

            webButton.VerticalAlignment   = VerticalAlignment.Bottom;
            webButton.HorizontalAlignment = HorizontalAlignment.Right;
            webButton.Margin          = new Border(10, 10, 10, 10);
            webButton.LeftMouseClick += (s, e) =>
            {
                Process.Start("http://octoawesome.net/");
            };
            Controls.Add(webButton);

            Button exitButton = Button.TextButton(manager, Languages.OctoClient.Exit);

            exitButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            exitButton.Margin          = new Border(0, 0, 0, 10);
            exitButton.LeftMouseClick += (s, e) => { manager.Exit(); };
            stack.Controls.Add(exitButton);
        }
        public ActionResult Delete(int id)
        {
            ScreenComponent screencomponent = context.ScreenComponent.FirstOrDefault(s => s.ID == id);

            context.ScreenComponent.Remove(screencomponent);
            context.SaveChanges();
            return(RedirectToAction(nameof(Index), new { screenId = screencomponent.ScreenID }));
        }
Beispiel #15
0
        public Screen(ScreenComponent manager, Point size) : this(manager)
        {
            Point pos = new Point(
                (manager.GraphicsDevice.Viewport.Width - size.X) / 2,
                (manager.GraphicsDevice.Viewport.Height - size.Y) / 2);

            Position = new Rectangle(pos, size);
        }
Beispiel #16
0
        public OctoGame()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory              = "Content";
            Window.Title                       = "OctoAwesome";
            graphics.PreferredBackBufferWidth  = 1280;
            graphics.PreferredBackBufferHeight = 720;
            IsMouseVisible                     = true;
            Window.AllowUserResizing           = false;

            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 15);

            int viewrange;

            if (int.TryParse(ConfigurationManager.AppSettings["Viewrange"], out viewrange))
            {
                if (viewrange < 1)
                {
                    throw new NotSupportedException("Viewrange in app.config darf nicht kleiner 1 sein");
                }

                SceneControl.VIEWRANGE = viewrange;
            }

            //int viewheight;
            //if (int.TryParse(ConfigurationManager.AppSettings["Viewheight"], out viewheight))
            //{
            //    if (viewheight < 1)
            //        throw new NotSupportedException("Viewheight in app.config darf nicht kleiner 1 sein");

            //    SceneComponent.VIEWHEIGHT = viewheight;
            //}

            ResourceManager.CacheSize = ((viewrange * 2) + 1) * ((viewrange * 2) + 1) * 5 * 2;

            input             = new InputComponent(this);
            input.UpdateOrder = 1;
            Components.Add(input);

            simulation             = new SimulationComponent(this);
            simulation.UpdateOrder = 3;
            Components.Add(simulation);

            player             = new PlayerComponent(this, input, simulation);
            player.UpdateOrder = 2;
            Components.Add(player);


            camera             = new CameraComponent(this, player);
            camera.UpdateOrder = 4;
            Components.Add(camera);

            screens             = new ScreenComponent(this, player, camera);
            screens.UpdateOrder = 8;
            screens.DrawOrder   = 4;
            Components.Add(screens);
        }
Beispiel #17
0
        public CrosshairControl(ScreenComponent manager) : base(manager)
        {
            assets = manager.Game.Assets;

            Transparency = 0.5f;
            Color        = Color.White;

            Texture = assets.LoadTexture(GetType(), "octocross");
        }
        public CreditsScreen(ScreenComponent manager) : base(manager)
        {
            Padding = new Border(0, 0, 0, 0);

            Title = Languages.OctoClient.CreditsCrew;

            SetDefaultBackground();

            List <CrewMember> crew = CrewMember.getCrew(manager);

            ScrollContainer crewScroll = new ScrollContainer(manager)
            {
                VerticalAlignment = VerticalAlignment.Stretch,
                Margin            = new Border(10, 10, 10, 10),
                CanFocus          = false
            };

            StackPanel crewList = new StackPanel(manager)
            {
                MinWidth          = 700,
                VerticalAlignment = VerticalAlignment.Stretch,
                Orientation       = Orientation.Vertical,
            };

            crewScroll.Content = crewList;

            foreach (CrewMember member in crew)
            {
                Panel memberPanel = new Panel(manager)
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    MinHeight           = 30,
                    Background          = new BorderBrush(Color.White),
                    Margin            = new Border(5, 5, 5, 5),
                    HoveredBackground = new BorderBrush(Color.LightGray)
                };

                memberPanel.LeftMouseClick += (s, e) =>
                {
                    manager.NavigateToScreen(new CrewMemberScreen(manager, member));
                };

                Label name = new Label(manager)
                {
                    Text = member.Username,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    Padding             = new Border(5, 5, 5, 5)
                };

                memberPanel.Controls.Add(name);
                crewList.Controls.Add(memberPanel);
            }


            Controls.Add(crewScroll);
        }
Beispiel #19
0
        public RheinwerkGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            graphics.IsFullScreen = false;
            IsMouseVisible        = true;

            Input             = new InputComponent(this);
            Input.UpdateOrder = 0;
            Components.Add(Input);

            Screen             = new ScreenComponent(this);
            Screen.UpdateOrder = 1;
            Screen.DrawOrder   = 2;
            Components.Add(Screen);

            Local             = new LocalComponent(this);
            Local.UpdateOrder = 2;
            Components.Add(Local);

            var client = new ClientComponent(this);

            Client             = client;
            client.UpdateOrder = 3;
            Components.Add(client);

            var server = new ServerComponent(this);

            Server             = server;
            server.UpdateOrder = 4;
            Components.Add(server);

            Simulation             = new SimulationComponent(this);
            Simulation.UpdateOrder = 5;
            Components.Add(Simulation);

            Scene             = new SceneComponent(this);
            Scene.UpdateOrder = 6;
            Scene.DrawOrder   = 0;
            Components.Add(Scene);

            Hud             = new HudComponent(this);
            Hud.UpdateOrder = 7;
            Hud.DrawOrder   = 1;
            Components.Add(Hud);

            Music             = new MusicComponent(this);
            Music.UpdateOrder = 8;
            Components.Add(Music);

            Sound             = new SoundComponent(this);
            Sound.UpdateOrder = 9;
            Components.Add(Sound);

            // Einstellungen laden
            Settings = Settings.LoadSettings();
        }
Beispiel #20
0
        public MessageScreen(ScreenComponent manager, string title, string content, string buttonText = "OK", Action <Control, MouseEventArgs> buttonClick = null) : base(manager)
        {
            assets = manager.Game.Assets;

            IsOverlay  = true;
            Background = new BorderBrush(Color.Black * 0.5f);
            Title      = title;

            panel = new Panel(manager)
            {
                Padding             = Border.All(20),
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center
            };
            Controls.Add(panel);

            StackPanel spanel = new StackPanel(manager);

            panel.Controls.Add(spanel);

            Label headLine = new Label(manager)
            {
                Text = title,
                Font = Skin.Current.HeadlineFont,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            spanel.Controls.Add(headLine);

            Label contentLabel = new Label(manager)
            {
                Text = content,
                Font = Skin.Current.TextFont,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            spanel.Controls.Add(contentLabel);

            Button closeButton = Button.TextButton(manager, buttonText);

            closeButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            closeButton.LeftMouseClick     += (s, e) =>
            {
                if (buttonClick != null)
                {
                    buttonClick(s, e);
                }
                else
                {
                    manager.NavigateBack();
                }
            };
            spanel.Controls.Add(closeButton);

            panel.Background = NineTileBrush.FromSingleTexture(assets.LoadTexture(typeof(ScreenComponent), "panel"), 30, 30);
        }
Beispiel #21
0
        public PauseScreen(ScreenComponent manager) : base(manager)
        {
            assets = manager.Game.Assets;

            // IsOverlay = true;
            // Background = new BorderBrush(new Color(Color.Black, 0.5f));

            Background = new TextureBrush(assets.LoadTexture(typeof(ScreenComponent), "background"), TextureBrushMode.Stretch);

            StackPanel stack = new StackPanel(manager);

            Controls.Add(stack);

            Button resumeButton = Button.TextButton(manager, Languages.OctoClient.Resume);

            resumeButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            resumeButton.Margin          = new Border(0, 0, 0, 10);
            resumeButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateBack();
            };
            stack.Controls.Add(resumeButton);

            Button optionButton = Button.TextButton(manager, Languages.OctoClient.Options);

            optionButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            optionButton.Margin          = new Border(0, 0, 0, 10);
            optionButton.MinWidth        = 300;
            optionButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateToScreen(new OptionsScreen(manager));
            };
            stack.Controls.Add(optionButton);

            Button creditsButton = Button.TextButton(manager, Languages.OctoClient.CreditsCrew);

            creditsButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            creditsButton.Margin          = new Border(0, 0, 0, 10);
            creditsButton.LeftMouseClick += (s, e) =>
            {
                manager.NavigateToScreen(new CreditsScreen(manager));
            };
            stack.Controls.Add(creditsButton);

            Button mainMenuButton = Button.TextButton(manager, Languages.OctoClient.ToMainMenu);

            mainMenuButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            mainMenuButton.Margin          = new Border(0, 0, 0, 10);
            mainMenuButton.LeftMouseClick += (s, e) =>
            {
                manager.Player.RemovePlayer();
                manager.Game.Simulation.ExitGame();
                manager.NavigateHome();
            };
            stack.Controls.Add(mainMenuButton);
        }
Beispiel #22
0
        public void LoadContent(Content content, GraphicsDevice graphicsDevice)
        {
            statusPanel.Background = content.PanelBackground;
            screenComponent        = new ScreenComponent()
            {
                Background = content.MainBackground
            };
            screenComponent.Components.Add(startAsTester);
            screenComponent.Components.Add(teams);
            screenComponent.Components.Add(createMatch);
            screenComponent.Components.Add(joinMatch);
            screenComponent.Components.Add(myMatches);
            screenComponent.Components.Add(help);
            screenComponent.Components.Add(matchesPanel);
            screenComponent.Components.Add(helpPanel);
            screenComponent.Components.Add(statusPanel);

            helpPanel.Background = content.PanelBackground;
            helpPanel.Components.Add(new Text {
                Value = "Welcome to the MVP of GameThing!"
            });
            helpPanel.Components.Add(new Text {
                Value = "You play as a team of 5 characters."
            });
            helpPanel.Components.Add(new Text {
                Value = "Each character has a deck of 8 cards, with 4 cards in hand at a time."
            });
            helpPanel.Components.Add(new Text {
                Value = "Characters can play 2 cards and move 5 in their turn."
            });
            helpPanel.Components.Add(new Text {
                Value = "Once you play a card or move a character, you can't choose another this turn."
            });
            helpPanel.Components.Add(new Text {
                Value = "When you choose to be finished for a turn, press New Turn and your opponent will play."
            });
            helpPanel.Components.Add(new Text {
                Value = "After one side looses all characters, the other side wins!"
            });
            helpPanel.Components.Add(new Text {
                Value = "The MVP only has play versus another person and is turn-based."
            });

            screenComponent.OnGestureRead += ScreenComponent_GestureRead;
            screenComponent.LoadContent(content.ContentManager, graphicsDevice);

            battleManager.GetAvailableBattles().ContinueWith(task =>
            {
                availableBattles.AddRange(task.Result);
                SetDynamicButtons();
            });

            battleManager.GetMyBattles().ContinueWith(task => myBattles.AddRange(task.Result));
            backgroundLine = content.BackgroundLine;
        }
Beispiel #23
0
        public CompassControl(ScreenComponent screenManager) : base(screenManager)
        {
            Player  = screenManager.Player;
            Padding = Border.All(7);

            Background = NineTileBrush.FromSingleTexture(
                screenManager.Game.Screen.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/UI/buttonLong_brown_pressed.png",
                                                                        screenManager.GraphicsDevice), 7, 7);

            compassTexture = ScreenManager.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/compass.png", ScreenManager.GraphicsDevice);
        }
Beispiel #24
0
        public CompassControl(ScreenComponent screenManager) : base(screenManager)
        {
            assets = screenManager.Game.Assets;

            Player  = screenManager.Player;
            Padding = Border.All(7);

            Texture2D background = assets.LoadTexture(typeof(ScreenComponent), "buttonLong_brown_pressed");

            Background     = NineTileBrush.FromSingleTexture(background, 7, 7);
            compassTexture = assets.LoadTexture(GetType(), "compass");
        }
Beispiel #25
0
        private void resetInputTimer(ScreenComponent c)
        {
            if (c is MenuList)
            {
                ((MenuList)c).InputTimer = -((MenuList)c).MillisPerInput;
            }

            if (c is Container)
            {
                ((Container)c).Children.ToList()
                .ForEach(resetInputTimer);
            }
        }
        private void PlayMultiplayer(ScreenComponent manager, string playerName)
        {
            Manager.Player.SetEntity(null);

            Manager.Game.Simulation.LoadGame(Guid.Empty);
            //settings.Set("LastUniverse", levelList.SelectedItem.Id.ToString());

            Player player = Manager.Game.Simulation.LoginPlayer(playerName);

            Manager.Game.Player.SetEntity(player);

            Manager.NavigateToScreen(new GameScreen(manager));
        }
Beispiel #27
0
        public void LoadContent(Content content, GraphicsDevice graphicsDevice)
        {
            screenComponent = new ScreenComponent()
            {
                Background = content.MainBackground
            };
            screenComponent.Components.Add(createTeamButton);
            screenComponent.Components.Add(deleteTeamButton);
            screenComponent.Components.Add(backButton);
            screenComponent.Components.Add(teamPanel);
            screenComponent.LoadContent(content.ContentManager, graphicsDevice);

            backgroundLine = content.BackgroundLine;
        }
Beispiel #28
0
        private void toggletScaleSpeed(ScreenComponent component, bool reset)
        {
            if (!scaleMap.ContainsKey(component))
            {
                scaleMap.Add(component, component.MillisPerScale);
            }

            component.MillisPerScale = reset ? scaleMap[component] : -1;
            if (component is Container)
            {
                ((Container)component).Children
                .ToList().ForEach(child => toggletScaleSpeed(child, reset));
            }
        }
        public BindingsOptionControl(ScreenComponent manager) : base(manager)
        {
            Manager = manager;

            ScrollContainer bindingsScroll = new ScrollContainer(manager);

            Controls.Add(bindingsScroll);

            StackPanel bindingsStack = new StackPanel(manager)
            {
                Orientation = Orientation.Vertical,
                Padding     = new Border(20, 20, 20, 20),
                Width       = 650
            };

            bindingsScroll.Content = bindingsStack;

            //////////////////////////////KeyBindings////////////////////////////////////////////
            var bindings = manager.Game.KeyMapper.GetBindings();

            foreach (var binding in bindings)
            {
                StackPanel bindingStack = new StackPanel(manager)
                {
                    Orientation         = Orientation.Horizontal,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    Height = 35
                };

                Label lbl = new Label(manager)
                {
                    Text  = binding.DisplayName,
                    Width = 480
                };

                Label bindingKeyLabel = new Label(manager)
                {
                    Text = binding.Keys.First().ToString(),
                    HorizontalAlignment = HorizontalAlignment.Right,
                    Width      = 90,
                    Background = new BorderBrush(Color.LightGray, LineType.Solid, Color.Gray),
                    Tag        = new object[] { binding.Id, binding.Keys.First() }
                };
                bindingKeyLabel.LeftMouseClick += BindingKeyLabel_LeftMouseClick;

                bindingStack.Controls.Add(lbl);
                bindingStack.Controls.Add(bindingKeyLabel);
                bindingsStack.Controls.Add(bindingStack);
            }
        }
 public ActionResult Edit(int id, ScreenComponent collection)
 {
     // TODO: Add update logic here
     try
     {
         context.Entry(collection).State = EntityState.Modified;
         context.SaveChanges();
         return(RedirectToAction(nameof(Index), new { screenId = collection.ScreenID }));
     }
     catch
     {
         return(View());
     }
 }