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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.