Changeset 401
- Timestamp:
- Jan 6, 2025, 11:12:12 AM (2 days ago)
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/1.4.0
-
tags/1.4.0/Core.pas
r394 r401 532 532 {$ENDIF} 533 533 begin 534 Randomize; 535 534 536 BaseDir := ExcludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))); 535 537 GameSystemsDir := CombinePaths(BaseDir, GameSystemsDirName); -
tags/1.4.0/Forms/FormCharts.pas
r394 r401 55 55 procedure TFormCharts.FormShow(Sender: TObject); 56 56 begin 57 Redraw;58 57 Translate; 59 58 if (ComboBox1.ItemIndex = -1) and (ComboBox1.Items.Count > 0) then 60 59 ComboBox1.ItemIndex := 0; 61 60 Chart1.BackColor := ThemeManager.ActualTheme.ColorWindow; 61 Redraw; 62 62 end; 63 63 … … 73 73 NewSeries := TLineSeries.Create(nil); 74 74 NewSeries.LinePen.Color := Color; 75 NewSeries.LinePen.Width := Scale96ToScreen(1); 75 76 for X := 0 to TurnStats.Count - 1 do begin 76 77 if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, TurnStats[X].OccupiedCells) -
tags/1.4.0/Forms/FormNew.pas
r394 r401 498 498 procedure TFormNew.FormShow(Sender: TObject); 499 499 begin 500 Randomize;501 500 NewRandSeed := RandSeed; 502 501 ReloadView; … … 659 658 procedure TFormNew.ButtonRandomizeClick(Sender: TObject); 660 659 begin 661 Randomize;662 660 NewRandSeed := RandSeed; 663 661 MapPreviewRedraw; -
tags/1.4.0/Game.pas
r377 r401 11 11 DefaultPlayerStartUnits = 5; 12 12 MinPlayerCount = 1; 13 MaxPlayerCount = 8;13 MaxPlayerCount = 12; 14 14 GameFileExt = '.xtg'; 15 15 … … 529 529 begin 530 530 with Config do begin 531 SetValue(DOMString(Path + '/RandSeed'), Integer(StoredRandSeed));531 SetValue(DOMString(Path + '/RandSeed'), DOMString(IntToStr(StoredRandSeed))); 532 532 SetValue(DOMString(Path + '/GridType'), Integer(MapType)); 533 533 SetValue(DOMString(Path + '/MapImage'), DOMString(MapImageFileName)); … … 558 558 var 559 559 Value: Integer; 560 ValueInt64: Int64; 560 561 begin 561 562 with Config do begin 562 StoredRandSeed := GetValue(DOMString(Path + '/RandSeed'), 0); 563 MapType := TMapType(GetValue(DOMString(Path + '/GridType'), Integer(mtHexagonVertical))); 564 Map.Size := TPoint.Create(GetValue(DOMString(Path + '/MapSizeX'), 10), 565 GetValue(DOMString(Path + '/MapSizeY'), 10)); 563 if TryStrToInt64(string(GetValue(DOMString(Path + '/RandSeed'), DOMString(IntToStr(StoredRandSeed)))), ValueInt64) then 564 StoredRandSeed := ValueInt64; 565 MapType := TMapType(GetValue(DOMString(Path + '/GridType'), Integer(MapType))); 566 Map.Size := TPoint.Create(GetValue(DOMString(Path + '/MapSizeX'), Map.Size.X), 567 GetValue(DOMString(Path + '/MapSizeY'), Map.Size.Y)); 566 568 MapImageFileName := string(GetValue(DOMString(Path + '/MapImage'), DOMString(MapImageFileName))); 567 SymetricMap := GetValue(DOMString(Path + '/SymetricMap'), False);568 CyclicMap := GetValue(DOMString(Path + '/CyclicMap'), False);569 FogOfWar := GetValue(DOMString(Path + '/FogOfWar'), F alse);570 VoidEnabled := GetValue(DOMString(Path + '/VoidEnabled'), True);571 VoidPercentage := GetValue(DOMString(Path + '/VoidPercentage'), 20);572 Value := GetValue(DOMString(Path + '/MapShape'), 0);569 SymetricMap := GetValue(DOMString(Path + '/SymetricMap'), SymetricMap); 570 CyclicMap := GetValue(DOMString(Path + '/CyclicMap'), CyclicMap); 571 FogOfWar := GetValue(DOMString(Path + '/FogOfWar'), FogOfWar); 572 VoidEnabled := GetValue(DOMString(Path + '/VoidEnabled'), VoidEnabled); 573 VoidPercentage := GetValue(DOMString(Path + '/VoidPercentage'), VoidPercentage); 574 Value := GetValue(DOMString(Path + '/MapShape'), Integer(Map.Shape)); 573 575 if (Value >= Integer(Low(TMapShape))) and (Value <= Integer(High(TMapShape))) then 574 576 Map.Shape := TMapShape(Value) else Map.Shape := Low(TMapShape); 575 CityEnabled := GetValue(DOMString(Path + '/CityEnabled'), False);576 CityPercentage := GetValue(DOMString(Path + '/CityPercentage'), 10);577 BridgeEnabled := GetValue(DOMString(Path + '/BridgeEnabled'), True);578 Value := GetValue(DOMString(Path + '/GrowAmount'), Integer( gaBySquareRoot));577 CityEnabled := GetValue(DOMString(Path + '/CityEnabled'), CityEnabled); 578 CityPercentage := GetValue(DOMString(Path + '/CityPercentage'), CityPercentage); 579 BridgeEnabled := GetValue(DOMString(Path + '/BridgeEnabled'), BridgeEnabled); 580 Value := GetValue(DOMString(Path + '/GrowAmount'), Integer(GrowAmount)); 579 581 if (Value >= Integer(Low(TGrowAmount))) and (Value <= Integer(High(TGrowAmount))) then 580 582 GrowAmount := TGrowAmount(Value) else GrowAmount := Low(TGrowAmount); 581 Value := GetValue(DOMString(Path + '/GrowCells'), Integer( gcPlayerAll));583 Value := GetValue(DOMString(Path + '/GrowCells'), Integer(GrowCells)); 582 584 if (Value >= Integer(Low(TGrowCells))) and (Value <= Integer(High(TGrowCells))) then 583 585 GrowCells := TGrowCells(Value) else GrowCells := Low(TGrowCells); 584 Value := GetValue(DOMString(Path + '/WinObjective'), Integer( woDefeatAllOponents));586 Value := GetValue(DOMString(Path + '/WinObjective'), Integer(WinObjective)); 585 587 if (Value >= Integer(Low(TWinObjective))) and (Value <= Integer(High(TWinObjective))) then 586 588 WinObjective := TWinObjective(Value) else WinObjective := Low(TWinObjective); 587 StayAliveForDefinedTurns := GetValue(DOMString(Path + '/StayAliveForDefinedTurns'), 20);588 SpecialCaptureCellCount := GetValue(DOMString(Path + '/SpecialCaptureCellCount'), 1);589 MaxNeutralUnits := GetValue(DOMString(Path + '/MaxNeutralUnits'), 5);590 MaxPower := GetValue(DOMString(Path + '/MaxPower'), 99);589 StayAliveForDefinedTurns := GetValue(DOMString(Path + '/StayAliveForDefinedTurns'), StayAliveForDefinedTurns); 590 SpecialCaptureCellCount := GetValue(DOMString(Path + '/SpecialCaptureCellCount'), SpecialCaptureCellCount); 591 MaxNeutralUnits := GetValue(DOMString(Path + '/MaxNeutralUnits'), MaxNeutralUnits); 592 MaxPower := GetValue(DOMString(Path + '/MaxPower'), MaxPower); 591 593 Players.LoadConfig(Config, Path + '/Players'); 592 594 end; … … 608 610 RootNode := Doc.DocumentElement; 609 611 with RootNode do begin 610 StoredRandSeed := ReadInt eger(RootNode, 'RandSeed', 0);612 StoredRandSeed := ReadInt64(RootNode, 'RandSeed', 0); 611 613 MapType := TMapType(ReadInteger(RootNode, 'MapType', Integer(mtNone))); 612 614 SymetricMap := ReadBoolean(RootNode, 'SymetricMap', False); … … 672 674 AppendChild(RootNode); 673 675 with RootNode do begin 674 WriteInteger(RootNode, 'RandSeed', Integer(StoredRandSeed)); 676 StoredRandSeed := RandSeed; 677 WriteInt64(RootNode, 'RandSeed', StoredRandSeed); 675 678 WriteInteger(RootNode, 'MapType', Integer(MapType)); 676 679 WriteBoolean(RootNode, 'SymetricMap', SymetricMap); … … 691 694 WriteBoolean(RootNode, 'Running', Running); 692 695 WriteInteger(RootNode, 'CurrentPlayer', CurrentPlayer.Id); 696 697 Units.RecalculateItemsId; 698 Players.RecalculateItemsId; 693 699 694 700 NewNode := OwnerDocument.CreateElement('GameSystem'); … … 910 916 911 917 GeneratePlayers := True; 918 StoredRandSeed := RandSeed; 912 919 MapImageFileName := ''; 913 Randomize;914 StoredRandSeed := RandSeed;915 InitDefaultPlayers; 916 920 MapType := mtHexagonVertical; 921 Map.Size := TPoint.Create(10, 10); 922 923 CityPercentage := 20; 917 924 VoidEnabled := True; 918 925 VoidPercentage := 20; 919 926 MaxPower := DefaultMaxPower; 920 927 MaxNeutralUnits := Min(4, MaxPower); 921 922 Map.Size := TPoint.Create(3, 3); 928 BridgeEnabled := True; 929 MaxNeutralUnits := 5; 930 MaxPower := 99; 931 SpecialCaptureCellCount := 1; 932 StayAliveForDefinedTurns := 20; 933 WinObjective := woDefeatAllOponents; 934 GrowCells := gcPlayerAll; 935 GrowAmount := gaBySquareRoot; 936 937 InitDefaultPlayers; 923 938 end; 924 939 -
tags/1.4.0/Install/flatpak/net.zdechov.app.xTactics.yml
r395 r401 27 27 - type: svn 28 28 url: https://svn.zdechov.net/xtactics/tags/1.4.0 29 revision: r 39529 revision: r401 30 30 buildsystem: simple 31 31 build-commands: -
tags/1.4.0/Map.pas
r376 r401 1058 1058 Cell: TCell; 1059 1059 begin 1060 Player := TGame(Map.Game).Players.FindById(PlayerId); 1061 OneUnit := TGame(Map.Game).Units.FindById(OneUnitId); 1060 if PlayerId <> 0 then begin 1061 Player := TGame(Map.Game).Players.FindById(PlayerId); 1062 if not Assigned(Player) then 1063 raise Exception.Create('Referenced player id ' + IntToStr(PlayerId) + ' not found.'); 1064 end else Player := nil; 1065 1066 if OneUnitId <> 0 then begin 1067 OneUnit := TGame(Map.Game).Units.FindById(OneUnitId); 1068 if not Assigned(OneUnit) then 1069 raise Exception.Create('Referenced unit id ' + IntToStr(OneUnitId) + ' not found.'); 1070 end else OneUnit := nil; 1062 1071 1063 1072 Neighbors.Count := Length(NeighborsId); -
tags/1.4.0/Packages/Common/Forms/FormItem.lfm
r365 r401 1 1 object FormItem: TFormItem 2 Left = 10403 Height = 3974 Top = 5405 Width = 4692 Left = 441 3 Height = 446 4 Top = 395 5 Width = 577 6 6 Caption = 'Item' 7 ClientHeight = 3978 ClientWidth = 4697 ClientHeight = 446 8 ClientWidth = 577 9 9 DesignTimePPI = 144 10 10 OnCreate = FormCreate … … 12 12 LCLVersion = '3.6.0.0' 13 13 object ButtonOk: TButton 14 Left = 22414 Left = 332 15 15 Height = 38 16 Top = 35316 Top = 402 17 17 Width = 113 18 18 Anchors = [akRight, akBottom] … … 24 24 end 25 25 object ButtonCancel: TButton 26 Left = 34826 Left = 456 27 27 Height = 38 28 Top = 35328 Top = 402 29 29 Width = 113 30 30 Anchors = [akRight, akBottom] … … 36 36 object ScrollBox1: TScrollBox 37 37 Left = 8 38 Height = 3 3438 Height = 383 39 39 Top = 8 40 Width = 45340 Width = 561 41 41 HorzScrollBar.Page = 1 42 42 VertScrollBar.Page = 1 -
tags/1.4.0/Packages/Common/Forms/FormItem.pas
r355 r401 176 176 if DataType = dtString then begin 177 177 NewControl := TEdit.Create(nil); 178 NewControl.Width := Scale96ToScreen( 300);178 NewControl.Width := Scale96ToScreen(200); 179 179 end else 180 180 if DataType = dtColor then begin -
tags/1.4.0/Packages/Common/ItemList.pas
r394 r401 133 133 FBaseItemList: TBaseItemList; 134 134 procedure RecalculateNewId(Reset: Boolean); 135 procedure RecalculateItemsId;136 135 function BaseGetItem(Index: SizeInt): TItem; 137 136 procedure BaseSetItem(Index: SizeInt; AValue: TItem); … … 145 144 public 146 145 NewId: Integer; 146 procedure RecalculateItemsId; 147 147 function CreateItem(Name: string = ''): T; virtual; 148 148 function IncrementName(Name: string): string; … … 265 265 NewNode2: TDOMNode; 266 266 begin 267 RecalculateItemsId;268 267 for I := 0 to Count - 1 do 269 268 with TItem(Items[I]) do begin -
tags/1.4.0/Player.pas
r394 r401 209 209 210 210 const 211 PlayerColors: array[0..11] of TColor = (clBlue, clRed, clGreen, clYellow, 211 clDarkYellow = $00C0C0; 212 PlayerColors: array[0..11] of TColor = (clBlue, clRed, clGreen, clDarkYellow, 212 213 clFuchsia, clAqua, clOlive, clMaroon, clNavy, clPurple, clTeal, clGray); 213 214 … … 557 558 Result := inherited; 558 559 Result.Game := Game; 560 Result.Mode := pmComputer; 561 Result.Agressivity := caMedium; 559 562 Result.Color := GetUnusedColor; 560 563 end; -
tags/1.4.0/Release notes.txt
r394 r401 2 2 ========================== 3 3 4 * Added: A pplication icon with 256x256 resolution.4 * Added: Added vector logo and generated raster logo with resolution 256x256. 5 5 * Added: Close button on more forms for better touch screen devices support. 6 6 * Added: Game systems action in Tools menu. … … 25 25 * Modified: Do not paint new game preview bellow form height. 26 26 * Modified: Automatically save running game on application exit and reopen it on next start. 27 * Modified: Automatic map zoom on new game.28 27 * Modified: Show icons in shortcuts window. 29 28 * Modified: Improved dark theme support on Windows. … … 31 30 * Modified: Allow to set nation in player settings. 32 31 * Modified: Allow to have only one player in the game. 32 * Modified: Set new created players as computer. 33 * Modified: Maximum number of player set to 12. 34 * Modified: Do not zoom all on new game start and game load from file. 35 * Modified: Allow to resize new game, settings and game system forms to be smaller with scroll box area. 36 * Modified: Use new higher resolution application image in about dialog. 33 37 * Fixed: Initialization of preset World image map. 34 38 * Fixed: Map image was not always loaded and applied. … … 52 56 * Fixed: Selection of unit moves. 53 57 * Fixed: Full screen mode under Windows and Linux. 58 * Fixed: Scale charts line width. 59 * Fixed: Item form made bigger to avoid showing scrollbars. 60 * Fixed: Item form string control made shorter. 61 * Fixed: Wrong players and units id recalculation during game save causing bad references. 62 * Fixed: Integrity checks for id references loaded from game file. 63 * Fixed: Run Randomize only once at startup. 64 * Fixed: Store current state of RandSeed to game save. 65 * Fixed: Load/store RandSeed as its Cardinal type instead of Integer. 66 * Fixed: Charts form chart was not drawn on the initial show. 67 * Fixed: Themed background in New game form rules win conditions. 68 * Fixed: Apply theme to chart background. 69 * Fixed: Add new players with different colors. 54 70 55 71 Version 1.3.0 (2018-09-22) -
tags/1.4.0/Units.pas
r376 r401 114 114 NewNode2: TDOMNode; 115 115 begin 116 RecalculateItemsId;117 116 for I := 0 to Count - 1 do 118 117 with Items[I] do begin … … 188 187 procedure TUnit.FixRefId; 189 188 begin 190 Player := TGame(Game).Players.FindById(PlayerId); 191 Kind := TGame(Game).GameSystem.UnitKinds.FindById(KindId); 189 if PlayerId <> 0 then begin 190 Player := TGame(Game).Players.FindById(PlayerId); 191 if not Assigned(Player) then 192 raise Exception.Create('Referenced player id ' + IntToStr(PlayerId) + ' not found.'); 193 end else Player := nil; 194 195 if KindId <> 0 then begin 196 Kind := TGame(Game).GameSystem.UnitKinds.FindById(KindId); 197 if not Assigned(Kind) then 198 raise Exception.Create('Referenced unit kind id ' + IntToStr(KindId) + ' not found.'); 199 end else Kind := nil; 192 200 end; 193 201 -
trunk/Forms/FormCharts.lfm
r364 r401 41 41 object ComboBox1: TComboBox 42 42 Left = 29 43 Height = 3 843 Height = 33 44 44 Top = 10 45 45 Width = 470 46 ItemHeight = 046 ItemHeight = 25 47 47 ItemIndex = 0 48 48 Items.Strings = ( -
trunk/Install/flatpak/net.zdechov.app.xTactics.yml
r395 r401 27 27 - type: svn 28 28 url: https://svn.zdechov.net/xtactics/trunk 29 revision: r 39529 revision: r401 30 30 buildsystem: simple 31 31 build-commands: -
trunk/Languages/xtactics.cs.po
r362 r401 1257 1257 msgid "View range" 1258 1258 msgstr "Dohled" 1259 -
trunk/Release notes.txt
r389 r401 2 2 ========================== 3 3 4 * Added: A pplication icon with 256x256 resolution.4 * Added: Added vector logo and generated raster logo with resolution 256x256. 5 5 * Added: Close button on more forms for better touch screen devices support. 6 6 * Added: Game systems action in Tools menu. … … 25 25 * Modified: Do not paint new game preview bellow form height. 26 26 * Modified: Automatically save running game on application exit and reopen it on next start. 27 * Modified: Automatic map zoom on new game.28 27 * Modified: Show icons in shortcuts window. 29 28 * Modified: Improved dark theme support on Windows. … … 31 30 * Modified: Allow to set nation in player settings. 32 31 * Modified: Allow to have only one player in the game. 32 * Modified: Set new created players as computer. 33 * Modified: Maximum number of player set to 12. 34 * Modified: Do not zoom all on new game start and game load from file. 35 * Modified: Allow to resize new game, settings and game system forms to be smaller with scroll box area. 36 * Modified: Use new higher resolution application image in about dialog. 33 37 * Fixed: Initialization of preset World image map. 34 38 * Fixed: Map image was not always loaded and applied. … … 52 56 * Fixed: Selection of unit moves. 53 57 * Fixed: Full screen mode under Windows and Linux. 58 * Fixed: Scale charts line width. 59 * Fixed: Item form made bigger to avoid showing scrollbars. 60 * Fixed: Item form string control made shorter. 61 * Fixed: Wrong players and units id recalculation during game save causing bad references. 62 * Fixed: Integrity checks for id references loaded from game file. 63 * Fixed: Run Randomize only once at startup. 64 * Fixed: Store current state of RandSeed to game save. 65 * Fixed: Load/store RandSeed as its Cardinal type instead of Integer. 66 * Fixed: Charts form chart was not drawn on the initial show. 67 * Fixed: Themed background in New game form rules win conditions. 68 * Fixed: Apply theme to chart background. 69 * Fixed: Add new players with different colors. 54 70 55 71 Version 1.3.0 (2018-09-22)
Note:
See TracChangeset
for help on using the changeset viewer.