Changeset 206 for trunk


Ignore:
Timestamp:
May 21, 2018, 2:50:02 PM (7 years ago)
Author:
chronos
Message:
  • Added: New window to list all available actions with their keyboard shortcuts.
  • Fixed: Keyboard shortcuts didn't worked for FormClient docked into FormMain.
  • Fixed: Signal a turn start to first player if a game is loaded from a file.
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r203 r206  
    11object FormClient: TFormClient
    2   Left = 662
     2  Left = 528
    33  Height = 621
    4   Top = 413
     4  Top = 280
    55  Width = 775
    66  Caption = 'Client'
    77  ClientHeight = 621
    88  ClientWidth = 775
    9   DesignTimePPI = 144
     9  DesignTimePPI = 120
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1717  object StatusBar1: TStatusBar
    1818    Left = 0
    19     Height = 30
    20     Top = 591
     19    Height = 28
     20    Top = 593
    2121    Width = 775
    2222    Panels = <   
     
    3434  object ToolBar1: TToolBar
    3535    Left = 0
    36     Height = 591
     36    Height = 593
    3737    Top = 0
    3838    Width = 32
     
    7575  object PaintBox1: TPaintBox
    7676    Left = 32
    77     Height = 591
     77    Height = 593
    7878    Top = 0
    7979    Width = 743
  • trunk/Forms/UFormClient.pas

    r205 r206  
    217217    Caption := NewCaption;
    218218    Drawing := False;
    219     AGameEndTurn.Enabled := Core.Game.Running;
    220219  end;
    221220end;
     
    299298  TimerPeriod := 0;
    300299  LastTimerTime := Now;
     300  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    301301end;
    302302
  • trunk/Forms/UFormMain.lfm

    r203 r206  
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 587
     7  ClientHeight = 596
    88  ClientWidth = 775
    9   DesignTimePPI = 144
     9  DesignTimePPI = 120
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    7777  object PanelMain: TPanel
    7878    Left = 0
    79     Height = 547
     79    Height = 556
    8080    Top = 40
    8181    Width = 775
     
    9292      object MenuItem2: TMenuItem
    9393        Action = Core.AGameNew
    94         Caption = 'New...'
    9594      end
    9695      object MenuItem3: TMenuItem
     
    108107      object MenuItem15: TMenuItem
    109108        Action = Core.AGameSave
    110         ShortCut = 16467
    111109      end
    112110      object MenuItem29: TMenuItem
    113111        Action = Core.AGameSaveAs
    114         Caption = 'Save as'
    115         ShortCut = 24659
    116112      end
    117113      object MenuItem5: TMenuItem
     
    177173      object MenuItem23: TMenuItem
    178174        Action = Core.AHelp
     175      end
     176      object MenuItem4: TMenuItem
     177        Action = Core.AShowKeyShortcuts
    179178      end
    180179      object MenuItem17: TMenuItem
  • trunk/Forms/UFormMain.pas

    r203 r206  
    4444    MenuItem28: TMenuItem;
    4545    MenuItem29: TMenuItem;
     46    MenuItem4: TMenuItem;
    4647    MenuItemLoadRecent: TMenuItem;
    4748    MenuItem3: TMenuItem;
  • trunk/Languages/xtactics.cs.po

    r203 r206  
    99"MIME-Version: 1.0\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "X-Generator: Poedit 2.0.6\n"
     11"X-Generator: Poedit 1.8.8\n"
    1212"Language: cs\n"
    1313
     
    6464#: tcore.agamesaveas.caption
    6565msgid "Save as..."
    66 msgstr ""
     66msgstr "Uložit jako..."
    6767
    6868#: tcore.ahelp.caption
     
    9393msgstr "Grafy"
    9494
     95#: tcore.ashowkeyshortcuts.caption
     96msgctxt "tcore.ashowkeyshortcuts.caption"
     97msgid "Key shortcuts"
     98msgstr "Klávesové zkratky"
     99
    95100#: tcore.ashowunitmoves.caption
    96101msgctxt "tcore.ashowunitmoves.caption"
     
    191196msgstr "Nápověda"
    192197
     198#: tformkeyshortcuts.caption
     199msgctxt "tformkeyshortcuts.caption"
     200msgid "Key shortcuts"
     201msgstr "Klávesové zkratky"
     202
     203#: tformkeyshortcuts.listview1.columns[0].caption
     204msgid "Action"
     205msgstr "Akce"
     206
     207#: tformkeyshortcuts.listview1.columns[1].caption
     208msgid "Window"
     209msgstr "Okno"
     210
     211#: tformkeyshortcuts.listview1.columns[2].caption
     212msgid "Shortcut"
     213msgstr "Zkratka"
     214
     215#: tformkeyshortcuts.menuitem1.caption
     216msgid "Execute"
     217msgstr "Vykonat"
     218
    193219#: tformmain.atoolbarbigicons.caption
    194220msgctxt "tformmain.atoolbarbigicons.caption"
     
    236262msgstr "Nápověda"
    237263
    238 #: tformmain.menuitem2.caption
    239 msgid "New..."
    240 msgstr ""
    241 
    242264#: tformmain.menuitem22.caption
    243265msgctxt "tformmain.menuitem22.caption"
    244266msgid "Statusbar visible"
    245267msgstr "Viditelná stavová lišta"
    246 
    247 #: tformmain.menuitem29.caption
    248 msgid "Save as"
    249 msgstr ""
    250268
    251269#: tformmain.menuitem8.caption
     
    794812"Vyhodnocení útoku jednotek je určen pravidlem podobným tomu, které je použito u hry Risk. Bitva se skládá z několika bojů. Každá boj útočník může použít do 3 jednotek a obránce do 2 jednotek. Počet jednotek pro každou stranu určuje počet kostek. Obě strany házejí jejich kostkami a seřadí je v sestupném pořadí. Každá strana bere jednu kostku s nejvyšší hodnotou. Ten, který má kostku s vyšší hodnotou vyhrává. V případě remízy, vyhrává obránce. Prohrávající ztrácí své jednotky a další pár kostek je vyhodnocen. Tento proces je vypočítáván automaticky a pro každý plánovaný útok je zobrazena odhadovaná pravděpodobnost.\n"
    795813
     814#: uformkeyshortcuts.sglobal
     815msgid "Global"
     816msgstr "Globální"
     817
     818#: uformkeyshortcuts.smainform
     819msgid "Main window"
     820msgstr "Hlavní okno"
     821
    796822#: uformmain.sturn
    797823msgctxt "uformmain.sturn"
  • trunk/Languages/xtactics.po

    r203 r206  
    8383msgstr ""
    8484
     85#: tcore.ashowkeyshortcuts.caption
     86msgctxt "tcore.ashowkeyshortcuts.caption"
     87msgid "Key shortcuts"
     88msgstr ""
     89
    8590#: tcore.ashowunitmoves.caption
    8691msgctxt "tcore.ashowunitmoves.caption"
     
    181186msgstr ""
    182187
     188#: tformkeyshortcuts.caption
     189msgctxt "tformkeyshortcuts.caption"
     190msgid "Key shortcuts"
     191msgstr ""
     192
     193#: tformkeyshortcuts.listview1.columns[0].caption
     194msgid "Action"
     195msgstr ""
     196
     197#: tformkeyshortcuts.listview1.columns[1].caption
     198msgid "Window"
     199msgstr ""
     200
     201#: tformkeyshortcuts.listview1.columns[2].caption
     202msgid "Shortcut"
     203msgstr ""
     204
     205#: tformkeyshortcuts.menuitem1.caption
     206msgid "Execute"
     207msgstr ""
     208
    183209#: tformmain.atoolbarbigicons.caption
    184210msgctxt "tformmain.atoolbarbigicons.caption"
     
    226252msgstr ""
    227253
    228 #: tformmain.menuitem2.caption
    229 msgid "New..."
    230 msgstr ""
    231 
    232254#: tformmain.menuitem22.caption
    233255msgctxt "tformmain.menuitem22.caption"
    234256msgid "Statusbar visible"
    235 msgstr ""
    236 
    237 #: tformmain.menuitem29.caption
    238 msgid "Save as"
    239257msgstr ""
    240258
     
    773791msgstr ""
    774792
     793#: uformkeyshortcuts.sglobal
     794msgid "Global"
     795msgstr ""
     796
     797#: uformkeyshortcuts.smainform
     798msgid "Main window"
     799msgstr ""
     800
    775801#: uformmain.sturn
    776802msgctxt "uformmain.sturn"
  • trunk/UCore.lfm

    r203 r206  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 811
    6   HorizontalOffset = 330
    7   VerticalOffset = 228
    8   Width = 1258
    9   PPI = 144
    10   object ActionList1: TActionList
     5  Height = 676
     6  HorizontalOffset = 275
     7  VerticalOffset = 190
     8  Width = 1048
     9  PPI = 120
     10  object ActionListMain: TActionList
    1111    Images = ImageListSmall
    12     left = 137
    13     top = 60
     12    left = 114
     13    top = 50
    1414    object AExit: TAction
    1515      Caption = 'Exit'
     
    9595      OnExecute = AGameSaveExecute
    9696    end
     97    object AShowKeyShortcuts: TAction
     98      Caption = 'Key shortcuts'
     99      OnExecute = AShowKeyShortcutsExecute
     100    end
    97101  end
    98102  object ImageListSmall: TImageList
    99     left = 786
    100     top = 420
     103    left = 655
     104    top = 350
    101105    Bitmap = {
    102106      4C690C00000010000000100000000000000000000000E3AA4BD6E5B35EFFE3B1
     
    490494    POFilesFolder = 'Languages'
    491495    OnTranslate = CoolTranslator1Translate
    492     left = 137
    493     top = 436
     496    left = 114
     497    top = 363
    494498  end
    495499  object ImageListLarge: TImageList
    496500    Height = 32
    497501    Width = 32
    498     left = 786
    499     top = 286
     502    left = 655
     503    top = 238
    500504    Bitmap = {
    501505      4C690C0000002000000020000000000000000000000000000000E2AA4B36E2A9
     
    20422046    RootName = 'CONFIG'
    20432047    ReadOnly = False
    2044     left = 137
    2045     top = 556
     2048    left = 114
     2049    top = 463
    20462050  end
    20472051  object OpenDialog1: TOpenDialog
    20482052    DefaultExt = '.xtmap'
    2049     left = 1126
    2050     top = 292
     2053    left = 938
     2054    top = 243
    20512055  end
    20522056  object SaveDialog1: TSaveDialog
    20532057    DefaultExt = '.xtmap'
    2054     left = 1126
    2055     top = 166
     2058    left = 938
     2059    top = 138
    20562060  end
    20572061  object ApplicationInfo: TApplicationInfo
     
    20702074    RegistryRoot = rrKeyCurrentUser
    20712075    License = 'CC0'
    2072     left = 137
    2073     top = 180
     2076    left = 114
     2077    top = 150
    20742078  end
    20752079  object PersistentForm: TPersistentForm
    20762080    MinVisiblePart = 50
    20772081    EntireVisible = False
    2078     left = 780
    2079     top = 600
     2082    left = 650
     2083    top = 500
    20802084  end
    20812085  object ScaleDPI1: TScaleDPI
    20822086    AutoDetect = False
    2083     left = 136
    2084     top = 676
     2087    left = 113
     2088    top = 563
    20852089  end
    20862090  object LastOpenedList1: TLastOpenedList
    20872091    MaxCount = 10
    20882092    OnChange = LastOpenedList1Change
    2089     left = 137
    2090     top = 300
     2093    left = 114
     2094    top = 250
    20912095  end
    20922096end
  • trunk/UCore.pas

    r203 r206  
    1717  TCore = class(TDataModule)
    1818    AAbout: TAction;
     19    AShowKeyShortcuts: TAction;
    1920    AGameSave: TAction;
    2021    APlayersStats: TAction;
     
    2728    ApplicationInfo: TApplicationInfo;
    2829    ASettings: TAction;
    29     ActionList1: TActionList;
     30    ActionListMain: TActionList;
    3031    AExit: TAction;
    3132    AGameEnd: TAction;
     
    5556    procedure ASettingsExecute(Sender: TObject);
    5657    procedure AShowChartsExecute(Sender: TObject);
     58    procedure AShowKeyShortcutsExecute(Sender: TObject);
    5759    procedure AShowUnitMovesExecute(Sender: TObject);
    5860    procedure CoolTranslator1Translate(Sender: TObject);
     
    8183    procedure RedrawClients;
    8284    procedure UpdateOtherForms;
     85    procedure FormClientActions;
    8386  public
    8487    Game: TGame;
     
    109112
    110113uses
    111   UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI,
     114  UFormMain, UFormNew, UFormSettings, UFormAbout, UClientAI, UFormKeyShortcuts,
    112115  UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats;
    113116
     
    373376end;
    374377
     378procedure TCore.AShowKeyShortcutsExecute(Sender: TObject);
     379begin
     380  if not Assigned(FormKeyShortcuts) then FormKeyShortcuts := TFormKeyShortcuts.Create(nil);
     381  FormKeyShortcuts.Show;
     382end;
     383
    375384procedure TCore.AShowUnitMovesExecute(Sender: TObject);
    376385begin
     
    382391begin
    383392  UGame.InitStrings;
     393  CoolTranslator1.TranslateComponentRecursive(FormClient);
    384394end;
    385395
     
    409419  if Assigned(FormUnitMoves) then FreeAndNil(FormUnitMoves);
    410420  if Assigned(FormCharts) then FreeAndNil(FormCharts);
     421  if Assigned(FormKeyShortcuts) then FreeAndNil(FormKeyShortcuts);
    411422  FreeAndNil(FormClients);
    412423  FreeAndNil(StoredDimension);
     
    431442  Player: TPlayer;
    432443  NewClient: TClient;
     444  ServerClient: TServerClient;
    433445begin
    434446  GameLoaded := True;
     
    473485  RedrawClients;
    474486  UpdateOtherForms;
     487  UpdateActions;
     488  ServerClient := Server.Clients.SearchByPlayer(Game.CurrentPlayer);
     489  if Assigned(ServerClient) then ServerClient.TurnStart
     490    else raise Exception.Create('Server client for current player not found.');
    475491end;
    476492
     
    489505  if Assigned(FormUnitMoves) and FormUnitMoves.Visible then FormUnitMoves.ReloadList;
    490506  if Assigned(FormPlayersStats) and FormPlayersStats.Visible then FormPlayersStats.ReloadList;
     507end;
     508
     509procedure TCore.FormClientActions;
     510var
     511  Action: TAction;
     512  I: Integer;
     513begin
     514  for I := 0 to FormClient.ActionList1.ActionCount - 1 do begin
     515    Action := TAction.Create(FormMain);
     516    Action.Assign(TAction(FormClient.ActionList1.Actions[I]));
     517    Action.ActionList := FormMain.ActionList1;
     518  end;
    491519end;
    492520
     
    597625      LoadGame(LastOpenedList1.Items[0]);
    598626    ScaleDPI;
     627    FormClientActions;
    599628
    600629    if Game.FileName = '' then StartNewGame;
  • trunk/xtactics.lpi

    r203 r206  
    104104      </Item7>
    105105    </RequiredPackages>
    106     <Units Count="28">
     106    <Units Count="29">
    107107      <Unit0>
    108108        <Filename Value="xtactics.lpr"/>
     
    259259        <IsPartOfProject Value="True"/>
    260260      </Unit27>
     261      <Unit28>
     262        <Filename Value="Forms/UFormKeyShortcuts.pas"/>
     263        <IsPartOfProject Value="True"/>
     264        <ComponentName Value="FormKeyShortcuts"/>
     265        <HasResources Value="True"/>
     266        <ResourceBaseClass Value="Form"/>
     267      </Unit28>
    261268    </Units>
    262269  </ProjectOptions>
     
    291298    <Linking>
    292299      <Debugging>
     300        <UseHeaptrc Value="True"/>
    293301        <UseExternalDbgSyms Value="True"/>
    294302      </Debugging>
Note: See TracChangeset for help on using the changeset viewer.