Changeset 277
- Timestamp:
- Feb 5, 2019, 11:17:27 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormGameSystem.lfm
r276 r277 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 OnDestroy = FormDestroy 12 13 OnShow = FormShow 13 14 LCLVersion = '1.8.4.0' … … 37 38 Top = 528 38 39 Width = 113 39 Anchors = [akRight ]40 Anchors = [akRight, akBottom] 40 41 Caption = 'Cancel' 41 42 ModalResult = 2 … … 57 58 Top = 16 58 59 Width = 744 59 ActivePage = TabSheet General60 ActivePage = TabSheetUnits 60 61 Anchors = [akTop, akLeft, akRight, akBottom] 61 TabIndex = 062 TabIndex = 1 62 63 TabOrder = 4 63 64 object TabSheetGeneral: TTabSheet -
trunk/Forms/UFormGameSystem.pas
r276 r277 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, UGameSystem ;9 ComCtrls, UGameSystem, UFormUnitKinds; 10 10 11 11 type … … 30 30 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 31 31 procedure FormCreate(Sender: TObject); 32 procedure FormDestroy(Sender: TObject); 32 33 procedure FormShow(Sender: TObject); 33 34 private 34 35 FGameSystem: TGameSystem; 36 FormUnitKinds: TFormUnitKinds; 35 37 procedure SetGameSystem(AValue: TGameSystem); 36 37 38 public 38 39 property GameSystem: TGameSystem read FGameSystem write SetGameSystem; … … 89 90 Core.ThemeManager1.UseTheme(Self); 90 91 Core.CoolTranslator1.TranslateComponentRecursive(Self); 92 FormUnitKinds := TFormUnitKinds.Create(nil); 93 FormUnitKinds.ManualDock(TabSheetUnits, nil, alClient); 94 FormUnitKinds.Align := alClient; 95 FormUnitKinds.Visible := True; 96 end; 97 98 procedure TFormGameSystem.FormDestroy(Sender: TObject); 99 begin 100 FormUnitKinds.Free; 91 101 end; 92 102 … … 99 109 begin 100 110 if FGameSystem = AValue then Exit; 111 if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := nil; 101 112 FGameSystem := AValue; 113 if Assigned(FGameSystem) then FormUnitKinds.UnitKinds := GameSystem.UnitKinds; 102 114 end; 103 115 -
trunk/Forms/UFormGameSystems.pas
r276 r277 124 124 if FormGameSystem.ShowModal = mrOk then begin 125 125 FormGameSystem.SaveData(TempEntry); 126 TGameSystem(ListView1.Selected.Data).Assign(TempEntry); 126 GameSystems.Add(TempEntry); 127 TempEntry := nil; 127 128 UpdateList; 128 129 UpdateInterface; … … 197 198 AModify.Enabled := Assigned(FGameSystems) and Assigned(ListView1.Selected); 198 199 AAdd.Enabled := Assigned(FGameSystems); 199 ASelectAll.Enabled := True;200 ASelectAll.Enabled := ListView1.Items.Count > 0; 200 201 end; 201 202 -
trunk/Languages/xtactics.cs.po
r276 r277 261 261 262 262 #: tformgamesystems.aclone.caption 263 msgctxt "tformgamesystems.aclone.caption" 263 264 msgid "Clone" 264 265 msgstr "Klonovat" … … 275 276 276 277 #: tformgamesystems.aselectall.caption 278 msgctxt "tformgamesystems.aselectall.caption" 277 279 msgid "Select all" 278 280 msgstr "Vybrat vše" … … 851 853 msgstr "Obecné" 852 854 855 #: tformunitkind.buttoncancel.caption 856 #, fuzzy 857 msgctxt "tformunitkind.buttoncancel.caption" 858 msgid "Cancel" 859 msgstr "Zrušit" 860 861 #: tformunitkind.buttonok.caption 862 #, fuzzy 863 msgctxt "tformunitkind.buttonok.caption" 864 msgid "OK" 865 msgstr "OK" 866 867 #: tformunitkind.caption 868 msgid "Unit kind" 869 msgstr "" 870 871 #: tformunitkind.labelhealth.caption 872 msgid "Health:" 873 msgstr "" 874 875 #: tformunitkind.labelname.caption 876 #, fuzzy 877 msgctxt "tformunitkind.labelname.caption" 878 msgid "Name:" 879 msgstr "Jméno:" 880 881 #: tformunitkinds.aadd.caption 882 #, fuzzy 883 msgctxt "tformunitkinds.aadd.caption" 884 msgid "Add" 885 msgstr "Přidat" 886 887 #: tformunitkinds.aclone.caption 888 #, fuzzy 889 msgctxt "tformunitkinds.aclone.caption" 890 msgid "Clone" 891 msgstr "Klonovat" 892 893 #: tformunitkinds.amodify.caption 894 #, fuzzy 895 msgctxt "tformunitkinds.amodify.caption" 896 msgid "Modify" 897 msgstr "Upravit" 898 899 #: tformunitkinds.aremove.caption 900 #, fuzzy 901 msgctxt "tformunitkinds.aremove.caption" 902 msgid "Remove" 903 msgstr "Odstranit" 904 905 #: tformunitkinds.aselectall.caption 906 #, fuzzy 907 msgctxt "tformunitkinds.aselectall.caption" 908 msgid "Select all" 909 msgstr "Vybrat vše" 910 911 #: tformunitkinds.caption 912 msgid "Unit kinds" 913 msgstr "" 914 915 #: tformunitkinds.listview1.columns[0].caption 916 #, fuzzy 917 msgctxt "tformunitkinds.listview1.columns[0].caption" 918 msgid "Name" 919 msgstr "Jméno" 920 853 921 #: tformunitmoves.caption 854 922 msgctxt "tformunitmoves.caption" … … 975 1043 976 1044 #: uformgamesystems.sremoveitems 1045 msgctxt "uformgamesystems.sremoveitems" 977 1046 msgid "Remove items" 978 1047 msgstr "Odstranit položky" 979 1048 980 1049 #: uformgamesystems.sremoveitemsquery 1050 msgctxt "uformgamesystems.sremoveitemsquery" 981 1051 msgid "Do you want to remove selected items?" 982 1052 msgstr "Opravdu chcete odstranit vybrané položky?" … … 1123 1193 msgstr "Člověk" 1124 1194 1195 #: uformunitkinds.snewunitkind 1196 msgid "New unit kind" 1197 msgstr "" 1198 1199 #: uformunitkinds.sremoveitems 1200 #, fuzzy 1201 msgctxt "uformunitkinds.sremoveitems" 1202 msgid "Remove items" 1203 msgstr "Odstranit položky" 1204 1205 #: uformunitkinds.sremoveitemsquery 1206 #, fuzzy 1207 msgctxt "uformunitkinds.sremoveitemsquery" 1208 msgid "Do you want to remove selected items?" 1209 msgstr "Opravdu chcete odstranit vybrané položky?" 1210 1125 1211 #: ugame.scomputer 1126 1212 msgctxt "ugame.scomputer" … … 1204 1290 msgid "64-bit UInt read overflow." 1205 1291 msgstr "Přetečení při čtení 64-bit UInt" 1292 -
trunk/Languages/xtactics.po
r276 r277 251 251 252 252 #: tformgamesystems.aclone.caption 253 msgctxt "tformgamesystems.aclone.caption" 253 254 msgid "Clone" 254 255 msgstr "" … … 265 266 266 267 #: tformgamesystems.aselectall.caption 268 msgctxt "tformgamesystems.aselectall.caption" 267 269 msgid "Select all" 268 270 msgstr "" … … 836 838 msgstr "" 837 839 840 #: tformunitkind.buttoncancel.caption 841 msgctxt "tformunitkind.buttoncancel.caption" 842 msgid "Cancel" 843 msgstr "" 844 845 #: tformunitkind.buttonok.caption 846 msgctxt "tformunitkind.buttonok.caption" 847 msgid "OK" 848 msgstr "" 849 850 #: tformunitkind.caption 851 msgid "Unit kind" 852 msgstr "" 853 854 #: tformunitkind.labelhealth.caption 855 msgid "Health:" 856 msgstr "" 857 858 #: tformunitkind.labelname.caption 859 msgctxt "tformunitkind.labelname.caption" 860 msgid "Name:" 861 msgstr "" 862 863 #: tformunitkinds.aadd.caption 864 msgctxt "tformunitkinds.aadd.caption" 865 msgid "Add" 866 msgstr "" 867 868 #: tformunitkinds.aclone.caption 869 msgctxt "tformunitkinds.aclone.caption" 870 msgid "Clone" 871 msgstr "" 872 873 #: tformunitkinds.amodify.caption 874 msgctxt "tformunitkinds.amodify.caption" 875 msgid "Modify" 876 msgstr "" 877 878 #: tformunitkinds.aremove.caption 879 msgctxt "tformunitkinds.aremove.caption" 880 msgid "Remove" 881 msgstr "" 882 883 #: tformunitkinds.aselectall.caption 884 msgctxt "tformunitkinds.aselectall.caption" 885 msgid "Select all" 886 msgstr "" 887 888 #: tformunitkinds.caption 889 msgid "Unit kinds" 890 msgstr "" 891 892 #: tformunitkinds.listview1.columns[0].caption 893 msgctxt "tformunitkinds.listview1.columns[0].caption" 894 msgid "Name" 895 msgstr "" 896 838 897 #: tformunitmoves.caption 839 898 msgctxt "tformunitmoves.caption" … … 960 1019 961 1020 #: uformgamesystems.sremoveitems 1021 msgctxt "uformgamesystems.sremoveitems" 962 1022 msgid "Remove items" 963 1023 msgstr "" 964 1024 965 1025 #: uformgamesystems.sremoveitemsquery 1026 msgctxt "uformgamesystems.sremoveitemsquery" 966 1027 msgid "Do you want to remove selected items?" 967 1028 msgstr "" … … 1100 1161 msgstr "" 1101 1162 1163 #: uformunitkinds.snewunitkind 1164 msgid "New unit kind" 1165 msgstr "" 1166 1167 #: uformunitkinds.sremoveitems 1168 msgctxt "uformunitkinds.sremoveitems" 1169 msgid "Remove items" 1170 msgstr "" 1171 1172 #: uformunitkinds.sremoveitemsquery 1173 msgctxt "uformunitkinds.sremoveitemsquery" 1174 msgid "Do you want to remove selected items?" 1175 msgstr "" 1176 1102 1177 #: ugame.scomputer 1103 1178 msgctxt "ugame.scomputer" -
trunk/UCore.pas
r275 r277 518 518 with UnitKinds.AddNew('Unit') do begin 519 519 Moves := 1; 520 Stack:= 99;520 Power := 99; 521 521 end; 522 522 end; … … 526 526 with UnitKinds.AddNew('Scout') do begin 527 527 Moves := 1; 528 Stack:= 1;528 Power := 1; 529 529 end; 530 530 with UnitKinds.AddNew('Settler') do begin 531 531 Moves := 1; 532 Stack:= 1;532 Power := 1; 533 533 end; 534 534 end; … … 554 554 with UnitKinds.AddNew('Demon 132') do begin 555 555 Moves := 4; 556 Stack:= 10;556 Power := 10; 557 557 end; 558 558 with UnitKinds.AddNew('Troll 142') do begin 559 559 Moves := 3; 560 Stack:= 10;560 Power := 10; 561 561 end; 562 562 with UnitKinds.AddNew('Ranger 132') do begin 563 563 Moves := 10; 564 Stack:= 10;564 Power := 10; 565 565 end; 566 566 with UnitKinds.AddNew('Buggy') do begin 567 567 Moves := 10; 568 Stack:= 10;568 Power := 10; 569 569 end; 570 570 end; -
trunk/UGame.pas
r276 r277 347 347 StartCell.Player := Player; 348 348 if not Assigned(StartCell.OneUnit) then 349 StartCell.OneUnit := Units.AddNew(GameSystem.UnitKinds[0], Player.StartUnits);349 StartCell.OneUnit := Self.Units.AddNew(GameSystem.UnitKinds[0], Player.StartUnits); 350 350 StartCell.OneUnit.Power := Player.StartUnits; 351 351 StartCell.OneUnit.Kind := GameSystem.UnitKinds[0]; -
trunk/UGameSystem.pas
r276 r277 99 99 UnitsSplitMerge := Source.UnitsSplitMerge; 100 100 EmptyCellsNeutral := Source.EmptyCellsNeutral; 101 UnitKinds.Assign(Source.UnitKinds); 101 102 end; 102 103 -
trunk/UUnit.pas
r265 r277 19 19 Moves: Integer; 20 20 Cost: Integer; 21 Stack: Integer;21 Power: Integer; 22 22 ViewRange: Integer; 23 procedure Assign(Source: TUnitKind); 23 24 procedure LoadFromNode(Node: TDOMNode); 24 25 procedure SaveToNode(Node: TDOMNode); … … 89 90 { TUnitKind } 90 91 92 procedure TUnitKind.Assign(Source: TUnitKind); 93 begin 94 Id := Source.Id; 95 Name := Source.Name; 96 PowerAttack := Source.PowerAttack; 97 PowerDefense := Source.PowerDefense; 98 Moves := Source.Moves; 99 Cost := Source.Cost; 100 Power := Source.Power; 101 ViewRange := Source.ViewRange; 102 end; 103 91 104 procedure TUnitKind.LoadFromNode(Node: TDOMNode); 92 105 begin 93 106 Id := ReadInteger(Node, 'Id', 0); 94 107 Name := ReadString(Node, 'Name', ''); 95 Stack:= ReadInteger(Node, 'Stack', 0);108 Power := ReadInteger(Node, 'Stack', 0); 96 109 Cost := ReadInteger(Node, 'Cost', 0); 97 110 Moves := ReadInteger(Node, 'Moves', 0); … … 105 118 WriteInteger(Node, 'Id', Id); 106 119 WriteString(Node, 'Name', Name); 107 WriteInteger(Node, 'Stack', Stack);120 WriteInteger(Node, 'Stack', Power); 108 121 WriteInteger(Node, 'Cost', Cost); 109 122 WriteInteger(Node, 'Moves', Moves); -
trunk/xtactics.lpi
r275 r277 109 109 </Item7> 110 110 </RequiredPackages> 111 <Units Count=" 38">111 <Units Count="40"> 112 112 <Unit0> 113 113 <Filename Value="xtactics.lpr"/> … … 303 303 <IsPartOfProject Value="True"/> 304 304 <ComponentName Value="FormGameSystem"/> 305 <HasResources Value="True"/> 305 306 <ResourceBaseClass Value="Form"/> 306 307 </Unit36> … … 309 310 <IsPartOfProject Value="True"/> 310 311 <ComponentName Value="FormGameSystems"/> 312 <HasResources Value="True"/> 311 313 <ResourceBaseClass Value="Form"/> 312 314 </Unit37> 315 <Unit38> 316 <Filename Value="Forms/UFormUnitKind.pas"/> 317 <IsPartOfProject Value="True"/> 318 <ComponentName Value="FormUnitKind"/> 319 <ResourceBaseClass Value="Form"/> 320 </Unit38> 321 <Unit39> 322 <Filename Value="Forms/UFormUnitKinds.pas"/> 323 <IsPartOfProject Value="True"/> 324 <ComponentName Value="FormUnitKinds"/> 325 <HasResources Value="True"/> 326 <ResourceBaseClass Value="Form"/> 327 </Unit39> 313 328 </Units> 314 329 </ProjectOptions> -
trunk/xtactics.lpr
r238 r277 11 11 CoolTranslator, TemplateGenerics 12 12 { you can add units after this }, 13 SysUtils, UFormMain, CoolStreaming ;13 SysUtils, UFormMain, CoolStreaming, UFormUnitKind; 14 14 15 15 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.