Changeset 169 for trunk/Start.pas
- Timestamp:
- Jun 15, 2019, 11:42:35 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r157 r169 72 72 procedure FormShow(Sender: TObject); 73 73 procedure FormHide(Sender: TObject); 74 procedure FormClose(Sender: TObject; var Action: TCloseAction); 74 75 procedure FormCreate(Sender: TObject); 75 76 procedure FormDestroy(Sender: TObject); 76 77 procedure BrainClick(Sender: TObject); 78 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 77 79 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 78 80 Shift: TShiftState; x, y: integer); 81 procedure FormMouseUp(Sender: TObject; Button: TMouseButton; 82 Shift: TShiftState; x, y: integer); 83 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; x, y: integer); 79 84 procedure Up1BtnClick(Sender: TObject); 80 85 procedure Down1BtnClick(Sender: TObject); 81 procedure FormClose(Sender: TObject; var Action: TCloseAction);82 86 procedure ListClick(Sender: TObject); 83 87 procedure RenameBtnClick(Sender: TObject); … … 88 92 procedure Down2BtnClick(Sender: TObject); 89 93 procedure QuitBtnClick(Sender: TObject); 90 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);91 94 procedure CustomizeBtnClick(Sender: TObject); 92 95 procedure AutoDiffUpBtnClick(Sender: TObject); 93 96 procedure AutoDiffDownBtnClick(Sender: TObject); 94 procedure FormMouseUp(Sender: TObject; Button: TMouseButton;95 Shift: TShiftState; x, y: integer);96 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; x, y: integer);97 97 procedure AutoEnemyUpBtnClick(Sender: TObject); 98 98 procedure AutoEnemyDownBtnClick(Sender: TObject); … … 926 926 begin // load 927 927 FileName := List.Items[List.ItemIndex]; 928 if LoadGame( DataDir + 'Saved'+ DirectorySeparator, FileName + CevoExt, LoadTurn, false)928 if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, false) 929 929 then 930 930 UnlistBackupFile(FileName) … … 1010 1010 end; 1011 1011 1012 StartNewGame( DataDir + 'Saved'+ DirectorySeparator, FileName + CevoExt, MapFileName,1012 StartNewGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, MapFileName, 1013 1013 lxpre[WorldSize], lypre[WorldSize], StartLandMass, MaxTurn); 1014 1014 UnlistBackupFile(FileName); … … 1145 1145 pgLoad: 1146 1146 begin 1147 AssignFile(LogFile, DataDir + 'Saved'+ DirectorySeparator + List.Items[List.ItemIndex]1147 AssignFile(LogFile, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] 1148 1148 + CevoExt); 1149 1149 try … … 1198 1198 if Page = pgEditMap then 1199 1199 MapFileName := List.Items[List.ItemIndex] + CevoMapExt; 1200 if LoadGraphicFile(Mini, DataDir + 'Maps'+ DirectorySeparator + Copy(MapFileName, 1,1200 if LoadGraphicFile(Mini, GetMapsDir + DirectorySeparator + Copy(MapFileName, 1, 1201 1201 Length(MapFileName) - 9) + '.png', gfNoError) then 1202 1202 begin … … 1215 1215 end; 1216 1216 1217 AssignFile(MapFile, DataDir + 'Maps'+ DirectorySeparator + MapFileName);1217 AssignFile(MapFile, GetMapsDir + DirectorySeparator + MapFileName); 1218 1218 try 1219 1219 Reset(MapFile, 4); … … 1395 1395 begin 1396 1396 FormerGames.Clear; 1397 if FindFirst( DataDir + 'Saved'+ DirectorySeparator + '*' + CevoExt, $21, F) = 0 then1397 if FindFirst(GetSavedDir + DirectorySeparator + '*' + CevoExt, $21, F) = 0 then 1398 1398 repeat 1399 1399 I := FormerGames.Count; … … 1415 1415 begin 1416 1416 Maps.Clear; 1417 if FindFirst( DataDir + 'Maps'+ DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then1417 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then 1418 1418 repeat 1419 1419 Maps.Add(Copy(f.Name, 1, Length(f.Name) - 9)); … … 1790 1790 end; 1791 1791 if Page = pgLoad then 1792 AssignFile(f, DataDir + 'Saved'+ DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1792 AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1793 1793 else 1794 AssignFile(f, DataDir + 'Maps'+ DirectorySeparator + List.Items[List.ItemIndex] +1794 AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1795 1795 CevoMapExt); 1796 1796 ok := true; 1797 1797 try 1798 1798 if Page = pgLoad then 1799 Rename(f, DataDir + 'Saved'+ DirectorySeparator + NewName + CevoExt)1799 Rename(f, GetSavedDir + DirectorySeparator + NewName + CevoExt) 1800 1800 else 1801 Rename(f, DataDir + 'Maps'+ DirectorySeparator + NewName + CevoMapExt);1801 Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapExt); 1802 1802 except 1803 1803 // Play('INVALID'); … … 1806 1806 if Page <> pgLoad then 1807 1807 try // rename map picture 1808 AssignFile(f, DataDir + 'Maps'+ DirectorySeparator + List.Items[List.ItemIndex]1808 AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] 1809 1809 + '.png'); 1810 Rename(f, DataDir + 'Maps'+ DirectorySeparator + NewName + '.png');1810 Rename(f, GetMapsDir + DirectorySeparator + NewName + '.png'); 1811 1811 except 1812 1812 end; … … 1842 1842 begin 1843 1843 if Page = pgLoad then 1844 AssignFile(f, DataDir + 'Saved'+ DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1844 AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1845 1845 else 1846 AssignFile(f, DataDir + 'Maps'+ DirectorySeparator + List.Items[List.ItemIndex] +1846 AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1847 1847 CevoMapExt); 1848 1848 Erase(f); … … 2036 2036 procedure TStartDlg.ReplayBtnClick(Sender: TObject); 2037 2037 begin 2038 LoadGame( DataDir + 'Saved'+ DirectorySeparator, List.Items[List.ItemIndex] + CevoExt,2038 LoadGame(GetSavedDir + DirectorySeparator, List.Items[List.ItemIndex] + CevoExt, 2039 2039 LastTurn, True); 2040 2040 SlotAvailable := -1;
Note:
See TracChangeset
for help on using the changeset viewer.