- Timestamp:
- Jun 11, 2020, 12:40:26 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Integrated.lpi
r259 r261 95 95 </Item2> 96 96 </RequiredPackages> 97 <Units Count="4 1">97 <Units Count="42"> 98 98 <Unit0> 99 99 <Filename Value="Integrated.lpr"/> … … 332 332 <IsPartOfProject Value="True"/> 333 333 </Unit40> 334 <Unit41> 335 <Filename Value="UKeyBindings.pas"/> 336 <IsPartOfProject Value="True"/> 337 </Unit41> 334 338 </Units> 335 339 </ProjectOptions> -
trunk/LocalPlayer/Help.pas
r245 r261 127 127 128 128 uses 129 Directories, ClientTools, Term, Tribes, Inp, Messg, UPixelPointer, Global; 129 Directories, ClientTools, Term, Tribes, Inp, Messg, UPixelPointer, Global, 130 UKeyBindings; 130 131 131 132 {$R *.lfm} … … 2010 2011 Shift: TShiftState); 2011 2012 begin 2012 if Key = VK_F1then // my key2013 if KeyToShortCut(Key, Shift) = BHelp.ShortCut then // my key 2013 2014 else 2014 inherited 2015 inherited; 2015 2016 end; 2016 2017 -
trunk/LocalPlayer/Term.pas
r260 r261 481 481 Directories, IsoEngine, CityScreen, Draft, MessgEx, Select, CityType, Help, 482 482 UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, UPixelPointer, Sound, 483 Battle, Rates, TechTree, Registry, Global ;483 Battle, Rates, TechTree, Registry, Global, UKeyBindings; 484 484 485 485 {$R *.lfm} … … 6453 6453 dx, dy: integer; 6454 6454 time0, time1: TDateTime; 6455 begin 6455 ShortCut: TShortCut; 6456 begin 6457 ShortCut := KeyToShortCut(Key, Shift); 6458 6456 6459 if GameMode = cMovie then 6457 6460 begin … … 6493 6496 'R': 6494 6497 MenuClick(mRandomMap); 6495 end6496 else if Shift = [] then6497 case char(Key) of6498 char(VK_F1):6499 MenuClick(mHelp);6500 6498 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); 6503 6514 6504 6515 if Shift = [ssAlt] then … … 6547 6558 else if Shift = [] then 6548 6559 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;6571 6560 '1': 6572 6561 MapBtnClick(MapBtn0); -
trunk/Start.pas
r259 r261 165 165 166 166 uses 167 Global, Directories, Direct, ScreenTools, Inp, Back, Settings, UPixelPointer; 167 Global, Directories, Direct, ScreenTools, Inp, Back, Settings, UPixelPointer, 168 UKeyBindings; 168 169 169 170 {$R *.lfm} … … 224 225 PlayerAutoDiff: array [1 .. 5] of integer = (1, 1, 2, 2, 3); 225 226 EnemyAutoDiff: array [1 .. 5] of integer = (4, 3, 2, 1, 1); 227 KeyBindingsFileName = 'KeyBindings.txt'; 226 228 227 229 { TMiniMap } … … 435 437 PlayerSlot: TPlayerSlot; 436 438 AIBrains: TBrains; 439 KeyBindingsAbsoluteFileName: string; 437 440 begin 438 441 PlayerSlots := TPlayerSlots.Create; … … 445 448 LoadConfig; 446 449 LoadAssets; 450 KeyBindingsAbsoluteFileName := DataDir + DirectorySeparator + KeyBindingsFileName; 451 if FileExists(KeyBindingsAbsoluteFileName) then KeyBindings.LoadFromFile(KeyBindingsAbsoluteFileName) 452 else begin 453 ForceDirectories(ExtractFileDir(KeyBindingsAbsoluteFileName)); 454 KeyBindings.SaveToFile(KeyBindingsAbsoluteFileName); 455 end; 447 456 448 457 ActionsOffered := [maConfig, maManual, maCredits, maWeb]; … … 1963 1972 Shift: TShiftState); 1964 1973 begin 1965 if (Shift = []) and (Key = VK_F1)then1974 if KeyToShortCut(Key, Shift) = BHelp.ShortCut then 1966 1975 DirectHelp(cStartHelp); 1967 1976 end;
Note:
See TracChangeset
for help on using the changeset viewer.