- Timestamp:
- Sep 7, 2024, 10:29:16 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.lfm
r335 r336 13 13 Top = 60 14 14 object AExit: TAction 15 Category = 'Game' 15 16 Caption = 'Exit' 16 17 Hint = 'Exit application' … … 64 65 end 65 66 object ASettings: TAction 67 Category = 'Tools' 66 68 Caption = 'Settings' 67 69 Hint = 'Application settings' … … 71 73 end 72 74 object AAbout: TAction 75 Category = 'Help' 73 76 Caption = 'About' 74 77 ImageIndex = 2 … … 76 79 end 77 80 object AHelp: TAction 81 Category = 'Help' 78 82 Caption = 'Help' 79 83 ImageIndex = 14 … … 81 85 end 82 86 object AShowCharts: TAction 87 Category = 'Tools' 83 88 Caption = 'Charts' 84 89 OnExecute = AShowChartsExecute 85 90 end 86 91 object AShowUnitMoves: TAction 92 Category = 'Tools' 87 93 Caption = 'Unit moves' 88 94 OnExecute = AShowUnitMovesExecute … … 93 99 end 94 100 object APlayersStats: TAction 101 Category = 'Tools' 95 102 Caption = 'Players statistics' 96 103 ImageIndex = 15 … … 98 105 end 99 106 object AShowKeyShortcuts: TAction 107 Category = 'Help' 100 108 Caption = 'Key shortcuts' 101 109 ImageIndex = 12 … … 103 111 end 104 112 object AToggleFogOfWar: TAction 113 Category = 'Debug' 105 114 Caption = 'Toggle fog of war' 106 115 OnExecute = AToggleFogOfWarExecute 107 116 end 108 117 object AFullscreen: TAction 118 Category = 'View' 109 119 Caption = 'Full screen mode' 110 120 ImageIndex = 13 111 121 OnExecute = AFullscreenExecute 112 122 ShortCut = 122 123 end 124 object ATests: TAction 125 Category = 'Debug' 126 Caption = 'Tests' 127 OnExecute = ATestsExecute 113 128 end 114 129 end -
trunk/Core.lrj
r335 r336 22 22 {"hash":91608562,"name":"tcore.atogglefogofwar.caption","sourcebytes":[84,111,103,103,108,101,32,102,111,103,32,111,102,32,119,97,114],"value":"Toggle fog of war"}, 23 23 {"hash":108810549,"name":"tcore.afullscreen.caption","sourcebytes":[70,117,108,108,32,115,99,114,101,101,110,32,109,111,100,101],"value":"Full screen mode"}, 24 {"hash":5950131,"name":"tcore.atests.caption","sourcebytes":[84,101,115,116,115],"value":"Tests"}, 24 25 {"hash":160200403,"name":"tcore.savedialog1.title","sourcebytes":[83,97,118,101,32,97,115],"value":"Save as"}, 25 26 {"hash":131198430,"name":"tcore.applicationinfo.description","sourcebytes":[65,32,116,117,114,110,45,98,97,115,101,100,32,115,116,114,97,116,101,103,121,32,103,97,109,101,32,105,110,115,112,105,114,101,100,32,98,121,32,99,108,97,115,115,105,99,32,82,105,115,107,32,98,111,97,114,100,32,103,97,109,101,46,32,84,104,101,32,103,97,109,101,32,105,115,32,104,105,103,104,108,121,32,99,111,110,102,105,103,117,114,97,98,108,101,32,116,111,32,97,108,108,111,119,32,116,111,32,97,100,106,117,115,116,32,98,97,116,116,108,101,32,102,105,101,108,100,32,97,110,100,32,103,97,109,101,32,114,117,108,101,115,46],"value":"A turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules."} -
trunk/Core.pas
r330 r336 16 16 TCore = class(TDataModule) 17 17 AAbout: TAction; 18 ATests: TAction; 18 19 AFullscreen: TAction; 19 20 AToggleFogOfWar: TAction; … … 60 61 procedure AShowKeyShortcutsExecute(Sender: TObject); 61 62 procedure AShowUnitMovesExecute(Sender: TObject); 63 procedure ATestsExecute(Sender: TObject); 62 64 procedure AToggleFogOfWarExecute(Sender: TObject); 63 65 procedure Translator1Translate(Sender: TObject); … … 127 129 128 130 uses 129 FormNew, FormSettings, ClientAI, FormKeyShortcuts, Common, FormEx, 130 FormHelp, FormUnitMoves, FormPlayersStats, ClientGUI, FormAbout ;131 FormNew, FormSettings, ClientAI, FormKeyShortcuts, Common, FormEx, FormTests, 132 FormHelp, FormUnitMoves, FormPlayersStats, ClientGUI, FormAbout, Tests; 131 133 132 134 const … … 292 294 procedure TCore.UpdateInterface; 293 295 begin 294 Core.AGameEnd.Enabled := Game.Running; 295 Core.AFullscreen.Checked := FormMain.FullScreen; 296 AGameEnd.Enabled := Game.Running; 297 AFullscreen.Checked := FormMain.FullScreen; 298 {$ifdef DEBUG} 299 ATests.Visible := True; 300 ATests.Enabled := True; 301 {$else} 302 ATests.Visible := False; 303 ATests.Enabled := False; 304 {$endif} 296 305 end; 297 306 … … 470 479 FormMain.FormUnitMoves.Game := Game; 471 480 FormMain.FormUnitMoves.Show; 481 end; 482 483 procedure TCore.ATestsExecute(Sender: TObject); 484 var 485 FormTests: TFormTests; 486 begin 487 FormTests := TFormTests.Create(nil); 488 FormTests.TestCases := GetTestCases; 489 FormTests.ShowModal; 490 FormTests.Free; 472 491 end; 473 492 -
trunk/Forms/FormMain.lfm
r331 r336 193 193 Action = Core.AToggleFogOfWar 194 194 end 195 object MenuItem36: TMenuItem 196 Action = Core.ATests 197 end 195 198 end 196 199 object MenuItem16: TMenuItem -
trunk/Forms/FormMain.pas
r333 r336 51 51 MenuItem34: TMenuItem; 52 52 MenuItem35: TMenuItem; 53 MenuItem36: TMenuItem; 53 54 MenuItemDebug: TMenuItem; 54 55 MenuItem31: TMenuItem; -
trunk/Game.pas
r317 r336 99 99 procedure New; 100 100 procedure EndGame(Winner: TPlayer = nil); 101 function Compare(Game: TGame): Boolean; 101 102 property Running: Boolean read FRunning write SetRunning; 102 103 property MapType: TMapType read FMapType write SetMapType; … … 887 888 for I := 0 to Players.Count - 1 do TPlayer(Players[I]).Clear; 888 889 Map.Clear; 890 Units.Clear; 889 891 end; 890 892 … … 924 926 end; 925 927 928 function TGame.Compare(Game: TGame): Boolean; 929 begin 930 Result := BridgeEnabled = Game.BridgeEnabled; 931 end; 932 926 933 end. -
trunk/ItemList.pas
r334 r336 79 79 private 80 80 procedure RecalculateNewId(Reset: Boolean); 81 procedure RecalculateItemsId; 81 82 public 82 83 NewId: Integer; … … 147 148 for I := 0 to Count - 1 do 148 149 TItem(Items[I]).Assign(Source.Items[I]); 149 RecalculateNewId(True);150 150 end; 151 151 … … 176 176 Node2 := Node2.NextSibling; 177 177 end; 178 RecalculateNewId(True);179 178 end; 180 179 … … 184 183 NewNode2: TDOMNode; 185 184 begin 185 RecalculateItemsId; 186 186 for I := 0 to Count - 1 do 187 187 with TItem(Items[I]) do begin … … 207 207 NewId := Max(NewId, Id + 1); 208 208 end; 209 end; 210 211 procedure TItemList.RecalculateItemsId; 212 var 213 I: Integer; 214 begin 215 for I := 0 to Count - 1 do 216 Items[I].Id := I + 1; 217 NewId := Count + 1; 209 218 end; 210 219 -
trunk/Languages/xtactics.cs.po
r332 r336 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3. 3.1\n"12 "X-Generator: Poedit 3.4.2\n" 13 13 14 14 #: building.sbonusattack … … 604 604 msgstr "Pohyby jednotek" 605 605 606 #: tcore.atests.caption 607 msgid "Tests" 608 msgstr "Testy" 609 606 610 #: tcore.atogglefogofwar.caption 607 611 msgid "Toggle fog of war" … … 1330 1334 msgid "View range" 1331 1335 msgstr "Dohled" 1332 -
trunk/Languages/xtactics.pot
r332 r336 582 582 msgstr "" 583 583 584 #: tcore.atests.caption 585 msgid "Tests" 586 msgstr "" 587 584 588 #: tcore.atogglefogofwar.caption 585 589 msgid "Toggle fog of war" -
trunk/Player.pas
r335 r336 776 776 begin 777 777 inherited; 778 WriteInteger(Node, 'StartCell', StartCell.Id); 778 if Assigned(StartCell) then 779 WriteInteger(Node, 'StartCell', StartCell.Id); 779 780 780 781 with Node do begin … … 809 810 810 811 destructor TPlayer.Destroy; 812 var 813 I: Integer; 811 814 begin 812 815 //Client := nil; … … 814 817 FreeAndNil(PlayerMap); 815 818 FreeAndNil(Moves); 819 for I := Units.Count - 1 downto 0 do 820 Units[I].Player := nil; 816 821 FreeAndNil(Units); 817 822 inherited; … … 828 833 TotalWinObjectiveCells := TPlayer(Source).TotalWinObjectiveCells; 829 834 StartCell := TPlayer(Source).StartCell; 835 Color := TPlayer(Source).Color; 836 //Units.Assign(TPlayer(Source).Units); 837 Nation := TPlayer(Source).Nation; 830 838 end; 831 839 … … 978 986 // Clean from cell from empty units 979 987 if UnitMove.CellFrom.MapCell.OneUnit.Power = 0 then begin 980 Unit s.Remove(UnitMove.CellFrom.MapCell.OneUnit);988 UnitMove.CellFrom.MapCell.OneUnit.Player := nil; 981 989 UnitMove.CellFrom.MapCell.OneUnit := nil; 982 990 end; … … 1036 1044 OneUnit := MapCell.OneUnit; 1037 1045 MapCell.OneUnit := nil; 1038 Units.Remove(OneUnit);1046 OneUnit.Player := nil; 1039 1047 end; 1040 1048 end; … … 1286 1294 NewUnit.Player := Self; 1287 1295 NewUnit.MapCell := Cells[I]; 1288 Units.Add(NewUnit);1289 1296 end; 1290 1297 if OneUnit.Power < MaxPower then begin -
trunk/Unit.pas
r317 r336 243 243 244 244 procedure TUnit.SetPlayer(AValue: TObject); 245 var 246 OldValue: TPlayer; 245 247 begin 246 248 if FPlayer = AValue then Exit; 247 if Assigned(FPlayer) then TPlayer(FPlayer).Units.Remove(Self); 249 OldValue := TPlayer(FPlayer); 250 FPlayer := nil; 251 if Assigned(OldValue) then TPlayer(OldValue).Units.Remove(Self); 248 252 FPlayer := AValue; 249 253 if Assigned(FPlayer) then TPlayer(FPlayer).Units.Add(Self); … … 301 305 destructor TUnit.Destroy; 302 306 begin 307 Player := nil; 303 308 inherited; 304 309 end; -
trunk/xtactics.lpi
r333 r336 110 110 </Item6> 111 111 </RequiredPackages> 112 <Units Count=" 39">112 <Units Count="40"> 113 113 <Unit0> 114 114 <Filename Value="xtactics.lpr"/> … … 316 316 <ResourceBaseClass Value="Form"/> 317 317 </Unit38> 318 <Unit39> 319 <Filename Value="Tests.pas"/> 320 <IsPartOfProject Value="True"/> 321 </Unit39> 318 322 </Units> 319 323 </ProjectOptions> -
trunk/xtactics.lpr
r328 r336 8 8 Forms, tachartlazaruspkg, Game, Core, Common, TemplateGenerics 9 9 { you can add units after this }, 10 SysUtils, FormMain, CoolStreaming ;10 SysUtils, FormMain, CoolStreaming, Tests; 11 11 12 12 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.