Changeset 233 for trunk


Ignore:
Timestamp:
Sep 19, 2018, 3:20:20 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Map type Image wasn't using loaded image from file on repeated new game creation.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r231 r233  
    9595    if Assigned(ControlPlayer) then begin
    9696      for Cell in ControlPlayer.PlayerMap.Cells do begin
    97         if (Cell.MapCell.Terrain <> ttVoid) and View.IsCellVisible(Cell.MapCell) then begin
     97        if View.IsCellVisible(Cell.MapCell) and (Cell.MapCell.Terrain <> ttVoid) then begin
    9898          if Cell.MapCell.Player = ControlPlayer then
    9999            CellText := IntToStr(Cell.GetAvialPower)
  • trunk/UCore.pas

    r231 r233  
    308308      Game.Running := False;
    309309      FormNew.Save(Server);
     310      GameSettings.PostConfig;
    310311      Game.Assign(GameSettings);
    311312      StartNewGame;
     
    533534
    534535  if Game.FileName = '' then begin
     536    GameSettings.PostConfig;
    535537    Game.Assign(GameSettings);
    536538    StartNewGame;
  • trunk/UGame.pas

    r231 r233  
    77uses
    88  Classes, SysUtils, ExtCtrls, Graphics, XMLConf, XMLRead, XMLWrite, Forms,
    9   DOM, Math, LazFileUtils, UXMLUtils, Dialogs, Types, LCLType, LCLIntf, fgl,
     9  DOM, Math, LazFileUtils, UXMLUtils, Dialogs, LCLType, LCLIntf, fgl,
    1010  UGeometry, UPlayer, UMap, UMapType;
    1111
     
    7777    BridgeEnabled: Boolean;
    7878    MaxPower: Integer;
     79    procedure PostConfig;
    7980    procedure Assign(Source: TGame);
    8081    function AttackProbability(AttackCount, DefendCount: Integer): Double;
     
    273274  Cell: TCell;
    274275begin
    275   if (Map.Shape = msImage) and FileExists(MapImageFileName) and
    276   (LoadedImageFileName <> MapImageFileName) then begin
    277     LoadedImageFileName := MapImageFileName;
    278     Map.Image.Picture.LoadFromFile(MapImageFileName);
    279   end;
    280 
    281276  // Randomize map terrain
    282277  for Cell in Map.Cells do
     
    290285    Power := Random(MaxNeutralUnits + 1);
    291286    Player := nil;
     287  end;
     288end;
     289
     290procedure TGame.PostConfig;
     291begin
     292  if (Map.Shape = msImage) and FileExists(MapImageFileName) and
     293  (LoadedImageFileName <> MapImageFileName) then begin
     294    LoadedImageFileName := MapImageFileName;
     295    Map.Image.Picture.LoadFromFile(MapImageFileName);
    292296  end;
    293297end;
  • trunk/UGameClient.pas

    r231 r233  
    77uses
    88  Classes, SysUtils, UGame, Forms, fgl, UGameProtocol, UGameServer, UCommThread,
    9   UThreading, UCommFrame, UMap, UPlayer;
     9  UThreading, UCommFrame, UPlayer;
    1010
    1111type
  • trunk/UMap.pas

    r231 r233  
    66
    77uses
    8   Classes, SysUtils, Graphics, ExtCtrls, UGeometry, XMLRead, XMLWrite, DOM, fgl,
     8  Classes, SysUtils, Graphics, ExtCtrls, UGeometry, DOM, fgl,
    99  UXMLUtils;
    1010
  • trunk/UPlayer.pas

    r231 r233  
    66
    77uses
    8   Classes, SysUtils, Graphics, UMap, XmlRead, XmlWrite, DOM, fgl, XMLConf,
     8  Classes, SysUtils, Graphics, UMap, DOM, fgl, XMLConf,
    99  UXMLUtils, Math, UGeometry;
    1010
Note: See TracChangeset for help on using the changeset viewer.