Changeset 76 for trunk/Forms


Ignore:
Timestamp:
Oct 5, 2014, 1:34:43 PM (10 years ago)
Author:
chronos
Message:
  • Modified: More changes to support game load from file.
  • Fixed: Require at least one player in new game.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r74 r76  
    9191      Style = tbsSeparator
    9292    end
     93    object ToolButton10: TToolButton
     94      Left = 1
     95      Top = 268
     96      Width = 32
     97      Style = tbsSeparator
     98    end
     99    object ToolButton11: TToolButton
     100      Left = 1
     101      Top = 278
     102      Action = Core.AGameLoad
     103    end
     104    object ToolButton12: TToolButton
     105      Left = 1
     106      Top = 310
     107      Action = Core.AGameSave
     108    end
     109    object ToolButton13: TToolButton
     110      Left = 1
     111      Top = 342
     112      Action = Core.AExit
     113    end
    93114  end
    94115  object PaintBox1: TPaintBox
  • trunk/Forms/UFormMain.pas

    r73 r76  
    5353    ToolBar1: TToolBar;
    5454    ToolButton1: TToolButton;
     55    ToolButton10: TToolButton;
     56    ToolButton11: TToolButton;
     57    ToolButton12: TToolButton;
     58    ToolButton13: TToolButton;
    5559    ToolButton2: TToolButton;
    5660    ToolButton3: TToolButton;
  • trunk/Forms/UFormNew.pas

    r75 r76  
    228228  ListView1.Items.Count := Players.Count;
    229229  ListView1.Refresh;
    230   ButtonPlayerRemove.Enabled := Assigned(ListView1.Selected);
     230  ButtonPlayerRemove.Enabled := Assigned(ListView1.Selected) and (Players.Count > 1);
    231231  ButtonPlayerAdd.Enabled := Players.Count < MaxPlayerCount;
    232232  APlayerModify.Enabled := Assigned(ListView1.Selected);
     
    306306  if Players.Count <= (MaxPlayerCount - 1) then begin
    307307    NewPlayer := TPlayer.Create;
    308     NewPlayer.Name := 'Player ' + IntToStr(Players.Count + 1);
     308    NewPlayer.Id := Players.GetNewPlayerId;
     309    NewPlayer.Name := SPlayer + ' ' + IntToStr(NewPlayer.Id);
    309310    NewPlayer.Color := PlayerColors[Players.Count];
    310311    NewPlayer.Mode := pmComputer;
     
    335336    TPlayer(Players[I]).Assign(TPlayer(Game.Players[I]));
    336337  end;
     338  Players.NewPlayerId := Game.Players.NewPlayerId;
     339
    337340  CheckBoxCity.Checked := Game.CityEnabled;
    338341  SpinEditCityPercent.Value := Game.CityPercentage;
     
    362365    TPlayer(Game.Players[I]).Game := Game;
    363366  end;
     367  Game.Players.NewPlayerId := Players.NewPlayerId;
    364368  Game.SymetricMap := CheckBoxSymetricMap.Checked;
    365369  Game.VoidEnabled := CheckBoxVoid.Checked;
Note: See TracChangeset for help on using the changeset viewer.