- Timestamp:
- Feb 3, 2019, 11:28:03 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r274 r275 18 18 object PageControl1: TPageControl 19 19 Left = 4 20 Height = 6 9221 Top = 420 Height = 636 21 Top = 60 22 22 Width = 806 23 ActivePage = TabSheet Rules23 ActivePage = TabSheetMode 24 24 Align = alClient 25 25 BorderSpacing.Around = 4 26 TabIndex = 326 TabIndex = 0 27 27 TabOrder = 0 28 28 OnChange = PageControl1Change 29 29 object TabSheetMode: TTabSheet 30 30 Caption = 'Mode' 31 ClientHeight = 65231 ClientHeight = 596 32 32 ClientWidth = 796 33 33 object Panel3: TPanel 34 34 Left = 0 35 Height = 65235 Height = 596 36 36 Top = 0 37 37 Width = 796 38 38 Align = alClient 39 39 BevelOuter = bvNone 40 ClientHeight = 65240 ClientHeight = 596 41 41 ClientWidth = 796 42 42 TabOrder = 0 … … 103 103 object ListViewServers: TListView 104 104 Left = 26 105 Height = 420105 Height = 364 106 106 Top = 181 107 107 Width = 334 … … 131 131 Left = 27 132 132 Height = 31 133 Top = 613133 Top = 557 134 134 Width = 94 135 135 Action = AServerAdd … … 140 140 Left = 240 141 141 Height = 31 142 Top = 613142 Top = 557 143 143 Width = 94 144 144 Action = AServerRemove … … 149 149 Left = 136 150 150 Height = 30 151 Top = 613151 Top = 557 152 152 Width = 94 153 153 Action = AServerModify … … 159 159 object TabSheetPlayers: TTabSheet 160 160 Caption = 'Players' 161 ClientHeight = 652161 ClientHeight = 596 162 162 ClientWidth = 796 163 163 object Panel2: TPanel … … 241 241 object TabSheetMap: TTabSheet 242 242 Caption = 'Map' 243 ClientHeight = 652243 ClientHeight = 596 244 244 ClientWidth = 796 245 245 OnShow = TabSheetMapShow … … 542 542 object TabSheetRules: TTabSheet 543 543 Caption = 'Rules' 544 ClientHeight = 652544 ClientHeight = 596 545 545 ClientWidth = 796 546 546 object Panel4: TPanel … … 754 754 object PanelChat: TPanel 755 755 Left = 820 756 Height = 700757 Top = 0756 Height = 644 757 Top = 56 758 758 Width = 391 759 759 Align = alRight … … 763 763 object Splitter1: TSplitter 764 764 Left = 814 765 Height = 700766 Top = 0765 Height = 644 766 Top = 56 767 767 Width = 6 768 768 Align = alRight 769 769 ResizeAnchor = akRight 770 end 771 object Panel5: TPanel 772 Left = 0 773 Height = 56 774 Top = 0 775 Width = 1211 776 Align = alTop 777 BevelOuter = bvNone 778 ClientHeight = 56 779 ClientWidth = 1211 780 TabOrder = 4 781 object Label16: TLabel 782 Left = 12 783 Height = 26 784 Top = 16 785 Width = 121 786 Caption = 'Game system:' 787 ParentColor = False 788 end 789 object ComboBoxGameSystem: TComboBox 790 Left = 176 791 Height = 43 792 Top = 9 793 Width = 254 794 ItemHeight = 0 795 Style = csDropDownList 796 TabOrder = 0 797 end 798 object ButtonGameSystems: TButton 799 Left = 443 800 Height = 38 801 Top = 12 802 Width = 113 803 Caption = 'Manage' 804 OnClick = ButtonGameSystemsClick 805 TabOrder = 1 806 end 770 807 end 771 808 object ActionList1: TActionList -
trunk/Forms/UFormNew.pas
r274 r275 25 25 Button2: TButton; 26 26 Button3: TButton; 27 ButtonGameSystems: TButton; 27 28 ButtonRandomize: TButton; 28 29 ButtonCancel: TButton; … … 41 42 CheckBoxUnitsMoveImmediately: TCheckBox; 42 43 CheckBoxVoid: TCheckBox; 44 ComboBoxGameSystem: TComboBox; 43 45 ComboBoxGridType: TComboBox; 44 46 ComboBoxMapShape: TComboBox; … … 54 56 Label14: TLabel; 55 57 Label15: TLabel; 58 Label16: TLabel; 56 59 Label2: TLabel; 57 60 Label3: TLabel; … … 117 120 procedure AServerModifyExecute(Sender: TObject); 118 121 procedure AServerRemoveExecute(Sender: TObject); 122 procedure ButtonGameSystemsClick(Sender: TObject); 119 123 procedure ButtonImageBrowseClick(Sender: TObject); 120 124 procedure ButtonRandomizeClick(Sender: TObject); … … 169 173 procedure MapPreviewPaint; 170 174 procedure MapPreviewRedraw; 175 procedure ReloadGameSystemsMenu; 171 176 public 172 177 procedure Translate; … … 186 191 187 192 uses 188 UFormPlayer, UFormChat, UCore, UFormServer, UClientGUI, UFormClient; 193 UFormPlayer, UFormChat, UCore, UFormServer, UClientGUI, UFormClient, 194 UFormGameSystems; 189 195 190 196 resourcestring … … 403 409 end; 404 410 411 procedure TFormNew.ReloadGameSystemsMenu; 412 var 413 I: Integer; 414 LastSystem: Pointer; 415 begin 416 if ComboBoxGameSystem.ItemIndex <> -1 then 417 LastSystem := ComboBoxGameSystem.Items.Objects[ComboBoxGameSystem.ItemIndex] 418 else LastSystem := nil; 419 ComboBoxGameSystem.Items.BeginUpdate; 420 try 421 while ComboBoxGameSystem.Items.Count > Core.GameSystems.Count do 422 ComboBoxGameSystem.Items.Delete(ComboBoxGameSystem.Items.Count - 1); 423 while ComboBoxGameSystem.Items.Count < Core.GameSystems.Count do 424 ComboBoxGameSystem.Items.Add(''); 425 for I := 0 to Core.GameSystems.Count - 1 do begin 426 ComboBoxGameSystem.Items[I] := Core.GameSystems[I].Name; 427 ComboBoxGameSystem.Items.Objects[I] := Core.GameSystems[I]; 428 end; 429 if Assigned(LastSystem) then 430 ComboBoxGameSystem.ItemIndex := ComboBoxGameSystem.Items.IndexOfObject(LastSystem); 431 if (ComboBoxGameSystem.ItemIndex = -1) and (ComboBoxGameSystem.Items.Count > 0) then 432 ComboBoxGameSystem.ItemIndex := 0; 433 finally 434 ComboBoxGameSystem.Items.EndUpdate; 435 end; 436 end; 437 405 438 procedure TFormNew.MapPreviewPaint; 406 439 var … … 525 558 Core.PersistentForm.Load(Self); 526 559 Core.ThemeManager1.UseTheme(Self); 560 ReloadGameSystemsMenu; 527 561 ReloadView; 528 562 //Height := Trunc(1.5 * Height); … … 678 712 ServerList.Items.Delete(I); 679 713 ReloadView; 714 end; 715 end; 716 717 procedure TFormNew.ButtonGameSystemsClick(Sender: TObject); 718 begin 719 FormGameSystems := TFormGameSystems.Create(nil); 720 try 721 FormGameSystems.GameSystems := Core.GameSystems; 722 FormGameSystems.ShowModal; 723 ReloadGameSystemsMenu; 724 finally 725 FreeAndNil(FormGameSystems); 680 726 end; 681 727 end; -
trunk/Languages/xtactics.cs.po
r274 r275 40 40 41 41 #: tcore.agameload.caption 42 msgctxt "tcore.agameload.caption" 42 43 msgid "Load" 43 44 msgstr "Načíst" … … 63 64 64 65 #: tcore.agamesave.caption 66 msgctxt "tcore.agamesave.caption" 65 67 msgid "Save" 66 68 msgstr "Uložit" … … 203 205 msgid "Client" 204 206 msgstr "Klient" 207 208 #: tformgamesystem.buttoncancel.caption 209 msgctxt "tformgamesystem.buttoncancel.caption" 210 msgid "Cancel" 211 msgstr "Zrušit" 212 213 #: tformgamesystem.buttonload.caption 214 msgctxt "tformgamesystem.buttonload.caption" 215 msgid "Load" 216 msgstr "Načíst" 217 218 #: tformgamesystem.buttonok.caption 219 msgctxt "tformgamesystem.buttonok.caption" 220 msgid "OK" 221 msgstr "OK" 222 223 #: tformgamesystem.buttonsave.caption 224 msgctxt "tformgamesystem.buttonsave.caption" 225 msgid "Save" 226 msgstr "Uložit" 227 228 #: tformgamesystem.caption 229 msgid "Game system" 230 msgstr "Herní systém" 231 232 #: tformgamesystems.aadd.caption 233 msgctxt "tformgamesystems.aadd.caption" 234 msgid "Add" 235 msgstr "Přidat" 236 237 #: tformgamesystems.aclone.caption 238 msgid "Clone" 239 msgstr "Klonovat" 240 241 #: tformgamesystems.amodify.caption 242 msgctxt "tformgamesystems.amodify.caption" 243 msgid "Modify" 244 msgstr "Upravit" 245 246 #: tformgamesystems.aremove.caption 247 msgctxt "tformgamesystems.aremove.caption" 248 msgid "Remove" 249 msgstr "Odstranit" 250 251 #: tformgamesystems.aselectall.caption 252 msgid "Select all" 253 msgstr "Vybrat vše" 254 255 #: tformgamesystems.caption 256 msgid "Game systems" 257 msgstr "Herní systémy" 258 259 #: tformgamesystems.listview1.columns[0].caption 260 msgctxt "tformgamesystems.listview1.columns[0].caption" 261 msgid "Name" 262 msgstr "Jméno" 205 263 206 264 #: tformhelp.caption … … 395 453 msgstr "Zrušit" 396 454 455 #: tformnew.buttongamesystems.caption 456 msgid "Manage" 457 msgstr "Spravovat" 458 397 459 #: tformnew.buttonimagebrowse.caption 398 460 msgctxt "tformnew.buttonimagebrowse.caption" … … 482 544 msgstr "Náhled:" 483 545 546 #: tformnew.label16.caption 547 msgid "Game system:" 548 msgstr "Herní systém:" 549 484 550 #: tformnew.label2.caption 485 551 #| msgid "x" … … 682 748 683 749 #: tformserver.buttonok.caption 750 msgctxt "tformserver.buttonok.caption" 684 751 msgid "OK" 685 752 msgstr "OK" … … 884 951 msgid "turn" 885 952 msgstr "tah" 953 954 #: uformgamesystem.sfiledialogfilter 955 msgid "xTactics game system (.xts)|*.xts|All files|*.*" 956 msgstr "xTactics herní systém (.xts)|*.xts|Všechny soubory|*.*" 957 958 #: uformgamesystems.sremoveitems 959 msgid "Remove items" 960 msgstr "Odstranit položky" 961 962 #: uformgamesystems.sremoveitemsquery 963 msgid "Do you want to remove selected items?" 964 msgstr "Opravdu chcete odstranit vybrané položky?" 886 965 887 966 #: uformhelp.scontent … … 1058 1137 1059 1138 #: ugame.swrongfileformat 1139 msgctxt "ugame.swrongfileformat" 1140 msgid "Wrong file format" 1141 msgstr "Chybný formát souboru" 1142 1143 #: ugamesystem.swrongfileformat 1144 msgctxt "ugamesystem.swrongfileformat" 1060 1145 msgid "Wrong file format" 1061 1146 msgstr "Chybný formát souboru" -
trunk/Languages/xtactics.po
r274 r275 30 30 31 31 #: tcore.agameload.caption 32 msgctxt "tcore.agameload.caption" 32 33 msgid "Load" 33 34 msgstr "" … … 53 54 54 55 #: tcore.agamesave.caption 56 msgctxt "tcore.agamesave.caption" 55 57 msgid "Save" 56 58 msgstr "" … … 194 196 msgstr "" 195 197 198 #: tformgamesystem.buttoncancel.caption 199 msgctxt "tformgamesystem.buttoncancel.caption" 200 msgid "Cancel" 201 msgstr "" 202 203 #: tformgamesystem.buttonload.caption 204 msgctxt "tformgamesystem.buttonload.caption" 205 msgid "Load" 206 msgstr "" 207 208 #: tformgamesystem.buttonok.caption 209 msgctxt "tformgamesystem.buttonok.caption" 210 msgid "OK" 211 msgstr "" 212 213 #: tformgamesystem.buttonsave.caption 214 msgctxt "tformgamesystem.buttonsave.caption" 215 msgid "Save" 216 msgstr "" 217 218 #: tformgamesystem.caption 219 msgid "Game system" 220 msgstr "" 221 222 #: tformgamesystems.aadd.caption 223 msgctxt "tformgamesystems.aadd.caption" 224 msgid "Add" 225 msgstr "" 226 227 #: tformgamesystems.aclone.caption 228 msgid "Clone" 229 msgstr "" 230 231 #: tformgamesystems.amodify.caption 232 msgctxt "tformgamesystems.amodify.caption" 233 msgid "Modify" 234 msgstr "" 235 236 #: tformgamesystems.aremove.caption 237 msgctxt "tformgamesystems.aremove.caption" 238 msgid "Remove" 239 msgstr "" 240 241 #: tformgamesystems.aselectall.caption 242 msgid "Select all" 243 msgstr "" 244 245 #: tformgamesystems.caption 246 msgid "Game systems" 247 msgstr "" 248 249 #: tformgamesystems.listview1.columns[0].caption 250 msgctxt "tformgamesystems.listview1.columns[0].caption" 251 msgid "Name" 252 msgstr "" 253 196 254 #: tformhelp.caption 197 255 msgctxt "TFORMHELP.CAPTION" … … 382 440 msgstr "" 383 441 442 #: tformnew.buttongamesystems.caption 443 msgid "Manage" 444 msgstr "" 445 384 446 #: tformnew.buttonimagebrowse.caption 385 447 msgctxt "TFORMNEW.BUTTONIMAGEBROWSE.CAPTION" … … 468 530 msgstr "" 469 531 532 #: tformnew.label16.caption 533 msgid "Game system:" 534 msgstr "" 535 470 536 #: tformnew.label2.caption 471 537 msgid "Map height:" … … 667 733 668 734 #: tformserver.buttonok.caption 735 msgctxt "tformserver.buttonok.caption" 669 736 msgid "OK" 670 737 msgstr "" … … 868 935 msgctxt "uformclient.sturn" 869 936 msgid "turn" 937 msgstr "" 938 939 #: uformgamesystem.sfiledialogfilter 940 msgid "xTactics game system (.xts)|*.xts|All files|*.*" 941 msgstr "" 942 943 #: uformgamesystems.sremoveitems 944 msgid "Remove items" 945 msgstr "" 946 947 #: uformgamesystems.sremoveitemsquery 948 msgid "Do you want to remove selected items?" 870 949 msgstr "" 871 950 … … 1035 1114 1036 1115 #: ugame.swrongfileformat 1116 msgctxt "ugame.swrongfileformat" 1117 msgid "Wrong file format" 1118 msgstr "" 1119 1120 #: ugamesystem.swrongfileformat 1121 msgctxt "ugamesystem.swrongfileformat" 1037 1122 msgid "Wrong file format" 1038 1123 msgstr "" -
trunk/UClientGUI.pas
r274 r275 153 153 Pen.Width := Round(10 * View.Zoom); 154 154 Brush.Style := bsClear; 155 TCanvasEx.Ellipse (Canvas, TRect.Create(155 TCanvasEx.EllipseEx(Canvas, TRect.Create( 156 156 TPoint.Create(TextPos.X - R, TextPos.Y - R), 157 157 TPoint.Create(TextPos.X + R, TextPos.Y + R) … … 221 221 Pen.Width := Round(10 * View.Zoom); 222 222 Brush.Style := bsClear; 223 TCanvasEx.Ellipse (Canvas, TRect.Create(223 TCanvasEx.EllipseEx(Canvas, TRect.Create( 224 224 TPoint.Create(TextPos.X - R, TextPos.Y - R), 225 225 TPoint.Create(TextPos.X + R, TextPos.Y + R) -
trunk/UCore.lfm
r264 r275 117 117 top = 420 118 118 Bitmap = { 119 4C691 000000010000000100000000000000000000000E3AA4BD6E5B35EFFE3B1119 4C691300000010000000100000000000000000000000E3AA4BD6E5B35EFFE3B1 120 120 61F2DEA85AF3D9A156F3D49B50F3CF904AF3CA8C47F3C58743F3C0813CF3BF80 121 121 38F8A75E20FB00000000000000000000000000000000E6AF53E7F6D084FFF8D8 … … 629 629 21FF77461EFF75421BFF75421BFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 630 630 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 631 FF00FFFFFF00FFFFFF00FFFFFF00 631 FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 632 000070A970FF006400FF006200FF70A670FF0000000000000000000000000000 633 0000000000000000000000000000000000000000000000000000000000000000 634 0000006400FFECFFECFF8CFE8CFF006000FFD4D4D4FF00000000000000000000 635 0000000000000000000000000000000000000000000000000000000000000000 636 0000006400FF8CFE8CFF00E800FF005E00FFB2B2B2FF00000000000000000000 637 0000000000000000000000000000000000000000000000000000000000000000 638 0000006200FF8CFE8CFF00E500FF005C00FFB2B2B2FF00000000000000000000 639 0000000000000000000000000000000000000000000000000000000000000000 640 0000006000FF8CFE8CFF00E000FF005A00FFB2B2B2FF00000000000000000000 641 000000000000000000000000000070A970FF006400FF006400FF006200FF0060 642 00FF006000FF8CFE8CFF00DD00FF005800FF005600FF005400FF005300FF0050 643 00FF709C70FF0000000000000000006400FFECFFECFF8CFE8CFF8CFE8CFF8CFE 644 8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D000FF00CC00FF00C800FF00C4 645 00FF004A00FFD4D4D4FF00000000006200FF8CFE8CFF00EA00FF00E600FF00E2 646 00FF00DE00FF00DA00FF00D400FF00D000FF00CC00FF00C800FF00C400FF00C2 647 00FF004800FFB2B2B2FF0000000070A670FF005E00FF005C00FF005A00FF0058 648 00FF005600FF00D600FF00D000FF005000FF004E00FF004C00FF004A00FF004A 649 00FF4E764EFFB2B2B2FF0000000000000000D4D4D4FFB2B2B2FFB2B2B2FFB2B2 650 B2FF005400FF00D200FF00CE00FF004E00FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2 651 B2FFB2B2B2FFD4D4D4FF00000000000000000000000000000000000000000000 652 0000005300FF00CE00FF00CA00FF004C00FFB2B2B2FF00000000000000000000 653 0000000000000000000000000000000000000000000000000000000000000000 654 0000005000FF00CA00FF00C600FF004A00FFB2B2B2FF00000000000000000000 655 0000000000000000000000000000000000000000000000000000000000000000 656 0000004E00FF00C800FF00C400FF004800FFB2B2B2FF00000000000000000000 657 0000000000000000000000000000000000000000000000000000000000000000 658 0000709B70FF004A00FF004800FF4E764EFFB2B2B2FF00000000000000000000 659 0000000000000000000000000000000000000000000000000000000000000000 660 000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4D4FF00000000000000000000 661 0000000000000000000000000000000000000000000000000000000000000000 662 0000000000000000000000000000000000000000000000000000000000000000 663 0000000000000000000000000000000000000000000000000000000000000000 664 0000000000000000000000000000000000000000000000000000000000000000 665 0000000000000000000000000000000000000000000000000000000000000000 666 00000000000000000000D69562FFD69562FFD69562FFD1925FFFD1925FFFD192 667 5FFFD1925FFFD1925FFF875735FF000000000000000000000000000000000000 668 00000000000000000000D69562FFF5F5F5FFF5F5F5FFF5F5F5FFF5F5F5FFF5F5 669 F5FFF5F5F5FFF5F5F5FF875735FF000000000000000000000000000000000000 670 00000000000000000000D69562FFFAFAFAFFFFEDE0FFFFEDE0FFFFEDE0FFFFED 671 E0FFFFEDE0FFFFFFFFFF875735FF000000000000000000000000000000000000 672 00000000000000000000EED4BFFFFFFFFFFFE0D5BFFFE4D9C3FFCCB27EFFFFED 673 E0FFFFEDE0FFFFFFFFFF875735FF00000000D69562FFD69562FFD69562FFD192 674 5FFFD1925FFFD1925FFFD1925FFFD1925FFF875735FFFFF7F2FFFFECDEFFFFEC 675 DEFFFFECDDFFFFFFFFFF875735FF00000000D69562FFF5F5F5FFF5F5F5FFF5F5 676 F5FFF5F5F5FFF5F5F5FFF5F5F5FFF5F5F5FF875735FFE4D9C3FFCCB27EFFD5BC 677 87FFDDC490FFFFFFFFFF875735FF00000000D69562FFFAFAFAFFFFEDE0FFFFED 678 E0FFFFEDE0FFFFEDE0FFFFEDE0FFFFFFFFFF875735FFFFF6EFFFFFE8D7FFFFE8 679 D7FFFFE8D7FFFFFFFFFF875735FF00000000D49360FFFFFFFFFFB2955FFFBB9F 680 69FFCCB27EFFFFEDE0FFFFEDE0FFFFFFFFFF875735FFE4D9C3FFCCB27EFFD5BC 681 87FFDDC490FFFFFFFFFF875735FF00000000D0905EFFFFFFFFFFFFECDEFFFFEC 682 DEFFFFECDEFFFFECDEFFFFECDDFFFFFFFFFF875735FFFFF6EFFFFFE8D7FFFFE8 683 D7FFFFE8D7FFFFFFFFFF875735FF00000000CC8D5CFFFFFFFFFFB2955FFFBB9F 684 69FFCCB27EFFD5BC87FFDDC490FFFFFFFFFF875735FFFFFFFFFFFFFFFFFFFFFF 685 FFFFFFFFFFFFFFFFFFFF875735FF00000000C18556FFFFFFFFFFFFE8D7FFFFE8 686 D7FFFFE8D7FFFFE8D7FFFFE8D7FFFFFFFFFF875735FFCFBCAEFF875735FF8757 687 35FF875735FF875735FF875735FF00000000C18556FFFFFFFFFFB2955FFFBB9F 688 69FFCCB27EFFD5BC87FFDDC490FFFFFFFFFF875735FF00000000000000000000 689 000000000000000000000000000000000000C18556FFFFFFFFFFFFE8D7FFFFE8 690 D7FFFFE8D7FFFFE8D7FFFFE8D7FFFFFFFFFF875735FF00000000000000000000 691 000000000000000000000000000000000000C18556FFFFFFFFFFFFFFFFFFFFFF 692 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF875735FF00000000000000000000 693 000000000000000000000000000000000000875735FF875735FF875735FF8757 694 35FF875735FF875735FF875735FF875735FF875735FF00000000000000000000 695 0000000000000000000000000000000000000000000000000000000000000000 696 0000000000000000000000000000000000000000000000000000000000000000 697 000000000000000000000000000000000000000000008C8CBBFF000088FF8C8C 698 BBFF00000000000000000000000000000000000000008C8CBBFF000075FF8C8C 699 BBFF000000000000000000000000000000008C8CBBFF000088FF619BFFFF0000 700 86FF7979A8FF0000000000000000000000008C8CBBFF000075FF619BFFFF0000 701 6EFF7979A8FF000000000000000000000000000088FF619BFFFF0057FFFF0054 702 FFFF000082FF7979A8FF000000008C8CBBFF000075FF619BFFFF003AFFFF0035 703 FFFF000068FFDCDCDCFF00000000000000008C8CBBFF000086FF0054FFFF0052 704 FFFF004EFFFF00007CFF7979A8FF000075FF619BFFFF003AFFFF0035FFFF0000 705 67FF626291FFB2B2B2FF0000000000000000000000007979A8FF000082FF004E 706 FFFF004BFFFF0047FFFF000075FF619BFFFF003AFFFF0035FFFF000068FF6262 707 91FFB2B2B2FFDCDCDCFF000000000000000000000000000000007979A8FF0000 708 7CFF0047FFFF0042FFFF003EFFFF003AFFFF0035FFFF000068FF626291FFB2B2 709 B2FFDCDCDCFF0000000000000000000000000000000000000000000000007979 710 A8FF000075FF003EFFFF003AFFFF0035FFFF000068FF626291FFB2B2B2FFDCDC 711 DCFF0000000000000000000000000000000000000000000000008C8CBBFF0000 712 75FF619BFFFF003AFFFF0035FFFF0030FFFF002BFFFF000061FF7979A8FF0000 713 000000000000000000000000000000000000000000008C8CBBFF000075FF619B 714 FFFF003AFFFF0035FFFF000067FF002CFFFF0027FFFF0023FFFF000059FF7979 715 A8FF000000000000000000000000000000008C8CBBFF000075FF619BFFFF003A 716 FFFF0035FFFF000067FF626291FF000061FF0023FFFF001FFFFF001BFFFF0000 717 54FF7979A8FF000000000000000000000000000072FF619BFFFF003AFFFF0035 718 FFFF000067FF626291FFB2B2B2FF7979A8FF000059FF001BFFFF0018FFFF0015 719 FFFF000050FFDCDCDCFF00000000000000008C8CBBFF00006EFF0035FFFF0000 720 68FF626291FFB2B2B2FFDCDCDCFF000000007979A8FF000054FF0015FFFF0000 721 50FF626291FFB2B2B2FF0000000000000000000000007979A8FF000067FF6262 722 91FFB2B2B2FFDCDCDCFF0000000000000000000000007979A8FF000050FF6262 723 91FFB2B2B2FFDCDCDCFF00000000000000000000000000000000DCDCDCFFB2B2 724 B2FFDCDCDCFF0000000000000000000000000000000000000000DCDCDCFFB2B2 725 B2FFDCDCDCFF0000000000000000000000000000000000000000000000000000 726 0000000000000000000000000000000000000000000000000000000000000000 727 0000000000000000000000000000 632 728 } 633 729 end -
trunk/UCore.pas
r274 r275 760 760 761 761 GameSettings.LoadConfig(XMLConfig1, 'Game'); 762 GameSettings.GameSystem := GameSystems.SearchByName(GameSettings.GameSystemName); 763 if not Assigned(GameSettings.GameSystem) then 764 GameSettings.GameSystem := GameSystems.First; 762 765 Server.LoadConfig(XMLConfig1, 'Server'); 763 766 ServerList.LoadConfig(XmlConfig1, 'ServerList'); -
trunk/UGame.pas
r274 r275 24 24 class procedure PolygonEx(Canvas: TCanvas; const Points: array of Classes.TPoint; Winding: Boolean); 25 25 class procedure PolyLineEx(Canvas: TCanvas; const Points: array of Classes.TPoint); 26 class procedure Ellipse (Canvas: TCanvas; const ARect: TRect);26 class procedure EllipseEx(Canvas: TCanvas; const ARect: TRect); 27 27 end; 28 28 … … 87 87 StoredRandSeed: Cardinal; 88 88 GeneratePlayers: Boolean; 89 GameSystemName: string; 89 90 procedure PostConfig; 90 91 procedure Assign(Source: TGame); … … 192 193 end; 193 194 194 class procedure TCanvasEx.Ellipse (Canvas: TCanvas; const ARect: TRect);195 class procedure TCanvasEx.EllipseEx(Canvas: TCanvas; const ARect: TRect); 195 196 begin 196 197 LCLIntf.Ellipse(Canvas.Handle, ARect.P1.X, ARect.P1.Y, ARect.P2.X, ARect.P2.Y); … … 526 527 SetValue(DOMString(Path + '/MaxPower'), MaxPower); 527 528 Players.SaveConfig(Config, Path + '/Players'); 528 GameSystem.SaveConfig(Config, Path + '/GameSystem');529 SetValue(DOMString(Path + '/GameSystemName'), DOMString(GameSystemName)); 529 530 end; 530 531 end; … … 565 566 MaxPower := GetValue(DOMString(Path + '/MaxPower'), 99); 566 567 Players.LoadConfig(Config, Path + '/Players'); 567 GameSystem .LoadConfig(Config, Path + '/GameSystem');568 GameSystemName := string(GetValue(DOMString(Path + '/GameSystemName'), DOMString(''))); 568 569 end; 569 570 end; … … 788 789 R: Boolean; 789 790 I: Integer; 790 PlayersCount: Integer;791 791 begin 792 792 Winner := nil; -
trunk/UGameSystem.pas
r274 r275 6 6 7 7 uses 8 Classes, SysUtils, fgl, UUnit, DOM, UXMLUtils, XMLConf;8 Classes, SysUtils, fgl, UUnit, DOM, XMLRead, XMLWrite, UXMLUtils, XMLConf; 9 9 10 10 type … … 20 20 EmptyCellsNeutral: Boolean; 21 21 UnitsMoveImmediately: Boolean; 22 FileName: string; 22 23 constructor Create; 23 24 destructor Destroy; override; 25 procedure Clear; 24 26 procedure Assign(Source: TGameSystem); 25 27 procedure LoadFromNode(Node: TDOMNode); … … 35 37 TGameSystems = class(TFPGObjectList<TGameSystem>) 36 38 function AddNew(Name: string): TGameSystem; 39 function SearchByName(Name: string): TGameSystem; 37 40 end; 38 41 42 39 43 implementation 44 45 resourcestring 46 SWrongFileFormat = 'Wrong file format'; 40 47 41 48 { TGameSystems } … … 46 53 Result.Name := Name; 47 54 Add(Result); 55 end; 56 57 function TGameSystems.SearchByName(Name: string): TGameSystem; 58 var 59 I: Integer; 60 begin 61 I := 0; 62 while (I < Count) and (Items[I].Name <> Name) do Inc(I); 63 if I < Count then Result := Items[I] 64 else Result := nil; 48 65 end; 49 66 … … 59 76 UnitKinds.Free; 60 77 inherited Destroy; 78 end; 79 80 procedure TGameSystem.Clear; 81 begin 82 UnitKinds.Clear; 61 83 end; 62 84 … … 99 121 100 122 procedure TGameSystem.LoadFromFile(FileName: string); 123 var 124 Doc: TXMLDocument; 125 RootNode: TDOMNode; 101 126 begin 102 127 ReadXMLFile(Doc, FileName); 128 Self.FileName := FileName; 129 Clear; 130 with Doc do try 131 if Doc.DocumentElement.NodeName <> 'XtacticsRules' then 132 raise Exception.Create(SWrongFileFormat); 133 RootNode := Doc.DocumentElement; 134 LoadFromNode(RootNode); 135 finally 136 FreeAndNil(Doc); 137 end; 103 138 end; 104 139 105 140 procedure TGameSystem.SaveToFile(FileName: string); 141 var 142 Doc: TXMLDocument; 143 RootNode: TDOMNode; 106 144 begin 107 145 Self.FileName := FileName; 146 Doc := TXMLDocument.Create; 147 with Doc do try 148 RootNode := CreateElement('XtacticsRules'); 149 AppendChild(RootNode); 150 SaveToNode(RootNode); 151 if ExtractFileDir(FileName) <> '' then 152 ForceDirectories(ExtractFileDir(FileName)); 153 WriteXMLFile(Doc, FileName); 154 finally 155 FreeAndNil(Doc); 156 end; 108 157 end; 109 158 -
trunk/xtactics.lpi
r265 r275 109 109 </Item7> 110 110 </RequiredPackages> 111 <Units Count="3 6">111 <Units Count="38"> 112 112 <Unit0> 113 113 <Filename Value="xtactics.lpr"/> … … 299 299 <IsPartOfProject Value="True"/> 300 300 </Unit35> 301 <Unit36> 302 <Filename Value="Forms/UFormGameSystem.pas"/> 303 <IsPartOfProject Value="True"/> 304 <ComponentName Value="FormGameSystem"/> 305 <ResourceBaseClass Value="Form"/> 306 </Unit36> 307 <Unit37> 308 <Filename Value="Forms/UFormGameSystems.pas"/> 309 <IsPartOfProject Value="True"/> 310 <ComponentName Value="FormGameSystems"/> 311 <ResourceBaseClass Value="Form"/> 312 </Unit37> 301 313 </Units> 302 314 </ProjectOptions>
Note:
See TracChangeset
for help on using the changeset viewer.