Ignore:
Timestamp:
Feb 26, 2021, 9:43:24 PM (4 years ago)
Author:
chronos
Message:
  • Added: Supported more key bindings.
  • Fixed: Wrong default binding for NoOrder (space key).
  • Modified: Pushed trunk version to 1.3.0.
  • Modified: Update readme.txt with information for development.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r263 r288  
    283283    procedure OnEOT(var Msg: TMessage); message WM_EOT;
    284284    procedure SoundPreload(Check: integer);
     285    procedure UpdateKeyShortcuts;
    285286  public
    286287    UsedOffscreenWidth, UsedOffscreenHeight: integer;
     
    34043405  i, j: integer;
    34053406begin
     3407  UpdateKeyShortcuts;
     3408
    34063409  MainFormKeyDown := FormKeyDown;
    34073410  BaseWin.CreateOffscreen(Offscreen);
     
    36173620  CanClose := Closable;
    36183621  if not Closable and idle and (me = 0) and (ClientMode < scContact) then
    3619     MenuClick(mResign)
     3622    MenuClick(mResign);
    36203623end;
    36213624
     
    36303633procedure TMainScreen.OnEOT(var Msg: TMessage);
    36313634begin
    3632   EndTurn
     3635  EndTurn;
    36333636end;
    36343637
     
    36383641  begin
    36393642    MessgExDlg.CancelMovie;
    3640     Server(sBreak, me, 0, nil^)
     3643    Server(sBreak, me, 0, nil^);
    36413644  end
    36423645  else if ClientMode < 0 then
     
    36473650  begin
    36483651    Jump[pTurn] := 0;
    3649     StartRunning := false
     3652    StartRunning := false;
    36503653  end
    36513654  else
    3652     EndTurn
     3655    EndTurn;
    36533656end;
    36543657
     
    64406443end;
    64416444
     6445procedure TMainScreen.UpdateKeyShortcuts;
     6446begin
     6447  mHelp.ShortCut := BHelp.ShortCut;
     6448  mUnitStat.ShortCut := BUnitStat.ShortCut;
     6449  mCityStat.ShortCut := BCityStat.ShortCut;
     6450  mScienceStat.ShortCut := BScienceStat.ShortCut;
     6451  mEUnitStat.ShortCut := BEUnitStat.ShortCut;;
     6452  mDiagram.ShortCut := BDiagram.ShortCut;
     6453  mWonders.ShortCut := BWonders.ShortCut;
     6454  mShips.ShortCut := BShips.ShortCut;
     6455  mNations.ShortCut := BNations.ShortCut;
     6456  mEmpire.ShortCut := BEmpire.ShortCut;
     6457  mResign.ShortCut := BResign.ShortCut;
     6458  mRandomMap.ShortCut := BRandomMap.ShortCut;
     6459  mDisband.ShortCut := BDisbandUnit.ShortCut;
     6460  mFort.ShortCut := BFortify.ShortCut;
     6461  mCentre.ShortCut := BCenterUnit.ShortCut;
     6462  mStay.ShortCut := BStay.ShortCut;
     6463  mNoOrders.ShortCut := BNoOrders.ShortCut;
     6464  mTechTree.ShortCut := BTechTree.ShortCut;
     6465  mWait.ShortCut := BWait.ShortCut;
     6466  mJump.ShortCut := BJump.ShortCut;;
     6467end;
     6468
    64426469procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: word;
    64436470  Shift: TShiftState);
     
    65136540    end
    65146541  end else if Shift = [ssCtrl] then begin
     6542    if ShortCut = BJump.ShortCut then MenuClick(mJump);
    65156543    case char(Key) of
    6516       'J': MenuClick(mJump);
    65176544      'K': mShowClick(mDebugMap);
    65186545      'L': mShowClick(mLocCodes);
     
    65426569      '4': MapBtnClick(MapBtn5);
    65436570      '5': MapBtnClick(MapBtn6);
    6544       'T': MenuClick(mTechTree);
    6545       'W': MenuClick(mWait);
    65466571    end;
     6572    if ShortCut = BTechTree.ShortCut then MenuClick(mTechTree)
     6573    else if ShortCut = BWait.ShortCut then MenuClick(mWait);
    65476574  end;
    65486575
Note: See TracChangeset for help on using the changeset viewer.