Example #1
0
        void SetStageSelectionInput(SelectData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (m_stageselector != null)
            {
                return;
            }

            data.ButtonMap.Clear();

            data.ButtonMap.Add(PlayerButton.Left, delegate(Boolean pressed) { if (pressed)
                                                                              {
                                                                                  MoveStageSelection(-1);
                                                                              }
                               });
            data.ButtonMap.Add(PlayerButton.Right, delegate(Boolean pressed) { if (pressed)
                                                                               {
                                                                                   MoveStageSelection(+1);
                                                                               }
                               });
            data.ButtonMap.Add(PlayerButton.A, this.SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.B, this.SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.C, this.SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.X, this.SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.Y, this.SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.Z, this.SelectCurrentStage);

            m_stageselector = data;
            m_currentstage  = 0;
        }
Example #2
0
        public void SetStageSelectionInput(SelectData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            if (StageSelector != null)
            {
                return;
            }

            data.ButtonMap.Clear();

            data.ButtonMap.Add(PlayerButton.Left, delegate(bool pressed) { if (pressed)
                                                                           {
                                                                               MoveStageSelection(-1);
                                                                           }
                               });
            data.ButtonMap.Add(PlayerButton.Right, delegate(bool pressed) { if (pressed)
                                                                            {
                                                                                MoveStageSelection(+1);
                                                                            }
                               });
            data.ButtonMap.Add(PlayerButton.A, SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.B, SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.C, SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.X, SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.Y, SelectCurrentStage);
            data.ButtonMap.Add(PlayerButton.Z, SelectCurrentStage);

            StageSelector     = data;
            CurrentStageIndex = 0;
        }
Example #3
0
        private void SetCharacterSelectionInput(SelectData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            data.ButtonMap.Clear();
            data.ButtonMap.Add(PlayerButton.Up, x => { if (x)
                                                       {
                                                           MoveCharacterSelection(data, CursorDirection.Up);
                                                       }
                               });
            data.ButtonMap.Add(PlayerButton.Down, x => { if (x)
                                                         {
                                                             MoveCharacterSelection(data, CursorDirection.Down);
                                                         }
                               });
            data.ButtonMap.Add(PlayerButton.Left, x => { if (x)
                                                         {
                                                             MoveCharacterSelection(data, CursorDirection.Left);
                                                         }
                               });
            data.ButtonMap.Add(PlayerButton.Right, x => { if (x)
                                                          {
                                                              MoveCharacterSelection(data, CursorDirection.Right);
                                                          }
                               });
            data.ButtonMap.Add(PlayerButton.Taunt, x => { CharacterPalletteShift(data, x); });
            data.ButtonMap.Add(PlayerButton.A, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 0);
                                                      }
                               });
            data.ButtonMap.Add(PlayerButton.B, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 1);
                                                      }
                               });
            data.ButtonMap.Add(PlayerButton.C, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 2);
                                                      }
                               });
            data.ButtonMap.Add(PlayerButton.X, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 3);
                                                      }
                               });
            data.ButtonMap.Add(PlayerButton.Y, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 4);
                                                      }
                               });
            data.ButtonMap.Add(PlayerButton.Z, x => { if (x)
                                                      {
                                                          SelectCharacter(data, 5);
                                                      }
                               });
        }
Example #4
0
        private void MoveCharacterSelection(SelectData data, CursorDirection direction)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            if (data.MoveCharacterCursor(direction, Grid.Size, Grid.Wrapping))
            {
                data.PlayCursorMoveSound();
            }
        }
Example #5
0
        void MoveCharacterSelection(SelectData data, CursorDirection direction)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (data.MoveCharacterCursor(direction, m_gridsize, m_wrapping) == true)
            {
                data.PlayCursorMoveSound();
            }
        }
        public ArcadeSelectScreenBehavior(SelectScreen selectScreen, TextSection textsection)
        {
            SelectScreen = selectScreen;

            m_stageSelect = new StageSelect(selectScreen, textsection);

            m_soundcancel   = textsection.GetAttribute <SoundId>("cancel.snd");
            m_titlelocation = textsection.GetAttribute <Point>("title.offset");
            m_titlefont     = textsection.GetAttribute <PrintData>("title.font");

            m_p1info = new SelectData(selectScreen, selectScreen.MenuSystem.GetSubSystem <Input.InputSystem>().CurrentInput[1], textsection, "p1", Grid.MoveOverEmptyBoxes);
        }
Example #7
0
        public void DrawCursorGrid(SelectData p1, SelectData p2)
        {
            for (var y = 0; y != Size.Y; ++y)
            {
                for (var x = 0; x != Size.X; ++x)
                {
                    var xy = new Point(x, y);

                    var location = (Vector2)GridPosition;
                    location.X += (CellSize.X + CellSpacing) * x;
                    location.Y += (CellSize.Y + CellSpacing) * y;

                    var selection = GetSelection(xy, false);
                    if (selection != null && selection.SelectionType == PlayerSelectType.Profile)
                    {
                        selection.Profile.SpriteManager.Draw(SpriteId.SmallPortrait, location, Vector2.Zero, Vector2.One, SpriteEffects.None);
                    }

                    if (selection != null && selection.SelectionType == PlayerSelectType.Random)
                    {
                        var randomimage = m_elements.GetElement("cell.random") as StaticImage;
                        if (randomimage != null)
                        {
                            randomimage.Draw(location);
                        }
                    }

                    if (p1?.CurrentCell == xy && p2?.CurrentCell == xy)
                    {
                        if (m_blinkval > 0)
                        {
                            p1.DrawCursorActive(location);
                        }
                        else
                        {
                            p2.DrawCursorActive(location);
                        }
                    }
                    else if (p1?.CurrentCell == xy)
                    {
                        p1.DrawCursorActive(location);
                    }
                    else if (p2?.CurrentCell == xy)
                    {
                        p2.DrawCursorActive(location);
                    }
                }
            }
        }
Example #8
0
        private void CharacterPalletteShift(SelectData data, bool pressed)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            if (pressed)
            {
                data.PaletteIndex += 6;
            }
            else
            {
                data.PaletteIndex -= 6;
            }
        }
Example #9
0
        void CharacterPalletteShift(SelectData data, Boolean pressed)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (pressed == true)
            {
                data.PaletteIndex += 6;
            }
            else
            {
                data.PaletteIndex -= 6;
            }
        }
Example #10
0
        public TeamSelectData(SelectScreen selectscreen, ButtonMap buttonmap, TextSection textsection, string prefix, bool moveoverempty, bool self = true)
        {
            if (selectscreen == null)
            {
                throw new ArgumentNullException(nameof(selectscreen));
            }
            if (buttonmap == null)
            {
                throw new ArgumentNullException(nameof(buttonmap));
            }
            if (textsection == null)
            {
                throw new ArgumentNullException(nameof(textsection));
            }
            if (prefix == null)
            {
                throw new ArgumentNullException(nameof(prefix));
            }

            m_self            = self;
            P1SelectData      = new SelectData(selectscreen, buttonmap, textsection, prefix, moveoverempty);
            P2SelectData      = new SelectData(selectscreen, buttonmap, textsection, prefix, moveoverempty);
            m_selectscreen    = selectscreen;
            ButtonMap         = buttonmap;
            m_elements        = new Collection(selectscreen.SpriteManager, selectscreen.AnimationManager, selectscreen.SoundManager, selectscreen.MenuSystem.FontMap);
            m_moveWrapping    = textsection.GetAttribute("teammenu.move.wrapping", true);
            m_position        = textsection.GetAttribute <Point>(prefix + ".teammenu.pos");
            m_itemLocation    = textsection.GetAttribute <Point>(prefix + ".teammenu.item.offset");
            m_itemSpacing     = textsection.GetAttribute <Point>(prefix + ".teammenu.item.spacing");
            m_itemFont        = textsection.GetAttribute <PrintData>(prefix + ".teammenu.item.font");
            m_itemActiveFont  = textsection.GetAttribute <PrintData>(prefix + ".teammenu.item.active.font");
            m_itemActive2Font = textsection.GetAttribute <PrintData>(prefix + ".teammenu.item.active2.font");
            m_spacing         = textsection.GetAttribute <Point>(prefix + ".teammenu.value.spacing");
            m_cursorSpriteId  = textsection.GetAttribute <SpriteId>(prefix + ".teammenu.item.cursor.anim");
            m_cursorOffset    = textsection.GetAttribute <Point>(prefix + ".teammenu.item.cursor.offset");

            m_elements.Build("selfTitle", textsection, prefix + ".teammenu.selftitle");
            m_elements.Build("enemytitle", textsection, prefix + ".teammenu.enemytitle");
            m_elements.Build("move", textsection, prefix + ".teammenu.move");
            m_elements.Build("value", textsection, prefix + ".teammenu.value");
            m_elements.Build("done", textsection, prefix + ".teammenu.done");
            m_elements.Build("value.icon", textsection, prefix + ".teammenu.value.icon");
            m_elements.Build("empty.icon", textsection, prefix + ".teammenu.value.empty.icon");
        }
Example #11
0
        private void DrawFace(SelectData data)
        {
            if (data == null)
            {
                return;
            }

            var selection = Grid.GetSelection(data.CurrentCell, false);

            if (selection == null)
            {
                return;
            }

            if (selection.SelectionType == PlayerSelectType.Profile)
            {
                data.DrawProfile(selection.Profile);
            }
        }
Example #12
0
        private void SelectCharacter(SelectData data, int index)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            var selection = Grid.GetSelection(data.CurrentCell, false);

            if (selection == null || selection.SelectionType != PlayerSelectType.Profile)
            {
                return;
            }

            data.PlaySelectSound();
            data.ButtonMap.Clear();
            data.IsSelected    = true;
            data.PaletteIndex += index;

            m_stageSelect.SetStageSelectionInput(data);
        }
Example #13
0
        void SelectCharacter(SelectData data, Int32 index)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            PlayerSelect selection = GetSelection(data.CurrentCell, false);

            if (selection == null || selection.SelectionType != PlayerSelectType.Profile)
            {
                return;
            }

            data.PlaySelectSound();
            data.ButtonMap.Clear();
            data.IsSelected    = true;
            data.PaletteIndex += index;

            SetStageSelectionInput(data);
        }
Example #14
0
        public SelectScreen(MenuSystem screensystem, TextSection textsection, String spritepath, String animationpath, String soundpath)
            : base(screensystem, textsection, spritepath, animationpath, soundpath)
        {
            m_selectmap     = new Dictionary <Point, PlayerSelect>();
            m_selectmovemap = new Dictionary <Point, PlayerSelect>();

            m_gridsize   = new Point();
            m_gridsize.X = textsection.GetAttribute <Int32>("columns");
            m_gridsize.Y = textsection.GetAttribute <Int32>("rows");

            m_wrapping           = textsection.GetAttribute <Boolean>("wrapping");
            m_showemptyboxes     = textsection.GetAttribute <Boolean>("showEmptyBoxes");
            m_moveoveremptyboxes = textsection.GetAttribute <Boolean>("moveOverEmptyBoxes");
            m_gridposition       = textsection.GetAttribute <Point>("pos");
            m_cellsize           = textsection.GetAttribute <Point>("cell.size");
            m_cellspacing        = textsection.GetAttribute <Int32>("cell.spacing");

            m_elements = new Elements.Collection(SpriteManager, AnimationManager, SoundManager, MenuSystem.FontMap);
            m_elements.Build(textsection, "cell.bg");
            m_elements.Build(textsection, "cell.random");

            m_cursorblinking      = textsection.GetAttribute <Boolean>("p2.cursor.blink");
            m_soundcancel         = textsection.GetAttribute <SoundId>("cancel.snd");
            m_titlelocation       = textsection.GetAttribute <Point>("title.offset");
            m_titlefont           = textsection.GetAttribute <PrintData>("title.font");
            m_stageposition       = textsection.GetAttribute <Point>("stage.pos");
            m_soundstagemove      = textsection.GetAttribute <SoundId>("stage.move.snd");
            m_soundstageselect    = textsection.GetAttribute <SoundId>("stage.done.snd");
            m_stagefont1          = textsection.GetAttribute <PrintData>("stage.active.font");
            m_stagefont2          = textsection.GetAttribute <PrintData>("stage.active2.font");
            m_stagedonefont       = textsection.GetAttribute <PrintData>("stage.done.font");
            m_randomswitchtime    = textsection.GetAttribute <Int32>("cell.random.switchtime", 5);
            m_p1info              = new SelectData(this, MenuSystem.GetSubSystem <Input.InputSystem>().CurrentInput[1], textsection, "p1", m_moveoveremptyboxes);
            m_p2info              = new SelectData(this, MenuSystem.GetSubSystem <Input.InputSystem>().CurrentInput[2], textsection, "p2", m_moveoveremptyboxes);
            m_isdone              = false;
            m_stagedisplaybuilder = new StringBuilder();

#warning Hack for now
            VersusMode = "Versus Mode";
        }
Example #15
0
        void DrawFace(SelectData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            PlayerSelect selection = GetSelection(data.CurrentCell, false);

            if (selection == null)
            {
                return;
            }

            if (selection.SelectionType == PlayerSelectType.Profile)
            {
                data.DrawProfile(selection.Profile);
            }

            if (selection.SelectionType == PlayerSelectType.Random)
            {
            }
        }