Changeset 199 for trunk/UCore.pas


Ignore:
Timestamp:
May 16, 2018, 2:48:57 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Initial game setting made independent to current game settings. So last game can be automatically loaded on start and initial setting will be intact.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r197 r199  
    8383  public
    8484    Game: TGame;
     85    GameSettings: TGame;
    8586    Server: TServer;
    8687    UseSingleView: Boolean;
     
    312313  try
    313314    FormNew.Load(Server);
    314     FormNew.ServerList := ServerList;
    315315    if FormNew.ShowModal = mrOk then begin
    316316      FormNew.Save(Server);
     317      Game.Assign(GameSettings);
    317318      StartNewGame;
    318319      GameLoaded := False;
     
    399400  Server := TServer.Create;
    400401  Clients := TClients.Create;
     402  GameSettings := TGame.Create;
    401403  Game := TGame.Create;
    402404  Game.OnMoveUpdated := DoMoveUpdated;
     
    424426  FreeAndNil(Clients);
    425427  FreeAndNil(Game);
     428  FreeAndNil(GameSettings);
    426429end;
    427430
     
    557560
    558561    // Update translated default player names
    559     Game.PlayersSetting[0].Name := SPlayer + ' 1';
    560     Game.PlayersSetting[1].Name := SPlayer + ' 2';
     562    GameSettings.Players[0].Name := SPlayer + ' 1';
     563    GameSettings.Players[1].Name := SPlayer + ' 2';
    561564
    562565    LoadConfig;
    563     Game.LoadConfig(XMLConfig1, 'Game');
     566    GameSettings.LoadConfig(XMLConfig1, 'Game');
    564567    Server.LoadConfig(XMLConfig1, 'Server');
    565568    ServerList.LoadConfig(XmlConfig1, 'ServerList');
     
    576579procedure TCore.Done;
    577580begin
    578   Game.SaveConfig(XMLConfig1, 'Game');
     581  GameSettings.SaveConfig(XMLConfig1, 'Game');
    579582  Server.SaveConfig(XMLConfig1, 'Server');
    580583  ServerList.SaveConfig(XmlConfig1, 'ServerList');
Note: See TracChangeset for help on using the changeset viewer.