Ignore:
Timestamp:
Jun 11, 2020, 12:40:26 AM (4 years ago)
Author:
chronos
Message:
  • Added: Partial support for key bindings configuration.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r260 r261  
    481481  Directories, IsoEngine, CityScreen, Draft, MessgEx, Select, CityType, Help,
    482482  UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, UPixelPointer, Sound,
    483   Battle, Rates, TechTree, Registry, Global;
     483  Battle, Rates, TechTree, Registry, Global, UKeyBindings;
    484484
    485485{$R *.lfm}
     
    64536453  dx, dy: integer;
    64546454  time0, time1: TDateTime;
    6455 begin
     6455  ShortCut: TShortCut;
     6456begin
     6457  ShortCut := KeyToShortCut(Key, Shift);
     6458
    64566459  if GameMode = cMovie then
    64576460  begin
     
    64936496        'R':
    64946497          MenuClick(mRandomMap);
    6495       end
    6496     else if Shift = [] then
    6497       case char(Key) of
    6498         char(VK_F1):
    6499           MenuClick(mHelp);
    65006498      end;
    6501     exit;
    6502   end;
     6499    if ShortCut = BHelp.ShortCut then MenuClick(mHelp);
     6500    Exit;
     6501  end;
     6502
     6503  if ShortCut = BEndTurn.ShortCut then EndTurn
     6504  else if ShortCut = BHelp.ShortCut then MenuClick(mHelp)
     6505  else if ShortCut = BUnitStat.ShortCut then MenuClick_Check(StatPopup, mUnitStat)
     6506  else if ShortCut = BCityStat.ShortCut then MenuClick_Check(StatPopup, mCityStat)
     6507  else if ShortCut = BScienceStat.ShortCut then MenuClick_Check(StatPopup, mScienceStat)
     6508  else if ShortCut = BEUnitStat.ShortCut then MenuClick_Check(StatPopup, mEUnitStat)
     6509  else if ShortCut = BDiagram.ShortCut then MenuClick_Check(StatPopup, mDiagram)
     6510  else if ShortCut = BWonders.ShortCut then MenuClick_Check(StatPopup, mWonders)
     6511  else if ShortCut = BShips.ShortCut then MenuClick_Check(StatPopup, mShips)
     6512  else if ShortCut = BNations.ShortCut then MenuClick_Check(StatPopup, mNations)
     6513  else if ShortCut = BEmpire.ShortCut then MenuClick_Check(StatPopup, mEmpire);
    65036514
    65046515  if Shift = [ssAlt] then
     
    65476558  else if Shift = [] then
    65486559    case char(Key) of
    6549       char(VK_F1):
    6550         MenuClick(mHelp);
    6551       char(VK_F2):
    6552         MenuClick_Check(StatPopup, mUnitStat);
    6553       char(VK_F3):
    6554         MenuClick_Check(StatPopup, mCityStat);
    6555       char(VK_F4):
    6556         MenuClick_Check(StatPopup, mScienceStat);
    6557       char(VK_F5):
    6558         MenuClick_Check(StatPopup, mEUnitStat);
    6559       char(VK_F6):
    6560         MenuClick_Check(StatPopup, mDiagram);
    6561       char(VK_F7):
    6562         MenuClick_Check(StatPopup, mWonders);
    6563       char(VK_F8):
    6564         MenuClick_Check(StatPopup, mShips);
    6565       char(VK_F9):
    6566         MenuClick_Check(StatPopup, mNations);
    6567       char(VK_F10):
    6568         MenuClick_Check(StatPopup, mEmpire);
    6569       char(VK_ADD):
    6570         EndTurn;
    65716560      '1':
    65726561        MapBtnClick(MapBtn0);
Note: See TracChangeset for help on using the changeset viewer.