Changeset 317 for trunk/Forms
- Timestamp:
- Jun 21, 2024, 12:44:53 PM (5 months ago)
- Location:
- trunk/Forms
- Files:
-
- 8 added
- 8 deleted
- 40 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormCharts.lfm
r316 r317 1 1 object FormCharts: TFormCharts 2 Left = 5622 Left = 808 3 3 Height = 709 4 Top = 3 334 Top = 365 5 5 Width = 944 6 6 Caption = 'Charts' 7 7 ClientHeight = 709 8 8 ClientWidth = 944 9 DesignTimePPI = 120 10 OnClose = FormClose 9 DesignTimePPI = 144 11 10 OnShow = FormShow 12 LCLVersion = ' 2.0.0.4'11 LCLVersion = '3.4.0.0' 13 12 object Chart1: TChart 14 Left = 815 Height = 6 4816 Top = 5617 Width = 9 3213 Left = 10 14 Height = 636 15 Top = 67 16 Width = 929 18 17 AxisList = < 19 18 item … … 39 38 end 40 39 object ComboBox1: TComboBox 41 Left = 2 442 Height = 2843 Top = 844 Width = 39245 ItemHeight = 2040 Left = 29 41 Height = 38 42 Top = 10 43 Width = 470 44 ItemHeight = 0 46 45 ItemIndex = 0 47 46 Items.Strings = ( … … 51 50 'Cities count' 52 51 ) 53 OnChange = ComboBox1Change54 52 Style = csDropDownList 55 53 TabOrder = 1 56 54 Text = 'Occupied cells' 55 OnChange = ComboBox1Change 57 56 end 58 57 end -
trunk/Forms/FormCharts.pas
r316 r317 1 unit UFormCharts;1 unit FormCharts; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics, 7 Dialogs, StdCtrls ;7 Dialogs, StdCtrls, FormEx; 8 8 9 9 type … … 11 11 { TFormCharts } 12 12 13 TFormCharts = class(TForm )13 TFormCharts = class(TFormEx) 14 14 Chart1: TChart; 15 15 ComboBox1: TComboBox; 16 16 procedure ComboBox1Change(Sender: TObject); 17 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);18 17 procedure FormShow(Sender: TObject); 19 18 public … … 21 20 procedure Translate; 22 21 end; 23 24 var25 FormCharts: TFormCharts;26 22 27 23 … … 31 27 32 28 uses 33 UCore, UGame, UPlayer;29 Core, Game, Player; 34 30 35 31 resourcestring … … 48 44 end; 49 45 50 procedure TFormCharts.FormClose(Sender: TObject; var CloseAction: TCloseAction);51 begin52 Core.PersistentForm.Save(Self);53 end;54 55 46 procedure TFormCharts.FormShow(Sender: TObject); 56 47 begin 57 Core.PersistentForm.Load(Self);58 Core.ThemeManager1.UseTheme(Self);59 48 Redraw; 60 49 Translate; … … 70 59 begin 71 60 Chart1.Series.Clear; 72 for I := 0 to Core. Game.Players.Count - 1 do73 with TPlayer(Core. Game.Players[I]) do begin61 for I := 0 to Core.Core.Game.Players.Count - 1 do 62 with TPlayer(Core.Core.Game.Players[I]) do begin 74 63 NewSeries := TLineSeries.Create(nil); 75 64 NewSeries.LinePen.Color := Color; … … 89 78 LastIndex: Integer; 90 79 begin 91 Core.Co olTranslator1.TranslateComponentRecursive(Self);80 Core.Core.Translator1.TranslateComponentRecursive(Self); 92 81 with ComboBox1 do begin 93 82 LastIndex := ItemIndex; -
trunk/Forms/FormChat.lfm
r316 r317 1 1 object FormChat: TFormChat 2 Left = 4963 Height = 3684 Top = 3285 Width = 4392 Left = 1060 3 Height = 442 4 Top = 536 5 Width = 527 6 6 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' 13 11 object MemoChat: TMemo 14 Left = 715 Height = 3 0216 Top = 2717 Width = 42412 Left = 8 13 Height = 363 14 Top = 32 15 Width = 509 18 16 Anchors = [akTop, akLeft, akRight, akBottom] 19 17 ParentFont = False … … 23 21 end 24 22 object EditMessage: TEdit 25 Left = 726 Height = 2827 Top = 3 3428 Width = 34223 Left = 8 24 Height = 43 25 Top = 392 26 Width = 411 29 27 Anchors = [akLeft, akRight, akBottom] 30 OnKeyPress = EditMessageKeyPress31 28 ParentFont = False 32 29 TabOrder = 1 30 OnKeyPress = EditMessageKeyPress 33 31 end 34 32 object ButtonMessageSend: TButton 35 Left = 35336 Height = 2637 Top = 33538 Width = 7833 Left = 423 34 Height = 31 35 Top = 403 36 Width = 94 39 37 Anchors = [akRight, akBottom] 40 38 Caption = 'Send' 41 OnClick = ButtonMessageSendClick42 39 ParentFont = False 43 40 TabOrder = 2 41 OnClick = ButtonMessageSendClick 44 42 end 45 43 object Label1: TLabel 46 Left = 847 Height = 2 048 Top = 349 Width = 3344 Left = 10 45 Height = 26 46 Top = 4 47 Width = 43 50 48 Caption = 'Chat:' 51 49 ParentColor = False -
trunk/Forms/FormChat.pas
r316 r317 1 unit UFormChat;1 unit FormChat; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 UGame, UGameClient;7 Game, GameClient, FormEx; 8 8 9 9 type … … 11 11 { TFormChat } 12 12 13 TFormChat = class(TForm )13 TFormChat = class(TFormEx) 14 14 ButtonMessageSend: TButton; 15 15 EditMessage: TEdit; … … 18 18 procedure ButtonMessageSendClick(Sender: TObject); 19 19 procedure EditMessageKeyPress(Sender: TObject; var Key: char); 20 procedure FormCreate(Sender: TObject);21 procedure FormShow(Sender: TObject);22 private23 24 20 public 25 21 Client: TClient; 26 22 end; 27 28 var29 FormChat: TFormChat;30 23 31 24 … … 34 27 {$R *.lfm} 35 28 36 uses37 UCore;38 39 29 { TFormChat } 40 30 … … 42 32 begin 43 33 if Key = #13 then ButtonMessageSend.Click; 44 end;45 46 procedure TFormChat.FormCreate(Sender: TObject);47 begin48 Core.CoolTranslator1.TranslateComponentRecursive(Self);49 end;50 51 procedure TFormChat.FormShow(Sender: TObject);52 begin53 Core.ThemeManager1.UseTheme(Self);54 34 end; 55 35 -
trunk/Forms/FormClient.lfm
r316 r317 1 1 object FormClient: TFormClient 2 Left = 5282 Left = 887 3 3 Height = 621 4 Top = 2804 Top = 404 5 5 Width = 775 6 6 Caption = 'Client' 7 7 ClientHeight = 621 8 8 ClientWidth = 775 9 DesignTimePPI = 1 209 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate … … 13 13 OnKeyUp = FormKeyUp 14 14 OnShow = FormShow 15 LCLVersion = ' 2.0.0.4'15 LCLVersion = '3.4.0.0' 16 16 WindowState = wsMaximized 17 17 object StatusBar1: TStatusBar … … 22 22 Panels = < 23 23 item 24 Width = 16724 Width = 200 25 25 end 26 26 item 27 Width = 1 2527 Width = 150 28 28 end 29 29 item 30 Width = 8330 Width = 100 31 31 end> 32 32 ParentFont = False … … 37 37 Height = 593 38 38 Top = 0 39 Width = 2739 Width = 32 40 40 Align = alLeft 41 ButtonHeight = 2742 ButtonWidth = 2741 ButtonHeight = 32 42 ButtonWidth = 32 43 43 Images = Core.ImageListSmall 44 44 ParentFont = False … … 54 54 object ToolButton6: TToolButton 55 55 Left = 1 56 Top = 6156 Top = 71 57 57 Action = AZoomIn 58 58 end 59 59 object ToolButton7: TToolButton 60 60 Left = 1 61 Top = 8861 Top = 103 62 62 Action = AZoomOut 63 63 end 64 64 object ToolButton8: TToolButton 65 65 Left = 1 66 Top = 1 1566 Top = 135 67 67 Action = AZoomAll 68 68 end 69 69 object ToolButton9: TToolButton 70 70 Left = 1 71 Top = 5672 Width = 2771 Top = 66 72 Width = 32 73 73 AutoSize = True 74 74 Style = tbsDivider … … 76 76 object ToolButton1: TToolButton 77 77 Left = 1 78 Top = 2978 Top = 34 79 79 Action = ASurrender 80 80 end 81 81 end 82 82 object PaintBox1: TPaintBox 83 Left = 2783 Left = 32 84 84 Height = 593 85 85 Top = 0 86 Width = 74 886 Width = 743 87 87 Align = alClient 88 88 ParentFont = False … … 99 99 Interval = 20 100 100 OnTimer = Timer1Timer 101 left = 133102 top = 133101 Left = 160 102 Top = 160 103 103 end 104 104 object ActionList1: TActionList 105 105 Images = Core.ImageListSmall 106 left = 233107 top = 127106 Left = 280 107 Top = 152 108 108 object AZoomIn: TAction 109 109 Caption = 'Zoom in' … … 152 152 end 153 153 object PopupMenuToolbar: TPopupMenu 154 left = 377155 top = 82154 Left = 452 155 Top = 98 156 156 object MenuItem18: TMenuItem 157 157 Action = AToolBarBigIcons -
trunk/Forms/FormClient.pas
r316 r317 1 unit UFormClient;1 unit FormClient; 2 2 3 3 interface … … 5 5 uses 6 6 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; 9 10 10 11 const … … 18 19 { TFormClient } 19 20 20 TFormClient = class(TForm )21 TFormClient = class(TFormEx) 21 22 ASurrender: TAction; 22 23 AGameEndTurn: TAction; … … 93 94 procedure DoClientDestroy(Sender: TObject); 94 95 public 95 FormMain: TFormMain;96 96 procedure LoadConfig(Config: TXmlConfig; Path: string); 97 97 procedure SaveConfig(Config: TXmlConfig; Path: string); … … 101 101 end; 102 102 103 var 104 FormClient: TFormClient;103 TFormClients = class(TObjectList<TFormClient>) 104 end; 105 105 106 106 const … … 111 111 112 112 uses 113 UCore, UFormMove;113 Core, FormMove; 114 114 115 115 resourcestring … … 321 321 if RedrawPending and not Drawing then begin 322 322 Drawing := True; 323 if not Core. DevelMode then RedrawPending := False;323 if not Core.Core.DevelMode then RedrawPending := False; 324 324 TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10; 325 325 LastTimerTime := Now; … … 327 327 StatusBar1.Panels[1].Text := IntToStr(Trunc(DrawDuration / OneMillisecond)) + ' / ' + 328 328 IntToStr(Trunc(TimerPeriod / OneMillisecond)) + ' ms' + 329 ' ' + IntToStr(Core. Game.Map.CellLinks.Count);329 ' ' + IntToStr(Core.Core.Game.Map.CellLinks.Count); 330 330 NewCaption := 'xTactics'; 331 if Assigned(Core. Game.CurrentPlayer) then332 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; 333 333 Caption := NewCaption; 334 334 Drawing := False; … … 350 350 FClient.OnNextPlayer := DoNextPlayer; 351 351 FClient.View.DestRect := TRect.CreateBounds(TPoint.Create(0, 0), TPoint.Create(PaintBox1.Width, PaintBox1.Height)); 352 FClient.CellGridVisible := Core.C ellGridVisible;353 FClient.UnitShapeVisible := Core. UnitShapeVisible;352 FClient.CellGridVisible := Core.Core.CellGridVisible; 353 FClient.UnitShapeVisible := Core.Core.UnitShapeVisible; 354 354 end; 355 355 Redraw; … … 399 399 begin 400 400 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; 406 406 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; 412 412 end; 413 413 ToolBar1.Visible := AToolBarVisible.Checked; … … 433 433 TimerPeriod := 0; 434 434 LastTimerTime := Now; 435 Core.CoolTranslator1.TranslateComponentRecursive(Self);436 435 end; 437 436 438 437 procedure TFormClient.AZoomAllExecute(Sender: TObject); 439 438 begin 440 with Core , Game, Client, View do begin439 with Core.Core, Game, Client, View do begin 441 440 ZoomAll; 442 441 end; … … 512 511 procedure TFormClient.FormClose(Sender: TObject; var CloseAction: TCloseAction); 513 512 begin 514 SaveConfig(Core.XMLConfig1, 'FormClient'); 515 Core.PersistentForm.Save(Self); 513 SaveConfig(Core.Core.XMLConfig1, 'FormClient'); 516 514 end; 517 515 … … 529 527 begin 530 528 if (Key = EscapeKey) or (Key = ControlKey) then 531 if Assigned(Core. Game.CurrentPlayer) then begin529 if Assigned(Core.Core.Game.CurrentPlayer) then begin 532 530 Client.View.SelectedCell := nil; 533 531 Redraw; … … 538 536 begin 539 537 SetToolbarHints; 540 LoadConfig(Core.XMLConfig1, 'FormClient'); 541 Core.PersistentForm.Load(Self); 542 Core.ThemeManager1.UseTheme(Self); 538 LoadConfig(Core.Core.XMLConfig1, 'FormClient'); 543 539 UpdateInterface; 544 540 Redraw; … … 585 581 Cell := nil; 586 582 OldCell := Client.View.FocusedCell; 587 with Core. Game do583 with Core.Core.Game do 588 584 if Assigned(Client.ControlPlayer) then begin 589 585 if Map.Cyclic then begin … … 619 615 if (Abs(StartMousePoint.X - X) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) and 620 616 (Abs(StartMousePoint.Y - Y) < Trunc(Screen.PixelsPerInch * MouseMinDiff)) then begin 621 if Core. Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) and622 (Core. Game.CurrentPlayer = Client.ControlPlayer) then begin617 if Core.Core.Game.Running and (Core.Core.Game.CurrentPlayer.Mode = pmHuman) and 618 (Core.Core.Game.CurrentPlayer = Client.ControlPlayer) then begin 623 619 Client.View.SelectCell(TPoint.Create(X, Y), Client.ControlPlayer, Shift); 624 620 Redraw; -
trunk/Forms/FormGameSystem.lfm
r316 r317 1 1 object FormGameSystem: TFormGameSystem 2 Left = 5713 Height = 4824 Top = 3645 Width = 6512 Left = 954 3 Height = 578 4 Top = 479 5 Width = 781 6 6 Caption = 'Game system' 7 ClientHeight = 482 8 ClientWidth = 651 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 578 8 ClientWidth = 781 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnDestroy = FormDestroy 13 OnShow = FormShow 14 LCLVersion = '2.0.0.4' 12 LCLVersion = '3.4.0.0' 15 13 object ButtonSave: TButton 16 Left = 1 3317 Height = 3 218 Top = 44019 Width = 9414 Left = 160 15 Height = 38 16 Top = 528 17 Width = 113 20 18 Anchors = [akLeft, akBottom] 21 19 Caption = 'Save' 22 OnClick = ButtonSaveClick23 20 ParentFont = False 24 21 TabOrder = 0 22 OnClick = ButtonSaveClick 25 23 end 26 24 object ButtonLoad: TButton 27 Left = 2 028 Height = 3 229 Top = 44030 Width = 9425 Left = 24 26 Height = 38 27 Top = 528 28 Width = 113 31 29 Anchors = [akLeft, akBottom] 32 30 Caption = 'Load' 33 OnClick = ButtonLoadClick34 31 ParentFont = False 35 32 TabOrder = 1 33 OnClick = ButtonLoadClick 36 34 end 37 35 object ButtonCancel: TButton 38 Left = 42039 Height = 3 240 Top = 44041 Width = 9436 Left = 504 37 Height = 38 38 Top = 528 39 Width = 113 42 40 Anchors = [akRight, akBottom] 43 41 Caption = 'Cancel' … … 47 45 end 48 46 object ButtonOk: TButton 49 Left = 53950 Height = 3 251 Top = 44052 Width = 9447 Left = 646 48 Height = 38 49 Top = 528 50 Width = 113 53 51 Anchors = [akRight, akBottom] 54 52 Caption = 'OK' … … 58 56 end 59 57 object PageControl1: TPageControl 60 Left = 1 361 Height = 4 1462 Top = 1 363 Width = 62058 Left = 16 59 Height = 496 60 Top = 16 61 Width = 743 64 62 ActivePage = TabSheetBuildings 65 63 Anchors = [akTop, akLeft, akRight, akBottom] … … 70 68 Caption = 'General' 71 69 ClientHeight = 456 72 ClientWidth = 73 470 ClientWidth = 733 73 71 ParentFont = False 74 72 object CheckBoxEmptyCellsNeutral: TCheckBox 75 Left = 1 373 Left = 16 76 74 Height = 30 77 Top = 1 378 Width = 3 6275 Top = 16 76 Width = 357 79 77 Caption = 'Set cells without player units as neutral' 80 78 ParentFont = False … … 82 80 end 83 81 object CheckBoxUnitsSplitMerge: TCheckBox 84 Left = 1 382 Left = 16 85 83 Height = 30 86 Top = 4687 Width = 2 3184 Top = 55 85 Width = 229 88 86 Caption = 'Units can split or merge' 89 87 ParentFont = False … … 91 89 end 92 90 object CheckBoxUnitsMoveImmediately: TCheckBox 93 Left = 1 391 Left = 16 94 92 Height = 30 95 Top = 7996 Width = 23 493 Top = 95 94 Width = 232 97 95 Caption = 'Units move immediately' 98 96 ParentFont = False … … 114 112 end 115 113 object OpenDialog1: TOpenDialog 116 left = 367117 top = 133114 Left = 440 115 Top = 160 118 116 end 119 117 object SaveDialog1: TSaveDialog 120 left = 193121 top = 133118 Left = 232 119 Top = 160 122 120 end 123 121 end -
trunk/Forms/FormGameSystem.pas
r316 r317 1 unit UFormGameSystem;1 unit FormGameSystem; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 ComCtrls, UGameSystem, UFormList;7 ComCtrls, GameSystem, FormList, FormEx; 8 8 9 9 type … … 11 11 { TFormGameSystem } 12 12 13 TFormGameSystem = class(TForm )13 TFormGameSystem = class(TFormEx) 14 14 ButtonCancel: TButton; 15 15 ButtonOk: TButton; … … 28 28 procedure ButtonLoadClick(Sender: TObject); 29 29 procedure ButtonSaveClick(Sender: TObject); 30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);31 30 procedure FormCreate(Sender: TObject); 32 31 procedure FormDestroy(Sender: TObject); 33 procedure FormShow(Sender: TObject);34 32 private 35 33 FGameSystem: TGameSystem; … … 44 42 end; 45 43 46 var47 FormGameSystem: TFormGameSystem;48 49 44 50 45 implementation 51 46 52 47 {$R *.lfm} 53 54 uses55 UCore;56 48 57 49 resourcestring … … 82 74 end; 83 75 84 procedure TFormGameSystem.FormClose(Sender: TObject;85 var CloseAction: TCloseAction);86 begin87 Core.PersistentForm.Save(Self);88 end;89 90 76 procedure TFormGameSystem.FormCreate(Sender: TObject); 91 77 begin 92 Core.ThemeManager1.UseTheme(Self);93 Core.CoolTranslator1.TranslateComponentRecursive(Self);94 78 FormUnitKinds := TFormList.Create(nil); 95 79 FormUnitKinds.ManualDock(TabSheetUnits, nil, alClient); … … 112 96 FreeAndNil(FormUnitKinds); 113 97 FreeAndNil(FormBuildingKinds); 114 end;115 116 procedure TFormGameSystem.FormShow(Sender: TObject);117 begin118 Core.PersistentForm.Load(Self);119 98 end; 120 99 -
trunk/Forms/FormGameSystems.lfm
r316 r317 1 1 object FormGameSystems: TFormGameSystems 2 Left = 7793 Height = 3 004 Top = 2365 Width = 4 002 Left = 1080 3 Height = 360 4 Top = 570 5 Width = 480 6 6 Caption = 'Game systems' 7 ClientHeight = 300 8 ClientWidth = 400 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 360 8 ClientWidth = 480 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnDestroy = FormDestroy 13 12 OnShow = FormShow 14 LCLVersion = ' 2.0.0.4'13 LCLVersion = '3.4.0.0' 15 14 object ListView1: TListView 16 15 Left = 0 17 Height = 26816 Height = 322 18 17 Top = 0 19 Width = 4 0018 Width = 480 20 19 Align = alClient 21 20 Columns = < 22 21 item 23 22 Caption = 'Name' 24 Width = 38823 Width = 466 25 24 end> 26 25 MultiSelect = True … … 39 38 object ToolBar1: TToolBar 40 39 Left = 0 41 Top = 268 42 Width = 400 40 Height = 38 41 Top = 322 42 Width = 480 43 43 Align = alBottom 44 44 Images = Core.ImageListSmall … … 51 51 end 52 52 object ToolButton2: TToolButton 53 Left = 3 053 Left = 36 54 54 Top = 2 55 55 Action = AModify 56 56 end 57 57 object ToolButton3: TToolButton 58 Left = 5958 Left = 71 59 59 Top = 2 60 60 Action = ARemove 61 61 end 62 62 object ToolButton4: TToolButton 63 Left = 8863 Left = 106 64 64 Top = 2 65 65 Action = AClone … … 68 68 object ActionList1: TActionList 69 69 Images = Core.ImageListSmall 70 left = 17371 top = 13670 Left = 208 71 Top = 163 72 72 object AAdd: TAction 73 73 Caption = 'Add' … … 97 97 object PopupMenu1: TPopupMenu 98 98 Images = Core.ImageListSmall 99 left = 293100 top = 13399 Left = 352 100 Top = 160 101 101 object MenuItem1: TMenuItem 102 102 Action = AAdd -
trunk/Forms/FormGameSystems.pas
r316 r317 1 unit UFormGameSystems;1 unit FormGameSystems; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 ActnList, Menus, UGameSystem;7 ActnList, Menus, GameSystem, FormEx; 8 8 9 9 type … … 11 11 { TFormGameSystems } 12 12 13 TFormGameSystems = class(TForm )13 TFormGameSystems = class(TFormEx) 14 14 AAdd: TAction; 15 15 ASelectAll: TAction; … … 34 34 procedure ARemoveExecute(Sender: TObject); 35 35 procedure ASelectAllExecute(Sender: TObject); 36 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);37 36 procedure FormCreate(Sender: TObject); 38 37 procedure FormDestroy(Sender: TObject); … … 51 50 end; 52 51 53 var54 FormGameSystems: TFormGameSystems;55 56 52 57 53 implementation … … 60 56 61 57 uses 62 UCore, UFormGameSystem;58 FormGameSystem; 63 59 64 60 resourcestring … … 90 86 var 91 87 TempEntry: TGameSystem; 88 FormGameSystem: TFormGameSystem; 92 89 begin 93 90 if Assigned(ListView1.Selected) then … … 114 111 var 115 112 TempEntry: TGameSystem; 113 FormGameSystem: TFormGameSystem; 116 114 begin 117 115 TempEntry := TGameSystem.Create; … … 141 139 end; 142 140 143 procedure TFormGameSystems.FormClose(Sender: TObject;144 var CloseAction: TCloseAction);145 begin146 Core.PersistentForm.Save(Self);147 end;148 149 141 procedure TFormGameSystems.FormCreate(Sender: TObject); 150 142 var 151 143 I: Integer; 152 144 begin 153 Core.CoolTranslator1.TranslateComponentRecursive(Self);154 Core.ThemeManager1.UseTheme(Self);155 145 for I := 0 to ToolBar1.ButtonCount - 1 do 156 146 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; … … 164 154 procedure TFormGameSystems.FormShow(Sender: TObject); 165 155 begin 166 Core.PersistentForm.Load(Self);167 156 UpdateList; 168 157 UpdateInterface; -
trunk/Forms/FormHelp.lfm
r316 r317 1 1 object FormHelp: TFormHelp 2 Left = 5663 Height = 6634 Top = 2375 Width = 10122 Left = 1040 3 Height = 432 4 Top = 540 5 Width = 582 6 6 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 13 12 OnCreate = FormCreate 14 OnShow = FormShow15 13 Position = poMainFormCenter 16 LCLVersion = ' 2.0.0.4'14 LCLVersion = '3.4.0.0' 17 15 object Memo1: TMemo 18 Left = 619 Height = 65120 Top = 621 Width = 100016 Left = 7 17 Height = 418 18 Top = 7 19 Width = 568 22 20 Align = alClient 23 BorderSpacing.Around = 621 BorderSpacing.Around = 7 24 22 ReadOnly = True 25 23 ScrollBars = ssAutoBoth -
trunk/Forms/FormHelp.pas
r316 r317 1 unit UFormHelp;1 unit FormHelp; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls; 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 FormEx; 7 8 8 9 type … … 10 11 { TFormHelp } 11 12 12 TFormHelp = class(TForm )13 TFormHelp = class(TFormEx) 13 14 Memo1: TMemo; 14 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);15 15 procedure FormCreate(Sender: TObject); 16 procedure FormShow(Sender: TObject);17 16 end; 18 19 var20 FormHelp: TFormHelp;21 17 22 18 23 19 implementation 24 25 uses26 UCore;27 20 28 21 resourcestring … … 60 53 procedure TFormHelp.FormCreate(Sender: TObject); 61 54 begin 62 Core.CoolTranslator1.TranslateComponentRecursive(Self);63 55 Memo1.Lines.Text := SContent; 64 end;65 66 procedure TFormHelp.FormClose(Sender: TObject; var CloseAction: TCloseAction);67 begin68 Core.PersistentForm.Save(Self);69 end;70 71 procedure TFormHelp.FormShow(Sender: TObject);72 begin73 Core.PersistentForm.Load(Self);74 Core.ThemeManager1.UseTheme(Self);75 56 end; 76 57 -
trunk/Forms/FormItem.lfm
r316 r317 1 1 object FormItem: TFormItem 2 Left = 5702 Left = 1040 3 3 Height = 360 4 Top = 4294 Top = 540 5 5 Width = 480 6 6 Caption = 'Item' … … 8 8 ClientWidth = 480 9 9 DesignTimePPI = 144 10 OnClose = FormClose11 10 OnCreate = FormCreate 12 11 OnDestroy = FormDestroy 13 OnShow = FormShow 14 LCLVersion = '2.0.2.0' 12 LCLVersion = '3.4.0.0' 15 13 object ButtonOk: TButton 16 14 Left = 89 … … 21 19 Caption = 'OK' 22 20 ModalResult = 1 23 OnClick = ButtonOkClick24 21 ParentFont = False 25 22 TabOrder = 0 23 OnClick = ButtonOkClick 26 24 end 27 25 object ButtonCancel: TButton -
trunk/Forms/FormItem.pas
r316 r317 1 unit UFormItem;1 unit FormItem; 2 2 3 3 interface 4 4 5 5 uses 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; 8 8 9 9 type … … 11 11 { TFormItem } 12 12 13 TFormItem = class(TForm )13 TFormItem = class(TFormEx) 14 14 ButtonOk: TButton; 15 15 ButtonCancel: TButton; 16 16 procedure ButtonOkClick(Sender: TObject); 17 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);18 17 procedure FormCreate(Sender: TObject); 19 18 procedure FormDestroy(Sender: TObject); 20 procedure FormShow(Sender: TObject);21 19 private 22 20 FItem: TItem; … … 33 31 end; 34 32 35 var36 FormItem: TFormItem;37 38 33 39 34 implementation … … 42 37 43 38 uses 44 UCore;39 Core; 45 40 46 41 { TFormItem } … … 51 46 end; 52 47 53 procedure TFormItem.FormClose(Sender: TObject; var CloseAction: TCloseAction);54 begin55 Core.PersistentForm.Save(Self);56 end;57 58 48 procedure TFormItem.FormCreate(Sender: TObject); 59 49 begin 60 Core.CoolTranslator1.TranslateComponentRecursive(Self);61 Core.ThemeManager1.UseTheme(Self);62 50 DataControls := TObjectList<TControl>.Create; 63 51 DataLabels := TObjectList<TLabel>.Create; … … 66 54 procedure TFormItem.FormDestroy(Sender: TObject); 67 55 begin 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); 75 58 end; 76 59 … … 221 204 NewControl.Top := Y; 222 205 NewControl.Parent := Self; 223 Core.Co olTranslator1.TranslateComponent(NewControl);224 Core. ThemeManager1.ApplyTheme(NewControl);206 Core.Core.Translator1.TranslateComponent(NewControl); 207 Core.Core.ThemeManager1.ApplyTheme(NewControl); 225 208 NewControl.Visible := True; 226 209 DataControls.Add(NewControl); -
trunk/Forms/FormKeyShortcuts.lfm
r316 r317 1 1 object FormKeyShortcuts: TFormKeyShortcuts 2 Left = 5283 Height = 4374 Top = 3035 Width = 5272 Left = 1016 3 Height = 524 4 Top = 501 5 Width = 632 6 6 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 12 10 OnShow = FormShow 13 LCLVersion = ' 2.0.0.4'11 LCLVersion = '3.4.0.0' 14 12 object ListView1: TListView 15 Left = 416 Height = 42917 Top = 418 Width = 51913 Left = 5 14 Height = 514 15 Top = 5 16 Width = 622 19 17 Align = alClient 20 BorderSpacing.Around = 418 BorderSpacing.Around = 5 21 19 Columns = < 22 20 item 23 21 Caption = 'Action' 24 Width = 2 0022 Width = 240 25 23 end 26 24 item 27 25 Caption = 'Window' 28 Width = 2 0026 Width = 240 29 27 end 30 28 item 31 29 Caption = 'Shortcut' 32 Width = 8030 Width = 127 33 31 end> 34 32 LargeImages = Core.ImageListLarge … … 41 39 end 42 40 object PopupMenu1: TPopupMenu 43 left = 29944 top = 18741 Left = 359 42 Top = 224 45 43 object MenuItem1: TMenuItem 46 44 Caption = 'Execute' -
trunk/Forms/FormKeyShortcuts.pas
r316 r317 1 unit UFormKeyShortcuts;1 unit FormKeyShortcuts; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 7 ComCtrls, ActnList, LCLProc, Menus ;7 ComCtrls, ActnList, LCLProc, Menus, FormEx; 8 8 9 9 type … … 11 11 { TFormKeyShortcuts } 12 12 13 TFormKeyShortcuts = class(TForm )13 TFormKeyShortcuts = class(TFormEx) 14 14 ListView1: TListView; 15 15 MenuItem1: TMenuItem; 16 16 PopupMenu1: TPopupMenu; 17 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);18 procedure FormCreate(Sender: TObject);19 17 procedure FormShow(Sender: TObject); 20 18 procedure MenuItem1Click(Sender: TObject); … … 23 21 end; 24 22 25 var26 FormKeyShortcuts: TFormKeyShortcuts;27 28 23 29 24 implementation 30 25 31 26 uses 32 UFormMain, UCore;27 FormMain, Core; 33 28 34 29 resourcestring … … 40 35 procedure TFormKeyShortcuts.FormShow(Sender: TObject); 41 36 begin 42 Core.PersistentForm.Load(Self);43 Core.ThemeManager1.UseTheme(Self);44 37 try 45 38 ListView1.BeginUpdate; 46 39 ListView1.Clear; 47 LoadFromComponent(Core );48 LoadFromComponent( FormMain);40 LoadFromComponent(Core.Core); 41 LoadFromComponent(Core.Core.FormMain); 49 42 finally 50 43 ListView1.EndUpdate; … … 56 49 if Assigned(ListView1.Selected) then 57 50 TAction(ListView1.Selected.Data).Execute; 58 end;59 60 procedure TFormKeyShortcuts.FormClose(Sender: TObject;61 var CloseAction: TCloseAction);62 begin63 Core.PersistentForm.Save(Self);64 end;65 66 procedure TFormKeyShortcuts.FormCreate(Sender: TObject);67 begin68 Core.CoolTranslator1.TranslateComponentRecursive(Self);69 51 end; 70 52 … … 99 81 100 82 initialization 101 {$I UFormKeyShortcuts.lrs}83 {$I FormKeyShortcuts.lrs} 102 84 103 85 end. -
trunk/Forms/FormList.lfm
r316 r317 1 1 object FormList: TFormList 2 Left = 7792 Left = 1040 3 3 Height = 360 4 Top = 2364 Top = 540 5 5 Width = 480 6 6 Caption = 'List' … … 8 8 ClientWidth = 480 9 9 DesignTimePPI = 144 10 OnClose = FormClose11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 LCLVersion = ' 2.0.2.0'12 LCLVersion = '3.4.0.0' 14 13 object ListView1: TListView 15 14 Left = 0 … … 70 69 object ActionList1: TActionList 71 70 Images = Core.ImageListSmall 72 left = 20873 top = 16371 Left = 208 72 Top = 163 74 73 object AAdd: TAction 75 74 Caption = 'Add' … … 100 99 object PopupMenu1: TPopupMenu 101 100 Images = Core.ImageListSmall 102 left = 352103 top = 160101 Left = 352 102 Top = 160 104 103 object MenuItem1: TMenuItem 105 104 Action = AAdd -
trunk/Forms/FormList.pas
r316 r317 1 unit UFormList;1 unit FormList; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 ActnList, Menus, UItemList;7 ActnList, Menus, ItemList, FormEx; 8 8 9 9 type 10 10 { TFormList } 11 11 12 TFormList = class(TForm )12 TFormList = class(TFormEx) 13 13 AAdd: TAction; 14 14 ASelectAll: TAction; … … 34 34 procedure ARemoveExecute(Sender: TObject); 35 35 procedure ASelectAllExecute(Sender: TObject); 36 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);37 36 procedure FormCreate(Sender: TObject); 38 37 procedure FormShow(Sender: TObject); … … 58 57 end; 59 58 60 var61 FormList: TFormList;62 63 59 64 60 implementation … … 67 63 68 64 uses 69 UCore, UFormItem;65 FormItem; 70 66 71 67 resourcestring … … 176 172 end; 177 173 178 procedure TFormList.FormClose(Sender: TObject;179 var CloseAction: TCloseAction);180 begin181 Core.PersistentForm.Save(Self);182 end;183 184 174 procedure TFormList.FormCreate(Sender: TObject); 185 175 var 186 176 I: Integer; 187 177 begin 188 Core.CoolTranslator1.TranslateComponentRecursive(Self);189 Core.ThemeManager1.UseTheme(Self);190 178 for I := 0 to ToolBar1.ButtonCount - 1 do 191 179 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; … … 196 184 procedure TFormList.FormShow(Sender: TObject); 197 185 begin 198 Core.PersistentForm.Load(Self);199 186 UpdateListViewColumns; 200 187 UpdateList; -
trunk/Forms/FormMain.lfm
r316 r317 1 1 object FormMain: TFormMain 2 Left = 8263 Height = 7454 Top = 4195 Width = 9302 Left = 534 3 Height = 993 4 Top = 223 5 Width = 1491 6 6 Caption = 'xTactics' 7 ClientHeight = 7118 ClientWidth = 9307 ClientHeight = 993 8 ClientWidth = 1491 9 9 DesignTimePPI = 144 10 10 Menu = MainMenu1 … … 15 15 OnKeyUp = FormKeyUp 16 16 OnShow = FormShow 17 LCLVersion = ' 2.0.12.0'17 LCLVersion = '3.4.0.0' 18 18 object ToolBar1: TToolBar 19 19 Left = 0 20 20 Height = 40 21 21 Top = 0 22 Width = 93022 Width = 1491 23 23 ButtonHeight = 32 24 24 ButtonWidth = 32 … … 79 79 object PanelMain: TPanel 80 80 Left = 0 81 Height = 67181 Height = 953 82 82 Top = 40 83 Width = 93083 Width = 1491 84 84 Align = alClient 85 85 BevelOuter = bvNone -
trunk/Forms/FormMain.pas
r316 r317 1 unit UFormMain;1 unit FormMain; 2 2 3 3 interface … … 5 5 uses 6 6 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; 8 9 9 10 const … … 15 16 { TFormMain } 16 17 17 TFormMain = class(TForm )18 TFormMain = class(TFormEx) 18 19 AUnitShapeVisible: TAction; 19 20 AMapGridVisible: TAction; … … 93 94 procedure UpdateClientForms; 94 95 public 96 FormClient: TFormClient; 97 FormKeyShortcuts: TFormKeyShortcuts; 98 FormPlayersStats: TFormPlayersStats; 99 FormUnitMoves: TFormUnitMoves; 100 FormCharts: TFormCharts; 95 101 procedure LoadConfig(Config: TXmlConfig; Path: string); 96 102 procedure SaveConfig(Config: TXmlConfig; Path: string); … … 98 104 end; 99 105 100 var101 FormMain: TFormMain;102 103 106 104 107 implementation 105 108 106 109 uses 107 UCore, UFormClient;110 Core; 108 111 109 112 resourcestring … … 124 127 begin 125 128 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; 128 132 Caption := NewCaption; 129 133 end; … … 150 154 begin 151 155 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; 157 161 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; 163 167 end; 164 168 ToolBar1.Visible := AToolBarVisible.Checked; … … 227 231 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 228 232 begin 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; 235 238 end; 236 239 237 240 procedure TFormMain.FormDestroy(Sender: TObject); 238 241 begin 239 F ormClient.Free;242 FreeAndNil(FormClient); 240 243 end; 241 244 242 245 procedure TFormMain.ApplicationStart(Ptr: IntPtr); 243 246 begin 244 Core. ReopenGameOnInit;247 Core.Core.ReopenGameOnInit; 245 248 end; 246 249 … … 255 258 FormClient.AStatusBarVisible.Checked := AStatusBarVisible.Checked; 256 259 FormClient.AStatusBarVisible.Update; 257 Core.C ellGridVisible := AMapGridVisible.Checked;258 Core. UnitShapeVisible := AUnitShapeVisible.Checked;260 Core.Core.CellGridVisible := AMapGridVisible.Checked; 261 Core.Core.UnitShapeVisible := AUnitShapeVisible.Checked; 259 262 if Assigned(FormClient.Client) then begin 260 FormClient.Client.CellGridVisible := Core.C ellGridVisible;261 FormClient.Client.UnitShapeVisible := Core. UnitShapeVisible;263 FormClient.Client.CellGridVisible := Core.Core.CellGridVisible; 264 FormClient.Client.UnitShapeVisible := Core.Core.UnitShapeVisible; 262 265 end; 263 266 FormClient.Redraw; 264 for I := 0 to Core. FormClients.Count - 1 do begin265 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 begin272 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; 274 277 end; 275 Core. FormClients[I].Redraw;278 Core.Core.FormClients[I].Redraw; 276 279 end; 277 280 end; … … 280 283 begin 281 284 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'); 291 291 ReloadView; 292 292 FormClient.Show; -
trunk/Forms/FormMove.lfm
r316 r317 1 1 object FormMove: TFormMove 2 Left = 4353 Height = 2 324 Top = 1535 Width = 3512 Left = 1104 3 Height = 278 4 Top = 604 5 Width = 421 6 6 ActiveControl = ButtonOk 7 7 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 15 13 OnKeyPress = FormKeyPress 16 14 OnShow = FormShow 17 15 Position = poMainFormCenter 18 LCLVersion = ' 2.0.0.4'16 LCLVersion = '3.4.0.0' 19 17 object SpinEditOnce: TSpinEdit 20 Left = 17321 Height = 2822 Top = 3323 Width = 8218 Left = 208 19 Height = 43 20 Top = 40 21 Width = 98 24 22 OnChange = SpinEditOnceChange 25 23 OnKeyPress = FormKeyPress … … 28 26 end 29 27 object Label1: TLabel 30 Left = 1 331 Height = 2 032 Top = 3333 Width = 3728 Left = 16 29 Height = 26 30 Top = 40 31 Width = 49 34 32 Caption = 'Once:' 35 33 ParentColor = False … … 37 35 end 38 36 object ButtonOk: TButton 39 Left = 2 4740 Height = 3 241 Top = 18742 Width = 8337 Left = 296 38 Height = 38 39 Top = 224 40 Width = 100 43 41 Caption = 'Ok' 44 42 Default = True … … 48 46 end 49 47 object ButtonCancel: TButton 50 Left = 1 4751 Height = 3 252 Top = 18753 Width = 8348 Left = 176 49 Height = 38 50 Top = 224 51 Width = 100 54 52 Caption = 'Cancel' 55 53 ModalResult = 2 … … 58 56 end 59 57 object Label2: TLabel 60 Left = 2 061 Height = 2 062 Top = 1 1363 Width = 6858 Left = 24 59 Height = 26 60 Top = 136 61 Width = 90 64 62 Caption = 'Every turn:' 65 63 ParentColor = False … … 67 65 end 68 66 object SpinEditRepeat: TSpinEdit 69 Left = 17370 Height = 2871 Top = 1 0772 Width = 8267 Left = 208 68 Height = 43 69 Top = 128 70 Width = 98 73 71 OnChange = SpinEditRepeatChange 74 72 OnKeyPress = FormKeyPress … … 77 75 end 78 76 object TrackBarOnce: TTrackBar 79 Left = 7380 Height = 4881 Top = 6782 Width = 2 0577 Left = 88 78 Height = 58 79 Top = 80 80 Width = 245 83 81 OnChange = TrackBarOnceChange 84 82 PageSize = 1 … … 91 89 end 92 90 object TrackBarRepeat: TTrackBar 93 Left = 8094 Height = 4895 Top = 1 4096 Width = 19391 Left = 96 92 Height = 58 93 Top = 168 94 Width = 231 97 95 OnChange = TrackBarRepeatChange 98 96 PageSize = 1 … … 105 103 end 106 104 object ButtonOnceMin: TButton 107 Left = 7108 Height = 3 2109 Top = 73110 Width = 67105 Left = 8 106 Height = 38 107 Top = 88 108 Width = 80 111 109 Caption = 'Min' 112 OnClick = ButtonOnceMinClick113 110 ParentFont = False 114 111 TabOrder = 6 112 OnClick = ButtonOnceMinClick 115 113 end 116 114 object ButtonOnceMax: TButton 117 Left = 277118 Height = 3 2119 Top = 73120 Width = 67115 Left = 333 116 Height = 38 117 Top = 88 118 Width = 80 121 119 Anchors = [akTop, akRight] 122 120 Caption = 'Max' 123 OnClick = ButtonOnceMaxClick124 121 ParentFont = False 125 122 TabOrder = 7 123 OnClick = ButtonOnceMaxClick 126 124 end 127 125 object ButtonRepeatMin: TButton 128 Left = 7129 Height = 3 2130 Top = 1 47131 Width = 67126 Left = 8 127 Height = 38 128 Top = 176 129 Width = 80 132 130 Caption = 'Min' 133 OnClick = ButtonRepeatMinClick134 131 ParentFont = False 135 132 TabOrder = 8 133 OnClick = ButtonRepeatMinClick 136 134 end 137 135 object ButtonRepeatMax: TButton 138 Left = 277139 Height = 3 2140 Top = 1 47141 Width = 67136 Left = 333 137 Height = 38 138 Top = 176 139 Width = 80 142 140 Anchors = [akTop, akRight] 143 141 Caption = 'Max' 144 OnClick = ButtonRepeatMaxClick145 142 ParentFont = False 146 143 TabOrder = 9 144 OnClick = ButtonRepeatMaxClick 147 145 end 148 146 object Label3: TLabel 149 Left = 1 3150 Height = 2 0151 Top = 7152 Width = 1 06147 Left = 16 148 Height = 26 149 Top = 8 150 Width = 134 153 151 Caption = 'Win probability:' 154 152 ParentColor = False … … 156 154 end 157 155 object LabelWinProbability: TLabel 158 Left = 2 20159 Height = 2 0160 Top = 7161 Width = 1 2156 Left = 264 157 Height = 26 158 Top = 8 159 Width = 15 162 160 Caption = ' ' 163 161 ParentColor = False … … 165 163 end 166 164 object ButtonRemove: TButton 167 Left = 4 0168 Height = 3 2169 Top = 187170 Width = 83165 Left = 48 166 Height = 38 167 Top = 224 168 Width = 100 171 169 Caption = 'Delete' 172 OnClick = ButtonRemoveClick173 170 ParentFont = False 174 171 TabOrder = 10 172 OnClick = ButtonRemoveClick 175 173 end 176 174 end -
trunk/Forms/FormMove.pas
r316 r317 1 unit UFormMove;1 unit FormMove; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin, 7 StdCtrls, ComCtrls ;7 StdCtrls, ComCtrls, FormEx; 8 8 9 9 type … … 11 11 { TFormMove } 12 12 13 TFormMove = class(TForm )13 TFormMove = class(TFormEx) 14 14 ButtonRemove: TButton; 15 15 ButtonRepeatMax: TButton; … … 30 30 procedure ButtonRemoveClick(Sender: TObject); 31 31 procedure ButtonRepeatMinClick(Sender: TObject); 32 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);33 procedure FormCreate(Sender: TObject);34 32 procedure ButtonOnceMinClick(Sender: TObject); 35 33 procedure ButtonRepeatMaxClick(Sender: TObject); … … 48 46 end; 49 47 50 var51 FormMove: TFormMove;52 53 48 54 49 implementation … … 57 52 58 53 uses 59 UCore;54 Core; 60 55 61 56 { TFormMove } … … 78 73 Label3.Visible := ShowWinProbability; 79 74 LabelWinProbability.Caption := 80 IntToStr(Round(Core. Game.AttackProbability(AttackCount + SpinEditOnce.Value,75 IntToStr(Round(Core.Core.Game.AttackProbability(AttackCount + SpinEditOnce.Value, 81 76 DefendCount) * 100)) + ' %'; 82 77 end; … … 91 86 procedure TFormMove.FormShow(Sender: TObject); 92 87 begin 93 Core.PersistentForm.Load(Self);94 Core.ThemeManager1.UseTheme(Self);95 88 if SpinEditOnce.MaxValue < SpinEditOnce.Value then begin 96 89 SpinEditOnce.Enabled := False; … … 128 121 end; 129 122 130 procedure TFormMove.FormClose(Sender: TObject; var CloseAction: TCloseAction);131 begin132 Core.PersistentForm.Save(Self);133 end;134 135 procedure TFormMove.FormCreate(Sender: TObject);136 begin137 Core.CoolTranslator1.TranslateComponentRecursive(Self);138 end;139 140 123 procedure TFormMove.ButtonOnceMinClick(Sender: TObject); 141 124 begin -
trunk/Forms/FormNew.lfm
r316 r317 1 1 object FormNew: TFormNew 2 Left = 4 783 Height = 7454 Top = 5 265 Width = 12 112 Left = 449 3 Height = 688 4 Top = 511 5 Width = 1209 6 6 Caption = 'New game' 7 ClientHeight = 7458 ClientWidth = 12 117 ClientHeight = 688 8 ClientWidth = 1209 9 9 Constraints.MinHeight = 502 10 10 Constraints.MinWidth = 667 11 11 DesignTimePPI = 144 12 OnClose = FormClose13 12 OnCreate = FormCreate 14 13 OnDestroy = FormDestroy 15 14 OnShow = FormShow 16 15 Position = poMainFormCenter 17 LCLVersion = ' 2.0.2.0'16 LCLVersion = '3.4.0.0' 18 17 object PageControl1: TPageControl 19 18 Left = 4 20 Height = 63519 Height = 578 21 20 Top = 60 22 Width = 80 623 ActivePage = TabSheet Rules21 Width = 804 22 ActivePage = TabSheetPlayers 24 23 Align = alClient 25 24 BorderSpacing.Around = 4 26 25 ParentFont = False 27 TabIndex = 326 TabIndex = 1 28 27 TabOrder = 0 29 28 OnChange = PageControl1Change 30 29 object TabSheetMode: TTabSheet 31 30 Caption = 'Mode' 32 ClientHeight = 5 9533 ClientWidth = 79 631 ClientHeight = 538 32 ClientWidth = 794 34 33 ParentFont = False 35 34 object Panel3: TPanel 36 35 Left = 0 37 Height = 5 9636 Height = 538 38 37 Top = 0 39 Width = 79 638 Width = 794 40 39 Align = alClient 41 40 BevelOuter = bvNone 42 ClientHeight = 5 9643 ClientWidth = 79 641 ClientHeight = 538 42 ClientWidth = 794 44 43 ParentFont = False 45 44 TabOrder = 0 … … 51 50 Caption = 'Local' 52 51 Checked = True 53 OnChange = RadioButtonModeLocalChange54 52 ParentFont = False 55 53 TabOrder = 0 56 54 TabStop = True 55 OnChange = RadioButtonModeLocalChange 57 56 end 58 57 object RadioButtonModeNetworkServer: TRadioButton … … 60 59 Height = 30 61 60 Top = 48 62 Width = 15 661 Width = 155 63 62 Caption = 'Network server' 63 ParentFont = False 64 TabOrder = 1 64 65 OnChange = RadioButtonModeLocalChange 65 ParentFont = False66 TabOrder = 167 66 end 68 67 object RadioButtonModeNetworkClient: TRadioButton … … 70 69 Height = 30 71 70 Top = 152 72 Width = 1 5171 Width = 149 73 72 Caption = 'Network client' 73 ParentFont = False 74 TabOrder = 2 74 75 OnChange = RadioButtonModeLocalChange 75 ParentFont = False76 TabOrder = 277 76 end 78 77 object EditServerAddress: TEdit … … 97 96 Height = 26 98 97 Top = 88 99 Width = 4 198 Width = 40 100 99 Caption = 'Port:' 101 100 ParentColor = False … … 113 112 object ListViewServers: TListView 114 113 Left = 26 115 Height = 3 65114 Height = 307 116 115 Top = 181 117 116 Width = 334 … … 142 141 Left = 26 143 142 Height = 31 144 Top = 557143 Top = 499 145 144 Width = 94 146 145 Action = AServerAdd … … 152 151 Left = 240 153 152 Height = 31 154 Top = 557153 Top = 499 155 154 Width = 94 156 155 Action = AServerRemove … … 162 161 Left = 136 163 162 Height = 30 164 Top = 556163 Top = 498 165 164 Width = 94 166 165 Action = AServerModify … … 173 172 object TabSheetPlayers: TTabSheet 174 173 Caption = 'Players' 175 ClientHeight = 5 95176 ClientWidth = 79 6174 ClientHeight = 538 175 ClientWidth = 794 177 176 ParentFont = False 178 177 object Panel2: TPanel 179 178 Left = 0 180 Height = 5 96179 Height = 538 181 180 Top = 0 182 Width = 79 6181 Width = 794 183 182 Align = alClient 184 183 BevelOuter = bvNone … … 189 188 object TabSheetMap: TTabSheet 190 189 Caption = 'Map' 191 ClientHeight = 5 95192 ClientWidth = 79 6190 ClientHeight = 538 191 ClientWidth = 794 193 192 OnShow = TabSheetMapShow 194 193 ParentFont = False 195 194 object Panel1: TPanel 196 195 Left = 0 197 Height = 5 96196 Height = 538 198 197 Top = 0 199 Width = 79 6198 Width = 794 200 199 Align = alClient 201 200 BevelOuter = bvNone 202 ClientHeight = 5 96203 ClientWidth = 79 6201 ClientHeight = 538 202 ClientWidth = 794 204 203 ParentFont = False 205 204 TabOrder = 0 … … 208 207 Height = 26 209 208 Top = 10 210 Width = 9 5209 Width = 94 211 210 Caption = 'Map width:' 212 211 ParentColor = False … … 217 216 Height = 26 218 217 Top = 58 219 Width = 10 2218 Width = 101 220 219 Caption = 'Map height:' 221 220 ParentColor = False … … 248 247 Height = 58 249 248 Top = 8 250 Width = 54 5249 Width = 543 251 250 Max = 100 252 251 Min = 2 … … 262 261 Height = 58 263 262 Top = 49 264 Width = 54 5263 Width = 543 265 264 Max = 100 266 265 Min = 2 … … 276 275 Height = 26 277 276 Top = 104 278 Width = 8 3277 Width = 82 279 278 Caption = 'Grid type:' 280 279 ParentColor = False … … 283 282 object ComboBoxGridType: TComboBox 284 283 Left = 146 285 Height = 28284 Height = 38 286 285 Top = 104 287 286 Width = 304 … … 294 293 'Isometric' 295 294 ) 296 OnChange = ComboBoxGridTypeChange297 295 ParentFont = False 298 296 Style = csDropDownList 299 297 TabOrder = 4 298 OnChange = ComboBoxGridTypeChange 300 299 end 301 300 object ComboBoxMapShape: TComboBox 302 301 Left = 146 303 Height = 28302 Height = 38 304 303 Top = 144 305 304 Width = 304 … … 310 309 'Triangular' 311 310 ) 312 OnChange = ComboBoxMapShapeChange313 311 ParentFont = False 314 312 Style = csDropDownList 315 313 TabOrder = 5 314 OnChange = ComboBoxMapShapeChange 316 315 end 317 316 object Label8: TLabel … … 328 327 Height = 26 329 328 Top = 248 330 Width = 308329 Width = 543 331 330 Anchors = [akTop, akLeft, akRight] 332 331 AutoSize = False 333 332 Caption = 'Symetric map' 333 ParentFont = False 334 TabOrder = 6 334 335 OnChange = CheckBoxSymetricMapChange 335 ParentFont = False336 TabOrder = 6337 336 end 338 337 object SpinEditVoidPercent: TSpinEdit … … 353 352 Width = 189 354 353 Caption = 'Inaccessible places' 354 ParentFont = False 355 TabOrder = 8 355 356 OnChange = CheckBoxVoidChange 356 ParentFont = False357 TabOrder = 8358 357 end 359 358 object CheckBoxCity: TCheckBox … … 361 360 Height = 30 362 361 Top = 368 363 Width = 7 3362 Width = 72 364 363 Caption = 'Cities' 364 ParentFont = False 365 TabOrder = 9 365 366 OnChange = CheckBoxCityChange 366 ParentFont = False367 TabOrder = 9368 367 end 369 368 object SpinEditCityPercent: TSpinEdit … … 411 410 Height = 26 412 411 Top = 496 413 Width = 22 7412 Width = 225 414 413 Caption = 'Max random neutral units:' 415 414 ParentColor = False … … 420 419 Height = 43 421 420 Top = 184 422 Width = 5 30421 Width = 543 423 422 Anchors = [akTop, akLeft, akRight] 423 ParentFont = False 424 TabOrder = 12 424 425 OnChange = EditImageFileChange 425 ParentFont = False426 TabOrder = 12427 426 end 428 427 object ButtonImageBrowse: TButton 429 Left = 6 81428 Left = 679 430 429 Height = 38 431 430 Top = 190 … … 433 432 Anchors = [akTop, akRight] 434 433 Caption = 'Browse' 434 ParentFont = False 435 TabOrder = 13 435 436 OnClick = ButtonImageBrowseClick 436 ParentFont = False437 TabOrder = 13438 437 end 439 438 object Label9: TLabel … … 450 449 Height = 30 451 450 Top = 408 452 Width = 21 2451 Width = 211 453 452 Caption = 'Bridges between cells' 453 ParentFont = False 454 TabOrder = 14 454 455 OnChange = CheckBoxBridgesChange 455 ParentFont = False456 TabOrder = 14457 456 end 458 457 object SpinEditMaxPower: TSpinEdit … … 472 471 Height = 26 473 472 Top = 448 474 Width = 15 6473 Width = 155 475 474 Caption = 'Max units per cell:' 476 475 ParentColor = False … … 481 480 Height = 26 482 481 Top = 283 483 Width = 308482 Width = 543 484 483 Anchors = [akTop, akLeft, akRight] 485 484 AutoSize = False 486 485 Caption = 'Cyclic map' 486 ParentFont = False 487 TabOrder = 16 487 488 OnChange = CheckBoxCyclicMapChange 488 ParentFont = False489 TabOrder = 16490 489 end 491 490 object Image1: TImage … … 493 492 Height = 316 494 493 Top = 272 495 Width = 359494 Width = 542 496 495 Anchors = [akTop, akLeft, akRight] 497 496 OnResize = Image1Resize … … 512 511 Width = 154 513 512 Caption = 'Randomize' 513 ParentFont = False 514 TabOrder = 17 514 515 OnClick = ButtonRandomizeClick 515 ParentFont = False516 TabOrder = 17517 516 end 518 517 end … … 520 519 object TabSheetRules: TTabSheet 521 520 Caption = 'Rules' 522 ClientHeight = 5 95523 ClientWidth = 79 6521 ClientHeight = 538 522 ClientWidth = 794 524 523 ParentFont = False 525 524 object Panel4: TPanel 526 525 Left = 0 527 Height = 5 95526 Height = 538 528 527 Top = 0 529 Width = 79 6528 Width = 794 530 529 Align = alClient 531 530 BevelOuter = bvNone 532 ClientHeight = 5 95533 ClientWidth = 79 6531 ClientHeight = 538 532 ClientWidth = 794 534 533 ParentFont = False 535 534 TabOrder = 0 … … 562 561 Height = 26 563 562 Top = 248 564 Width = 1 20563 Width = 119 565 564 Caption = 'Win objective:' 566 565 ParentColor = False … … 579 578 'Stay alive for number of turns' 580 579 ) 581 OnChange = ComboBoxWinObjectiveChange582 580 ParentFont = False 583 581 Style = csDropDownList 584 582 TabOrder = 1 583 OnChange = ComboBoxWinObjectiveChange 585 584 end 586 585 object RadioGroupGrowAmount: TRadioGroup … … 620 619 Height = 78 621 620 Top = 290 622 Width = 77 3621 Width = 771 623 622 ActivePage = TabSheetCaptureEntireMap 624 623 Anchors = [akTop, akLeft, akRight] … … 635 634 object TabSheetCaptureCells: TTabSheet 636 635 ClientHeight = 74 637 ClientWidth = 76 3636 ClientWidth = 761 638 637 ParentFont = False 639 638 object Label14: TLabel 640 639 Left = 8 641 Height = 2 0640 Height = 26 642 641 Top = 16 643 Width = 1 25642 Width = 161 644 643 Caption = 'Special cells count:' 645 644 ParentColor = False … … 648 647 object SpinEditSpecialCells: TSpinEdit 649 648 Left = 236 650 Height = 28649 Height = 43 651 650 Top = 8 652 651 Width = 158 … … 660 659 object TabSheetStayAliveTurns: TTabSheet 661 660 ClientHeight = 74 662 ClientWidth = 76 3661 ClientWidth = 761 663 662 ParentFont = False 664 663 object Label13: TLabel 665 664 Left = 8 666 Height = 2 0665 Height = 26 667 666 Top = 16 668 Width = 1 11667 Width = 146 669 668 Caption = 'Number of turns:' 670 669 ParentColor = False … … 673 672 object SpinEditTurns: TSpinEdit 674 673 Left = 236 675 Height = 28674 Height = 43 676 675 Top = 8 677 676 Width = 158 … … 696 695 Left = 0 697 696 Height = 46 698 Top = 6 99699 Width = 12 11697 Top = 642 698 Width = 1209 700 699 Align = alBottom 701 700 BevelOuter = bvNone 702 701 ClientHeight = 46 703 ClientWidth = 12 11702 ClientWidth = 1209 704 703 ParentFont = False 705 704 TabOrder = 1 706 705 object ButtonOk: TButton 707 Left = 102 4706 Left = 1022 708 707 Height = 25 709 708 Top = 7 … … 712 711 Caption = 'Ok' 713 712 ModalResult = 1 714 OnClick = ButtonOkClick715 713 ParentFont = False 716 714 TabOrder = 0 715 OnClick = ButtonOkClick 717 716 end 718 717 object ButtonCancel: TButton 719 Left = 112 7718 Left = 1125 720 719 Height = 25 721 720 Top = 7 … … 729 728 end 730 729 object PanelChat: TPanel 731 Left = 8 20732 Height = 643730 Left = 818 731 Height = 586 733 732 Top = 56 734 733 Width = 391 … … 739 738 end 740 739 object Splitter1: TSplitter 741 Left = 81 4742 Height = 643740 Left = 812 741 Height = 586 743 742 Top = 56 744 743 Width = 6 … … 750 749 Height = 56 751 750 Top = 0 752 Width = 12 11751 Width = 1209 753 752 Align = alTop 754 753 BevelOuter = bvNone 755 754 ClientHeight = 56 756 ClientWidth = 12 11755 ClientWidth = 1209 757 756 ParentFont = False 758 757 TabOrder = 4 … … 761 760 Height = 26 762 761 Top = 16 763 Width = 12 1762 Width = 120 764 763 Caption = 'Game system:' 765 764 ParentColor = False … … 772 771 Width = 254 773 772 ItemHeight = 0 774 OnChange = ComboBoxGameSystemChange775 773 ParentFont = False 776 774 Style = csDropDownList 777 775 TabOrder = 0 776 OnChange = ComboBoxGameSystemChange 778 777 end 779 778 object ButtonGameSystems: TButton … … 783 782 Width = 113 784 783 Caption = 'Manage' 785 OnClick = ButtonGameSystemsClick786 784 ParentFont = False 787 785 TabOrder = 1 786 OnClick = ButtonGameSystemsClick 788 787 end 789 788 end 790 789 object ActionList1: TActionList 791 790 Images = Core.ImageListSmall 792 left = 864793 top = 216791 Left = 864 792 Top = 216 794 793 object AServerAdd: TAction 795 794 Caption = 'Add' … … 806 805 end 807 806 object OpenPictureDialog1: TOpenPictureDialog 808 left = 864809 top = 360807 Left = 864 808 Top = 360 810 809 end 811 810 object PopupMenuServers: TPopupMenu 812 left = 864813 top = 136811 Left = 864 812 Top = 136 814 813 object MenuItem4: TMenuItem 815 814 Action = AServerAdd … … 825 824 Interval = 500 826 825 OnTimer = TimerMapPreviewTimer 827 left = 864828 top = 446826 Left = 864 827 Top = 446 829 828 end 830 829 end -
trunk/Forms/FormNew.pas
r316 r317 1 unit UFormNew;1 unit FormNew; 2 2 3 3 interface … … 5 5 uses 6 6 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; 9 9 10 10 type … … 12 12 { TFormNew } 13 13 14 TFormNew = class(TForm )14 TFormNew = class(TFormEx) 15 15 ActionList1: TActionList; 16 16 AServerAdd: TAction; … … 115 115 procedure ComboBoxWinObjectiveChange(Sender: TObject); 116 116 procedure EditImageFileChange(Sender: TObject); 117 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);118 117 procedure FormCreate(Sender: TObject); 119 118 procedure FormDestroy(Sender: TObject); … … 143 142 NewRandSeed: Cardinal; 144 143 FormPlayers: TFormList; 144 FormChat: TFormChat; 145 145 procedure LoadGame(Game: TGame); 146 146 procedure SaveGame(Game: TGame); … … 158 158 end; 159 159 160 var161 FormNew: TFormNew;162 163 160 164 161 implementation … … 167 164 168 165 uses 169 UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 170 UFormGameSystems, UMapType; 166 Core, FormServer, ClientGUI, FormClient, FormGameSystems, MapType; 171 167 172 168 resourcestring … … 350 346 ComboBoxGameSystem.Items.BeginUpdate; 351 347 try 352 while ComboBoxGameSystem.Items.Count > Core. GameSystems.Count do348 while ComboBoxGameSystem.Items.Count > Core.Core.GameSystems.Count do 353 349 ComboBoxGameSystem.Items.Delete(ComboBoxGameSystem.Items.Count - 1); 354 while ComboBoxGameSystem.Items.Count < Core. GameSystems.Count do350 while ComboBoxGameSystem.Items.Count < Core.Core.GameSystems.Count do 355 351 ComboBoxGameSystem.Items.Add(''); 356 for I := 0 to Core. GameSystems.Count - 1 do begin357 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]; 359 355 end; 360 356 if Assigned(LastSystem) then … … 457 453 ItemIndex := LastIndex; 458 454 end; 459 Core.Co olTranslator1.TranslateComponentRecursive(Self);455 Core.Core.Translator1.TranslateComponentRecursive(Self); 460 456 end; 461 457 … … 500 496 Randomize; 501 497 NewRandSeed := RandSeed; 502 Core.PersistentForm.Load(Self);503 Core.ThemeManager1.UseTheme(Self);504 498 ReloadView; 505 499 //Height := Trunc(1.5 * Height); … … 583 577 end; 584 578 585 procedure TFormNew.FormClose(Sender: TObject; var CloseAction: TCloseAction);586 begin587 Core.PersistentForm.Save(Self);588 end;589 590 579 procedure TFormNew.AServerAddExecute(Sender: TObject); 591 580 var 592 581 NewServerInfo: TServerInfo; 582 FormServer: TFormServer; 593 583 begin 594 584 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; 602 595 end; 603 596 … … 605 598 var 606 599 ServerInfo: TServerInfo; 600 FormServer: TFormServer; 607 601 begin 608 602 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; 615 612 end; 616 613 … … 629 626 630 627 procedure TFormNew.ButtonGameSystemsClick(Sender: TObject); 628 var 629 FormGameSystems: TFormGameSystems; 631 630 begin 632 631 FormGameSystems := TFormGameSystems.Create(nil); 633 632 try 634 FormGameSystems.GameSystems := Core. GameSystems;633 FormGameSystems.GameSystems := Core.Core.GameSystems; 635 634 FormGameSystems.ShowModal; 636 635 ReloadGameSystemsMenu; … … 683 682 SpinEditServerPort.Value := LocalNetworkPort; 684 683 end; 685 ServerList.Assign(Core. ServerList);684 ServerList.Assign(Core.Core.ServerList); 686 685 LoadGame(Server.Game); 687 686 end; … … 703 702 end; 704 703 end; 705 Core. ServerList.Assign(ServerList);704 Core.Core.ServerList.Assign(ServerList); 706 705 SaveGame(Server.Game); 707 706 end; -
trunk/Forms/FormPlayersStats.lfm
r316 r317 1 1 object FormPlayersStats: TFormPlayersStats 2 Left = 4682 Left = 907 3 3 Height = 300 4 Top = 4774 Top = 570 5 5 Width = 746 6 6 Caption = 'Players stats' 7 7 ClientHeight = 300 8 8 ClientWidth = 746 9 DesignTimePPI = 120 10 OnClose = FormClose 9 DesignTimePPI = 144 11 10 OnShow = FormShow 12 LCLVersion = ' 2.0.0.4'11 LCLVersion = '3.4.0.0' 13 12 object ListView1: TListView 14 Left = 415 Height = 29 216 Top = 417 Width = 73 813 Left = 5 14 Height = 290 15 Top = 5 16 Width = 736 18 17 Align = alClient 19 BorderSpacing.Around = 418 BorderSpacing.Around = 5 20 19 Columns = < 21 20 item 22 21 Caption = 'Name' 23 Width = 1 0022 Width = 120 24 23 end 25 24 item 26 25 Caption = 'Mode' 27 Width = 1 0026 Width = 120 28 27 end 29 28 item 30 29 Caption = 'Cells' 31 Width = 1 0030 Width = 120 32 31 end 33 32 item 34 33 Caption = 'Discovered' 35 Width = 1 0034 Width = 120 36 35 end 37 36 item 38 37 Caption = 'Cities' 39 Width = 1 0038 Width = 120 40 39 end 41 40 item 42 41 Caption = 'Units' 43 Width = 1 0042 Width = 120 44 43 end 45 44 item 46 45 Caption = 'Win objective cells' 47 Width = 1 0046 Width = 150 48 47 end> 49 48 OwnerData = True … … 56 55 end 57 56 object PopupMenu1: TPopupMenu 58 left = 14359 top = 11057 Left = 172 58 Top = 132 60 59 object MenuItem1: TMenuItem 61 60 Action = ASpectate … … 63 62 end 64 63 object ActionList1: TActionList 65 left = 35866 top = 11164 Left = 448 65 Top = 136 67 66 object ASpectate: TAction 68 67 Caption = 'Spectate' … … 76 75 Column = 0 77 76 Order = soNone 78 left = 54479 top = 11077 Left = 653 78 Top = 132 80 79 end 81 80 end -
trunk/Forms/FormPlayersStats.pas
r316 r317 1 unit UFormPlayersStats;1 unit FormPlayersStats; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, UGame, ListViewSort;7 Menus, ActnList, Game, ListViewSort, FormEx; 8 8 9 9 type … … 11 11 { TFormPlayersStats } 12 12 13 TFormPlayersStats = class(TForm )13 TFormPlayersStats = class(TFormEx) 14 14 ASpectate: TAction; 15 15 ActionList1: TActionList; … … 19 19 PopupMenu1: TPopupMenu; 20 20 procedure ASpectateExecute(Sender: TObject); 21 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);22 21 procedure FormShow(Sender: TObject); 23 22 procedure ListView1Data(Sender: TObject; Item: TListItem); … … 28 27 end; 29 28 30 var31 FormPlayersStats: TFormPlayersStats;32 33 29 34 30 implementation 35 31 36 32 uses 37 UCore, UPlayer;33 Core, Player; 38 34 39 35 {$R *.lfm} … … 43 39 procedure TFormPlayersStats.ListView1Data(Sender: TObject; Item: TListItem); 44 40 begin 45 with Core. Game do41 with Core.Core.Game do 46 42 if Item.Index < ListViewSort1.List.Count then 47 43 with TPlayer(ListViewSort1.List[Item.Index]) do begin … … 81 77 begin 82 78 ListViewSort1.List.Clear; 83 for I := 0 to Core. Game.Players.Count - 1 do begin84 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]); 85 81 end; 86 82 end; … … 88 84 procedure TFormPlayersStats.FormShow(Sender: TObject); 89 85 begin 90 Core.PersistentForm.Load(Self);91 Core.ThemeManager1.UseTheme(Self);92 Core.CoolTranslator1.TranslateComponentRecursive(Self);93 86 ReloadList; 94 end;95 96 procedure TFormPlayersStats.FormClose(Sender: TObject;97 var CloseAction: TCloseAction);98 begin99 Core.PersistentForm.Save(Self);100 87 end; 101 88 … … 103 90 begin 104 91 if Assigned(ListView1.Selected) then 105 Core. Spectate(TPlayer(ListView1.Selected.Data));92 Core.Core.Spectate(TPlayer(ListView1.Selected.Data)); 106 93 end; 107 94 -
trunk/Forms/FormServer.lfm
r316 r317 1 1 object FormServer: TFormServer 2 Left = 6912 Left = 1078 3 3 Height = 210 4 Top = 3894 Top = 615 5 5 Width = 403 6 6 Caption = 'Server' 7 7 ClientHeight = 210 8 8 ClientWidth = 403 9 DesignTimePPI = 120 10 OnShow = FormShow 11 LCLVersion = '2.0.0.4' 9 DesignTimePPI = 144 10 LCLVersion = '3.4.0.0' 12 11 object Label1: TLabel 13 Left = 1 014 Height = 2 015 Top = 2 016 Width = 4312 Left = 12 13 Height = 26 14 Top = 24 15 Width = 56 17 16 Caption = 'Name:' 18 17 ParentColor = False … … 20 19 end 21 20 object EditName: TEdit 22 Left = 1 3623 Height = 2824 Top = 1 425 Width = 2 3421 Left = 163 22 Height = 43 23 Top = 17 24 Width = 281 26 25 ParentFont = False 27 26 TabOrder = 0 28 27 end 29 28 object Label2: TLabel 30 Left = 1 031 Height = 2 032 Top = 6033 Width = 5629 Left = 12 30 Height = 26 31 Top = 72 32 Width = 74 34 33 Caption = 'Address:' 35 34 ParentColor = False … … 37 36 end 38 37 object EditAddress: TEdit 39 Left = 1 3640 Height = 2841 Top = 5342 Width = 2 3638 Left = 163 39 Height = 43 40 Top = 64 41 Width = 283 43 42 ParentFont = False 44 43 TabOrder = 1 45 44 end 46 45 object Label3: TLabel 47 Left = 1 048 Height = 2 049 Top = 1 0050 Width = 3046 Left = 12 47 Height = 26 48 Top = 120 49 Width = 40 51 50 Caption = 'Port:' 52 51 ParentColor = False … … 54 53 end 55 54 object SpinEdit1: TSpinEdit 56 Left = 1 3657 Height = 2858 Top = 9359 Width = 9755 Left = 163 56 Height = 43 57 Top = 112 58 Width = 116 60 59 MaxValue = 65535 61 60 ParentFont = False … … 63 62 end 64 63 object ButtonCancel: TButton 65 Left = 2 4066 Height = 3 167 Top = 1 5568 Width = 9464 Left = 288 65 Height = 37 66 Top = 186 67 Width = 113 69 68 Caption = 'Cancel' 70 69 ModalResult = 2 … … 73 72 end 74 73 object ButtonOk: TButton 75 Left = 8076 Height = 3 177 Top = 1 5578 Width = 9474 Left = 96 75 Height = 37 76 Top = 186 77 Width = 113 79 78 Caption = 'OK' 80 79 ModalResult = 1 81 OnClick = ButtonOkClick82 80 ParentFont = False 83 81 TabOrder = 4 82 OnClick = ButtonOkClick 84 83 end 85 84 end -
trunk/Forms/FormServer.pas
r316 r317 1 unit UFormServer;1 unit FormServer; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 Spin, UServerList;7 Spin, ServerList, FormEx; 8 8 9 9 type … … 11 11 { TFormServer } 12 12 13 TFormServer = class(TForm )13 TFormServer = class(TFormEx) 14 14 ButtonCancel: TButton; 15 15 ButtonOk: TButton; … … 21 21 SpinEdit1: TSpinEdit; 22 22 procedure ButtonOkClick(Sender: TObject); 23 procedure FormShow(Sender: TObject);24 23 private 25 24 FServerInfo: TServerInfo; … … 31 30 end; 32 31 33 var34 FormServer: TFormServer;35 36 32 37 33 implementation … … 39 35 {$R *.lfm} 40 36 41 uses42 UCore;43 44 37 { TFormServer } 45 46 procedure TFormServer.FormShow(Sender: TObject);47 begin48 Core.ThemeManager1.UseTheme(Self);49 end;50 38 51 39 procedure TFormServer.ButtonOkClick(Sender: TObject); -
trunk/Forms/FormSettings.lfm
r316 r317 1 1 object FormSettings: TFormSettings 2 Left = 5353 Height = 2994 Top = 3865 Width = 4802 Left = 851 3 Height = 613 4 Top = 413 5 Width = 857 6 6 ActiveControl = ButtonOk 7 7 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 14 13 OnCreate = FormCreate 15 14 OnShow = FormShow 16 15 Position = poMainFormCenter 17 LCLVersion = ' 2.0.0.4'16 LCLVersion = '3.4.0.0' 18 17 object ButtonOk: TButton 19 Left = 41120 Height = 2 121 Top = 26622 Width = 6218 Left = 775 19 Height = 25 20 Top = 574 21 Width = 74 23 22 Anchors = [akRight, akBottom] 24 23 Caption = 'Ok' … … 28 27 end 29 28 object ButtonCancel: TButton 30 Left = 33231 Height = 2 132 Top = 26633 Width = 6229 Left = 680 30 Height = 25 31 Top = 574 32 Width = 74 34 33 Anchors = [akRight, akBottom] 35 34 Caption = 'Cancel' … … 39 38 end 40 39 object PageControl1: TPageControl 41 Left = 742 Height = 24543 Top = 744 Width = 46640 Left = 8 41 Height = 558 42 Top = 8 43 Width = 841 45 44 ActivePage = TabSheetGeneral 46 45 Align = alTop 47 46 Anchors = [akTop, akLeft, akRight, akBottom] 48 BorderSpacing.Around = 747 BorderSpacing.Around = 8 49 48 ParentFont = False 50 49 TabIndex = 0 … … 52 51 object TabSheetGeneral: TTabSheet 53 52 Caption = 'General' 54 ClientHeight = 21255 ClientWidth = 45853 ClientHeight = 518 54 ClientWidth = 831 56 55 ParentFont = False 57 56 object Panel1: TPanel 58 57 Left = 0 59 Height = 21258 Height = 518 60 59 Top = 0 61 Width = 45860 Width = 831 62 61 Align = alClient 63 62 BevelOuter = bvNone 64 ClientHeight = 21265 ClientWidth = 45863 ClientHeight = 518 64 ClientWidth = 831 66 65 ParentFont = False 67 66 TabOrder = 0 68 67 object Label1: TLabel 69 Left = 1770 Height = 2 071 Top = 2772 Width = 6868 Left = 20 69 Height = 26 70 Top = 32 71 Width = 88 73 72 Caption = 'Language:' 74 73 ParentColor = False … … 76 75 end 77 76 object ComboBoxLanguage: TComboBox 78 Left = 1 4879 Height = 2880 Top = 2 081 Width = 1 6382 ItemHeight = 2077 Left = 178 78 Height = 42 79 Top = 24 80 Width = 196 81 ItemHeight = 0 83 82 ParentFont = False 84 83 Style = csDropDownList … … 86 85 end 87 86 object ComboBoxTheme: TComboBox 88 Left = 1 4789 Height = 2890 Top = 6091 Width = 1 6392 ItemHeight = 2087 Left = 176 88 Height = 42 89 Top = 72 90 Width = 196 91 ItemHeight = 0 93 92 ParentFont = False 94 93 Style = csDropDownList … … 96 95 end 97 96 object Label6: TLabel 98 Left = 1799 Height = 2 0100 Top = 67101 Width = 4897 Left = 20 98 Height = 26 99 Top = 80 100 Width = 63 102 101 Caption = 'Theme:' 103 102 ParentColor = False … … 105 104 end 106 105 object SpinEditAnimSpeed: TSpinEdit 107 Left = 193108 Height = 28109 Top = 1 00110 Width = 1 02106 Left = 232 107 Height = 43 108 Top = 120 109 Width = 122 111 110 ParentFont = False 112 111 TabOrder = 2 113 112 end 114 113 object Label3: TLabel 115 Left = 3 07116 Height = 2 0117 Top = 1 03118 Width = 1 2114 Left = 368 115 Height = 26 116 Top = 124 117 Width = 15 119 118 Caption = '%' 120 119 ParentColor = False … … 122 121 end 123 122 object Label2: TLabel 124 Left = 17125 Height = 2 0126 Top = 1 00127 Width = 1 16123 Left = 20 124 Height = 26 125 Top = 120 126 Width = 149 128 127 Caption = 'Animation speed:' 129 128 ParentColor = False … … 131 130 end 132 131 object CheckBoxAutoSaveTurn: TCheckBox 133 Left = 17134 Height = 24135 Top = 1 28136 Width = 2 13132 Left = 20 133 Height = 30 134 Top = 154 135 Width = 269 137 136 Caption = 'Autosave game on each turn' 138 137 ParentFont = False … … 140 139 end 141 140 object CheckBoxReopenLastFile: TCheckBox 142 Left = 17143 Height = 24144 Top = 1 62145 Width = 198141 Left = 20 142 Height = 30 143 Top = 194 144 Width = 248 146 145 Caption = 'Reopen last game on start' 147 146 ParentFont = False … … 152 151 object TabSheetDebug: TTabSheet 153 152 Caption = 'Debug' 154 ClientHeight = 260155 ClientWidth = 554153 ClientHeight = 518 154 ClientWidth = 831 156 155 ParentFont = False 157 156 object Panel2: TPanel 158 157 Left = 0 159 Height = 229158 Height = 518 160 159 Top = 0 161 Width = 583160 Width = 831 162 161 Align = alClient 163 162 BevelOuter = bvNone 164 ClientHeight = 229165 ClientWidth = 583163 ClientHeight = 518 164 ClientWidth = 831 166 165 ParentFont = False 167 166 TabOrder = 0 168 167 object CheckBox2: TCheckBox 169 Left = 1 3170 Height = 2 0171 Top = 27172 Width = 557168 Left = 16 169 Height = 24 170 Top = 32 171 Width = 799 173 172 Anchors = [akTop, akLeft, akRight] 174 173 AutoSize = False 175 174 Caption = 'Automatic DPI' 175 ParentFont = False 176 TabOrder = 0 176 177 OnChange = CheckBox2Change 177 ParentFont = False178 TabOrder = 0179 178 end 180 179 object Label4: TLabel 181 Left = 1 2182 Height = 26 183 Top = 56180 Left = 14 181 Height = 26 182 Top = 67 184 183 Width = 35 185 184 Caption = 'DPI:' … … 188 187 end 189 188 object SpinEditX: TSpinEdit 190 Left = 87191 Height = 36192 Top = 53193 Width = 80189 Left = 104 190 Height = 43 191 Top = 64 192 Width = 96 194 193 MaxValue = 500 195 194 MinValue = 20 … … 199 198 end 200 199 object Label5: TLabel 201 Left = 173202 Height = 26 203 Top = 56200 Left = 208 201 Height = 26 202 Top = 67 204 203 Width = 10 205 204 Caption = 'x' … … 208 207 end 209 208 object SpinEditY: TSpinEdit 210 Left = 193211 Height = 36212 Top = 53213 Width = 75209 Left = 232 210 Height = 43 211 Top = 64 212 Width = 90 214 213 MaxValue = 500 215 214 MinValue = 20 … … 219 218 end 220 219 object CheckBoxDevelMode: TCheckBox 221 Left = 1 3222 Height = 2 2223 Top = 1 13224 Width = 560220 Left = 16 221 Height = 26 222 Top = 136 223 Width = 803 225 224 Anchors = [akTop, akLeft, akRight] 226 225 AutoSize = False -
trunk/Forms/FormSettings.pas
r316 r317 1 unit UFormSettings;1 unit FormSettings; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 Spin, ComCtrls, ExtCtrls ;7 Spin, ComCtrls, ExtCtrls, FormEx; 8 8 9 9 type … … 11 11 { TFormSettings } 12 12 13 TFormSettings = class(TForm )13 TFormSettings = class(TFormEx) 14 14 ButtonOk: TButton; 15 15 ButtonCancel: TButton; … … 35 35 TabSheetDebug: TTabSheet; 36 36 procedure CheckBox2Change(Sender: TObject); 37 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);38 37 procedure FormCreate(Sender: TObject); 39 38 procedure FormShow(Sender: TObject); … … 43 42 end; 44 43 45 var46 FormSettings: TFormSettings;47 44 48 45 … … 52 49 53 50 uses 54 UCore, Languages, Theme;51 Core, Languages, Theme; 55 52 56 53 { TFormSettings } … … 62 59 end; 63 60 64 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction65 );66 begin67 Core.PersistentForm.Save(Self);68 end;69 70 61 procedure TFormSettings.FormCreate(Sender: TObject); 71 62 begin 72 63 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); 76 66 end; 77 67 78 68 procedure TFormSettings.FormShow(Sender: TObject); 79 69 begin 80 Core.PersistentForm.Load(Self);81 Core.ThemeManager1.UseTheme(Self);82 70 {$IFDEF DEBUG} 83 71 TabSheetDebug.TabVisible := True; … … 89 77 procedure TFormSettings.Load; 90 78 begin 91 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Co olTranslator1.Language);79 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator1.Language); 92 80 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); 94 82 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; 102 90 end; 103 91 … … 105 93 begin 106 94 if ComboBoxLanguage.ItemIndex <> -1 then 107 Core.Co olTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);95 Core.Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 108 96 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; 116 104 end; 117 105 -
trunk/Forms/FormUnitMoves.lfm
r316 r317 1 1 object FormUnitMoves: TFormUnitMoves 2 Left = 7303 Height = 4 184 Top = 2115 Width = 8022 Left = 879 3 Height = 499 4 Top = 514 5 Width = 950 6 6 Caption = 'Unit moves' 7 ClientHeight = 418 8 ClientWidth = 802 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 499 8 ClientWidth = 950 9 DesignTimePPI = 144 11 10 OnShow = FormShow 12 LCLVersion = ' 2.0.0.4'11 LCLVersion = '3.4.0.0' 13 12 object ListView1: TListView 14 13 Left = 0 15 Height = 4 1814 Height = 499 16 15 Top = 0 17 Width = 80216 Width = 950 18 17 Align = alClient 19 18 Columns = < 20 19 item 21 20 Caption = 'From cell' 22 Width = 1 5021 Width = 180 23 22 end 24 23 item 25 24 Caption = 'To cell' 26 Width = 1 5025 Width = 180 27 26 end 28 27 item 29 28 Caption = 'Once count' 30 Width = 1 5029 Width = 180 31 30 end 32 31 item 33 32 Caption = 'Repeat count' 34 Width = 3 3233 Width = 398 35 34 end> 36 35 OwnerData = True -
trunk/Forms/FormUnitMoves.pas
r316 r317 1 unit UFormUnitMoves;1 unit FormUnitMoves; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls; 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 FormEx; 7 8 8 9 type … … 10 11 { TFormUnitMoves } 11 12 12 TFormUnitMoves = class(TForm )13 TFormUnitMoves = class(TFormEx) 13 14 ListView1: TListView; 14 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);15 15 procedure FormShow(Sender: TObject); 16 16 procedure ListView1Data(Sender: TObject; Item: TListItem); 17 private18 19 17 public 20 18 procedure ReloadList; 21 19 end; 22 20 23 var24 FormUnitMoves: TFormUnitMoves;25 21 26 22 implementation 27 23 28 24 uses 29 UGame, UCore, UPlayer;25 Game, Core, Player; 30 26 31 27 {$R *.lfm} … … 35 31 procedure TFormUnitMoves.ListView1Data(Sender: TObject; Item: TListItem); 36 32 begin 37 if Assigned(Core. Game) and Assigned(Core.Game.CurrentPlayer) then38 with Core. Game.CurrentPlayer do33 if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) then 34 with Core.Core.Game.CurrentPlayer do 39 35 if (Mode = pmHuman) and (Item.Index < Moves.Count) then 40 36 with TUnitMove(Moves[Item.Index]) do begin … … 48 44 procedure TFormUnitMoves.FormShow(Sender: TObject); 49 45 begin 50 Core.PersistentForm.Load(Self);51 Core.ThemeManager1.UseTheme(Self);52 Core.CoolTranslator1.TranslateComponentRecursive(Self);53 46 ReloadList; 54 end;55 56 procedure TFormUnitMoves.FormClose(Sender: TObject;57 var CloseAction: TCloseAction);58 begin59 Core.PersistentForm.Save(Self);60 47 end; 61 48 62 49 procedure TFormUnitMoves.ReloadList; 63 50 begin 64 if Assigned(Core. Game) and Assigned(Core.Game.CurrentPlayer) and65 (Core. Game.CurrentPlayer.Mode = pmHuman) then66 ListView1.Items.Count := Core. Game.CurrentPlayer.Moves.Count51 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 67 54 else ListView1.Items.Count := 0; 68 55 ListView1.Refresh;
Note:
See TracChangeset
for help on using the changeset viewer.