Changeset 77 for trunk/UCore.pas
- Timestamp:
- Oct 5, 2014, 7:13:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r76 r77 49 49 procedure DoOnWin(Player: TPlayer); 50 50 procedure Delay(Time: Integer); 51 procedure GameNewTurnExecute(Sender: TObject); 52 procedure AutoSave; 51 53 public 52 54 Game: TGame; … … 55 57 LastMapFileName: string; 56 58 AnimationSpeed: Integer; 59 AutoSaveEnabled: Boolean; 57 60 procedure UpdateActions; 58 61 procedure Init; … … 129 132 end; 130 133 134 procedure TCore.GameNewTurnExecute(Sender: TObject); 135 begin 136 if AutoSaveEnabled then AutoSave; 137 end; 138 139 procedure TCore.AutoSave; 140 begin 141 Game.SaveToFile(GetAppConfigDir(False) + 'AutoSave.xtg'); 142 GetUserDir; 143 end; 144 131 145 procedure TCore.UpdateActions; 132 146 begin … … 249 263 Game.OnMove := DoOnMove; 250 264 Game.OnWin := DoOnWin; 265 Game.OnNewTurn := GameNewTurnExecute; 251 266 end; 252 267 … … 258 273 XMLConfig1.SetValue('DevelMode', DevelMode); 259 274 XMLConfig1.SetValue('AnimationSpeed', AnimationSpeed); 275 XMLConfig1.SetValue('AutoSave', AutoSaveEnabled); 260 276 FreeAndNil(Game); 261 277 end; … … 269 285 DevelMode := XMLConfig1.GetValue('DevelMode', false); 270 286 AnimationSpeed := XMLConfig1.GetValue('AnimationSpeed', 50); 287 AutoSaveEnabled := XMLConfig1.GetValue('AutoSave', True); 271 288 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', '')); 272 289 for I := 0 to Game.Players.Count - 1 do
Note:
See TracChangeset
for help on using the changeset viewer.