コード例 #1
0
ファイル: GLOBAL.cs プロジェクト: clarvalon/Awakener
 public override void on_key_press(eKeyCode keycode)
 {
     if (IsGamePaused() == 0)
     {
         keycode = 0;
     }
     if (keycode == eKeyCtrlQ)
     {
         QuitGame(1);
     }
     if (keycode == eKeyF9)
     {
         RestartGame();
     }
     if (keycode == eKeyF12)
     {
         SaveScreenShot("scrnshot.pcx");
     }
     if (keycode == eKeyCtrlS)
     {
         Debug(0, 0);
     }
     if (keycode == eKeyCtrlV)
     {
         Debug(1, 0);
     }
     if (keycode == eKeyCtrlA)
     {
         Debug(2, 0);
     }
     if (keycode == eKeyCtrlX)
     {
         Debug(3, 0);
     }
 }
コード例 #2
0
 public void on_key_press(eKeyCode key)
 {
     if (!gGameMenu.Visible)
     {
         return;
     }
     if (MenuType == eMenuCredits)
     {
         SwitchToMenu(eMenuStart);
         return;
     }
     if (key == eKeyEscape)
     {
         CancelMenu();
     }
     else if (key == eKeyUpArrow)
     {
         if (MMSelection > 0)
         {
             MMSelection -= 1;
             UpdateSelection();
         }
     }
     else if (key == eKeyDownArrow)
     {
         if (MMSelection < MMOptionCount - 1)
         {
             MMSelection += 1;
             UpdateSelection();
         }
     }
     else if (key == eKeyLeftArrow)
     {
         ChangeOption(true);
     }
     else if (key == eKeyRightArrow)
     {
         ChangeOption(false);
     }
     else if (key == eKeyReturn || key == eKeySpace)
     {
         ConfirmSelection();
     }
     ClaimEvent();
 }
コード例 #3
0
 public void on_key_press(eKeyCode key)
 {
     if (!RaceBuilderEnabled)
     {
         return;
     }
     if (SelectedPathNode >= 0)
     {
         if (key == eKeyDelete)
         {
             DeleteNode(SelectedPathNode);
         }
         else if (key == eKeyInsert)
         {
             TryInsertNode(SelectedPathNode, mouse.x + GetViewportX(), mouse.y + GetViewportY());
         }
     }
 }
コード例 #4
0
 public override void on_key_press(eKeyCode key)
 {
     if (IsGamePaused())
     {
         return;
     }
     if (!gGameMenu.Visible && (IsAIRace && key != 392 || key == eKeyEscape))
     {
         if (IsAIRace)
         {
             DisplayGameMenu(eMenuMain, false);
         }
         else
         {
             DisplayGameMenu(eMenuMainInGame, true);
         }
         ClaimEvent();
     }
 }
コード例 #5
0
ファイル: AIBuilder.cs プロジェクト: clarvalon/LastAndFurious
 public void on_key_press(eKeyCode key)
 {
     if (!AIBuilderEnabled)
     {
         return;
     }
     if (SelectedPathNode >= 0)
     {
         if (key == eKeyDelete)
         {
             DeleteNode(SelectedPathNode);
         }
         else if (key == eKeyInsert)
         {
             TryInsertNode(SelectedPathNode, mouse.x + GetViewportX(), mouse.y + GetViewportY());
         }
         else if (key == eKeyHome)
         {
             String input = Game.InputBox(StringFormatAGS("Speed (now %.2f)", Paths[SelectedPathNode].speed));
             if (!String.IsNullOrEmpty(input))
             {
                 Paths[SelectedPathNode].speed = input.AsFloat();
             }
         }
         else if (key == eKeyPageUp)
         {
             String input = Game.InputBox(StringFormatAGS("Check radius (now %.2f)", Paths[SelectedPathNode].radius));
             if (!String.IsNullOrEmpty(input))
             {
                 Paths[SelectedPathNode].radius = input.AsFloat();
             }
         }
         else if (key == eKeyPageDown)
         {
             String input = Game.InputBox(StringFormatAGS("Direction threshold (now %.2f)", Paths[SelectedPathNode].threshold));
             if (!String.IsNullOrEmpty(input))
             {
                 Paths[SelectedPathNode].threshold = input.AsFloat();
             }
         }
     }
 }
コード例 #6
0
 public override void on_key_press(eKeyCode keycode)
 {
     if (IsDebugMode)
     {
         if (keycode == eKeyQ)
         {
             DisplayDebugInfo   = !DisplayDebugInfo;
             gDebugInfo.Visible = !gDebugInfo.Visible;
         }
         if (keycode == eKeyW)
         {
             DisplayDebugOverlay = !DisplayDebugOverlay;
             gDebugOver.Visible  = !gDebugOver.Visible;
         }
         if (keycode == eKeyE)
         {
             DisplayDebugAI   = !DisplayDebugAI;
             DisplayDebugRace = !DisplayDebugAI;
             gDebugAI.Visible = DisplayDebugAI;
         }
         if (keycode == eKeyR)
         {
             DisplayDebugRace = !DisplayDebugRace;
             DisplayDebugAI   = !DisplayDebugRace;
             gDebugAI.Visible = DisplayDebugRace;
         }
         if (keycode == eKeyA)
         {
             if (RaceBuilderEnabled)
             {
                 EnableRaceBuilder(false);
             }
             EnableAIBuilder(!AIBuilderEnabled);
         }
         else if (keycode == eKeyZ)
         {
             if (AIBuilderEnabled)
             {
                 EnableAIBuilder(false);
             }
             EnableRaceBuilder(!RaceBuilderEnabled);
         }
         if (keycode == eKeyCtrlS)
         {
             if (AIBuilderEnabled)
             {
                 SaveAIPaths();
             }
             else if (RaceBuilderEnabled)
             {
                 SaveRaceCheckpoints();
             }
         }
         if (keycode == eKeyCtrlL)
         {
             LoadRaceCheckpoints();
             LoadAIPaths();
         }
     }
     if (keycode == eKeyF12)
     {
         SaveScreenShot("$SAVEGAMEDIR$/screenshot.bmp");
     }
     if (keycode == eKeyCtrlV)
     {
         Debug(1, 0);
     }
     if (keycode == eKeyCtrlA)
     {
         Debug(2, 0);
     }
     if (keycode == eKeyCtrlX)
     {
         Debug(3, 0);
     }
 }