Changeset 317 for trunk/Forms


Ignore:
Timestamp:
Jun 21, 2024, 12:44:53 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
  • Modified: Use TFormEx for all forms for code simplification.
Location:
trunk/Forms
Files:
8 added
8 deleted
40 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormCharts.lfm

    r316 r317  
    11object FormCharts: TFormCharts
    2   Left = 562
     2  Left = 808
    33  Height = 709
    4   Top = 333
     4  Top = 365
    55  Width = 944
    66  Caption = 'Charts'
    77  ClientHeight = 709
    88  ClientWidth = 944
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     9  DesignTimePPI = 144
    1110  OnShow = FormShow
    12   LCLVersion = '2.0.0.4'
     11  LCLVersion = '3.4.0.0'
    1312  object Chart1: TChart
    14     Left = 8
    15     Height = 648
    16     Top = 56
    17     Width = 932
     13    Left = 10
     14    Height = 636
     15    Top = 67
     16    Width = 929
    1817    AxisList = <   
    1918      item
     
    3938  end
    4039  object ComboBox1: TComboBox
    41     Left = 24
    42     Height = 28
    43     Top = 8
    44     Width = 392
    45     ItemHeight = 20
     40    Left = 29
     41    Height = 38
     42    Top = 10
     43    Width = 470
     44    ItemHeight = 0
    4645    ItemIndex = 0
    4746    Items.Strings = (
     
    5150      'Cities count'
    5251    )
    53     OnChange = ComboBox1Change
    5452    Style = csDropDownList
    5553    TabOrder = 1
    5654    Text = 'Occupied cells'
     55    OnChange = ComboBox1Change
    5756  end
    5857end
  • trunk/Forms/FormCharts.pas

    r316 r317  
    1 unit UFormCharts;
     1unit FormCharts;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics,
    7   Dialogs, StdCtrls;
     7  Dialogs, StdCtrls, FormEx;
    88
    99type
     
    1111  { TFormCharts }
    1212
    13   TFormCharts = class(TForm)
     13  TFormCharts = class(TFormEx)
    1414    Chart1: TChart;
    1515    ComboBox1: TComboBox;
    1616    procedure ComboBox1Change(Sender: TObject);
    17     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1817    procedure FormShow(Sender: TObject);
    1918  public
     
    2120    procedure Translate;
    2221  end;
    23 
    24 var
    25   FormCharts: TFormCharts;
    2622
    2723
     
    3127
    3228uses
    33   UCore, UGame, UPlayer;
     29  Core, Game, Player;
    3430
    3531resourcestring
     
    4844end;
    4945
    50 procedure TFormCharts.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    51 begin
    52   Core.PersistentForm.Save(Self);
    53 end;
    54 
    5546procedure TFormCharts.FormShow(Sender: TObject);
    5647begin
    57   Core.PersistentForm.Load(Self);
    58   Core.ThemeManager1.UseTheme(Self);
    5948  Redraw;
    6049  Translate;
     
    7059begin
    7160  Chart1.Series.Clear;
    72   for I := 0 to Core.Game.Players.Count - 1 do
    73   with TPlayer(Core.Game.Players[I]) do begin
     61  for I := 0 to Core.Core.Game.Players.Count - 1 do
     62  with TPlayer(Core.Core.Game.Players[I]) do begin
    7463    NewSeries := TLineSeries.Create(nil);
    7564    NewSeries.LinePen.Color := Color;
     
    8978  LastIndex: Integer;
    9079begin
    91   Core.CoolTranslator1.TranslateComponentRecursive(Self);
     80  Core.Core.Translator1.TranslateComponentRecursive(Self);
    9281  with ComboBox1 do begin
    9382    LastIndex := ItemIndex;
  • trunk/Forms/FormChat.lfm

    r316 r317  
    11object FormChat: TFormChat
    2   Left = 496
    3   Height = 368
    4   Top = 328
    5   Width = 439
     2  Left = 1060
     3  Height = 442
     4  Top = 536
     5  Width = 527
    66  Caption = 'Chat'
    7   ClientHeight = 368
    8   ClientWidth = 439
    9   DesignTimePPI = 120
    10   OnCreate = FormCreate
    11   OnShow = FormShow
    12   LCLVersion = '2.0.0.4'
     7  ClientHeight = 442
     8  ClientWidth = 527
     9  DesignTimePPI = 144
     10  LCLVersion = '3.4.0.0'
    1311  object MemoChat: TMemo
    14     Left = 7
    15     Height = 302
    16     Top = 27
    17     Width = 424
     12    Left = 8
     13    Height = 363
     14    Top = 32
     15    Width = 509
    1816    Anchors = [akTop, akLeft, akRight, akBottom]
    1917    ParentFont = False
     
    2321  end
    2422  object EditMessage: TEdit
    25     Left = 7
    26     Height = 28
    27     Top = 334
    28     Width = 342
     23    Left = 8
     24    Height = 43
     25    Top = 392
     26    Width = 411
    2927    Anchors = [akLeft, akRight, akBottom]
    30     OnKeyPress = EditMessageKeyPress
    3128    ParentFont = False
    3229    TabOrder = 1
     30    OnKeyPress = EditMessageKeyPress
    3331  end
    3432  object ButtonMessageSend: TButton
    35     Left = 353
    36     Height = 26
    37     Top = 335
    38     Width = 78
     33    Left = 423
     34    Height = 31
     35    Top = 403
     36    Width = 94
    3937    Anchors = [akRight, akBottom]
    4038    Caption = 'Send'
    41     OnClick = ButtonMessageSendClick
    4239    ParentFont = False
    4340    TabOrder = 2
     41    OnClick = ButtonMessageSendClick
    4442  end
    4543  object Label1: TLabel
    46     Left = 8
    47     Height = 20
    48     Top = 3
    49     Width = 33
     44    Left = 10
     45    Height = 26
     46    Top = 4
     47    Width = 43
    5048    Caption = 'Chat:'
    5149    ParentColor = False
  • trunk/Forms/FormChat.pas

    r316 r317  
    1 unit UFormChat;
     1unit FormChat;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   UGame, UGameClient;
     7  Game, GameClient, FormEx;
    88
    99type
     
    1111  { TFormChat }
    1212
    13   TFormChat = class(TForm)
     13  TFormChat = class(TFormEx)
    1414    ButtonMessageSend: TButton;
    1515    EditMessage: TEdit;
     
    1818    procedure ButtonMessageSendClick(Sender: TObject);
    1919    procedure EditMessageKeyPress(Sender: TObject; var Key: char);
    20     procedure FormCreate(Sender: TObject);
    21     procedure FormShow(Sender: TObject);
    22   private
    23 
    2420  public
    2521    Client: TClient;
    2622  end;
    27 
    28 var
    29   FormChat: TFormChat;
    3023
    3124
     
    3427{$R *.lfm}
    3528
    36 uses
    37   UCore;
    38 
    3929{ TFormChat }
    4030
     
    4232begin
    4333  if Key = #13 then ButtonMessageSend.Click;
    44 end;
    45 
    46 procedure TFormChat.FormCreate(Sender: TObject);
    47 begin
    48   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    49 end;
    50 
    51 procedure TFormChat.FormShow(Sender: TObject);
    52 begin
    53   Core.ThemeManager1.UseTheme(Self);
    5434end;
    5535
  • trunk/Forms/FormClient.lfm

    r316 r317  
    11object FormClient: TFormClient
    2   Left = 528
     2  Left = 887
    33  Height = 621
    4   Top = 280
     4  Top = 404
    55  Width = 775
    66  Caption = 'Client'
    77  ClientHeight = 621
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1313  OnKeyUp = FormKeyUp
    1414  OnShow = FormShow
    15   LCLVersion = '2.0.0.4'
     15  LCLVersion = '3.4.0.0'
    1616  WindowState = wsMaximized
    1717  object StatusBar1: TStatusBar
     
    2222    Panels = <   
    2323      item
    24         Width = 167
     24        Width = 200
    2525      end   
    2626      item
    27         Width = 125
     27        Width = 150
    2828      end   
    2929      item
    30         Width = 83
     30        Width = 100
    3131      end>
    3232    ParentFont = False
     
    3737    Height = 593
    3838    Top = 0
    39     Width = 27
     39    Width = 32
    4040    Align = alLeft
    41     ButtonHeight = 27
    42     ButtonWidth = 27
     41    ButtonHeight = 32
     42    ButtonWidth = 32
    4343    Images = Core.ImageListSmall
    4444    ParentFont = False
     
    5454    object ToolButton6: TToolButton
    5555      Left = 1
    56       Top = 61
     56      Top = 71
    5757      Action = AZoomIn
    5858    end
    5959    object ToolButton7: TToolButton
    6060      Left = 1
    61       Top = 88
     61      Top = 103
    6262      Action = AZoomOut
    6363    end
    6464    object ToolButton8: TToolButton
    6565      Left = 1
    66       Top = 115
     66      Top = 135
    6767      Action = AZoomAll
    6868    end
    6969    object ToolButton9: TToolButton
    7070      Left = 1
    71       Top = 56
    72       Width = 27
     71      Top = 66
     72      Width = 32
    7373      AutoSize = True
    7474      Style = tbsDivider
     
    7676    object ToolButton1: TToolButton
    7777      Left = 1
    78       Top = 29
     78      Top = 34
    7979      Action = ASurrender
    8080    end
    8181  end
    8282  object PaintBox1: TPaintBox
    83     Left = 27
     83    Left = 32
    8484    Height = 593
    8585    Top = 0
    86     Width = 748
     86    Width = 743
    8787    Align = alClient
    8888    ParentFont = False
     
    9999    Interval = 20
    100100    OnTimer = Timer1Timer
    101     left = 133
    102     top = 133
     101    Left = 160
     102    Top = 160
    103103  end
    104104  object ActionList1: TActionList
    105105    Images = Core.ImageListSmall
    106     left = 233
    107     top = 127
     106    Left = 280
     107    Top = 152
    108108    object AZoomIn: TAction
    109109      Caption = 'Zoom in'
     
    152152  end
    153153  object PopupMenuToolbar: TPopupMenu
    154     left = 377
    155     top = 82
     154    Left = 452
     155    Top = 98
    156156    object MenuItem18: TMenuItem
    157157      Action = AToolBarBigIcons
  • trunk/Forms/FormClient.pas

    r316 r317  
    1 unit UFormClient;
     1unit FormClient;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    7   UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math,
    8   UGeometry, UGameClient, UGameProtocol, Threading, UPlayer, UClientGUI, UFormMain;
     7  Game, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math,
     8  Geometry, GameClient, GameProtocol, Threading, Player, ClientGUI,
     9  FormEx, Generics.Collections;
    910
    1011const
     
    1819  { TFormClient }
    1920
    20   TFormClient = class(TForm)
     21  TFormClient = class(TFormEx)
    2122    ASurrender: TAction;
    2223    AGameEndTurn: TAction;
     
    9394    procedure DoClientDestroy(Sender: TObject);
    9495  public
    95     FormMain: TFormMain;
    9696    procedure LoadConfig(Config: TXmlConfig; Path: string);
    9797    procedure SaveConfig(Config: TXmlConfig; Path: string);
     
    101101  end;
    102102
    103 var
    104   FormClient: TFormClient;
     103  TFormClients = class(TObjectList<TFormClient>)
     104  end;
    105105
    106106const
     
    111111
    112112uses
    113   UCore, UFormMove;
     113  Core, FormMove;
    114114
    115115resourcestring
     
    321321  if RedrawPending and not Drawing then begin
    322322    Drawing := True;
    323     if not Core.DevelMode then RedrawPending := False;
     323    if not Core.Core.DevelMode then RedrawPending := False;
    324324    TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10;
    325325    LastTimerTime := Now;
     
    327327    StatusBar1.Panels[1].Text := IntToStr(Trunc(DrawDuration / OneMillisecond)) + ' / ' +
    328328      IntToStr(Trunc(TimerPeriod / OneMillisecond)) + ' ms' +
    329       ' ' + IntToStr(Core.Game.Map.CellLinks.Count);
     329      ' ' + IntToStr(Core.Core.Game.Map.CellLinks.Count);
    330330    NewCaption := 'xTactics';
    331     if Assigned(Core.Game.CurrentPlayer) then
    332       NewCaption := Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption;
     331    if Assigned(Core.Core.Game.CurrentPlayer) then
     332      NewCaption := Core.Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Core.Game.TurnCounter) + ' - ' + NewCaption;
    333333    Caption := NewCaption;
    334334    Drawing := False;
     
    350350    FClient.OnNextPlayer := DoNextPlayer;
    351351    FClient.View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height));
    352     FClient.CellGridVisible := Core.CellGridVisible;
    353     FClient.UnitShapeVisible := Core.UnitShapeVisible;
     352    FClient.CellGridVisible := Core.Core.CellGridVisible;
     353    FClient.UnitShapeVisible := Core.Core.UnitShapeVisible;
    354354  end;
    355355  Redraw;
     
    399399begin
    400400  if AToolBarBigIcons.Checked then begin
    401     ToolBar1.Images := Core.ImageListLarge;
    402     ToolBar1.ButtonWidth := Core.ImageListLarge.Width + 7;
    403     ToolBar1.ButtonHeight := Core.ImageListLarge.Height + 6;
    404     ToolBar1.Width := Core.ImageListLarge.Width + 10;
    405     ToolBar1.Height := Core.ImageListLarge.Height + 10;
     401    ToolBar1.Images := Core.Core.ImageListLarge;
     402    ToolBar1.ButtonWidth := Core.Core.ImageListLarge.Width + 7;
     403    ToolBar1.ButtonHeight := Core.Core.ImageListLarge.Height + 6;
     404    ToolBar1.Width := Core.Core.ImageListLarge.Width + 10;
     405    ToolBar1.Height := Core.Core.ImageListLarge.Height + 10;
    406406  end else begin
    407     ToolBar1.Images := Core.ImageListSmall;
    408     ToolBar1.ButtonWidth := Core.ImageListSmall.Width + 7;
    409     ToolBar1.ButtonHeight := Core.ImageListSmall.Height + 6;
    410     ToolBar1.Width := Core.ImageListSmall.Width + 10;
    411     ToolBar1.Height := Core.ImageListSmall.Height + 10;
     407    ToolBar1.Images := Core.Core.ImageListSmall;
     408    ToolBar1.ButtonWidth := Core.Core.ImageListSmall.Width + 7;
     409    ToolBar1.ButtonHeight := Core.Core.ImageListSmall.Height + 6;
     410    ToolBar1.Width := Core.Core.ImageListSmall.Width + 10;
     411    ToolBar1.Height := Core.Core.ImageListSmall.Height + 10;
    412412  end;
    413413  ToolBar1.Visible := AToolBarVisible.Checked;
     
    433433  TimerPeriod := 0;
    434434  LastTimerTime := Now;
    435   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    436435end;
    437436
    438437procedure TFormClient.AZoomAllExecute(Sender: TObject);
    439438begin
    440   with Core, Game, Client, View do begin
     439  with Core.Core, Game, Client, View do begin
    441440    ZoomAll;
    442441  end;
     
    512511procedure TFormClient.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    513512begin
    514   SaveConfig(Core.XMLConfig1, 'FormClient');
    515   Core.PersistentForm.Save(Self);
     513  SaveConfig(Core.Core.XMLConfig1, 'FormClient');
    516514end;
    517515
     
    529527begin
    530528  if (Key = EscapeKey) or (Key = ControlKey) then
    531   if Assigned(Core.Game.CurrentPlayer) then begin
     529  if Assigned(Core.Core.Game.CurrentPlayer) then begin
    532530    Client.View.SelectedCell := nil;
    533531    Redraw;
     
    538536begin
    539537  SetToolbarHints;
    540   LoadConfig(Core.XMLConfig1, 'FormClient');
    541   Core.PersistentForm.Load(Self);
    542   Core.ThemeManager1.UseTheme(Self);
     538  LoadConfig(Core.Core.XMLConfig1, 'FormClient');
    543539  UpdateInterface;
    544540  Redraw;
     
    585581    Cell := nil;
    586582    OldCell := Client.View.FocusedCell;
    587     with Core.Game do
     583    with Core.Core.Game do
    588584      if Assigned(Client.ControlPlayer) then begin
    589585        if Map.Cyclic then begin
     
    619615  if (Abs(StartMousePoint.X - X) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) and
    620616  (Abs(StartMousePoint.Y - Y) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) then begin
    621     if Core.Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) and
    622     (Core.Game.CurrentPlayer = Client.ControlPlayer) then begin
     617    if Core.Core.Game.Running and (Core.Core.Game.CurrentPlayer.Mode = pmHuman) and
     618    (Core.Core.Game.CurrentPlayer = Client.ControlPlayer) then begin
    623619      Client.View.SelectCell(TPoint.Create(X, Y), Client.ControlPlayer, Shift);
    624620      Redraw;
  • trunk/Forms/FormGameSystem.lfm

    r316 r317  
    11object FormGameSystem: TFormGameSystem
    2   Left = 571
    3   Height = 482
    4   Top = 364
    5   Width = 651
     2  Left = 954
     3  Height = 578
     4  Top = 479
     5  Width = 781
    66  Caption = 'Game system'
    7   ClientHeight = 482
    8   ClientWidth = 651
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 578
     8  ClientWidth = 781
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnDestroy = FormDestroy
    13   OnShow = FormShow
    14   LCLVersion = '2.0.0.4'
     12  LCLVersion = '3.4.0.0'
    1513  object ButtonSave: TButton
    16     Left = 133
    17     Height = 32
    18     Top = 440
    19     Width = 94
     14    Left = 160
     15    Height = 38
     16    Top = 528
     17    Width = 113
    2018    Anchors = [akLeft, akBottom]
    2119    Caption = 'Save'
    22     OnClick = ButtonSaveClick
    2320    ParentFont = False
    2421    TabOrder = 0
     22    OnClick = ButtonSaveClick
    2523  end
    2624  object ButtonLoad: TButton
    27     Left = 20
    28     Height = 32
    29     Top = 440
    30     Width = 94
     25    Left = 24
     26    Height = 38
     27    Top = 528
     28    Width = 113
    3129    Anchors = [akLeft, akBottom]
    3230    Caption = 'Load'
    33     OnClick = ButtonLoadClick
    3431    ParentFont = False
    3532    TabOrder = 1
     33    OnClick = ButtonLoadClick
    3634  end
    3735  object ButtonCancel: TButton
    38     Left = 420
    39     Height = 32
    40     Top = 440
    41     Width = 94
     36    Left = 504
     37    Height = 38
     38    Top = 528
     39    Width = 113
    4240    Anchors = [akRight, akBottom]
    4341    Caption = 'Cancel'
     
    4745  end
    4846  object ButtonOk: TButton
    49     Left = 539
    50     Height = 32
    51     Top = 440
    52     Width = 94
     47    Left = 646
     48    Height = 38
     49    Top = 528
     50    Width = 113
    5351    Anchors = [akRight, akBottom]
    5452    Caption = 'OK'
     
    5856  end
    5957  object PageControl1: TPageControl
    60     Left = 13
    61     Height = 414
    62     Top = 13
    63     Width = 620
     58    Left = 16
     59    Height = 496
     60    Top = 16
     61    Width = 743
    6462    ActivePage = TabSheetBuildings
    6563    Anchors = [akTop, akLeft, akRight, akBottom]
     
    7068      Caption = 'General'
    7169      ClientHeight = 456
    72       ClientWidth = 734
     70      ClientWidth = 733
    7371      ParentFont = False
    7472      object CheckBoxEmptyCellsNeutral: TCheckBox
    75         Left = 13
     73        Left = 16
    7674        Height = 30
    77         Top = 13
    78         Width = 362
     75        Top = 16
     76        Width = 357
    7977        Caption = 'Set cells without player units as neutral'
    8078        ParentFont = False
     
    8280      end
    8381      object CheckBoxUnitsSplitMerge: TCheckBox
    84         Left = 13
     82        Left = 16
    8583        Height = 30
    86         Top = 46
    87         Width = 231
     84        Top = 55
     85        Width = 229
    8886        Caption = 'Units can split or merge'
    8987        ParentFont = False
     
    9189      end
    9290      object CheckBoxUnitsMoveImmediately: TCheckBox
    93         Left = 13
     91        Left = 16
    9492        Height = 30
    95         Top = 79
    96         Width = 234
     93        Top = 95
     94        Width = 232
    9795        Caption = 'Units move immediately'
    9896        ParentFont = False
     
    114112  end
    115113  object OpenDialog1: TOpenDialog
    116     left = 367
    117     top = 133
     114    Left = 440
     115    Top = 160
    118116  end
    119117  object SaveDialog1: TSaveDialog
    120     left = 193
    121     top = 133
     118    Left = 232
     119    Top = 160
    122120  end
    123121end
  • trunk/Forms/FormGameSystem.pas

    r316 r317  
    1 unit UFormGameSystem;
     1unit FormGameSystem;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   ComCtrls, UGameSystem, UFormList;
     7  ComCtrls, GameSystem, FormList, FormEx;
    88
    99type
     
    1111  { TFormGameSystem }
    1212
    13   TFormGameSystem = class(TForm)
     13  TFormGameSystem = class(TFormEx)
    1414    ButtonCancel: TButton;
    1515    ButtonOk: TButton;
     
    2828    procedure ButtonLoadClick(Sender: TObject);
    2929    procedure ButtonSaveClick(Sender: TObject);
    30     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3130    procedure FormCreate(Sender: TObject);
    3231    procedure FormDestroy(Sender: TObject);
    33     procedure FormShow(Sender: TObject);
    3432  private
    3533    FGameSystem: TGameSystem;
     
    4442  end;
    4543
    46 var
    47   FormGameSystem: TFormGameSystem;
    48 
    4944
    5045implementation
    5146
    5247{$R *.lfm}
    53 
    54 uses
    55   UCore;
    5648
    5749resourcestring
     
    8274end;
    8375
    84 procedure TFormGameSystem.FormClose(Sender: TObject;
    85   var CloseAction: TCloseAction);
    86 begin
    87   Core.PersistentForm.Save(Self);
    88 end;
    89 
    9076procedure TFormGameSystem.FormCreate(Sender: TObject);
    9177begin
    92   Core.ThemeManager1.UseTheme(Self);
    93   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    9478  FormUnitKinds := TFormList.Create(nil);
    9579  FormUnitKinds.ManualDock(TabSheetUnits, nil, alClient);
     
    11296  FreeAndNil(FormUnitKinds);
    11397  FreeAndNil(FormBuildingKinds);
    114 end;
    115 
    116 procedure TFormGameSystem.FormShow(Sender: TObject);
    117 begin
    118   Core.PersistentForm.Load(Self);
    11998end;
    12099
  • trunk/Forms/FormGameSystems.lfm

    r316 r317  
    11object FormGameSystems: TFormGameSystems
    2   Left = 779
    3   Height = 300
    4   Top = 236
    5   Width = 400
     2  Left = 1080
     3  Height = 360
     4  Top = 570
     5  Width = 480
    66  Caption = 'Game systems'
    7   ClientHeight = 300
    8   ClientWidth = 400
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 360
     8  ClientWidth = 480
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnDestroy = FormDestroy
    1312  OnShow = FormShow
    14   LCLVersion = '2.0.0.4'
     13  LCLVersion = '3.4.0.0'
    1514  object ListView1: TListView
    1615    Left = 0
    17     Height = 268
     16    Height = 322
    1817    Top = 0
    19     Width = 400
     18    Width = 480
    2019    Align = alClient
    2120    Columns = <   
    2221      item
    2322        Caption = 'Name'
    24         Width = 388
     23        Width = 466
    2524      end>
    2625    MultiSelect = True
     
    3938  object ToolBar1: TToolBar
    4039    Left = 0
    41     Top = 268
    42     Width = 400
     40    Height = 38
     41    Top = 322
     42    Width = 480
    4343    Align = alBottom
    4444    Images = Core.ImageListSmall
     
    5151    end
    5252    object ToolButton2: TToolButton
    53       Left = 30
     53      Left = 36
    5454      Top = 2
    5555      Action = AModify
    5656    end
    5757    object ToolButton3: TToolButton
    58       Left = 59
     58      Left = 71
    5959      Top = 2
    6060      Action = ARemove
    6161    end
    6262    object ToolButton4: TToolButton
    63       Left = 88
     63      Left = 106
    6464      Top = 2
    6565      Action = AClone
     
    6868  object ActionList1: TActionList
    6969    Images = Core.ImageListSmall
    70     left = 173
    71     top = 136
     70    Left = 208
     71    Top = 163
    7272    object AAdd: TAction
    7373      Caption = 'Add'
     
    9797  object PopupMenu1: TPopupMenu
    9898    Images = Core.ImageListSmall
    99     left = 293
    100     top = 133
     99    Left = 352
     100    Top = 160
    101101    object MenuItem1: TMenuItem
    102102      Action = AAdd
  • trunk/Forms/FormGameSystems.pas

    r316 r317  
    1 unit UFormGameSystems;
     1unit FormGameSystems;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ActnList, Menus, UGameSystem;
     7  ActnList, Menus, GameSystem, FormEx;
    88
    99type
     
    1111  { TFormGameSystems }
    1212
    13   TFormGameSystems = class(TForm)
     13  TFormGameSystems = class(TFormEx)
    1414    AAdd: TAction;
    1515    ASelectAll: TAction;
     
    3434    procedure ARemoveExecute(Sender: TObject);
    3535    procedure ASelectAllExecute(Sender: TObject);
    36     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3736    procedure FormCreate(Sender: TObject);
    3837    procedure FormDestroy(Sender: TObject);
     
    5150  end;
    5251
    53 var
    54   FormGameSystems: TFormGameSystems;
    55 
    5652
    5753implementation
     
    6056
    6157uses
    62   UCore, UFormGameSystem;
     58  FormGameSystem;
    6359
    6460resourcestring
     
    9086var
    9187  TempEntry: TGameSystem;
     88  FormGameSystem: TFormGameSystem;
    9289begin
    9390  if Assigned(ListView1.Selected) then
     
    114111var
    115112  TempEntry: TGameSystem;
     113  FormGameSystem: TFormGameSystem;
    116114begin
    117115  TempEntry := TGameSystem.Create;
     
    141139end;
    142140
    143 procedure TFormGameSystems.FormClose(Sender: TObject;
    144   var CloseAction: TCloseAction);
    145 begin
    146   Core.PersistentForm.Save(Self);
    147 end;
    148 
    149141procedure TFormGameSystems.FormCreate(Sender: TObject);
    150142var
    151143  I: Integer;
    152144begin
    153   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    154   Core.ThemeManager1.UseTheme(Self);
    155145  for I := 0 to ToolBar1.ButtonCount - 1 do
    156146    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     
    164154procedure TFormGameSystems.FormShow(Sender: TObject);
    165155begin
    166   Core.PersistentForm.Load(Self);
    167156  UpdateList;
    168157  UpdateInterface;
  • trunk/Forms/FormHelp.lfm

    r316 r317  
    11object FormHelp: TFormHelp
    2   Left = 566
    3   Height = 663
    4   Top = 237
    5   Width = 1012
     2  Left = 1040
     3  Height = 432
     4  Top = 540
     5  Width = 582
    66  Caption = 'Help'
    7   ClientHeight = 663
    8   ClientWidth = 1012
    9   Constraints.MinHeight = 223
    10   Constraints.MinWidth = 424
    11   DesignTimePPI = 120
    12   OnClose = FormClose
     7  ClientHeight = 432
     8  ClientWidth = 582
     9  Constraints.MinHeight = 268
     10  Constraints.MinWidth = 509
     11  DesignTimePPI = 144
    1312  OnCreate = FormCreate
    14   OnShow = FormShow
    1513  Position = poMainFormCenter
    16   LCLVersion = '2.0.0.4'
     14  LCLVersion = '3.4.0.0'
    1715  object Memo1: TMemo
    18     Left = 6
    19     Height = 651
    20     Top = 6
    21     Width = 1000
     16    Left = 7
     17    Height = 418
     18    Top = 7
     19    Width = 568
    2220    Align = alClient
    23     BorderSpacing.Around = 6
     21    BorderSpacing.Around = 7
    2422    ReadOnly = True
    2523    ScrollBars = ssAutoBoth
  • trunk/Forms/FormHelp.pas

    r316 r317  
    1 unit UFormHelp;
     1unit FormHelp;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormHelp }
    1112
    12   TFormHelp = class(TForm)
     13  TFormHelp = class(TFormEx)
    1314    Memo1: TMemo;
    14     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1515    procedure FormCreate(Sender: TObject);
    16     procedure FormShow(Sender: TObject);
    1716  end;
    18 
    19 var
    20   FormHelp: TFormHelp;
    2117
    2218
    2319implementation
    24 
    25 uses
    26   UCore;
    2720
    2821resourcestring
     
    6053procedure TFormHelp.FormCreate(Sender: TObject);
    6154begin
    62   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    6355  Memo1.Lines.Text := SContent;
    64 end;
    65 
    66 procedure TFormHelp.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    67 begin
    68   Core.PersistentForm.Save(Self);
    69 end;
    70 
    71 procedure TFormHelp.FormShow(Sender: TObject);
    72 begin
    73   Core.PersistentForm.Load(Self);
    74   Core.ThemeManager1.UseTheme(Self);
    7556end;
    7657
  • trunk/Forms/FormItem.lfm

    r316 r317  
    11object FormItem: TFormItem
    2   Left = 570
     2  Left = 1040
    33  Height = 360
    4   Top = 429
     4  Top = 540
    55  Width = 480
    66  Caption = 'Item'
     
    88  ClientWidth = 480
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    1110  OnCreate = FormCreate
    1211  OnDestroy = FormDestroy
    13   OnShow = FormShow
    14   LCLVersion = '2.0.2.0'
     12  LCLVersion = '3.4.0.0'
    1513  object ButtonOk: TButton
    1614    Left = 89
     
    2119    Caption = 'OK'
    2220    ModalResult = 1
    23     OnClick = ButtonOkClick
    2421    ParentFont = False
    2522    TabOrder = 0
     23    OnClick = ButtonOkClick
    2624  end
    2725  object ButtonCancel: TButton
  • trunk/Forms/FormItem.pas

    r316 r317  
    1 unit UFormItem;
     1unit FormItem;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, UItemList,
    7   ExtCtrls, ColorBox, Spin, Generics.Collections;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ItemList,
     7  ExtCtrls, ColorBox, Spin, Generics.Collections, FormEx;
    88
    99type
     
    1111  { TFormItem }
    1212
    13   TFormItem = class(TForm)
     13  TFormItem = class(TFormEx)
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
    1616    procedure ButtonOkClick(Sender: TObject);
    17     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1817    procedure FormCreate(Sender: TObject);
    1918    procedure FormDestroy(Sender: TObject);
    20     procedure FormShow(Sender: TObject);
    2119  private
    2220    FItem: TItem;
     
    3331  end;
    3432
    35 var
    36   FormItem: TFormItem;
    37 
    3833
    3934implementation
     
    4237
    4338uses
    44   UCore;
     39  Core;
    4540
    4641{ TFormItem }
     
    5146end;
    5247
    53 procedure TFormItem.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    54 begin
    55   Core.PersistentForm.Save(Self);
    56 end;
    57 
    5848procedure TFormItem.FormCreate(Sender: TObject);
    5949begin
    60   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    61   Core.ThemeManager1.UseTheme(Self);
    6250  DataControls := TObjectList<TControl>.Create;
    6351  DataLabels := TObjectList<TLabel>.Create;
     
    6654procedure TFormItem.FormDestroy(Sender: TObject);
    6755begin
    68   DataLabels.Free;
    69   DataControls.Free;
    70 end;
    71 
    72 procedure TFormItem.FormShow(Sender: TObject);
    73 begin
    74   Core.PersistentForm.Load(Self);
     56  FreeAndNil(DataLabels);
     57  FreeAndNil(DataControls);
    7558end;
    7659
     
    221204    NewControl.Top := Y;
    222205    NewControl.Parent := Self;
    223     Core.CoolTranslator1.TranslateComponent(NewControl);
    224     Core.ThemeManager1.ApplyTheme(NewControl);
     206    Core.Core.Translator1.TranslateComponent(NewControl);
     207    Core.Core.ThemeManager1.ApplyTheme(NewControl);
    225208    NewControl.Visible := True;
    226209    DataControls.Add(NewControl);
  • trunk/Forms/FormKeyShortcuts.lfm

    r316 r317  
    11object FormKeyShortcuts: TFormKeyShortcuts
    2   Left = 528
    3   Height = 437
    4   Top = 303
    5   Width = 527
     2  Left = 1016
     3  Height = 524
     4  Top = 501
     5  Width = 632
    66  Caption = 'Key shortcuts'
    7   ClientHeight = 437
    8   ClientWidth = 527
    9   DesignTimePPI = 120
    10   OnClose = FormClose
    11   OnCreate = FormCreate
     7  ClientHeight = 524
     8  ClientWidth = 632
     9  DesignTimePPI = 144
    1210  OnShow = FormShow
    13   LCLVersion = '2.0.0.4'
     11  LCLVersion = '3.4.0.0'
    1412  object ListView1: TListView
    15     Left = 4
    16     Height = 429
    17     Top = 4
    18     Width = 519
     13    Left = 5
     14    Height = 514
     15    Top = 5
     16    Width = 622
    1917    Align = alClient
    20     BorderSpacing.Around = 4
     18    BorderSpacing.Around = 5
    2119    Columns = <   
    2220      item
    2321        Caption = 'Action'
    24         Width = 200
     22        Width = 240
    2523      end   
    2624      item
    2725        Caption = 'Window'
    28         Width = 200
     26        Width = 240
    2927      end   
    3028      item
    3129        Caption = 'Shortcut'
    32         Width = 80
     30        Width = 127
    3331      end>
    3432    LargeImages = Core.ImageListLarge
     
    4139  end
    4240  object PopupMenu1: TPopupMenu
    43     left = 299
    44     top = 187
     41    Left = 359
     42    Top = 224
    4543    object MenuItem1: TMenuItem
    4644      Caption = 'Execute'
  • trunk/Forms/FormKeyShortcuts.pas

    r316 r317  
    1 unit UFormKeyShortcuts;
     1unit FormKeyShortcuts;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
    7   ComCtrls, ActnList, LCLProc, Menus;
     7  ComCtrls, ActnList, LCLProc, Menus, FormEx;
    88
    99type
     
    1111  { TFormKeyShortcuts }
    1212
    13   TFormKeyShortcuts = class(TForm)
     13  TFormKeyShortcuts = class(TFormEx)
    1414    ListView1: TListView;
    1515    MenuItem1: TMenuItem;
    1616    PopupMenu1: TPopupMenu;
    17     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    18     procedure FormCreate(Sender: TObject);
    1917    procedure FormShow(Sender: TObject);
    2018    procedure MenuItem1Click(Sender: TObject);
     
    2321  end;
    2422
    25 var
    26   FormKeyShortcuts: TFormKeyShortcuts;
    27 
    2823
    2924implementation
    3025
    3126uses
    32   UFormMain, UCore;
     27  FormMain, Core;
    3328
    3429resourcestring
     
    4035procedure TFormKeyShortcuts.FormShow(Sender: TObject);
    4136begin
    42   Core.PersistentForm.Load(Self);
    43   Core.ThemeManager1.UseTheme(Self);
    4437  try
    4538    ListView1.BeginUpdate;
    4639    ListView1.Clear;
    47     LoadFromComponent(Core);
    48     LoadFromComponent(FormMain);
     40    LoadFromComponent(Core.Core);
     41    LoadFromComponent(Core.Core.FormMain);
    4942  finally
    5043    ListView1.EndUpdate;
     
    5649  if Assigned(ListView1.Selected) then
    5750    TAction(ListView1.Selected.Data).Execute;
    58 end;
    59 
    60 procedure TFormKeyShortcuts.FormClose(Sender: TObject;
    61   var CloseAction: TCloseAction);
    62 begin
    63   Core.PersistentForm.Save(Self);
    64 end;
    65 
    66 procedure TFormKeyShortcuts.FormCreate(Sender: TObject);
    67 begin
    68   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    6951end;
    7052
     
    9981
    10082initialization
    101   {$I UFormKeyShortcuts.lrs}
     83  {$I FormKeyShortcuts.lrs}
    10284
    10385end.
  • trunk/Forms/FormList.lfm

    r316 r317  
    11object FormList: TFormList
    2   Left = 779
     2  Left = 1040
    33  Height = 360
    4   Top = 236
     4  Top = 540
    55  Width = 480
    66  Caption = 'List'
     
    88  ClientWidth = 480
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    13   LCLVersion = '2.0.2.0'
     12  LCLVersion = '3.4.0.0'
    1413  object ListView1: TListView
    1514    Left = 0
     
    7069  object ActionList1: TActionList
    7170    Images = Core.ImageListSmall
    72     left = 208
    73     top = 163
     71    Left = 208
     72    Top = 163
    7473    object AAdd: TAction
    7574      Caption = 'Add'
     
    10099  object PopupMenu1: TPopupMenu
    101100    Images = Core.ImageListSmall
    102     left = 352
    103     top = 160
     101    Left = 352
     102    Top = 160
    104103    object MenuItem1: TMenuItem
    105104      Action = AAdd
  • trunk/Forms/FormList.pas

    r316 r317  
    1 unit UFormList;
     1unit FormList;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   ActnList, Menus, UItemList;
     7  ActnList, Menus, ItemList, FormEx;
    88
    99type
    1010  { TFormList }
    1111
    12   TFormList = class(TForm)
     12  TFormList = class(TFormEx)
    1313    AAdd: TAction;
    1414    ASelectAll: TAction;
     
    3434    procedure ARemoveExecute(Sender: TObject);
    3535    procedure ASelectAllExecute(Sender: TObject);
    36     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3736    procedure FormCreate(Sender: TObject);
    3837    procedure FormShow(Sender: TObject);
     
    5857  end;
    5958
    60 var
    61   FormList: TFormList;
    62 
    6359
    6460implementation
     
    6763
    6864uses
    69   UCore, UFormItem;
     65  FormItem;
    7066
    7167resourcestring
     
    176172end;
    177173
    178 procedure TFormList.FormClose(Sender: TObject;
    179   var CloseAction: TCloseAction);
    180 begin
    181   Core.PersistentForm.Save(Self);
    182 end;
    183 
    184174procedure TFormList.FormCreate(Sender: TObject);
    185175var
    186176  I: Integer;
    187177begin
    188   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    189   Core.ThemeManager1.UseTheme(Self);
    190178  for I := 0 to ToolBar1.ButtonCount - 1 do
    191179    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     
    196184procedure TFormList.FormShow(Sender: TObject);
    197185begin
    198   Core.PersistentForm.Load(Self);
    199186  UpdateListViewColumns;
    200187  UpdateList;
  • trunk/Forms/FormMain.lfm

    r316 r317  
    11object FormMain: TFormMain
    2   Left = 826
    3   Height = 745
    4   Top = 419
    5   Width = 930
     2  Left = 534
     3  Height = 993
     4  Top = 223
     5  Width = 1491
    66  Caption = 'xTactics'
    7   ClientHeight = 711
    8   ClientWidth = 930
     7  ClientHeight = 993
     8  ClientWidth = 1491
    99  DesignTimePPI = 144
    1010  Menu = MainMenu1
     
    1515  OnKeyUp = FormKeyUp
    1616  OnShow = FormShow
    17   LCLVersion = '2.0.12.0'
     17  LCLVersion = '3.4.0.0'
    1818  object ToolBar1: TToolBar
    1919    Left = 0
    2020    Height = 40
    2121    Top = 0
    22     Width = 930
     22    Width = 1491
    2323    ButtonHeight = 32
    2424    ButtonWidth = 32
     
    7979  object PanelMain: TPanel
    8080    Left = 0
    81     Height = 671
     81    Height = 953
    8282    Top = 40
    83     Width = 930
     83    Width = 1491
    8484    Align = alClient
    8585    BevelOuter = bvNone
  • trunk/Forms/FormMain.pas

    r316 r317  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    7   UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM;
     7  Game, LCLType, Menus, ActnList, ComCtrls, DateUtils, XMLConf, DOM, FormClient,
     8  FormKeyShortcuts, FormPlayersStats, FormUnitMoves, FormCharts, FormEx;
    89
    910const
     
    1516  { TFormMain }
    1617
    17   TFormMain = class(TForm)
     18  TFormMain = class(TFormEx)
    1819    AUnitShapeVisible: TAction;
    1920    AMapGridVisible: TAction;
     
    9394    procedure UpdateClientForms;
    9495  public
     96    FormClient: TFormClient;
     97    FormKeyShortcuts: TFormKeyShortcuts;
     98    FormPlayersStats: TFormPlayersStats;
     99    FormUnitMoves: TFormUnitMoves;
     100    FormCharts: TFormCharts;
    95101    procedure LoadConfig(Config: TXmlConfig; Path: string);
    96102    procedure SaveConfig(Config: TXmlConfig; Path: string);
     
    98104  end;
    99105
    100 var
    101   FormMain: TFormMain;
    102 
    103106
    104107implementation
    105108
    106109uses
    107   UCore, UFormClient;
     110  Core;
    108111
    109112resourcestring
     
    124127begin
    125128  NewCaption := 'xTactics';
    126   if Assigned(Core.Game.CurrentPlayer) then
    127     NewCaption := Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption;
     129  if Assigned(Core.Core.Game.CurrentPlayer) then
     130    NewCaption := Core.Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' +
     131    IntToStr(Core.Core.Game.TurnCounter) + ' - ' + NewCaption;
    128132  Caption := NewCaption;
    129133end;
     
    150154begin
    151155  if AToolBarBigIcons.Checked then begin
    152     ToolBar1.Images := Core.ImageListLarge;
    153     ToolBar1.ButtonWidth := Core.ImageListLarge.Width + 7;
    154     ToolBar1.ButtonHeight := Core.ImageListLarge.Height + 6;
    155     ToolBar1.Width := Core.ImageListLarge.Width + 10;
    156     ToolBar1.Height := Core.ImageListLarge.Height + 10;
     156    ToolBar1.Images := Core.Core.ImageListLarge;
     157    ToolBar1.ButtonWidth := Core.Core.ImageListLarge.Width + 7;
     158    ToolBar1.ButtonHeight := Core.Core.ImageListLarge.Height + 6;
     159    ToolBar1.Width := Core.Core.ImageListLarge.Width + 10;
     160    ToolBar1.Height := Core.Core.ImageListLarge.Height + 10;
    157161  end else begin
    158     ToolBar1.Images := Core.ImageListSmall;
    159     ToolBar1.ButtonWidth := Core.ImageListSmall.Width + 7;
    160     ToolBar1.ButtonHeight := Core.ImageListSmall.Height + 6;
    161     ToolBar1.Width := Core.ImageListSmall.Width + 10;
    162     ToolBar1.Height := Core.ImageListSmall.Height + 10;
     162    ToolBar1.Images := Core.Core.ImageListSmall;
     163    ToolBar1.ButtonWidth := Core.Core.ImageListSmall.Width + 7;
     164    ToolBar1.ButtonHeight := Core.Core.ImageListSmall.Height + 6;
     165    ToolBar1.Width := Core.Core.ImageListSmall.Width + 10;
     166    ToolBar1.Height := Core.Core.ImageListSmall.Height + 10;
    163167  end;
    164168  ToolBar1.Visible := AToolBarVisible.Checked;
     
    227231procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    228232begin
    229   Core.Game.Running := False;
    230   Core.PersistentForm.Save(Self);
    231   SaveConfig(Core.XMLConfig1, 'FormMain');
    232   Core.CellGridVisible := AMapGridVisible.Checked;
    233   Core.UnitShapeVisible := AUnitShapeVisible.Checked;
    234   Core.Done;
     233  Core.Core.Game.Running := False;
     234  SaveConfig(Core.Core.XMLConfig1, 'FormMain');
     235  Core.Core.CellGridVisible := AMapGridVisible.Checked;
     236  Core.Core.UnitShapeVisible := AUnitShapeVisible.Checked;
     237  Core.Core.Done;
    235238end;
    236239
    237240procedure TFormMain.FormDestroy(Sender: TObject);
    238241begin
    239   FormClient.Free;
     242  FreeAndNil(FormClient);
    240243end;
    241244
    242245procedure TFormMain.ApplicationStart(Ptr: IntPtr);
    243246begin
    244   Core.ReopenGameOnInit;
     247  Core.Core.ReopenGameOnInit;
    245248end;
    246249
     
    255258  FormClient.AStatusBarVisible.Checked := AStatusBarVisible.Checked;
    256259  FormClient.AStatusBarVisible.Update;
    257   Core.CellGridVisible := AMapGridVisible.Checked;
    258   Core.UnitShapeVisible := AUnitShapeVisible.Checked;
     260  Core.Core.CellGridVisible := AMapGridVisible.Checked;
     261  Core.Core.UnitShapeVisible := AUnitShapeVisible.Checked;
    259262  if Assigned(FormClient.Client) then begin
    260     FormClient.Client.CellGridVisible := Core.CellGridVisible;
    261     FormClient.Client.UnitShapeVisible := Core.UnitShapeVisible;
     263    FormClient.Client.CellGridVisible := Core.Core.CellGridVisible;
     264    FormClient.Client.UnitShapeVisible := Core.Core.UnitShapeVisible;
    262265  end;
    263266  FormClient.Redraw;
    264   for I := 0 to Core.FormClients.Count - 1 do begin
    265     Core.FormClients[I].AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
    266     Core.FormClients[I].AToolBarBigIcons.Update;
    267     Core.FormClients[I].AToolBarVisible.Checked := AToolBarVisible.Checked;
    268     Core.FormClients[I].AToolBarVisible.Update;
    269     Core.FormClients[I].AStatusBarVisible.Checked := AStatusBarVisible.Checked;
    270     Core.FormClients[I].AStatusBarVisible.Update;
    271     if Assigned(Core.FormClients[I].Client) then begin
    272       Core.FormClients[I].Client.CellGridVisible := Core.CellGridVisible;
    273       Core.FormClients[I].Client.UnitShapeVisible := Core.UnitShapeVisible;
     267  for I := 0 to Core.Core.FormClients.Count - 1 do begin
     268    Core.Core.FormClients[I].AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
     269    Core.Core.FormClients[I].AToolBarBigIcons.Update;
     270    Core.Core.FormClients[I].AToolBarVisible.Checked := AToolBarVisible.Checked;
     271    Core.Core.FormClients[I].AToolBarVisible.Update;
     272    Core.Core.FormClients[I].AStatusBarVisible.Checked := AStatusBarVisible.Checked;
     273    Core.Core.FormClients[I].AStatusBarVisible.Update;
     274    if Assigned(Core.Core.FormClients[I].Client) then begin
     275      Core.Core.FormClients[I].Client.CellGridVisible := Core.Core.CellGridVisible;
     276      Core.Core.FormClients[I].Client.UnitShapeVisible := Core.Core.UnitShapeVisible;
    274277    end;
    275     Core.FormClients[I].Redraw;
     278    Core.Core.FormClients[I].Redraw;
    276279  end;
    277280end;
     
    280283begin
    281284  if not FormShown then begin
    282     Core.LoadConfig;
    283     AMapGridVisible.Checked := Core.CellGridVisible;
    284     AUnitShapeVisible.Checked := Core.UnitShapeVisible;
    285     Core.ScaleDPI;
    286     Core.PersistentForm.Load(Self);
    287     FullScreen := Core.PersistentForm.FormFullScreen;
    288     Core.ThemeManager1.UseTheme(Self);
    289     Core.Init;
    290     LoadConfig(Core.XMLConfig1, 'FormMain');
     285    AMapGridVisible.Checked := Core.Core.CellGridVisible;
     286    AUnitShapeVisible.Checked := Core.Core.UnitShapeVisible;
     287    Core.Core.ScaleDPI;
     288    FullScreen := Core.Core.PersistentForm1.FormFullScreen;
     289    Core.Core.Init;
     290    LoadConfig(Core.Core.XMLConfig1, 'FormMain');
    291291    ReloadView;
    292292    FormClient.Show;
  • trunk/Forms/FormMove.lfm

    r316 r317  
    11object FormMove: TFormMove
    2   Left = 435
    3   Height = 232
    4   Top = 153
    5   Width = 351
     2  Left = 1104
     3  Height = 278
     4  Top = 604
     5  Width = 421
    66  ActiveControl = ButtonOk
    77  Caption = 'Move'
    8   ClientHeight = 232
    9   ClientWidth = 351
    10   Constraints.MinHeight = 232
    11   Constraints.MinWidth = 351
    12   DesignTimePPI = 120
    13   OnClose = FormClose
    14   OnCreate = FormCreate
     8  ClientHeight = 278
     9  ClientWidth = 421
     10  Constraints.MinHeight = 278
     11  Constraints.MinWidth = 421
     12  DesignTimePPI = 144
    1513  OnKeyPress = FormKeyPress
    1614  OnShow = FormShow
    1715  Position = poMainFormCenter
    18   LCLVersion = '2.0.0.4'
     16  LCLVersion = '3.4.0.0'
    1917  object SpinEditOnce: TSpinEdit
    20     Left = 173
    21     Height = 28
    22     Top = 33
    23     Width = 82
     18    Left = 208
     19    Height = 43
     20    Top = 40
     21    Width = 98
    2422    OnChange = SpinEditOnceChange
    2523    OnKeyPress = FormKeyPress
     
    2826  end
    2927  object Label1: TLabel
    30     Left = 13
    31     Height = 20
    32     Top = 33
    33     Width = 37
     28    Left = 16
     29    Height = 26
     30    Top = 40
     31    Width = 49
    3432    Caption = 'Once:'
    3533    ParentColor = False
     
    3735  end
    3836  object ButtonOk: TButton
    39     Left = 247
    40     Height = 32
    41     Top = 187
    42     Width = 83
     37    Left = 296
     38    Height = 38
     39    Top = 224
     40    Width = 100
    4341    Caption = 'Ok'
    4442    Default = True
     
    4846  end
    4947  object ButtonCancel: TButton
    50     Left = 147
    51     Height = 32
    52     Top = 187
    53     Width = 83
     48    Left = 176
     49    Height = 38
     50    Top = 224
     51    Width = 100
    5452    Caption = 'Cancel'
    5553    ModalResult = 2
     
    5856  end
    5957  object Label2: TLabel
    60     Left = 20
    61     Height = 20
    62     Top = 113
    63     Width = 68
     58    Left = 24
     59    Height = 26
     60    Top = 136
     61    Width = 90
    6462    Caption = 'Every turn:'
    6563    ParentColor = False
     
    6765  end
    6866  object SpinEditRepeat: TSpinEdit
    69     Left = 173
    70     Height = 28
    71     Top = 107
    72     Width = 82
     67    Left = 208
     68    Height = 43
     69    Top = 128
     70    Width = 98
    7371    OnChange = SpinEditRepeatChange
    7472    OnKeyPress = FormKeyPress
     
    7775  end
    7876  object TrackBarOnce: TTrackBar
    79     Left = 73
    80     Height = 48
    81     Top = 67
    82     Width = 205
     77    Left = 88
     78    Height = 58
     79    Top = 80
     80    Width = 245
    8381    OnChange = TrackBarOnceChange
    8482    PageSize = 1
     
    9189  end
    9290  object TrackBarRepeat: TTrackBar
    93     Left = 80
    94     Height = 48
    95     Top = 140
    96     Width = 193
     91    Left = 96
     92    Height = 58
     93    Top = 168
     94    Width = 231
    9795    OnChange = TrackBarRepeatChange
    9896    PageSize = 1
     
    105103  end
    106104  object ButtonOnceMin: TButton
    107     Left = 7
    108     Height = 32
    109     Top = 73
    110     Width = 67
     105    Left = 8
     106    Height = 38
     107    Top = 88
     108    Width = 80
    111109    Caption = 'Min'
    112     OnClick = ButtonOnceMinClick
    113110    ParentFont = False
    114111    TabOrder = 6
     112    OnClick = ButtonOnceMinClick
    115113  end
    116114  object ButtonOnceMax: TButton
    117     Left = 277
    118     Height = 32
    119     Top = 73
    120     Width = 67
     115    Left = 333
     116    Height = 38
     117    Top = 88
     118    Width = 80
    121119    Anchors = [akTop, akRight]
    122120    Caption = 'Max'
    123     OnClick = ButtonOnceMaxClick
    124121    ParentFont = False
    125122    TabOrder = 7
     123    OnClick = ButtonOnceMaxClick
    126124  end
    127125  object ButtonRepeatMin: TButton
    128     Left = 7
    129     Height = 32
    130     Top = 147
    131     Width = 67
     126    Left = 8
     127    Height = 38
     128    Top = 176
     129    Width = 80
    132130    Caption = 'Min'
    133     OnClick = ButtonRepeatMinClick
    134131    ParentFont = False
    135132    TabOrder = 8
     133    OnClick = ButtonRepeatMinClick
    136134  end
    137135  object ButtonRepeatMax: TButton
    138     Left = 277
    139     Height = 32
    140     Top = 147
    141     Width = 67
     136    Left = 333
     137    Height = 38
     138    Top = 176
     139    Width = 80
    142140    Anchors = [akTop, akRight]
    143141    Caption = 'Max'
    144     OnClick = ButtonRepeatMaxClick
    145142    ParentFont = False
    146143    TabOrder = 9
     144    OnClick = ButtonRepeatMaxClick
    147145  end
    148146  object Label3: TLabel
    149     Left = 13
    150     Height = 20
    151     Top = 7
    152     Width = 106
     147    Left = 16
     148    Height = 26
     149    Top = 8
     150    Width = 134
    153151    Caption = 'Win probability:'
    154152    ParentColor = False
     
    156154  end
    157155  object LabelWinProbability: TLabel
    158     Left = 220
    159     Height = 20
    160     Top = 7
    161     Width = 12
     156    Left = 264
     157    Height = 26
     158    Top = 8
     159    Width = 15
    162160    Caption = '   '
    163161    ParentColor = False
     
    165163  end
    166164  object ButtonRemove: TButton
    167     Left = 40
    168     Height = 32
    169     Top = 187
    170     Width = 83
     165    Left = 48
     166    Height = 38
     167    Top = 224
     168    Width = 100
    171169    Caption = 'Delete'
    172     OnClick = ButtonRemoveClick
    173170    ParentFont = False
    174171    TabOrder = 10
     172    OnClick = ButtonRemoveClick
    175173  end
    176174end
  • trunk/Forms/FormMove.pas

    r316 r317  
    1 unit UFormMove;
     1unit FormMove;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin,
    7   StdCtrls, ComCtrls;
     7  StdCtrls, ComCtrls, FormEx;
    88
    99type
     
    1111  { TFormMove }
    1212
    13   TFormMove = class(TForm)
     13  TFormMove = class(TFormEx)
    1414    ButtonRemove: TButton;
    1515    ButtonRepeatMax: TButton;
     
    3030    procedure ButtonRemoveClick(Sender: TObject);
    3131    procedure ButtonRepeatMinClick(Sender: TObject);
    32     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    33     procedure FormCreate(Sender: TObject);
    3432    procedure ButtonOnceMinClick(Sender: TObject);
    3533    procedure ButtonRepeatMaxClick(Sender: TObject);
     
    4846  end;
    4947
    50 var
    51   FormMove: TFormMove;
    52 
    5348
    5449implementation
     
    5752
    5853uses
    59   UCore;
     54  Core;
    6055
    6156{ TFormMove }
     
    7873  Label3.Visible := ShowWinProbability;
    7974  LabelWinProbability.Caption :=
    80     IntToStr(Round(Core.Game.AttackProbability(AttackCount + SpinEditOnce.Value,
     75    IntToStr(Round(Core.Core.Game.AttackProbability(AttackCount + SpinEditOnce.Value,
    8176    DefendCount) * 100)) + ' %';
    8277end;
     
    9186procedure TFormMove.FormShow(Sender: TObject);
    9287begin
    93   Core.PersistentForm.Load(Self);
    94   Core.ThemeManager1.UseTheme(Self);
    9588  if SpinEditOnce.MaxValue < SpinEditOnce.Value then begin
    9689    SpinEditOnce.Enabled := False;
     
    128121end;
    129122
    130 procedure TFormMove.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    131 begin
    132   Core.PersistentForm.Save(Self);
    133 end;
    134 
    135 procedure TFormMove.FormCreate(Sender: TObject);
    136 begin
    137   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    138 end;
    139 
    140123procedure TFormMove.ButtonOnceMinClick(Sender: TObject);
    141124begin
  • trunk/Forms/FormNew.lfm

    r316 r317  
    11object FormNew: TFormNew
    2   Left = 478
    3   Height = 745
    4   Top = 526
    5   Width = 1211
     2  Left = 449
     3  Height = 688
     4  Top = 511
     5  Width = 1209
    66  Caption = 'New game'
    7   ClientHeight = 745
    8   ClientWidth = 1211
     7  ClientHeight = 688
     8  ClientWidth = 1209
    99  Constraints.MinHeight = 502
    1010  Constraints.MinWidth = 667
    1111  DesignTimePPI = 144
    12   OnClose = FormClose
    1312  OnCreate = FormCreate
    1413  OnDestroy = FormDestroy
    1514  OnShow = FormShow
    1615  Position = poMainFormCenter
    17   LCLVersion = '2.0.2.0'
     16  LCLVersion = '3.4.0.0'
    1817  object PageControl1: TPageControl
    1918    Left = 4
    20     Height = 635
     19    Height = 578
    2120    Top = 60
    22     Width = 806
    23     ActivePage = TabSheetRules
     21    Width = 804
     22    ActivePage = TabSheetPlayers
    2423    Align = alClient
    2524    BorderSpacing.Around = 4
    2625    ParentFont = False
    27     TabIndex = 3
     26    TabIndex = 1
    2827    TabOrder = 0
    2928    OnChange = PageControl1Change
    3029    object TabSheetMode: TTabSheet
    3130      Caption = 'Mode'
    32       ClientHeight = 595
    33       ClientWidth = 796
     31      ClientHeight = 538
     32      ClientWidth = 794
    3433      ParentFont = False
    3534      object Panel3: TPanel
    3635        Left = 0
    37         Height = 596
     36        Height = 538
    3837        Top = 0
    39         Width = 796
     38        Width = 794
    4039        Align = alClient
    4140        BevelOuter = bvNone
    42         ClientHeight = 596
    43         ClientWidth = 796
     41        ClientHeight = 538
     42        ClientWidth = 794
    4443        ParentFont = False
    4544        TabOrder = 0
     
    5150          Caption = 'Local'
    5251          Checked = True
    53           OnChange = RadioButtonModeLocalChange
    5452          ParentFont = False
    5553          TabOrder = 0
    5654          TabStop = True
     55          OnChange = RadioButtonModeLocalChange
    5756        end
    5857        object RadioButtonModeNetworkServer: TRadioButton
     
    6059          Height = 30
    6160          Top = 48
    62           Width = 156
     61          Width = 155
    6362          Caption = 'Network server'
     63          ParentFont = False
     64          TabOrder = 1
    6465          OnChange = RadioButtonModeLocalChange
    65           ParentFont = False
    66           TabOrder = 1
    6766        end
    6867        object RadioButtonModeNetworkClient: TRadioButton
     
    7069          Height = 30
    7170          Top = 152
    72           Width = 151
     71          Width = 149
    7372          Caption = 'Network client'
     73          ParentFont = False
     74          TabOrder = 2
    7475          OnChange = RadioButtonModeLocalChange
    75           ParentFont = False
    76           TabOrder = 2
    7776        end
    7877        object EditServerAddress: TEdit
     
    9796          Height = 26
    9897          Top = 88
    99           Width = 41
     98          Width = 40
    10099          Caption = 'Port:'
    101100          ParentColor = False
     
    113112        object ListViewServers: TListView
    114113          Left = 26
    115           Height = 365
     114          Height = 307
    116115          Top = 181
    117116          Width = 334
     
    142141          Left = 26
    143142          Height = 31
    144           Top = 557
     143          Top = 499
    145144          Width = 94
    146145          Action = AServerAdd
     
    152151          Left = 240
    153152          Height = 31
    154           Top = 557
     153          Top = 499
    155154          Width = 94
    156155          Action = AServerRemove
     
    162161          Left = 136
    163162          Height = 30
    164           Top = 556
     163          Top = 498
    165164          Width = 94
    166165          Action = AServerModify
     
    173172    object TabSheetPlayers: TTabSheet
    174173      Caption = 'Players'
    175       ClientHeight = 595
    176       ClientWidth = 796
     174      ClientHeight = 538
     175      ClientWidth = 794
    177176      ParentFont = False
    178177      object Panel2: TPanel
    179178        Left = 0
    180         Height = 596
     179        Height = 538
    181180        Top = 0
    182         Width = 796
     181        Width = 794
    183182        Align = alClient
    184183        BevelOuter = bvNone
     
    189188    object TabSheetMap: TTabSheet
    190189      Caption = 'Map'
    191       ClientHeight = 595
    192       ClientWidth = 796
     190      ClientHeight = 538
     191      ClientWidth = 794
    193192      OnShow = TabSheetMapShow
    194193      ParentFont = False
    195194      object Panel1: TPanel
    196195        Left = 0
    197         Height = 596
     196        Height = 538
    198197        Top = 0
    199         Width = 796
     198        Width = 794
    200199        Align = alClient
    201200        BevelOuter = bvNone
    202         ClientHeight = 596
    203         ClientWidth = 796
     201        ClientHeight = 538
     202        ClientWidth = 794
    204203        ParentFont = False
    205204        TabOrder = 0
     
    208207          Height = 26
    209208          Top = 10
    210           Width = 95
     209          Width = 94
    211210          Caption = 'Map width:'
    212211          ParentColor = False
     
    217216          Height = 26
    218217          Top = 58
    219           Width = 102
     218          Width = 101
    220219          Caption = 'Map height:'
    221220          ParentColor = False
     
    248247          Height = 58
    249248          Top = 8
    250           Width = 545
     249          Width = 543
    251250          Max = 100
    252251          Min = 2
     
    262261          Height = 58
    263262          Top = 49
    264           Width = 545
     263          Width = 543
    265264          Max = 100
    266265          Min = 2
     
    276275          Height = 26
    277276          Top = 104
    278           Width = 83
     277          Width = 82
    279278          Caption = 'Grid type:'
    280279          ParentColor = False
     
    283282        object ComboBoxGridType: TComboBox
    284283          Left = 146
    285           Height = 28
     284          Height = 38
    286285          Top = 104
    287286          Width = 304
     
    294293            'Isometric'
    295294          )
    296           OnChange = ComboBoxGridTypeChange
    297295          ParentFont = False
    298296          Style = csDropDownList
    299297          TabOrder = 4
     298          OnChange = ComboBoxGridTypeChange
    300299        end
    301300        object ComboBoxMapShape: TComboBox
    302301          Left = 146
    303           Height = 28
     302          Height = 38
    304303          Top = 144
    305304          Width = 304
     
    310309            'Triangular'
    311310          )
    312           OnChange = ComboBoxMapShapeChange
    313311          ParentFont = False
    314312          Style = csDropDownList
    315313          TabOrder = 5
     314          OnChange = ComboBoxMapShapeChange
    316315        end
    317316        object Label8: TLabel
     
    328327          Height = 26
    329328          Top = 248
    330           Width = 308
     329          Width = 543
    331330          Anchors = [akTop, akLeft, akRight]
    332331          AutoSize = False
    333332          Caption = 'Symetric map'
     333          ParentFont = False
     334          TabOrder = 6
    334335          OnChange = CheckBoxSymetricMapChange
    335           ParentFont = False
    336           TabOrder = 6
    337336        end
    338337        object SpinEditVoidPercent: TSpinEdit
     
    353352          Width = 189
    354353          Caption = 'Inaccessible places'
     354          ParentFont = False
     355          TabOrder = 8
    355356          OnChange = CheckBoxVoidChange
    356           ParentFont = False
    357           TabOrder = 8
    358357        end
    359358        object CheckBoxCity: TCheckBox
     
    361360          Height = 30
    362361          Top = 368
    363           Width = 73
     362          Width = 72
    364363          Caption = 'Cities'
     364          ParentFont = False
     365          TabOrder = 9
    365366          OnChange = CheckBoxCityChange
    366           ParentFont = False
    367           TabOrder = 9
    368367        end
    369368        object SpinEditCityPercent: TSpinEdit
     
    411410          Height = 26
    412411          Top = 496
    413           Width = 227
     412          Width = 225
    414413          Caption = 'Max random neutral units:'
    415414          ParentColor = False
     
    420419          Height = 43
    421420          Top = 184
    422           Width = 530
     421          Width = 543
    423422          Anchors = [akTop, akLeft, akRight]
     423          ParentFont = False
     424          TabOrder = 12
    424425          OnChange = EditImageFileChange
    425           ParentFont = False
    426           TabOrder = 12
    427426        end
    428427        object ButtonImageBrowse: TButton
    429           Left = 681
     428          Left = 679
    430429          Height = 38
    431430          Top = 190
     
    433432          Anchors = [akTop, akRight]
    434433          Caption = 'Browse'
     434          ParentFont = False
     435          TabOrder = 13
    435436          OnClick = ButtonImageBrowseClick
    436           ParentFont = False
    437           TabOrder = 13
    438437        end
    439438        object Label9: TLabel
     
    450449          Height = 30
    451450          Top = 408
    452           Width = 212
     451          Width = 211
    453452          Caption = 'Bridges between cells'
     453          ParentFont = False
     454          TabOrder = 14
    454455          OnChange = CheckBoxBridgesChange
    455           ParentFont = False
    456           TabOrder = 14
    457456        end
    458457        object SpinEditMaxPower: TSpinEdit
     
    472471          Height = 26
    473472          Top = 448
    474           Width = 156
     473          Width = 155
    475474          Caption = 'Max units per cell:'
    476475          ParentColor = False
     
    481480          Height = 26
    482481          Top = 283
    483           Width = 308
     482          Width = 543
    484483          Anchors = [akTop, akLeft, akRight]
    485484          AutoSize = False
    486485          Caption = 'Cyclic map'
     486          ParentFont = False
     487          TabOrder = 16
    487488          OnChange = CheckBoxCyclicMapChange
    488           ParentFont = False
    489           TabOrder = 16
    490489        end
    491490        object Image1: TImage
     
    493492          Height = 316
    494493          Top = 272
    495           Width = 359
     494          Width = 542
    496495          Anchors = [akTop, akLeft, akRight]
    497496          OnResize = Image1Resize
     
    512511          Width = 154
    513512          Caption = 'Randomize'
     513          ParentFont = False
     514          TabOrder = 17
    514515          OnClick = ButtonRandomizeClick
    515           ParentFont = False
    516           TabOrder = 17
    517516        end
    518517      end
     
    520519    object TabSheetRules: TTabSheet
    521520      Caption = 'Rules'
    522       ClientHeight = 595
    523       ClientWidth = 796
     521      ClientHeight = 538
     522      ClientWidth = 794
    524523      ParentFont = False
    525524      object Panel4: TPanel
    526525        Left = 0
    527         Height = 595
     526        Height = 538
    528527        Top = 0
    529         Width = 796
     528        Width = 794
    530529        Align = alClient
    531530        BevelOuter = bvNone
    532         ClientHeight = 595
    533         ClientWidth = 796
     531        ClientHeight = 538
     532        ClientWidth = 794
    534533        ParentFont = False
    535534        TabOrder = 0
     
    562561          Height = 26
    563562          Top = 248
    564           Width = 120
     563          Width = 119
    565564          Caption = 'Win objective:'
    566565          ParentColor = False
     
    579578            'Stay alive for number of turns'
    580579          )
    581           OnChange = ComboBoxWinObjectiveChange
    582580          ParentFont = False
    583581          Style = csDropDownList
    584582          TabOrder = 1
     583          OnChange = ComboBoxWinObjectiveChange
    585584        end
    586585        object RadioGroupGrowAmount: TRadioGroup
     
    620619          Height = 78
    621620          Top = 290
    622           Width = 773
     621          Width = 771
    623622          ActivePage = TabSheetCaptureEntireMap
    624623          Anchors = [akTop, akLeft, akRight]
     
    635634          object TabSheetCaptureCells: TTabSheet
    636635            ClientHeight = 74
    637             ClientWidth = 763
     636            ClientWidth = 761
    638637            ParentFont = False
    639638            object Label14: TLabel
    640639              Left = 8
    641               Height = 20
     640              Height = 26
    642641              Top = 16
    643               Width = 125
     642              Width = 161
    644643              Caption = 'Special cells count:'
    645644              ParentColor = False
     
    648647            object SpinEditSpecialCells: TSpinEdit
    649648              Left = 236
    650               Height = 28
     649              Height = 43
    651650              Top = 8
    652651              Width = 158
     
    660659          object TabSheetStayAliveTurns: TTabSheet
    661660            ClientHeight = 74
    662             ClientWidth = 763
     661            ClientWidth = 761
    663662            ParentFont = False
    664663            object Label13: TLabel
    665664              Left = 8
    666               Height = 20
     665              Height = 26
    667666              Top = 16
    668               Width = 111
     667              Width = 146
    669668              Caption = 'Number of turns:'
    670669              ParentColor = False
     
    673672            object SpinEditTurns: TSpinEdit
    674673              Left = 236
    675               Height = 28
     674              Height = 43
    676675              Top = 8
    677676              Width = 158
     
    696695    Left = 0
    697696    Height = 46
    698     Top = 699
    699     Width = 1211
     697    Top = 642
     698    Width = 1209
    700699    Align = alBottom
    701700    BevelOuter = bvNone
    702701    ClientHeight = 46
    703     ClientWidth = 1211
     702    ClientWidth = 1209
    704703    ParentFont = False
    705704    TabOrder = 1
    706705    object ButtonOk: TButton
    707       Left = 1024
     706      Left = 1022
    708707      Height = 25
    709708      Top = 7
     
    712711      Caption = 'Ok'
    713712      ModalResult = 1
    714       OnClick = ButtonOkClick
    715713      ParentFont = False
    716714      TabOrder = 0
     715      OnClick = ButtonOkClick
    717716    end
    718717    object ButtonCancel: TButton
    719       Left = 1127
     718      Left = 1125
    720719      Height = 25
    721720      Top = 7
     
    729728  end
    730729  object PanelChat: TPanel
    731     Left = 820
    732     Height = 643
     730    Left = 818
     731    Height = 586
    733732    Top = 56
    734733    Width = 391
     
    739738  end
    740739  object Splitter1: TSplitter
    741     Left = 814
    742     Height = 643
     740    Left = 812
     741    Height = 586
    743742    Top = 56
    744743    Width = 6
     
    750749    Height = 56
    751750    Top = 0
    752     Width = 1211
     751    Width = 1209
    753752    Align = alTop
    754753    BevelOuter = bvNone
    755754    ClientHeight = 56
    756     ClientWidth = 1211
     755    ClientWidth = 1209
    757756    ParentFont = False
    758757    TabOrder = 4
     
    761760      Height = 26
    762761      Top = 16
    763       Width = 121
     762      Width = 120
    764763      Caption = 'Game system:'
    765764      ParentColor = False
     
    772771      Width = 254
    773772      ItemHeight = 0
    774       OnChange = ComboBoxGameSystemChange
    775773      ParentFont = False
    776774      Style = csDropDownList
    777775      TabOrder = 0
     776      OnChange = ComboBoxGameSystemChange
    778777    end
    779778    object ButtonGameSystems: TButton
     
    783782      Width = 113
    784783      Caption = 'Manage'
    785       OnClick = ButtonGameSystemsClick
    786784      ParentFont = False
    787785      TabOrder = 1
     786      OnClick = ButtonGameSystemsClick
    788787    end
    789788  end
    790789  object ActionList1: TActionList
    791790    Images = Core.ImageListSmall
    792     left = 864
    793     top = 216
     791    Left = 864
     792    Top = 216
    794793    object AServerAdd: TAction
    795794      Caption = 'Add'
     
    806805  end
    807806  object OpenPictureDialog1: TOpenPictureDialog
    808     left = 864
    809     top = 360
     807    Left = 864
     808    Top = 360
    810809  end
    811810  object PopupMenuServers: TPopupMenu
    812     left = 864
    813     top = 136
     811    Left = 864
     812    Top = 136
    814813    object MenuItem4: TMenuItem
    815814      Action = AServerAdd
     
    825824    Interval = 500
    826825    OnTimer = TimerMapPreviewTimer
    827     left = 864
    828     top = 446
     826    Left = 864
     827    Top = 446
    829828  end
    830829end
  • trunk/Forms/FormNew.pas

    r316 r317  
    1 unit UFormNew;
     1unit FormNew;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, UGame, UGeometry, UPlayer,
    8   UGameServer, UServerList, UMap, UGameSystem, UFormList;
     7  ComCtrls, Spin, ExtCtrls, ActnList, ExtDlgs, Menus, Game, Geometry, Player,
     8  GameServer, ServerList, Map, GameSystem, FormList, FormEx, FormChat;
    99
    1010type
     
    1212  { TFormNew }
    1313
    14   TFormNew = class(TForm)
     14  TFormNew = class(TFormEx)
    1515    ActionList1: TActionList;
    1616    AServerAdd: TAction;
     
    115115    procedure ComboBoxWinObjectiveChange(Sender: TObject);
    116116    procedure EditImageFileChange(Sender: TObject);
    117     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    118117    procedure FormCreate(Sender: TObject);
    119118    procedure FormDestroy(Sender: TObject);
     
    143142    NewRandSeed: Cardinal;
    144143    FormPlayers: TFormList;
     144    FormChat: TFormChat;
    145145    procedure LoadGame(Game: TGame);
    146146    procedure SaveGame(Game: TGame);
     
    158158  end;
    159159
    160 var
    161   FormNew: TFormNew;
    162 
    163160
    164161implementation
     
    167164
    168165uses
    169   UFormChat, UCore, UFormServer, UClientGUI, UFormClient,
    170   UFormGameSystems, UMapType;
     166  Core, FormServer, ClientGUI, FormClient, FormGameSystems, MapType;
    171167
    172168resourcestring
     
    350346  ComboBoxGameSystem.Items.BeginUpdate;
    351347  try
    352     while ComboBoxGameSystem.Items.Count > Core.GameSystems.Count do
     348    while ComboBoxGameSystem.Items.Count > Core.Core.GameSystems.Count do
    353349      ComboBoxGameSystem.Items.Delete(ComboBoxGameSystem.Items.Count - 1);
    354     while ComboBoxGameSystem.Items.Count < Core.GameSystems.Count do
     350    while ComboBoxGameSystem.Items.Count < Core.Core.GameSystems.Count do
    355351      ComboBoxGameSystem.Items.Add('');
    356     for I := 0 to Core.GameSystems.Count - 1 do begin
    357       ComboBoxGameSystem.Items[I] := Core.GameSystems[I].GetName;
    358       ComboBoxGameSystem.Items.Objects[I] := Core.GameSystems[I];
     352    for I := 0 to Core.Core.GameSystems.Count - 1 do begin
     353      ComboBoxGameSystem.Items[I] := Core.Core.GameSystems[I].GetName;
     354      ComboBoxGameSystem.Items.Objects[I] := Core.Core.GameSystems[I];
    359355    end;
    360356    if Assigned(LastSystem) then
     
    457453    ItemIndex := LastIndex;
    458454  end;
    459   Core.CoolTranslator1.TranslateComponentRecursive(Self);
     455  Core.Core.Translator1.TranslateComponentRecursive(Self);
    460456end;
    461457
     
    500496  Randomize;
    501497  NewRandSeed := RandSeed;
    502   Core.PersistentForm.Load(Self);
    503   Core.ThemeManager1.UseTheme(Self);
    504498  ReloadView;
    505499  //Height := Trunc(1.5 * Height);
     
    583577end;
    584578
    585 procedure TFormNew.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    586 begin
    587   Core.PersistentForm.Save(Self);
    588 end;
    589 
    590579procedure TFormNew.AServerAddExecute(Sender: TObject);
    591580var
    592581  NewServerInfo: TServerInfo;
     582  FormServer: TFormServer;
    593583begin
    594584  FormServer := TFormServer.Create(nil);
    595   NewServerInfo := TServerInfo.Create;
    596   FormServer.ServerInfo := NewServerInfo;
    597   if FormServer.ShowModal = mrOK then begin
    598     ServerList.Items.Add(NewServerInfo);
    599     ReloadView;
    600   end else NewServerInfo.Free;
    601   FormServer.Free;
     585  try
     586    NewServerInfo := TServerInfo.Create;
     587    FormServer.ServerInfo := NewServerInfo;
     588    if FormServer.ShowModal = mrOK then begin
     589      ServerList.Items.Add(NewServerInfo);
     590      ReloadView;
     591    end else NewServerInfo.Free;
     592  finally
     593    FormServer.Free;
     594  end;
    602595end;
    603596
     
    605598var
    606599  ServerInfo: TServerInfo;
     600  FormServer: TFormServer;
    607601begin
    608602  FormServer := TFormServer.Create(nil);
    609   ServerInfo := TServerInfo(ListViewServers.Selected.Data);
    610   FormServer.ServerInfo := ServerInfo;
    611   if FormServer.ShowModal = mrOK then begin
    612     ReloadView;
    613   end;
    614   FormServer.Free;
     603  try
     604    ServerInfo := TServerInfo(ListViewServers.Selected.Data);
     605    FormServer.ServerInfo := ServerInfo;
     606    if FormServer.ShowModal = mrOK then begin
     607      ReloadView;
     608    end;
     609  finally
     610    FormServer.Free;
     611  end;
    615612end;
    616613
     
    629626
    630627procedure TFormNew.ButtonGameSystemsClick(Sender: TObject);
     628var
     629  FormGameSystems: TFormGameSystems;
    631630begin
    632631  FormGameSystems := TFormGameSystems.Create(nil);
    633632  try
    634     FormGameSystems.GameSystems := Core.GameSystems;
     633    FormGameSystems.GameSystems := Core.Core.GameSystems;
    635634    FormGameSystems.ShowModal;
    636635    ReloadGameSystemsMenu;
     
    683682    SpinEditServerPort.Value := LocalNetworkPort;
    684683  end;
    685   ServerList.Assign(Core.ServerList);
     684  ServerList.Assign(Core.Core.ServerList);
    686685  LoadGame(Server.Game);
    687686end;
     
    703702    end;
    704703  end;
    705   Core.ServerList.Assign(ServerList);
     704  Core.Core.ServerList.Assign(ServerList);
    706705  SaveGame(Server.Game);
    707706end;
  • trunk/Forms/FormPlayersStats.lfm

    r316 r317  
    11object FormPlayersStats: TFormPlayersStats
    2   Left = 468
     2  Left = 907
    33  Height = 300
    4   Top = 477
     4  Top = 570
    55  Width = 746
    66  Caption = 'Players stats'
    77  ClientHeight = 300
    88  ClientWidth = 746
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     9  DesignTimePPI = 144
    1110  OnShow = FormShow
    12   LCLVersion = '2.0.0.4'
     11  LCLVersion = '3.4.0.0'
    1312  object ListView1: TListView
    14     Left = 4
    15     Height = 292
    16     Top = 4
    17     Width = 738
     13    Left = 5
     14    Height = 290
     15    Top = 5
     16    Width = 736
    1817    Align = alClient
    19     BorderSpacing.Around = 4
     18    BorderSpacing.Around = 5
    2019    Columns = <   
    2120      item
    2221        Caption = 'Name'
    23         Width = 100
     22        Width = 120
    2423      end   
    2524      item
    2625        Caption = 'Mode'
    27         Width = 100
     26        Width = 120
    2827      end   
    2928      item
    3029        Caption = 'Cells'
    31         Width = 100
     30        Width = 120
    3231      end   
    3332      item
    3433        Caption = 'Discovered'
    35         Width = 100
     34        Width = 120
    3635      end   
    3736      item
    3837        Caption = 'Cities'
    39         Width = 100
     38        Width = 120
    4039      end   
    4140      item
    4241        Caption = 'Units'
    43         Width = 100
     42        Width = 120
    4443      end   
    4544      item
    4645        Caption = 'Win objective cells'
    47         Width = 100
     46        Width = 150
    4847      end>
    4948    OwnerData = True
     
    5655  end
    5756  object PopupMenu1: TPopupMenu
    58     left = 143
    59     top = 110
     57    Left = 172
     58    Top = 132
    6059    object MenuItem1: TMenuItem
    6160      Action = ASpectate
     
    6362  end
    6463  object ActionList1: TActionList
    65     left = 358
    66     top = 111
     64    Left = 448
     65    Top = 136
    6766    object ASpectate: TAction
    6867      Caption = 'Spectate'
     
    7675    Column = 0
    7776    Order = soNone
    78     left = 544
    79     top = 110
     77    Left = 653
     78    Top = 132
    8079  end
    8180end
  • trunk/Forms/FormPlayersStats.pas

    r316 r317  
    1 unit UFormPlayersStats;
     1unit FormPlayersStats;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UGame, ListViewSort;
     7  Menus, ActnList, Game, ListViewSort, FormEx;
    88
    99type
     
    1111  { TFormPlayersStats }
    1212
    13   TFormPlayersStats = class(TForm)
     13  TFormPlayersStats = class(TFormEx)
    1414    ASpectate: TAction;
    1515    ActionList1: TActionList;
     
    1919    PopupMenu1: TPopupMenu;
    2020    procedure ASpectateExecute(Sender: TObject);
    21     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2221    procedure FormShow(Sender: TObject);
    2322    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    2827  end;
    2928
    30 var
    31   FormPlayersStats: TFormPlayersStats;
    32 
    3329
    3430implementation
    3531
    3632uses
    37   UCore, UPlayer;
     33  Core, Player;
    3834
    3935{$R *.lfm}
     
    4339procedure TFormPlayersStats.ListView1Data(Sender: TObject; Item: TListItem);
    4440begin
    45   with Core.Game do
     41  with Core.Core.Game do
    4642  if Item.Index < ListViewSort1.List.Count then
    4743  with TPlayer(ListViewSort1.List[Item.Index]) do begin
     
    8177begin
    8278  ListViewSort1.List.Clear;
    83   for I := 0 to Core.Game.Players.Count - 1 do begin
    84     ListViewSort1.List.Add(Core.Game.Players[I]);
     79  for I := 0 to Core.Core.Game.Players.Count - 1 do begin
     80    ListViewSort1.List.Add(Core.Core.Game.Players[I]);
    8581  end;
    8682end;
     
    8884procedure TFormPlayersStats.FormShow(Sender: TObject);
    8985begin
    90   Core.PersistentForm.Load(Self);
    91   Core.ThemeManager1.UseTheme(Self);
    92   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    9386  ReloadList;
    94 end;
    95 
    96 procedure TFormPlayersStats.FormClose(Sender: TObject;
    97   var CloseAction: TCloseAction);
    98 begin
    99   Core.PersistentForm.Save(Self);
    10087end;
    10188
     
    10390begin
    10491  if Assigned(ListView1.Selected) then
    105     Core.Spectate(TPlayer(ListView1.Selected.Data));
     92    Core.Core.Spectate(TPlayer(ListView1.Selected.Data));
    10693end;
    10794
  • trunk/Forms/FormServer.lfm

    r316 r317  
    11object FormServer: TFormServer
    2   Left = 691
     2  Left = 1078
    33  Height = 210
    4   Top = 389
     4  Top = 615
    55  Width = 403
    66  Caption = 'Server'
    77  ClientHeight = 210
    88  ClientWidth = 403
    9   DesignTimePPI = 120
    10   OnShow = FormShow
    11   LCLVersion = '2.0.0.4'
     9  DesignTimePPI = 144
     10  LCLVersion = '3.4.0.0'
    1211  object Label1: TLabel
    13     Left = 10
    14     Height = 20
    15     Top = 20
    16     Width = 43
     12    Left = 12
     13    Height = 26
     14    Top = 24
     15    Width = 56
    1716    Caption = 'Name:'
    1817    ParentColor = False
     
    2019  end
    2120  object EditName: TEdit
    22     Left = 136
    23     Height = 28
    24     Top = 14
    25     Width = 234
     21    Left = 163
     22    Height = 43
     23    Top = 17
     24    Width = 281
    2625    ParentFont = False
    2726    TabOrder = 0
    2827  end
    2928  object Label2: TLabel
    30     Left = 10
    31     Height = 20
    32     Top = 60
    33     Width = 56
     29    Left = 12
     30    Height = 26
     31    Top = 72
     32    Width = 74
    3433    Caption = 'Address:'
    3534    ParentColor = False
     
    3736  end
    3837  object EditAddress: TEdit
    39     Left = 136
    40     Height = 28
    41     Top = 53
    42     Width = 236
     38    Left = 163
     39    Height = 43
     40    Top = 64
     41    Width = 283
    4342    ParentFont = False
    4443    TabOrder = 1
    4544  end
    4645  object Label3: TLabel
    47     Left = 10
    48     Height = 20
    49     Top = 100
    50     Width = 30
     46    Left = 12
     47    Height = 26
     48    Top = 120
     49    Width = 40
    5150    Caption = 'Port:'
    5251    ParentColor = False
     
    5453  end
    5554  object SpinEdit1: TSpinEdit
    56     Left = 136
    57     Height = 28
    58     Top = 93
    59     Width = 97
     55    Left = 163
     56    Height = 43
     57    Top = 112
     58    Width = 116
    6059    MaxValue = 65535
    6160    ParentFont = False
     
    6362  end
    6463  object ButtonCancel: TButton
    65     Left = 240
    66     Height = 31
    67     Top = 155
    68     Width = 94
     64    Left = 288
     65    Height = 37
     66    Top = 186
     67    Width = 113
    6968    Caption = 'Cancel'
    7069    ModalResult = 2
     
    7372  end
    7473  object ButtonOk: TButton
    75     Left = 80
    76     Height = 31
    77     Top = 155
    78     Width = 94
     74    Left = 96
     75    Height = 37
     76    Top = 186
     77    Width = 113
    7978    Caption = 'OK'
    8079    ModalResult = 1
    81     OnClick = ButtonOkClick
    8280    ParentFont = False
    8381    TabOrder = 4
     82    OnClick = ButtonOkClick
    8483  end
    8584end
  • trunk/Forms/FormServer.pas

    r316 r317  
    1 unit UFormServer;
     1unit FormServer;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Spin, UServerList;
     7  Spin, ServerList, FormEx;
    88
    99type
     
    1111  { TFormServer }
    1212
    13   TFormServer = class(TForm)
     13  TFormServer = class(TFormEx)
    1414    ButtonCancel: TButton;
    1515    ButtonOk: TButton;
     
    2121    SpinEdit1: TSpinEdit;
    2222    procedure ButtonOkClick(Sender: TObject);
    23     procedure FormShow(Sender: TObject);
    2423  private
    2524    FServerInfo: TServerInfo;
     
    3130  end;
    3231
    33 var
    34   FormServer: TFormServer;
    35 
    3632
    3733implementation
     
    3935{$R *.lfm}
    4036
    41 uses
    42   UCore;
    43 
    4437{ TFormServer }
    45 
    46 procedure TFormServer.FormShow(Sender: TObject);
    47 begin
    48   Core.ThemeManager1.UseTheme(Self);
    49 end;
    5038
    5139procedure TFormServer.ButtonOkClick(Sender: TObject);
  • trunk/Forms/FormSettings.lfm

    r316 r317  
    11object FormSettings: TFormSettings
    2   Left = 535
    3   Height = 299
    4   Top = 386
    5   Width = 480
     2  Left = 851
     3  Height = 613
     4  Top = 413
     5  Width = 857
    66  ActiveControl = ButtonOk
    77  Caption = 'Settings'
    8   ClientHeight = 299
    9   ClientWidth = 480
    10   Constraints.MinHeight = 250
    11   Constraints.MinWidth = 378
    12   DesignTimePPI = 120
    13   OnClose = FormClose
     8  ClientHeight = 613
     9  ClientWidth = 857
     10  Constraints.MinHeight = 300
     11  Constraints.MinWidth = 454
     12  DesignTimePPI = 144
    1413  OnCreate = FormCreate
    1514  OnShow = FormShow
    1615  Position = poMainFormCenter
    17   LCLVersion = '2.0.0.4'
     16  LCLVersion = '3.4.0.0'
    1817  object ButtonOk: TButton
    19     Left = 411
    20     Height = 21
    21     Top = 266
    22     Width = 62
     18    Left = 775
     19    Height = 25
     20    Top = 574
     21    Width = 74
    2322    Anchors = [akRight, akBottom]
    2423    Caption = 'Ok'
     
    2827  end
    2928  object ButtonCancel: TButton
    30     Left = 332
    31     Height = 21
    32     Top = 266
    33     Width = 62
     29    Left = 680
     30    Height = 25
     31    Top = 574
     32    Width = 74
    3433    Anchors = [akRight, akBottom]
    3534    Caption = 'Cancel'
     
    3938  end
    4039  object PageControl1: TPageControl
    41     Left = 7
    42     Height = 245
    43     Top = 7
    44     Width = 466
     40    Left = 8
     41    Height = 558
     42    Top = 8
     43    Width = 841
    4544    ActivePage = TabSheetGeneral
    4645    Align = alTop
    4746    Anchors = [akTop, akLeft, akRight, akBottom]
    48     BorderSpacing.Around = 7
     47    BorderSpacing.Around = 8
    4948    ParentFont = False
    5049    TabIndex = 0
     
    5251    object TabSheetGeneral: TTabSheet
    5352      Caption = 'General'
    54       ClientHeight = 212
    55       ClientWidth = 458
     53      ClientHeight = 518
     54      ClientWidth = 831
    5655      ParentFont = False
    5756      object Panel1: TPanel
    5857        Left = 0
    59         Height = 212
     58        Height = 518
    6059        Top = 0
    61         Width = 458
     60        Width = 831
    6261        Align = alClient
    6362        BevelOuter = bvNone
    64         ClientHeight = 212
    65         ClientWidth = 458
     63        ClientHeight = 518
     64        ClientWidth = 831
    6665        ParentFont = False
    6766        TabOrder = 0
    6867        object Label1: TLabel
    69           Left = 17
    70           Height = 20
    71           Top = 27
    72           Width = 68
     68          Left = 20
     69          Height = 26
     70          Top = 32
     71          Width = 88
    7372          Caption = 'Language:'
    7473          ParentColor = False
     
    7675        end
    7776        object ComboBoxLanguage: TComboBox
    78           Left = 148
    79           Height = 28
    80           Top = 20
    81           Width = 163
    82           ItemHeight = 20
     77          Left = 178
     78          Height = 42
     79          Top = 24
     80          Width = 196
     81          ItemHeight = 0
    8382          ParentFont = False
    8483          Style = csDropDownList
     
    8685        end
    8786        object ComboBoxTheme: TComboBox
    88           Left = 147
    89           Height = 28
    90           Top = 60
    91           Width = 163
    92           ItemHeight = 20
     87          Left = 176
     88          Height = 42
     89          Top = 72
     90          Width = 196
     91          ItemHeight = 0
    9392          ParentFont = False
    9493          Style = csDropDownList
     
    9695        end
    9796        object Label6: TLabel
    98           Left = 17
    99           Height = 20
    100           Top = 67
    101           Width = 48
     97          Left = 20
     98          Height = 26
     99          Top = 80
     100          Width = 63
    102101          Caption = 'Theme:'
    103102          ParentColor = False
     
    105104        end
    106105        object SpinEditAnimSpeed: TSpinEdit
    107           Left = 193
    108           Height = 28
    109           Top = 100
    110           Width = 102
     106          Left = 232
     107          Height = 43
     108          Top = 120
     109          Width = 122
    111110          ParentFont = False
    112111          TabOrder = 2
    113112        end
    114113        object Label3: TLabel
    115           Left = 307
    116           Height = 20
    117           Top = 103
    118           Width = 12
     114          Left = 368
     115          Height = 26
     116          Top = 124
     117          Width = 15
    119118          Caption = '%'
    120119          ParentColor = False
     
    122121        end
    123122        object Label2: TLabel
    124           Left = 17
    125           Height = 20
    126           Top = 100
    127           Width = 116
     123          Left = 20
     124          Height = 26
     125          Top = 120
     126          Width = 149
    128127          Caption = 'Animation speed:'
    129128          ParentColor = False
     
    131130        end
    132131        object CheckBoxAutoSaveTurn: TCheckBox
    133           Left = 17
    134           Height = 24
    135           Top = 128
    136           Width = 213
     132          Left = 20
     133          Height = 30
     134          Top = 154
     135          Width = 269
    137136          Caption = 'Autosave game on each turn'
    138137          ParentFont = False
     
    140139        end
    141140        object CheckBoxReopenLastFile: TCheckBox
    142           Left = 17
    143           Height = 24
    144           Top = 162
    145           Width = 198
     141          Left = 20
     142          Height = 30
     143          Top = 194
     144          Width = 248
    146145          Caption = 'Reopen last game on start'
    147146          ParentFont = False
     
    152151    object TabSheetDebug: TTabSheet
    153152      Caption = 'Debug'
    154       ClientHeight = 260
    155       ClientWidth = 554
     153      ClientHeight = 518
     154      ClientWidth = 831
    156155      ParentFont = False
    157156      object Panel2: TPanel
    158157        Left = 0
    159         Height = 229
     158        Height = 518
    160159        Top = 0
    161         Width = 583
     160        Width = 831
    162161        Align = alClient
    163162        BevelOuter = bvNone
    164         ClientHeight = 229
    165         ClientWidth = 583
     163        ClientHeight = 518
     164        ClientWidth = 831
    166165        ParentFont = False
    167166        TabOrder = 0
    168167        object CheckBox2: TCheckBox
    169           Left = 13
    170           Height = 20
    171           Top = 27
    172           Width = 557
     168          Left = 16
     169          Height = 24
     170          Top = 32
     171          Width = 799
    173172          Anchors = [akTop, akLeft, akRight]
    174173          AutoSize = False
    175174          Caption = 'Automatic DPI'
     175          ParentFont = False
     176          TabOrder = 0
    176177          OnChange = CheckBox2Change
    177           ParentFont = False
    178           TabOrder = 0
    179178        end
    180179        object Label4: TLabel
    181           Left = 12
    182           Height = 26
    183           Top = 56
     180          Left = 14
     181          Height = 26
     182          Top = 67
    184183          Width = 35
    185184          Caption = 'DPI:'
     
    188187        end
    189188        object SpinEditX: TSpinEdit
    190           Left = 87
    191           Height = 36
    192           Top = 53
    193           Width = 80
     189          Left = 104
     190          Height = 43
     191          Top = 64
     192          Width = 96
    194193          MaxValue = 500
    195194          MinValue = 20
     
    199198        end
    200199        object Label5: TLabel
    201           Left = 173
    202           Height = 26
    203           Top = 56
     200          Left = 208
     201          Height = 26
     202          Top = 67
    204203          Width = 10
    205204          Caption = 'x'
     
    208207        end
    209208        object SpinEditY: TSpinEdit
    210           Left = 193
    211           Height = 36
    212           Top = 53
    213           Width = 75
     209          Left = 232
     210          Height = 43
     211          Top = 64
     212          Width = 90
    214213          MaxValue = 500
    215214          MinValue = 20
     
    219218        end
    220219        object CheckBoxDevelMode: TCheckBox
    221           Left = 13
    222           Height = 22
    223           Top = 113
    224           Width = 560
     220          Left = 16
     221          Height = 26
     222          Top = 136
     223          Width = 803
    225224          Anchors = [akTop, akLeft, akRight]
    226225          AutoSize = False
  • trunk/Forms/FormSettings.pas

    r316 r317  
    1 unit UFormSettings;
     1unit FormSettings;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Spin, ComCtrls, ExtCtrls;
     7  Spin, ComCtrls, ExtCtrls, FormEx;
    88
    99type
     
    1111  { TFormSettings }
    1212
    13   TFormSettings = class(TForm)
     13  TFormSettings = class(TFormEx)
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
     
    3535    TabSheetDebug: TTabSheet;
    3636    procedure CheckBox2Change(Sender: TObject);
    37     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3837    procedure FormCreate(Sender: TObject);
    3938    procedure FormShow(Sender: TObject);
     
    4342  end;
    4443
    45 var
    46   FormSettings: TFormSettings;
    4744
    4845
     
    5249
    5350uses
    54   UCore, Languages, Theme;
     51  Core, Languages, Theme;
    5552
    5653{ TFormSettings }
     
    6259end;
    6360
    64 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction
    65   );
    66 begin
    67   Core.PersistentForm.Save(Self);
    68 end;
    69 
    7061procedure TFormSettings.FormCreate(Sender: TObject);
    7162begin
    7263  PageControl1.TabIndex := 0;
    73   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    74   Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
    75   Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
     64  Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
     65  Core.Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items);
    7666end;
    7767
    7868procedure TFormSettings.FormShow(Sender: TObject);
    7969begin
    80   Core.PersistentForm.Load(Self);
    81   Core.ThemeManager1.UseTheme(Self);
    8270  {$IFDEF DEBUG}
    8371  TabSheetDebug.TabVisible := True;
     
    8977procedure TFormSettings.Load;
    9078begin
    91   ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
     79  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator1.Language);
    9280  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
    93   ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme);
     81  ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme);
    9482  if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
    95   CheckBoxDevelMode.Checked := Core.DevelMode;
    96   SpinEditAnimSpeed.Value := Core.AnimationSpeed;
    97   CheckBox2.Checked := Core.ScaleDPI1.AutoDetect;
    98   SpinEditX.Value := Core.ScaleDPI1.DPI.X;
    99   SpinEditY.Value := Core.ScaleDPI1.DPI.Y;
    100   CheckBoxAutoSaveTurn.Checked := Core.AutoSaveEnabled;
    101   CheckBoxReopenLastFile.Checked := Core.ReopenLastFile;
     83  CheckBoxDevelMode.Checked := Core.Core.DevelMode;
     84  SpinEditAnimSpeed.Value := Core.Core.AnimationSpeed;
     85  CheckBox2.Checked := Core.Core.ScaleDPI1.AutoDetect;
     86  SpinEditX.Value := Core.Core.ScaleDPI1.DPI.X;
     87  SpinEditY.Value := Core.Core.ScaleDPI1.DPI.Y;
     88  CheckBoxAutoSaveTurn.Checked := Core.Core.AutoSaveEnabled;
     89  CheckBoxReopenLastFile.Checked := Core.Core.ReopenLastFile;
    10290end;
    10391
     
    10593begin
    10694  if ComboBoxLanguage.ItemIndex <> -1 then
    107     Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     95    Core.Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    10896   if ComboBoxTheme.ItemIndex <> -1 then
    109     Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
    110   Core.DevelMode := CheckBoxDevelMode.Checked;
    111   Core.AnimationSpeed := SpinEditAnimSpeed.Value;
    112   Core.ScaleDPI1.AutoDetect := CheckBox2.Checked;
    113   Core.ScaleDPI1.DPI := Point(SpinEditX.Value, SpinEditY.Value);
    114   Core.AutoSaveEnabled := CheckBoxAutoSaveTurn.Checked;
    115   Core.ReopenLastFile := CheckBoxReopenLastFile.Checked;
     97    Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
     98  Core.Core.DevelMode := CheckBoxDevelMode.Checked;
     99  Core.Core.AnimationSpeed := SpinEditAnimSpeed.Value;
     100  Core.Core.ScaleDPI1.AutoDetect := CheckBox2.Checked;
     101  Core.Core.ScaleDPI1.DPI := Point(SpinEditX.Value, SpinEditY.Value);
     102  Core.Core.AutoSaveEnabled := CheckBoxAutoSaveTurn.Checked;
     103  Core.Core.ReopenLastFile := CheckBoxReopenLastFile.Checked;
    116104end;
    117105
  • trunk/Forms/FormUnitMoves.lfm

    r316 r317  
    11object FormUnitMoves: TFormUnitMoves
    2   Left = 730
    3   Height = 418
    4   Top = 211
    5   Width = 802
     2  Left = 879
     3  Height = 499
     4  Top = 514
     5  Width = 950
    66  Caption = 'Unit moves'
    7   ClientHeight = 418
    8   ClientWidth = 802
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 499
     8  ClientWidth = 950
     9  DesignTimePPI = 144
    1110  OnShow = FormShow
    12   LCLVersion = '2.0.0.4'
     11  LCLVersion = '3.4.0.0'
    1312  object ListView1: TListView
    1413    Left = 0
    15     Height = 418
     14    Height = 499
    1615    Top = 0
    17     Width = 802
     16    Width = 950
    1817    Align = alClient
    1918    Columns = <   
    2019      item
    2120        Caption = 'From cell'
    22         Width = 150
     21        Width = 180
    2322      end   
    2423      item
    2524        Caption = 'To cell'
    26         Width = 150
     25        Width = 180
    2726      end   
    2827      item
    2928        Caption = 'Once count'
    30         Width = 150
     29        Width = 180
    3130      end   
    3231      item
    3332        Caption = 'Repeat count'
    34         Width = 332
     33        Width = 398
    3534      end>
    3635    OwnerData = True
  • trunk/Forms/FormUnitMoves.pas

    r316 r317  
    1 unit UFormUnitMoves;
     1unit FormUnitMoves;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormUnitMoves }
    1112
    12   TFormUnitMoves = class(TForm)
     13  TFormUnitMoves = class(TFormEx)
    1314    ListView1: TListView;
    14     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1515    procedure FormShow(Sender: TObject);
    1616    procedure ListView1Data(Sender: TObject; Item: TListItem);
    17   private
    18 
    1917  public
    2018    procedure ReloadList;
    2119  end;
    2220
    23 var
    24   FormUnitMoves: TFormUnitMoves;
    2521
    2622implementation
    2723
    2824uses
    29   UGame, UCore, UPlayer;
     25  Game, Core, Player;
    3026
    3127{$R *.lfm}
     
    3531procedure TFormUnitMoves.ListView1Data(Sender: TObject; Item: TListItem);
    3632begin
    37   if Assigned(Core.Game) and Assigned(Core.Game.CurrentPlayer) then
    38   with Core.Game.CurrentPlayer do
     33  if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) then
     34  with Core.Core.Game.CurrentPlayer do
    3935  if (Mode = pmHuman) and (Item.Index < Moves.Count) then
    4036  with TUnitMove(Moves[Item.Index]) do begin
     
    4844procedure TFormUnitMoves.FormShow(Sender: TObject);
    4945begin
    50   Core.PersistentForm.Load(Self);
    51   Core.ThemeManager1.UseTheme(Self);
    52   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    5346  ReloadList;
    54 end;
    55 
    56 procedure TFormUnitMoves.FormClose(Sender: TObject;
    57   var CloseAction: TCloseAction);
    58 begin
    59   Core.PersistentForm.Save(Self);
    6047end;
    6148
    6249procedure TFormUnitMoves.ReloadList;
    6350begin
    64   if Assigned(Core.Game) and Assigned(Core.Game.CurrentPlayer) and
    65   (Core.Game.CurrentPlayer.Mode = pmHuman) then
    66     ListView1.Items.Count := Core.Game.CurrentPlayer.Moves.Count
     51  if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) and
     52  (Core.Core.Game.CurrentPlayer.Mode = pmHuman) then
     53    ListView1.Items.Count := Core.Core.Game.CurrentPlayer.Moves.Count
    6754  else ListView1.Items.Count := 0;
    6855  ListView1.Refresh;
Note: See TracChangeset for help on using the changeset viewer.