예제 #1
0
 public override void Dispose()
 {
     if (!base.IsDisposed)
     {
         Console.WriteLine("Disposing Options Screen");
         foreach (OptionsObj current in this.m_optionsArray)
         {
             current.Dispose();
         }
         this.m_optionsArray.Clear();
         this.m_optionsArray = null;
         this.m_bgSprite.Dispose();
         this.m_bgSprite = null;
         this.m_optionsTitle = null;
         this.m_changeControlsTitle = null;
         this.m_backToMenuObj = null;
         this.m_confirmText.Dispose();
         this.m_confirmText = null;
         this.m_cancelText.Dispose();
         this.m_cancelText = null;
         this.m_navigationText.Dispose();
         this.m_navigationText = null;
         this.m_optionsBar.Dispose();
         this.m_optionsBar = null;
         this.m_selectedOption = null;
         this.m_quickDropText.Dispose();
         this.m_quickDropText = null;
         this.m_quickDropObj = null;
         this.m_enableSteamCloudObj = null;
         this.m_reduceQualityObj = null;
         base.Dispose();
     }
 }
예제 #2
0
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         Console.WriteLine("Disposing Options Screen");
         foreach (var current in m_optionsArray)
         {
             current.Dispose();
         }
         m_optionsArray.Clear();
         m_optionsArray = null;
         m_bgSprite.Dispose();
         m_bgSprite            = null;
         m_optionsTitle        = null;
         m_changeControlsTitle = null;
         m_backToMenuObj       = null;
         m_confirmText.Dispose();
         m_confirmText = null;
         m_cancelText.Dispose();
         m_cancelText = null;
         m_navigationText.Dispose();
         m_navigationText = null;
         m_optionsBar.Dispose();
         m_optionsBar     = null;
         m_selectedOption = null;
         m_quickDropText.Dispose();
         m_quickDropText       = null;
         m_quickDropObj        = null;
         m_enableSteamCloudObj = null;
         m_reduceQualityObj    = null;
         base.Dispose();
     }
 }
예제 #3
0
 public override void OnExit()
 {
     m_selectedOption.IsActive   = false;
     m_selectedOption.IsSelected = false;
     m_selectedOption            = null;
     (ScreenManager.Game as Game).SaveConfig();
     (ScreenManager as RCScreenManager).UpdatePauseScreenIcons();
     base.OnExit();
 }
예제 #4
0
        public override void OnEnter()
        {
            m_quickDropText.Visible = false;
            if (InputManager.GamePadIsConnected(PlayerIndex.One))
            {
                m_confirmText.ForcedScale = new Vector2(0.7f, 0.7f);
                m_cancelText.ForcedScale  = new Vector2(0.7f, 0.7f);
                m_navigationText.Text     = "[Button:LeftStick] to navigate options";
            }
            else
            {
                m_confirmText.ForcedScale = new Vector2(1f, 1f);
                m_cancelText.ForcedScale  = new Vector2(1f, 1f);
                m_navigationText.Text     = "Arrow keys to navigate options";
            }
            m_confirmText.Text       = "[Input:" + 0 + "] to select option";
            m_cancelText.Text        = "[Input:" + 2 + "] to exit options";
            m_confirmText.Opacity    = 0f;
            m_cancelText.Opacity     = 0f;
            m_navigationText.Opacity = 0f;
            Tween.To(m_confirmText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.To(m_cancelText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.To(m_navigationText, 0.2f, Tween.EaseNone, "Opacity", "1");
            Tween.RunFunction(0.1f, typeof(SoundManager), "PlaySound", "DialogueMenuOpen");
            if (!m_optionsArray.Contains(m_backToMenuObj))
            {
                m_optionsArray.Insert(m_optionsArray.Count - 1, m_backToMenuObj);
            }
            if (m_titleScreenOptions)
            {
                m_optionsArray.RemoveAt(m_optionsArray.Count - 2);
            }
            m_transitioning = true;
            Tween.To(this, 0.2f, Tween.EaseNone, "BackBufferOpacity", "0.8");
            m_selectedOptionIndex     = 0;
            m_selectedOption          = m_optionsArray[m_selectedOptionIndex];
            m_selectedOption.IsActive = false;
            m_bgSprite.Position       = new Vector2(660f, 0f);
            m_bgSprite.Opacity        = 0f;
            Tween.To(m_bgSprite, 0.5f, Quad.EaseOut, "Y", 360f.ToString());
            Tween.AddEndHandlerToLastTween(this, "EndTransition");
            Tween.To(m_bgSprite, 0.2f, Tween.EaseNone, "Opacity", "1");
            var num = 0;

            foreach (var current in m_optionsArray)
            {
                current.Y       = 160 + num * 30 - 360f;
                current.Opacity = 0f;
                Tween.By(current, 0.5f, Quad.EaseOut, "Y", 360f.ToString());
                Tween.To(current, 0.2f, Tween.EaseNone, "Opacity", "1");
                current.Initialize();
                num++;
            }
            m_optionsBar.Opacity = 0f;
            Tween.To(m_optionsBar, 0.2f, Tween.EaseNone, "Opacity", "1");
            base.OnEnter();
        }
예제 #5
0
 public override void LoadContent()
 {
     m_bgSprite           = new ObjContainer("SkillUnlockPlate_Character");
     m_bgSprite.ForceDraw = true;
     m_optionsTitle       = new SpriteObj("OptionsScreenTitle_Sprite");
     m_bgSprite.AddChild(m_optionsTitle);
     m_optionsTitle.Position = new Vector2(0f, -(float)m_bgSprite.Width / 2f + 60f);
     m_changeControlsTitle   = new SpriteObj("OptionsScreenChangeControls_Sprite");
     m_bgSprite.AddChild(m_changeControlsTitle);
     m_changeControlsTitle.Position = new Vector2(1320f, m_optionsTitle.Y);
     m_optionsArray.Add(new ResolutionOptionsObj(this));
     m_optionsArray.Add(new FullScreenOptionsObj(this));
     m_reduceQualityObj = new ReduceQualityOptionsObj(this);
     m_optionsArray.Add(m_reduceQualityObj);
     m_optionsArray.Add(new MusicVolOptionsObj(this));
     m_optionsArray.Add(new SFXVolOptionsObj(this));
     m_quickDropObj = new QuickDropOptionsObj(this);
     m_optionsArray.Add(m_quickDropObj);
     m_optionsArray.Add(new DeadZoneOptionsObj(this));
     m_optionsArray.Add(new ToggleDirectInputOptionsObj(this));
     m_optionsArray.Add(new ChangeControlsOptionsObj(this));
     m_optionsArray.Add(new ExitProgramOptionsObj(this));
     m_backToMenuObj   = new BackToMenuOptionsObj(this);
     m_backToMenuObj.X = 420f;
     for (var i = 0; i < m_optionsArray.Count; i++)
     {
         m_optionsArray[i].X = 420f;
         m_optionsArray[i].Y = 160 + i * 30;
     }
     m_optionsBar                = new SpriteObj("OptionsBar_Sprite");
     m_optionsBar.ForceDraw      = true;
     m_optionsBar.Position       = new Vector2(m_optionsArray[0].X - 20f, m_optionsArray[0].Y);
     m_confirmText               = new KeyIconTextObj(Game.JunicodeFont);
     m_confirmText.Text          = "to select option";
     m_confirmText.DropShadow    = new Vector2(2f, 2f);
     m_confirmText.FontSize      = 12f;
     m_confirmText.Align         = Types.TextAlign.Right;
     m_confirmText.Position      = new Vector2(1290f, 570f);
     m_confirmText.ForceDraw     = true;
     m_cancelText                = new KeyIconTextObj(Game.JunicodeFont);
     m_cancelText.Text           = "to exit options";
     m_cancelText.Align          = Types.TextAlign.Right;
     m_cancelText.DropShadow     = new Vector2(2f, 2f);
     m_cancelText.FontSize       = 12f;
     m_cancelText.Position       = new Vector2(m_confirmText.X, m_confirmText.Y + 40f);
     m_cancelText.ForceDraw      = true;
     m_navigationText            = new KeyIconTextObj(Game.JunicodeFont);
     m_navigationText.Text       = "to navigate options";
     m_navigationText.Align      = Types.TextAlign.Right;
     m_navigationText.DropShadow = new Vector2(2f, 2f);
     m_navigationText.FontSize   = 12f;
     m_navigationText.Position   = new Vector2(m_confirmText.X, m_confirmText.Y + 80f);
     m_navigationText.ForceDraw  = true;
     m_quickDropText             = new TextObj(Game.JunicodeFont);
     m_quickDropText.FontSize    = 8f;
     m_quickDropText.Text        =
         "*Quick drop allows you to drop down ledges and down-attack in \nthe air by pressing DOWN";
     m_quickDropText.Position   = new Vector2(420f, 530f);
     m_quickDropText.ForceDraw  = true;
     m_quickDropText.DropShadow = new Vector2(2f, 2f);
     base.LoadContent();
 }
예제 #6
0
 public override void HandleInput()
 {
     if (!m_transitioning)
     {
         if (m_selectedOption.IsActive)
         {
             m_selectedOption.HandleInput();
         }
         else
         {
             if (!m_selectedOption.IsActive)
             {
                 var selectedOptionIndex = m_selectedOptionIndex;
                 if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17))
                 {
                     if (m_selectedOptionIndex > 0)
                     {
                         SoundManager.PlaySound("frame_swap");
                     }
                     m_selectedOptionIndex--;
                 }
                 else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19))
                 {
                     if (m_selectedOptionIndex < m_optionsArray.Count - 1)
                     {
                         SoundManager.PlaySound("frame_swap");
                     }
                     m_selectedOptionIndex++;
                 }
                 if (m_selectedOptionIndex < 0)
                 {
                     m_selectedOptionIndex = m_optionsArray.Count - 1;
                 }
                 if (m_selectedOptionIndex > m_optionsArray.Count - 1)
                 {
                     m_selectedOptionIndex = 0;
                 }
                 if (selectedOptionIndex != m_selectedOptionIndex)
                 {
                     if (m_selectedOption != null)
                     {
                         m_selectedOption.IsSelected = false;
                     }
                     m_selectedOption            = m_optionsArray[m_selectedOptionIndex];
                     m_selectedOption.IsSelected = true;
                 }
             }
             if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1))
             {
                 SoundManager.PlaySound("Option_Menu_Select");
                 m_selectedOption.IsActive = true;
             }
             if (Game.GlobalInput.JustPressed(2) || Game.GlobalInput.JustPressed(3) ||
                 Game.GlobalInput.JustPressed(4))
             {
                 ExitTransition();
             }
         }
         if (m_selectedOption == m_quickDropObj)
         {
             m_quickDropText.Visible = true;
             m_quickDropText.Text    =
                 "*Quick drop allows you to drop down ledges and down-attack in \nthe air by pressing DOWN";
         }
         else if (m_selectedOption == m_reduceQualityObj)
         {
             m_quickDropText.Visible = true;
             m_quickDropText.Text    = "*The game must be restarted for this change to come into effect.";
         }
         else if (m_selectedOption == m_enableSteamCloudObj)
         {
             m_quickDropText.Visible = true;
             m_quickDropText.Text    =
                 "*Cloud support must be enabled on the Steam platform as well for\nthis feature to work.";
         }
         else
         {
             m_quickDropText.Visible = false;
         }
     }
     else
     {
         m_quickDropText.Visible = false;
     }
     base.HandleInput();
 }
예제 #7
0
 public override void OnExit()
 {
     this.m_selectedOption.IsActive = false;
     this.m_selectedOption.IsSelected = false;
     this.m_selectedOption = null;
     (base.ScreenManager.Game as Game).SaveConfig();
     (base.ScreenManager as RCScreenManager).UpdatePauseScreenIcons();
     base.OnExit();
 }
예제 #8
0
 public override void OnEnter()
 {
     this.m_quickDropText.Visible = false;
     if (InputManager.GamePadIsConnected(PlayerIndex.One))
     {
         this.m_confirmText.ForcedScale = new Vector2(0.7f, 0.7f);
         this.m_cancelText.ForcedScale = new Vector2(0.7f, 0.7f);
         this.m_navigationText.Text = "[Button:LeftStick] to navigate options";
     }
     else
     {
         this.m_confirmText.ForcedScale = new Vector2(1f, 1f);
         this.m_cancelText.ForcedScale = new Vector2(1f, 1f);
         this.m_navigationText.Text = "Arrow keys to navigate options";
     }
     this.m_confirmText.Text = "[Input:" + 0 + "] to select option";
     this.m_cancelText.Text = "[Input:" + 2 + "] to exit options";
     this.m_confirmText.Opacity = 0f;
     this.m_cancelText.Opacity = 0f;
     this.m_navigationText.Opacity = 0f;
     Tween.To(this.m_confirmText, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "Opacity",
         "1"
     });
     Tween.To(this.m_cancelText, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "Opacity",
         "1"
     });
     Tween.To(this.m_navigationText, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "Opacity",
         "1"
     });
     Tween.RunFunction(0.1f, typeof(SoundManager), "PlaySound", new object[]
     {
         "DialogueMenuOpen"
     });
     if (!this.m_optionsArray.Contains(this.m_backToMenuObj))
     {
         this.m_optionsArray.Insert(this.m_optionsArray.Count - 1, this.m_backToMenuObj);
     }
     if (this.m_titleScreenOptions)
     {
         this.m_optionsArray.RemoveAt(this.m_optionsArray.Count - 2);
     }
     this.m_transitioning = true;
     Tween.To(this, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "BackBufferOpacity",
         "0.8"
     });
     this.m_selectedOptionIndex = 0;
     this.m_selectedOption = this.m_optionsArray[this.m_selectedOptionIndex];
     this.m_selectedOption.IsActive = false;
     this.m_bgSprite.Position = new Vector2(660f, 0f);
     this.m_bgSprite.Opacity = 0f;
     Tween.To(this.m_bgSprite, 0.5f, new Easing(Quad.EaseOut), new string[]
     {
         "Y",
         360f.ToString()
     });
     Tween.AddEndHandlerToLastTween(this, "EndTransition", new object[0]);
     Tween.To(this.m_bgSprite, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "Opacity",
         "1"
     });
     int num = 0;
     foreach (OptionsObj current in this.m_optionsArray)
     {
         current.Y = (float)(160 + num * 30) - 360f;
         current.Opacity = 0f;
         Tween.By(current, 0.5f, new Easing(Quad.EaseOut), new string[]
         {
             "Y",
             360f.ToString()
         });
         Tween.To(current, 0.2f, new Easing(Tween.EaseNone), new string[]
         {
             "Opacity",
             "1"
         });
         current.Initialize();
         num++;
     }
     this.m_optionsBar.Opacity = 0f;
     Tween.To(this.m_optionsBar, 0.2f, new Easing(Tween.EaseNone), new string[]
     {
         "Opacity",
         "1"
     });
     base.OnEnter();
 }
예제 #9
0
 public override void LoadContent()
 {
     this.m_bgSprite = new ObjContainer("SkillUnlockPlate_Character");
     this.m_bgSprite.ForceDraw = true;
     this.m_optionsTitle = new SpriteObj("OptionsScreenTitle_Sprite");
     this.m_bgSprite.AddChild(this.m_optionsTitle);
     this.m_optionsTitle.Position = new Vector2(0f, (float)(-(float)this.m_bgSprite.Width) / 2f + 60f);
     this.m_changeControlsTitle = new SpriteObj("OptionsScreenChangeControls_Sprite");
     this.m_bgSprite.AddChild(this.m_changeControlsTitle);
     this.m_changeControlsTitle.Position = new Vector2(1320f, this.m_optionsTitle.Y);
     this.m_optionsArray.Add(new ResolutionOptionsObj(this));
     this.m_optionsArray.Add(new FullScreenOptionsObj(this));
     this.m_reduceQualityObj = new ReduceQualityOptionsObj(this);
     this.m_optionsArray.Add(this.m_reduceQualityObj);
     this.m_optionsArray.Add(new MusicVolOptionsObj(this));
     this.m_optionsArray.Add(new SFXVolOptionsObj(this));
     this.m_quickDropObj = new QuickDropOptionsObj(this);
     this.m_optionsArray.Add(this.m_quickDropObj);
     this.m_optionsArray.Add(new DeadZoneOptionsObj(this));
     this.m_optionsArray.Add(new ToggleDirectInputOptionsObj(this));
     this.m_optionsArray.Add(new ChangeControlsOptionsObj(this));
     this.m_optionsArray.Add(new ExitProgramOptionsObj(this));
     this.m_backToMenuObj = new BackToMenuOptionsObj(this);
     this.m_backToMenuObj.X = 420f;
     for (int i = 0; i < this.m_optionsArray.Count; i++)
     {
         this.m_optionsArray[i].X = 420f;
         this.m_optionsArray[i].Y = (float)(160 + i * 30);
     }
     this.m_optionsBar = new SpriteObj("OptionsBar_Sprite");
     this.m_optionsBar.ForceDraw = true;
     this.m_optionsBar.Position = new Vector2(this.m_optionsArray[0].X - 20f, this.m_optionsArray[0].Y);
     this.m_confirmText = new KeyIconTextObj(Game.JunicodeFont);
     this.m_confirmText.Text = "to select option";
     this.m_confirmText.DropShadow = new Vector2(2f, 2f);
     this.m_confirmText.FontSize = 12f;
     this.m_confirmText.Align = Types.TextAlign.Right;
     this.m_confirmText.Position = new Vector2(1290f, 570f);
     this.m_confirmText.ForceDraw = true;
     this.m_cancelText = new KeyIconTextObj(Game.JunicodeFont);
     this.m_cancelText.Text = "to exit options";
     this.m_cancelText.Align = Types.TextAlign.Right;
     this.m_cancelText.DropShadow = new Vector2(2f, 2f);
     this.m_cancelText.FontSize = 12f;
     this.m_cancelText.Position = new Vector2(this.m_confirmText.X, this.m_confirmText.Y + 40f);
     this.m_cancelText.ForceDraw = true;
     this.m_navigationText = new KeyIconTextObj(Game.JunicodeFont);
     this.m_navigationText.Text = "to navigate options";
     this.m_navigationText.Align = Types.TextAlign.Right;
     this.m_navigationText.DropShadow = new Vector2(2f, 2f);
     this.m_navigationText.FontSize = 12f;
     this.m_navigationText.Position = new Vector2(this.m_confirmText.X, this.m_confirmText.Y + 80f);
     this.m_navigationText.ForceDraw = true;
     this.m_quickDropText = new TextObj(Game.JunicodeFont);
     this.m_quickDropText.FontSize = 8f;
     this.m_quickDropText.Text = "*Quick drop allows you to drop down ledges and down-attack in \nthe air by pressing DOWN";
     this.m_quickDropText.Position = new Vector2(420f, 530f);
     this.m_quickDropText.ForceDraw = true;
     this.m_quickDropText.DropShadow = new Vector2(2f, 2f);
     base.LoadContent();
 }
예제 #10
0
 public override void HandleInput()
 {
     if (!this.m_transitioning)
     {
         if (this.m_selectedOption.IsActive)
         {
             this.m_selectedOption.HandleInput();
         }
         else
         {
             if (!this.m_selectedOption.IsActive)
             {
                 int selectedOptionIndex = this.m_selectedOptionIndex;
                 if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17))
                 {
                     if (this.m_selectedOptionIndex > 0)
                     {
                         SoundManager.PlaySound("frame_swap");
                     }
                     this.m_selectedOptionIndex--;
                 }
                 else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19))
                 {
                     if (this.m_selectedOptionIndex < this.m_optionsArray.Count - 1)
                     {
                         SoundManager.PlaySound("frame_swap");
                     }
                     this.m_selectedOptionIndex++;
                 }
                 if (this.m_selectedOptionIndex < 0)
                 {
                     this.m_selectedOptionIndex = this.m_optionsArray.Count - 1;
                 }
                 if (this.m_selectedOptionIndex > this.m_optionsArray.Count - 1)
                 {
                     this.m_selectedOptionIndex = 0;
                 }
                 if (selectedOptionIndex != this.m_selectedOptionIndex)
                 {
                     if (this.m_selectedOption != null)
                     {
                         this.m_selectedOption.IsSelected = false;
                     }
                     this.m_selectedOption = this.m_optionsArray[this.m_selectedOptionIndex];
                     this.m_selectedOption.IsSelected = true;
                 }
             }
             if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1))
             {
                 SoundManager.PlaySound("Option_Menu_Select");
                 this.m_selectedOption.IsActive = true;
             }
             if (Game.GlobalInput.JustPressed(2) || Game.GlobalInput.JustPressed(3) || Game.GlobalInput.JustPressed(4))
             {
                 this.ExitTransition();
             }
         }
         if (this.m_selectedOption == this.m_quickDropObj)
         {
             this.m_quickDropText.Visible = true;
             this.m_quickDropText.Text = "*Quick drop allows you to drop down ledges and down-attack in \nthe air by pressing DOWN";
         }
         else if (this.m_selectedOption == this.m_reduceQualityObj)
         {
             this.m_quickDropText.Visible = true;
             this.m_quickDropText.Text = "*The game must be restarted for this change to come into effect.";
         }
         else if (this.m_selectedOption == this.m_enableSteamCloudObj)
         {
             this.m_quickDropText.Visible = true;
             this.m_quickDropText.Text = "*Cloud support must be enabled on the Steam platform as well for\nthis feature to work.";
         }
         else
         {
             this.m_quickDropText.Visible = false;
         }
     }
     else
     {
         this.m_quickDropText.Visible = false;
     }
     base.HandleInput();
 }