Exemplo n.º 1
0
 /// <summary>
 /// Default Mouse Up Event Handler
 /// </summary>
 protected virtual void BaseGameControl_MouseUp(IGameControl sender, GameControlEventArgs args)
 {
 }
Exemplo n.º 2
0
 /// <summary>
 /// Default Change focus Event Handler
 /// </summary>
 protected virtual void BaseGameControl_ChangeFocus(IGameControl sender, GameControlEventArgs args)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Default Click Event Handler
 /// </summary>
 protected virtual void BaseGameControl_Click(IGameControl sender, GameControlEventArgs args)
 {
 }
Exemplo n.º 4
0
 //The quit button handler
 void ClickQuit(IGameControl sender, GameControlEventArgs args)
 {
     Stage.DumpDebugToFile();
     this.Exit();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Use this method to raise a base GameControl event. (typically called by the observer.)
 /// </summary>
 /// <param name="e">The event to raise</param>
 /// <param name="sender">The GameControl sending the event</param>
 /// <param name="args">The event arguments</param>
 public void RaiseEvent(BaseControlEvents e, IGameControl sender, GameControlEventArgs args)
 {
     switch (e)
     {
         case BaseControlEvents.ChangeFocus: ChangeFocus(sender, args); break;
         case BaseControlEvents.Click: Click(sender, args); break;
         case BaseControlEvents.Init: Init(sender, (GameControlTimedEventArgs)args); break;
         case BaseControlEvents.MouseDown: MouseDown(sender, args); break;
         case BaseControlEvents.MouseEnter: MouseEnter(sender, args); break;
         case BaseControlEvents.MouseLeave: MouseLeave(sender, args); break;
         case BaseControlEvents.MouseUp: MouseUp(sender, args); break;
         case BaseControlEvents.Render: Render(sender, (GameControlRenderEventArgs)args); break;
         case BaseControlEvents.Update: Update(sender, (GameControlTimedEventArgs)args); break;
         case BaseControlEvents.MouseHeld: MouseHeld(sender, args); break;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Handle the transition to the Options screen.
 /// </summary>
 void ClickOptions(IGameControl sender, GameControlEventArgs args)
 {
     SwitchMenuScreen(UIScreenEnum.Options);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Handle the OK click button (return to main screen from sub screen.
        /// </summary>
        void ClickOk(IGameControl sender, GameControlEventArgs args)
        {
            //If this is the options screen, save the selected values;
            if (((TestRootForm)UI.RootForm).ScreenState == UIScreenEnum.Options)
            {
                //Populate local

                //floats
                OptionsTextureSampler = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderSampling")).Value;
                OptionsParticleDensity = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderParticles")).Value;
                OptionsSFXVolume = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderSFX")).Value;
                OptionsMusicVolume = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderMusic")).Value;
                OptionsViewDistance = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderViewDist")).Value;
                OptionsBloomLevel = ((GOOS.JFX.UI.Controls.Slider)UI.RootForm.GetControl("SliderBloom")).Value;

                //bools
                //((GOOS.JFX.UI.Controls.Checkbox)UI.RootForm.GetControl("OptionsCheckFullscreen")).Checked = Stage.ConfigurationSettings.Fullscreen; //HMMMMM
                OptionsMuteMusic = ((GOOS.JFX.UI.Controls.Checkbox)UI.RootForm.GetControl("OptionsCheckMusicMute")).Checked;
                OptionsMuteSFX = ((GOOS.JFX.UI.Controls.Checkbox)UI.RootForm.GetControl("OptionsCheckSFXMute")).Checked;
                OptionsBloomOn = ((GOOS.JFX.UI.Controls.Checkbox)UI.RootForm.GetControl("OptionsCheckBloom")).Checked;

                //Populate config object

                ExtraConfigFile.ExtraFloatSettings["BloomLevel"] = OptionsBloomLevel;
                ExtraConfigFile.ExtraFloatSettings["ParticleDensity"] = OptionsParticleDensity;
                ExtraConfigFile.ExtraFloatSettings["SoundVolume"] = OptionsSFXVolume;
                ExtraConfigFile.ExtraFloatSettings["TextureSampler"] = OptionsTextureSampler;
                ExtraConfigFile.ExtraFloatSettings["ViewDistance"] = OptionsViewDistance;
                ExtraConfigFile.ExtraFloatSettings["MusicVolume"] = OptionsMusicVolume;

                ExtraConfigFile.ExtraBoolSettings["BloomOn"] = OptionsBloomOn;
                ExtraConfigFile.ExtraBoolSettings["MusicMute"] = OptionsMuteMusic;
                ExtraConfigFile.ExtraBoolSettings["SFXMute"] = OptionsMuteSFX;

                //Save config object

                ExtraConfigFile.SaveTofile("CCExtra.config");

                //Set sounds if sounds playing
                if (Ambient_Heart != null)
                    Ambient_Heart.Volume = (OptionsSFXVolume / 100);
                if (Ambient_Monster != null)
                    Ambient_Monster.Volume = (OptionsSFXVolume / 100);
                if(Ambient_Wind != null)
                    Ambient_Wind.Volume = (OptionsSFXVolume / 100);
                if (MusicPlaying)
                    MediaPlayer.Volume = (OptionsMusicVolume / 100);

                //Set particle density
                ((SmokePlumeParticleSystem)smokePlumeParticles).Density = (int)OptionsParticleDensity;
                ((AntiFireParticleSystem)antifireParticles).Density = (int)OptionsParticleDensity;
                ((FireParticleSystem)fireParticles).Density = (int)OptionsParticleDensity;

                //Bloom
                bloom.Settings.BloomIntensity = 3.0f * (OptionsBloomLevel / 100);

            }

            if (((TestRootForm)UI.RootForm).ScreenState == UIScreenEnum.EnterName)
            {
                CurrentScoreInfo.ExtendedValues["name"] = ((TextBox)UI.RootForm.GetControl("KeyboardTestLabel")).Text;
                HiScores.AddScore(CurrentScoreInfo);
                HiScores.SaveToFile("CreatureCave.hiscores");
                SwitchMenuScreen(UIScreenEnum.Hiscore);
            }
            else
                SwitchMenuScreen(UIScreenEnum.MainMenu);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Handle the New Game button click event
 /// </summary>
 void ClickNew(IGameControl sender, GameControlEventArgs args)
 {
     Stage.GameState.DemoMode = false;
     Stage.GameState.Pause = false;
     Stage.GameState.Menu = false;
     Stage.GameState.Intro = false;
     Stage.GameState.Console = false;
     Score = 0;
     Level = 0;
     GenerateNewMap();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Handle the transition to the hi score screen.
 /// </summary>	
 void ClickHiScore(IGameControl sender, GameControlEventArgs args)
 {
     SwitchMenuScreen(UIScreenEnum.Hiscore);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Handle the transition to the Help screen
 /// </summary>
 void ClickHelp(IGameControl sender, GameControlEventArgs args)
 {
     SwitchMenuScreen(UIScreenEnum.Help);
 }