Changeset 377


Ignore:
Timestamp:
Jan 3, 2025, 11:20:28 PM (5 days ago)
Author:
chronos
Message:
  • Fixed: Map image was not always loaded and applied.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClientGUI.pas

    r334 r377  
    1717    procedure SetZoom(AValue: Double);
    1818  public
    19     Game: TObject; //TGame;
     19    Game: TObject; // TGame;
    2020    SourceRect: TRect;
    2121    FocusedCell: TPlayerCell;
  • trunk/Core.pas

    r375 r377  
    370370      Server.Game := Game;
    371371      Game.Running := False;
    372       Game.PostConfig;
    373372      Game.Assign(NewServer.Game);
    374373      GameSettings.Assign(NewServer.Game);
     
    738737
    739738  if Game.FileName = '' then begin
    740     GameSettings.PostConfig;
    741739    Game.Assign(GameSettings);
    742740    StartNewGame;
  • trunk/Forms/FormMove.lfm

    r373 r377  
    11object FormMove: TFormMove
    2   Left = 1104
    3   Height = 299
    4   Top = 604
    5   Width = 467
     2  Left = 938
     3  Height = 318
     4  Top = 539
     5  Width = 493
    66  ActiveControl = ButtonOk
    77  Caption = 'Move'
    8   ClientHeight = 299
    9   ClientWidth = 467
     8  ClientHeight = 318
     9  ClientWidth = 493
    1010  Constraints.MinHeight = 100
    1111  Constraints.MinWidth = 350
     
    1616  LCLVersion = '3.6.0.0'
    1717  object ButtonOk: TButton
    18     Left = 134
     18    Left = 160
    1919    Height = 38
    20     Top = 253
     20    Top = 272
    2121    Width = 100
    2222    Anchors = [akRight, akBottom]
     
    2828  end
    2929  object ButtonCancel: TButton
    30     Left = 246
     30    Left = 272
    3131    Height = 38
    32     Top = 253
     32    Top = 272
    3333    Width = 100
    3434    Anchors = [akRight, akBottom]
     
    3838    TabOrder = 1
    3939  end
    40   object LabelWinProbability: TLabel
    41     Left = 264
    42     Height = 26
    43     Top = 8
    44     Width = 15
    45     Caption = '   '
    46     ParentColor = False
    47     ParentFont = False
    48   end
    4940  object ButtonRemove: TButton
    50     Left = 358
     41    Left = 384
    5142    Height = 38
    52     Top = 253
     43    Top = 272
    5344    Width = 100
    5445    Anchors = [akRight, akBottom]
     
    6051  object ScrollBox1: TScrollBox
    6152    Left = 8
    62     Height = 231
     53    Height = 250
    6354    Top = 8
    64     Width = 451
     55    Width = 477
    6556    HorzScrollBar.Page = 298
    66     VertScrollBar.Page = 214
     57    VertScrollBar.Page = 222
    6758    Align = alTop
    6859    Anchors = [akTop, akLeft, akRight, akBottom]
    6960    BorderSpacing.Around = 8
    70     ClientHeight = 229
    71     ClientWidth = 449
     61    ClientHeight = 248
     62    ClientWidth = 475
    7263    TabOrder = 3
    7364    object Label3: TLabel
     
    8374      Left = 8
    8475      Height = 26
    85       Top = 48
     76      Top = 56
    8677      Width = 49
    8778      Caption = 'Once:'
     
    9283      Left = 200
    9384      Height = 43
    94       Top = 40
     85      Top = 48
    9586      Width = 98
    9687      OnChange = SpinEditOnceChange
     
    10293      Left = 8
    10394      Height = 38
    104       Top = 88
     95      Top = 96
    10596      Width = 80
    10697      Caption = 'Min'
     
    111102    object TrackBarOnce: TTrackBar
    112103      Left = 96
    113       Height = 58
    114       Top = 80
    115       Width = 256
     104      Height = 30
     105      Top = 104
     106      Width = 282
    116107      OnChange = TrackBarOnceChange
    117108      PageSize = 1
     
    124115    end
    125116    object ButtonOnceMax: TButton
    126       Left = 361
     117      Left = 387
    127118      Height = 38
    128       Top = 88
     119      Top = 96
    129120      Width = 80
    130121      Anchors = [akTop, akRight]
     
    135126    end
    136127    object ButtonRepeatMax: TButton
    137       Left = 361
     128      Left = 387
    138129      Height = 38
    139       Top = 176
     130      Top = 184
    140131      Width = 80
    141132      Anchors = [akTop, akRight]
     
    148139      Left = 200
    149140      Height = 43
    150       Top = 128
     141      Top = 136
    151142      Width = 98
    152143      OnChange = SpinEditRepeatChange
     
    158149      Left = 96
    159150      Height = 30
    160       Top = 180
    161       Width = 256
     151      Top = 188
     152      Width = 282
    162153      OnChange = TrackBarRepeatChange
    163154      PageSize = 1
     
    172163      Left = 8
    173164      Height = 38
    174       Top = 176
     165      Top = 184
    175166      Width = 80
    176167      Caption = 'Min'
     
    182173      Left = 8
    183174      Height = 26
    184       Top = 136
     175      Top = 144
    185176      Width = 90
    186177      Caption = 'Every turn:'
     
    188179      ParentFont = False
    189180    end
     181    object LabelWinProbability: TLabel
     182      Left = 264
     183      Height = 26
     184      Top = 8
     185      Width = 15
     186      Caption = '   '
     187      ParentColor = False
     188      ParentFont = False
     189    end
    190190  end
    191191end
  • trunk/Forms/FormMove.lrj

    r365 r377  
    33{"hash":1371,"name":"tformmove.buttonok.caption","sourcebytes":[79,107],"value":"Ok"},
    44{"hash":77089212,"name":"tformmove.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
    5 {"hash":8736,"name":"tformmove.labelwinprobability.caption","sourcebytes":[32,32,32],"value":"   "},
    65{"hash":78392485,"name":"tformmove.buttonremove.caption","sourcebytes":[68,101,108,101,116,101],"value":"Delete"},
    76{"hash":261993402,"name":"tformmove.label3.caption","sourcebytes":[87,105,110,32,112,114,111,98,97,98,105,108,105,116,121,58],"value":"Win probability:"},
     
    1110{"hash":21384,"name":"tformmove.buttonrepeatmax.caption","sourcebytes":[77,97,120],"value":"Max"},
    1211{"hash":21502,"name":"tformmove.buttonrepeatmin.caption","sourcebytes":[77,105,110],"value":"Min"},
    13 {"hash":188155274,"name":"tformmove.label2.caption","sourcebytes":[69,118,101,114,121,32,116,117,114,110,58],"value":"Every turn:"}
     12{"hash":188155274,"name":"tformmove.label2.caption","sourcebytes":[69,118,101,114,121,32,116,117,114,110,58],"value":"Every turn:"},
     13{"hash":8736,"name":"tformmove.labelwinprobability.caption","sourcebytes":[32,32,32],"value":"   "}
    1414]}
  • trunk/Forms/FormNew.pas

    r363 r377  
    384384  GamePreview.GameSystem.Assign(FServer.Game.GameSystem);
    385385  SaveGame(GamePreview);
    386   GamePreview.PostConfig;
    387386  GamePreview.GeneratePlayers := False;
    388387  GamePreview.New;
  • trunk/Game.pas

    r360 r377  
    8686    StoredRandSeed: Cardinal;
    8787    GeneratePlayers: Boolean;
    88     procedure PostConfig;
    8988    procedure Assign(Source: TGame);
    9089    function AttackProbability(AttackCount, DefendCount: Integer): Double;
     
    297296  Cell: TCell;
    298297begin
     298  // Load map image
     299  if (Map.Shape = msImage) then begin
     300    if LoadedImageFileName <> MapImageFileName then begin
     301      LoadedImageFileName := MapImageFileName;
     302      if FileExists(MapImageFileName) then begin
     303        Map.Image.Picture.LoadFromFile(MapImageFileName)
     304      end else begin
     305        LoadedImageFileName := '';
     306        Map.Image.Picture.Clear;
     307      end;
     308    end;
     309  end;
     310
    299311  // Randomize map terrain
    300312  for Cell in Map.Cells do
     
    376388end;
    377389
    378 procedure TGame.PostConfig;
    379 begin
    380   if (Map.Shape = msImage) and FileExists(MapImageFileName) and
    381   (LoadedImageFileName <> MapImageFileName) then begin
    382     LoadedImageFileName := MapImageFileName;
    383     Map.Image.Picture.LoadFromFile(MapImageFileName);
    384   end;
    385 end;
    386 
    387390procedure TGame.SelectPlayerStartCell(Player: TPlayer);
    388391var
     
    502505  Map.Assign(Source.Map);
    503506  MapImageFileName := Source.MapImageFileName;
     507  LoadedImageFileName := Source.LoadedImageFileName;
    504508  VoidEnabled := Source.VoidEnabled;
    505509  VoidPercentage := Source.VoidPercentage;
Note: See TracChangeset for help on using the changeset viewer.