Changeset 263
- Timestamp:
- Jun 11, 2020, 10:57:27 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r261 r263 6460 6460 begin 6461 6461 case Key of 6462 VK_F4: 6463 MenuClick_Check(StatPopup, mScienceStat); 6464 VK_F6: 6465 MenuClick_Check(StatPopup, mDiagram); 6466 VK_F7: 6467 MenuClick_Check(StatPopup, mWonders); 6468 VK_F8: 6469 MenuClick_Check(StatPopup, mShips); 6462 VK_F4: MenuClick_Check(StatPopup, mScienceStat); 6463 VK_F6: MenuClick_Check(StatPopup, mDiagram); 6464 VK_F7: MenuClick_Check(StatPopup, mWonders); 6465 VK_F8: MenuClick_Check(StatPopup, mShips); 6470 6466 end; 6471 6467 exit; 6472 6468 end; 6473 6469 6474 if not idle then 6475 exit; 6476 6477 if ClientMode = cEditMap then 6478 begin 6479 if Shift = [ssCtrl] then 6470 if not idle then exit; 6471 6472 if ClientMode = cEditMap then begin 6473 if ShortCut = BResign.ShortCut then MenuClick(mResign) 6474 else if ShortCut = BRandomMap.ShortCut then MenuClick(mRandomMap) 6475 else if ShortCut = BHelp.ShortCut then MenuClick(mHelp); 6476 (*if Shift = [ssCtrl] then 6480 6477 case char(Key) of 6481 (*'A':6478 'A': 6482 6479 begin // auto symmetry 6483 6480 Server($7F0,me,0,nil^); … … 6491 6488 if MyMap[dx] and fTerrain>=fGrass then inc(dy); 6492 6489 dy:=dy 6493 end; *) 6494 'Q': 6495 MenuClick(mResign); 6496 'R': 6497 MenuClick(mRandomMap); 6490 end; 6498 6491 end; 6499 if ShortCut = BHelp.ShortCut then MenuClick(mHelp); 6492 *) 6493 6500 6494 Exit; 6501 6495 end; … … 6513 6507 else if ShortCut = BEmpire.ShortCut then MenuClick_Check(StatPopup, mEmpire); 6514 6508 6515 if Shift = [ssAlt] then 6509 if Shift = [ssAlt] then begin 6516 6510 case char(Key) of 6517 '0': 6518 SetDebugMap(-1); 6519 '1' .. '9': 6520 SetDebugMap(ord(Key) - 48); 6511 '0': SetDebugMap(-1); 6512 '1'..'9': SetDebugMap(ord(Key) - 48); 6521 6513 end 6522 e lse if Shift = [ssCtrl] then6514 end else if Shift = [ssCtrl] then begin 6523 6515 case char(Key) of 6524 'J': 6525 MenuClick(mJump); 6526 'K': 6527 mShowClick(mDebugMap); 6528 'L': 6529 mShowClick(mLocCodes); 6530 'M': 6531 if LogDlg.Visible then 6532 LogDlg.Close 6533 else 6534 LogDlg.Show; 6535 'N': 6536 mNamesClick(mNames); 6537 'Q': 6538 MenuClick_Check(GamePopup, mResign); 6539 'R': 6540 MenuClick(mRun); 6541 '0' .. '9': 6542 begin 6543 if ord(Key) - 48 = me then 6544 SetViewpoint(0) 6545 else 6546 SetViewpoint(ord(Key) - 48); 6516 'J': MenuClick(mJump); 6517 'K': mShowClick(mDebugMap); 6518 'L': mShowClick(mLocCodes); 6519 'M': if LogDlg.Visible then LogDlg.Close 6520 else LogDlg.Show; 6521 'N': mNamesClick(mNames); 6522 'Q': MenuClick_Check(GamePopup, mResign); 6523 'R': MenuClick(mRun); 6524 '0'..'9': begin 6525 if ord(Key) - 48 = me then SetViewpoint(0) 6526 else SetViewpoint(ord(Key) - 48); 6547 6527 end; 6548 ' ': 6549 begin // test map repaint time 6528 ' ': begin // test map repaint time 6550 6529 time0 := NowPrecise; 6551 6530 MapValid := false; … … 6554 6533 SimpleMessage(Format('Map repaint time: %.3f ms', 6555 6534 [(time1 - time0) / OneMillisecond])); 6556 end 6535 end; 6557 6536 end 6558 e lse if Shift = [] then6537 end else if Shift = [] then begin 6559 6538 case char(Key) of 6560 '1': 6561 MapBtnClick(MapBtn0); 6562 '2': 6563 MapBtnClick(MapBtn1); 6564 '3': 6565 MapBtnClick(MapBtn4); 6566 '4': 6567 MapBtnClick(MapBtn5); 6568 '5': 6569 MapBtnClick(MapBtn6); 6570 'T': 6571 MenuClick(mTechTree); 6572 'W': 6573 MenuClick(mWait); 6539 '1': MapBtnClick(MapBtn0); 6540 '2': MapBtnClick(MapBtn1); 6541 '3': MapBtnClick(MapBtn4); 6542 '4': MapBtnClick(MapBtn5); 6543 '5': MapBtnClick(MapBtn6); 6544 'T': MenuClick(mTechTree); 6545 'W': MenuClick(mWait); 6574 6546 end; 6575 6576 if UnFocus >= 0 then 6577 if Shift = [ssCtrl] then 6547 end; 6548 6549 if UnFocus >= 0 then begin 6550 if ShortCut = BDisbandUnit.ShortCut then MenuClick(mDisband) 6551 else if ShortCut = BFortify.ShortCut then MenuClick_Check(TerrainPopup, mFort) 6552 else if ShortCut = BCenterUnit.ShortCut then MenuClick(mCentre) 6553 else if ShortCut = BStay.ShortCut then MenuClick(mStay) 6554 else if ShortCut = BNoOrders.ShortCut then MenuClick(mNoOrders); 6555 6556 if Shift = [ssCtrl] then begin 6578 6557 case char(Key) of 6579 'C': 6580 MenuClick_Check(UnitPopup, mCancel); 6581 'D': 6582 MenuClick(mDisband); 6583 'P': 6584 MenuClick_Check(UnitPopup, mPillage); 6585 'T': 6586 MenuClick_Check(UnitPopup, mSelectTransport); 6587 end 6588 else if Shift = [] then 6558 'C': MenuClick_Check(UnitPopup, mCancel); 6559 'P': MenuClick_Check(UnitPopup, mPillage); 6560 'T': MenuClick_Check(UnitPopup, mSelectTransport); 6561 end; 6562 end else if Shift = [] then begin 6589 6563 case char(Key) of 6590 ' ': 6591 MenuClick(mNoOrders); 6592 'A': 6593 MenuClick_Check(TerrainPopup, mAirBase); 6594 'B': 6595 MenuClick_Check(UnitPopup, mCity); 6596 'C': 6597 MenuClick(mCentre); 6598 'E': 6599 begin 6564 'A': MenuClick_Check(TerrainPopup, mAirBase); 6565 'B': MenuClick_Check(UnitPopup, mCity); 6566 'E': begin 6600 6567 InitPopup(TerrainPopup); 6601 6568 if mEnhance.Visible and mEnhance.Enabled then 6602 6569 MenuClick(mEnhance) 6603 else 6604 MenuClick(mEnhanceDef) 6570 else MenuClick(mEnhanceDef) 6605 6571 end; 6606 'F': 6607 MenuClick_Check(TerrainPopup, mFort); 6608 'G': 6609 MenuClick_Check(UnitPopup, mGoOn); 6610 'H': 6611 MenuClick_Check(UnitPopup, mHome); 6612 'I': 6613 if JobTest(UnFocus, jFarm, [eTreaty]) then 6572 'G': MenuClick_Check(UnitPopup, mGoOn); 6573 'H': MenuClick_Check(UnitPopup, mHome); 6574 'I': if JobTest(UnFocus, jFarm, [eTreaty]) then 6614 6575 MenuClick(mFarm) 6615 6576 else if JobTest(UnFocus, jClear, [eTreaty]) then 6616 6577 MenuClick(mClear) 6617 else 6618 MenuClick_Check(TerrainPopup, mIrrigation); 6619 'L': 6620 MenuClick_Check(UnitPopup, mLoad); 6621 'M': 6622 if JobTest(UnFocus, jAfforest, [eTreaty]) then 6578 else MenuClick_Check(TerrainPopup, mIrrigation); 6579 'L': MenuClick_Check(UnitPopup, mLoad); 6580 'M': if JobTest(UnFocus, jAfforest, [eTreaty]) then 6623 6581 MenuClick(mAfforest) 6624 else 6625 MenuClick_Check(TerrainPopup, mMine); 6626 'N': 6627 MenuClick_Check(TerrainPopup, mCanal); 6628 'O': 6629 MenuClick_Check(TerrainPopup, MTrans); 6630 'P': 6631 MenuClick_Check(TerrainPopup, mPollution); 6632 'R': 6633 if JobTest(UnFocus, jRR, [eTreaty]) then 6582 else MenuClick_Check(TerrainPopup, mMine); 6583 'N': MenuClick_Check(TerrainPopup, mCanal); 6584 'O': MenuClick_Check(TerrainPopup, MTrans); 6585 'P': MenuClick_Check(TerrainPopup, mPollution); 6586 'R': if JobTest(UnFocus, jRR, [eTreaty]) then 6634 6587 MenuClick(mRR) 6635 else 6636 MenuClick_Check(TerrainPopup, mRoad); 6637 'S': 6638 MenuClick(mStay); 6639 'U': 6640 MenuClick_Check(UnitPopup, mUnload); 6641 'V': 6642 MenuClick_Check(UnitPopup, mRecover); 6643 'Z': 6644 MenuClick_Check(UnitPopup, mUtilize); 6588 else MenuClick_Check(TerrainPopup, mRoad); 6589 'U': MenuClick_Check(UnitPopup, mUnload); 6590 'V': MenuClick_Check(UnitPopup, mRecover); 6591 'Z': MenuClick_Check(UnitPopup, mUtilize); 6645 6592 #33 .. #40, #97 .. #100, #102 .. #105: 6646 6593 begin { arrow keys } … … 6693 6640 MoveUnit(dx, dy, muAutoNext) 6694 6641 end; 6695 end 6642 end; 6643 end; 6644 end; 6696 6645 end; 6697 6646 -
trunk/UKeyBindings.pas
r262 r263 38 38 BNations: TKeyBinding; 39 39 BEmpire: TKeyBinding; 40 BResign: TKeyBinding; 41 BRandomMap: TKeyBinding; 42 BDisbandUnit: TKeyBinding; 43 BFortify: TKeyBinding; 44 BCenterUnit: TKeyBinding; 45 BStay: TKeyBinding; 46 BNoOrders: TKeyBinding; 40 47 41 48 … … 113 120 114 121 KeyBindings := TKeyBindings.Create; 115 BEndTurn := KeyBindings.AddItem('EndTurn', 'End turn', 'NumPlus'); 116 BHelp := KeyBindings.AddItem('Help', 'Help', 'F1'); 117 BUnitStat := KeyBindings.AddItem('UnitStat', 'Unit stat', 'F2'); 118 BCityStat := KeyBindings.AddItem('CityStat', 'City stat', 'F3'); 119 BScienceStat := KeyBindings.AddItem('ScienceStat', 'Science research', 'F4'); 120 BEUnitStat := KeyBindings.AddItem('EnemyUnitStat', 'Enemy unit stat', 'F5'); 121 BDiagram := KeyBindings.AddItem('Diagram', 'Charts', 'F6'); 122 BWonders := KeyBindings.AddItem('Wonders', 'World wonders', 'F7'); 123 BShips := KeyBindings.AddItem('Ships', 'Colonization ships', 'F8'); 124 BNations := KeyBindings.AddItem('Nations', 'Nations', 'F9'); 125 BEmpire := KeyBindings.AddItem('Empire', 'Empire', 'F10'); 122 with KeyBindings do begin 123 BEndTurn := AddItem('EndTurn', 'End turn', 'NumPlus'); 124 BHelp := AddItem('Help', 'Help', 'F1'); 125 BUnitStat := AddItem('UnitStat', 'Unit stat', 'F2'); 126 BCityStat := AddItem('CityStat', 'City stat', 'F3'); 127 BScienceStat := AddItem('ScienceStat', 'Science research', 'F4'); 128 BEUnitStat := AddItem('EnemyUnitStat', 'Enemy unit stat', 'F5'); 129 BDiagram := AddItem('Diagram', 'Charts', 'F6'); 130 BWonders := AddItem('Wonders', 'World wonders', 'F7'); 131 BShips := AddItem('Ships', 'Colonization ships', 'F8'); 132 BNations := AddItem('Nations', 'Nations', 'F9'); 133 BEmpire := AddItem('Empire', 'Empire', 'F10'); 134 BResign := AddItem('Resign', 'Resign', 'Ctrl+Q'); 135 BRandomMap := AddItem('RandomMap', 'Random map', 'Ctrl+R'); 136 BDisbandUnit := AddItem('DisbandUnit', 'Disband unit', 'Ctrl+D'); 137 BFortify := AddItem('Fortify', 'Fortify', 'F'); 138 BCenterUnit := AddItem('CenterUnit', 'Center', 'C'); 139 BStay := AddItem('Stay', 'Stay', 'S'); 140 BNoOrders := AddItem('NoOrders', 'No orders', ' '); 141 end; 126 142 127 143
Note:
See TracChangeset
for help on using the changeset viewer.