internal void BindKey(InputPlayableKeyBoard ip, BindAction ba)
 {
     if (ba == BindAction.ADD)
     {
         if (ip.StateKey == StateKey.DOWN)
         {
             _keysMapperDown.Add(ip);
         }
         else if (ip.StateKey == StateKey.PRESS)
         {
             _keysMapperPress.Add(ip);
         }
         else if (ip.StateKey == StateKey.RELEASE)
         {
             _keysMapperRelease.Add(ip);
         }
         else if (ip.StateKey == StateKey.UP)
         {
             _keysMapperUp.Add(ip);
         }
     }
     else if (ba == BindAction.REMOVE)
     {
         if (ip.StateKey == StateKey.DOWN)
         {
             _keysMapperDown.Remove(ip);
         }
         else if (ip.StateKey == StateKey.PRESS)
         {
             _keysMapperPress.Remove(ip);
         }
         else if (ip.StateKey == StateKey.RELEASE)
         {
             _keysMapperRelease.Remove(ip);
         }
         else if (ip.StateKey == StateKey.UP)
         {
             _keysMapperUp.Remove(ip);
         }
     }
 }
예제 #2
0
파일: InputManager.cs 프로젝트: tubitos/1
 void GameMenu(InputPlayableKeyBoard ipk)
 {
     EngineSettings.freeMouse = !EngineSettings.freeMouse;
 }
 void sc_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     SpriteAnimated sa = sheet.Modelo as SpriteAnimated;
     if (sa.GetCurrentAnimation().Name == "ANIM1")
         sa.ChangeAnimation("ANIM2");
     else
         sa.ChangeAnimation("ANIM1");
 }
 public void ChangeCamera(InputPlayableKeyBoard ipk)
 {
     if (shouldDraw) shouldDraw = false;
     else shouldDraw = true;
     camerasNames.Next();
     this.World.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);    
 }
        public void ChangeGroup(InputPlayableKeyBoard ipk)
        {
            index = (index + 1) % 3;

            ///Turn Off all Masks (we cant turn the GSYSTEM MASK, even if we try ....)
            TurnOffInputMaskCommand tof = new TurnOffInputMaskCommand(InputMask.GALL);
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(tof);

            ///Turn only the right mask
            ///Masks are Bit Field, You can turn more than one using InputMask.GALL | InputMask.G1 for example
            ///The TurnOnInputMaskCommand Just combine its actual mask with the mask provided, It does not TURN OFFthe active masks (this is the reason why i sent a turn off mask before)
            TurnOnInputMaskCommand tom = new TurnOnInputMaskCommand(Im[index] | InputMask.GNONE);            
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(tom);

            isAllActive = false;
            isGroup1 = false;
            isGroup2 = false;
            isComboPressed = false;            
            isChangeGroup = true;
        }
 public void LeaveGame(InputPlayableKeyBoard ipk)
 {
     engine.Exit();
 }
 public void specularChange(InputPlayableKeyBoard ipk)
 {
     foreach (var item in withSpecular)
     {
         DeferredCustomShader shader = item.Material.Shader as DeferredCustomShader;
         System.Diagnostics.Debug.Assert(shader != null);
         shader.UseSpecular = !shader.UseSpecular;
         specular = shader.UseSpecular;
     }
 }
        internal void BindKey(InputPlayableKeyBoard ip, BindAction ba)
        {
            if (ba == BindAction.ADD)
            {
                if (ip.StateKey == StateKey.DOWN)
                {
                    _keysMapperDown.Add(ip);
                }
                else if (ip.StateKey == StateKey.PRESS)
                {
                    _keysMapperPress.Add(ip);

                }
                else if (ip.StateKey == StateKey.RELEASE)
                {
                    _keysMapperRelease.Add(ip);
                }
                else if (ip.StateKey == StateKey.UP)
                {
                    _keysMapperUp.Add(ip);
                }
            }
            else if (ba == BindAction.REMOVE)
            {
                if (ip.StateKey == StateKey.DOWN)
                {
                    _keysMapperDown.Remove(ip);
                }
                else if (ip.StateKey == StateKey.PRESS)
                {
                    _keysMapperPress.Remove(ip);

                }
                else if (ip.StateKey == StateKey.RELEASE)
                {
                    _keysMapperRelease.Remove(ip);
                }
                else if (ip.StateKey == StateKey.UP)
                {
                    _keysMapperUp.Remove(ip);
                }
            }            
            
        }
 public void diminuiBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y - 0.001f);
 }
 public void aumentaBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y + 0.001f);
 }
 void ipk_KeyStateChange2(InputPlayableKeyBoard ipk)
 {
     if (wh.CurrentWaypointsCollection.State == WaypointsState.Connected)
     {
         wh.SaveConnectedWaypoints("savedwaypoints.xml");
         saved = true;
     }            
 }
 void ipk_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     if (wh.CurrentWaypointsCollection.State == WaypointsState.UnConnected)
     {
         List<Waypoint> waypointsList = wh.CurrentWaypointsCollection.GetWaypointsList();
         if (waypointsList.Count > 0)
         {
             VisibilityWaypointConnector VisibilityWaypointConnector = new VisibilityWaypointConnector(this.World);
             wh.ConnectWaypoints(VisibilityWaypointConnector);
         }
     }
 }
예제 #13
0
 /// <summary>
 /// Removes the KeyBoard binding.
 /// </summary>
 /// <param name="ipk">The InputPlayableKeyBoard.</param>
 public void RemoveInputBinding(InputPlayableKeyBoard ipk)
 {
     System.Diagnostics.Debug.Assert(ipk != null);
     BindKeyCommand bc = KeyBinds[ipk];
     if (bc != null)
     {
         bc.BindAction = BindAction.REMOVE;
         CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bc);
     }
 }
예제 #14
0
 /// <summary>
 /// Binds the KeyBoard input.
 /// </summary>
 /// <param name="ipk">The InputPlayableKeyBoard.</param>
 public void BindInput(InputPlayableKeyBoard ipk)
 {
     System.Diagnostics.Debug.Assert(ipk != null);
     BindKeyCommand bkc = new BindKeyCommand(ipk, BindAction.ADD);
     KeyBinds.Add(ipk,bkc);
     CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc);
 }
예제 #15
0
파일: InputManager.cs 프로젝트: tubitos/1
 void Save(InputPlayableKeyBoard ipk)
 {
     Saver.Save();
 }
예제 #16
0
 public void Active(InputPlayableKeyBoard ipk)
 {
     ssao.Enabled = !ssao.Enabled;
 }
 public BindKeyCommand(InputPlayableKeyBoard ip, BindAction ba)
 {
     this.ip = ip;
     this.ba = ba;
 }
 public void EnableDisableParalax(InputPlayableKeyBoard ipk)
 {
     paralax.UseParalax = !paralax.UseParalax;
 }
 public void bumpChange(InputPlayableKeyBoard ipk)
 {
     foreach (var item in withBump)
     {
         DeferredCustomShader shader = item.Material.Shader as DeferredCustomShader;
         System.Diagnostics.Debug.Assert(shader != null);
         shader.UseBump = !shader.UseBump;
         bump = shader.UseBump;
     }
 }
 public void EnableDisableBump(InputPlayableKeyBoard ipk)
 {
     paralax.UseBump = !paralax.UseBump;
 }
 public void ChangeDemo(InputPlayableKeyBoard ipk)
 {
     if(this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active)
         this.ScreenState = ScreenState.Hidden;
     if (active != null)
         ScreenManager.RemoveScreen(active);
     active = GetScreen(screenList[index % screenList.GetLength(0)]);
     ScreenManager.AddScreen(active);
     index++;
 }
 public BindKeyCommand(InputPlayableKeyBoard ip, BindAction ba)
 {
     this.ip = ip;
     this.ba = ba;
 }
 public void g2(InputPlayableKeyBoard ipk)
 {
     isGroup1 = false;
     isComboPressed = false;
     isGroup2 = true;
 }
 void key_KeyStateChange2(InputPlayableKeyBoard ipk)
 {
     NetWorkEchoMessageClient c = new NetWorkEchoMessageClient("teste",
         (mes) =>
         {
             mes.Write("TESTE");
             return mes;
         }
     ,
     (mes) =>
     {
         ///server will change the message =P (just  a test ...)
         Debug.Assert(mes.ReadString() == "TESTE123");
     }
     );
     client.AddNetWorkEchoMessage(c,true);
 }
 public void Multiple(InputPlayableKeyBoard ipk)
 {
     isGroup1 = false;
     isGroup2 = false;
     isComboPressed = true;
 }
        void key_KeyStateChange(InputPlayableKeyBoard ipk)
        {
            NetWorkClientObject no = new NetWorkClientObject("simpleball",

                (mes) =>
                {
                    mes.WriteSphere(new Vector3(50, 50, 10), 1, 1, 10, MaterialDescription.DefaultBepuMaterial());
                    return mes;
                },
                (mes,id) =>
                {
                        SimpleModel simpleModel = new SimpleModel(this.GraphicFactory, "Model//ball");
                        SphereObject sphere =  mes.ReadSphere();
                        DeferredNormalShader shader = new DeferredNormalShader();                        
                        DeferredMaterial fmaterial = new DeferredMaterial(shader);
                        IObject obj = new IObject(fmaterial, simpleModel, sphere);
                        obj.SetId(id);
                        return obj;
                }
            );

            client.CreateNetWorkObject(no);
        }
 /// <summary>
 /// Release the objects
 /// </summary>
 /// <param name="ipk"></param>
 private void releaseObjects(InputPlayableKeyBoard ipk)
 {
     foreach (var item in objects)
     {
         item.PhysicObject.isMotionLess = false;
     }
 }
예제 #28
0
 void ik_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     if(ssao.Enabled)
         ssao.OutputONLYSSAOMAP = !ssao.OutputONLYSSAOMAP;
 }
        /// <summary>
        /// Chamada qd Espaco for pressionado
        /// </summary>
        /// <param name="ipk"></param>
        void KeyStateChange(InputPlayableKeyBoard ipk)
        {
            ///TO CHANGE ONLY IN THE END OF THE INTERPOLATION
            //if (mundo.CameraManager.ActiveCameraType != State.INTERPOLATING)
            //{ 
                //camerasNames.Next();
                //mundo.CameraManager.SetActiveCamera(camerasNames.Value,InterpolationType.BYSTEP, 0.005f);
                //mundo.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);
            //}

            ///Avanca o ponteiro da lista circular            
            camerasNames.Next();
            ///Ativa a camera correspondente
            ///Existem dois interpoladores, Por tempo (demora um tempo fixo independententemente da distancia)
            ///e um Por Etapa, que tem uma velocidade fixa de movimentacao (independente de quanto tempo for levar)
            this.World.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);            
        }
        public void ChangeDemo(InputPlayableKeyBoard ipk)
        {

            ///lazy ways of cycling between demos
            ///just remove everything and load the righ screen

            if (active is LoadingScreen || (active != null && active.IsLoaded == false))
                return;            

            //if(this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active)
            //    this.ScreenState = ScreenState.Hidden;


            foreach (var item in ScreenManager.GetScreens())
            {
                ScreenManager.RemoveScreen(item);
            }
                

            active = GetScreen(screenList[index % screenList.GetLength(0)]);
            ScreenManager.AddScreen(active,new LoadingScreen());
            index++;            
        }