protected override void OnUpdate(SAMTime gameTime, InputState istate)
        {
#if DEBUG
            DebugDisp.IsEnabled = DebugSettings.Get("DebugTextDisplay");
            DebugDisp.Scale     = 0.75f;
#endif

#if (DEBUG && __DESKTOP__)
            if (istate.IsKeyExclusiveJustDown(SKeys.R))
            {
                var xcfg = XConfigFile.LoadFromString(System.IO.File.ReadAllText(@"F:\Symlinks\GridDominance\Data\presets\green_gas.xconf"));
                var pcfg = ParticleEmitterConfig.ParticleEmitterConfigBuilder.LoadFromXConfig(xcfg);
                _banner.CreateEntities(pcfg);
            }
#endif

#if !GD_SHADERLESS
            if (_effectsEnabledCache != MainGame.Inst.Profile.EffectsEnabled)
            {
                _effectsEnabledCache = MainGame.Inst.Profile.EffectsEnabled;

                if (MainGame.Inst.Profile.EffectsEnabled)
                {
                    _banner.CreateEntities(ParticlePresets.GetConfigLetterGreenGas());
                }
                else
                {
                    _banner.RemoveEntities();
                }
            }
#endif
        }
        public override void Update(SAMTime gameTime, InputState istate)
        {
            base.Update(gameTime, istate);

#if (DEBUG && __DESKTOP__)
            if (istate.IsKeyExclusiveJustDown(SKeys.R))
            {
                var xcfg = XConfigFile.LoadFromString(System.IO.File.ReadAllText(@"F:\Symlinks\GridDominance\Data\presets\generic.xconf"));
                var pcfg = ParticleEmitterConfig.ParticleEmitterConfigBuilder.LoadFromXConfig(xcfg);
                _emitter.Alive = false;


                var scrn = HUD.Screen;

                var path = VectorPathBuilder
                           .Start()
                           .MoveTo(scrn.TranslateHUDToGameCoordinates(-WIDTH / 2f, -HEIGHT / 2f))
                           .LineTo(scrn.TranslateHUDToGameCoordinates(-WIDTH / 2f, +HEIGHT / 2f))
                           .LineTo(scrn.TranslateHUDToGameCoordinates(+WIDTH / 2f, +HEIGHT / 2f))
                           .LineTo(scrn.TranslateHUDToGameCoordinates(+WIDTH / 2f, -HEIGHT / 2f))
                           .LineTo(scrn.TranslateHUDToGameCoordinates(-WIDTH / 2f, -HEIGHT / 2f))
                           .Build();

                var cfg = pcfg.Build(Textures.TexParticle, 2f, 3f);

                _emitter = new PathGPUParticleEmitter(scrn, scrn.MapViewportCenter, path, cfg, GDConstants.ORDER_WORLD_SUPEREFFECTS);

                HUD.Screen.Entities.AddEntity(_emitter);
            }
#endif
        }
Esempio n. 3
0
        protected override void OnUpdate(SAMTime gameTime, InputState istate)
        {
            _lifetime += gameTime.ElapsedSeconds;

#if DEBUG
            DebugDisp.IsEnabled = DebugSettings.Get("DebugTextDisplay");
            DebugDisp.Scale     = 0.75f;
#endif

#if (DEBUG && __DESKTOP__)
            if (istate.IsKeyExclusiveJustDown(SKeys.R))
            {
                _banner1.AnimationStartDelay = 0;
                _banner2.AnimationStartDelay = 0;

                var xcfg = XConfigFile.LoadFromString(System.IO.File.ReadAllText(@"F:\Symlinks\GridDominance\Data\presets\auto.xconf"));
                var pcfg = ParticleEmitterConfig.ParticleEmitterConfigBuilder.LoadFromXConfig(xcfg);
                _banner1.CreateEntities(pcfg);
                _banner2.CreateEntities(pcfg);
            }
#endif

            bool trigger = false;
            if (istate.IsKeyExclusiveJustDown(SKeys.AndroidBack))
            {
                istate.SwallowKey(SKeys.AndroidBack, InputConsumer.ScreenAgent);
                trigger = true;
            }
            else if (istate.IsKeyExclusiveJustDown(SKeys.Backspace))
            {
                istate.SwallowKey(SKeys.Backspace, InputConsumer.ScreenAgent);
                trigger = true;
            }

            if (trigger)
            {
                LeaveScreen();
            }
        }