Ignore:
Timestamp:
Sep 14, 2024, 6:20:50 PM (2 months ago)
Author:
chronos
Message:
  • Added: Allow to scroll map with Ctrl+arrows/num keys.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r614 r615  
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1414  LCLIntf, LCLType, Menus, SysUtils, Classes, DrawDlg, Types, Math,
    15   DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area,
     15  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area, Help,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
    1717  Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx,
    18   Help,
    1918  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.Menus, Dpi.ExtCtrls,
    2019  Dpi.PixelPointer, Dpi.Common, System.UITypes{$ELSE}
     
    244243      Shift: TShiftState; X, Y: Integer);
    245244    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     245    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    246246    procedure mDisbandOrUtilizeClick(Sender: TObject);
    247247    procedure FormResize(Sender: TObject);
     
    270270    procedure mNamesClick(Sender: TObject);
    271271    procedure MapBtnClick(Sender: TObject);
    272     procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    273272    procedure CreateUnitClick(Sender: TObject);
    274273    procedure mSoundOffClick(Sender: TObject);
     
    71207119  end;
    71217120
     7121  procedure DoMoveMap(X, Y: Integer);
     7122  var
     7123    ScrollSpeed: Integer;
     7124  begin
     7125    if mScrollFast.Checked then ScrollSpeed := 2
     7126      else ScrollSpeed := 1;
     7127    if (X <> 0) or (Y <> 0) then begin
     7128      Scroll(X * ScrollSpeed, Y * ScrollSpeed);
     7129    end;
     7130  end;
     7131
    71227132var
    71237133  Time0, Time1: TDateTime;
     
    72417251      InitPopup(TerrainPopup);
    72427252      if mEnhance.Visible and mEnhance.Enabled then mEnhance.Click
    7243         else mEnhanceDef.Click
     7253        else mEnhanceDef.Click;
    72447254    end
    72457255    else if BGoOn.Test(ShortCut) then MenuClick_Check(UnitPopup, mGoOn)
     
    72677277    else if BRecover.Test(ShortCut) then MenuClick_Check(UnitPopup, mRecover)
    72687278    else if BUtilize.Test(ShortCut) then MenuClick_Check(UnitPopup, mUtilize)
    7269     else if BMoveLeftDown.Test(ShortCut) then DoMoveUnit(-1, 1)
    7270     else if BMoveDown.Test(ShortCut) then DoMoveUnit(0, 2)
    7271     else if BMoveRightDown.Test(ShortCut) then DoMoveUnit(1, 1)
    7272     else if BMoveLeft.Test(ShortCut) then DoMoveUnit(-2, 0)
    7273     else if BMoveRight.Test(ShortCut) then DoMoveUnit(2, 0)
    7274     else if BMoveLeftUp.Test(ShortCut) then DoMoveUnit(-1, -1)
    7275     else if BMoveUp.Test(ShortCut) then  DoMoveUnit(0, -2)
    7276     else if BMoveRightUp.Test(ShortCut) then DoMoveUnit(1, -1);
     7279    // Unit move
     7280    else if BUnitMoveLeftDown.Test(ShortCut) then DoMoveUnit(-1, 1)
     7281    else if BUnitMoveDown.Test(ShortCut) then DoMoveUnit(0, 2)
     7282    else if BUnitMoveRightDown.Test(ShortCut) then DoMoveUnit(1, 1)
     7283    else if BUnitMoveLeft.Test(ShortCut) then DoMoveUnit(-2, 0)
     7284    else if BUnitMoveRight.Test(ShortCut) then DoMoveUnit(2, 0)
     7285    else if BUnitMoveLeftUp.Test(ShortCut) then DoMoveUnit(-1, -1)
     7286    else if BUnitMoveUp.Test(ShortCut) then  DoMoveUnit(0, -2)
     7287    else if BUnitMoveRightUp.Test(ShortCut) then DoMoveUnit(1, -1)
     7288    // Map move
     7289    else if BMapMoveLeftDown.Test(ShortCut) then DoMoveMap(-1, 1)
     7290    else if BMapMoveDown.Test(ShortCut) then DoMoveMap(0, 2)
     7291    else if BMapMoveRightDown.Test(ShortCut) then DoMoveMap(1, 1)
     7292    else if BMapMoveLeft.Test(ShortCut) then DoMoveMap(-2, 0)
     7293    else if BMapMoveRight.Test(ShortCut) then DoMoveMap(2, 0)
     7294    else if BMapMoveLeftUp.Test(ShortCut) then DoMoveMap(-1, -1)
     7295    else if BMapMoveUp.Test(ShortCut) then DoMoveMap(0, -2)
     7296    else if BMapMoveRightUp.Test(ShortCut) then DoMoveMap(1, -1);
    72777297  end;
    72787298end;
Note: See TracChangeset for help on using the changeset viewer.