- Timestamp:
- Apr 1, 2021, 6:12:35 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
- 50 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Direct.pas
r338 r339 43 43 44 44 uses 45 ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back ;45 ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global; 46 46 47 47 {$R *.lfm} … … 204 204 i: integer; 205 205 s: string; 206 FileName: string; 206 207 begin 207 208 Hide; … … 229 230 end; 230 231 end 231 else if (FileExists(ParamStr(1))) then 232 begin 233 Quick := True; 234 if not LoadGame(ExtractFilePath(ParamStr(1)), ExtractFileName(ParamStr(1) 235 ), -1, false) then 236 begin 232 else if (FileExists(ParamStr(1))) then begin 233 FileName := ParamStr(1); 234 if ExtractFileExt(FileName) = CevoExt then begin 235 Quick := True; 236 if not LoadGame(ExtractFilePath(ParamStr(1)), ExtractFileName(ParamStr(1) 237 ), -1, false) then begin 238 SimpleMessage(Phrases.Lookup('LOADERR')); 239 Close; 240 end; 241 end else 242 if ExtractFileExt(FileName) = CevoMapExt then begin 243 Quick := True; 244 EditMap(FileName, lxmax, lymax, 30); 245 end else begin 237 246 SimpleMessage(Phrases.Lookup('LOADERR')); 238 247 Close; -
trunk/GameServer.pas
r338 r339 583 583 MapFile := nil; 584 584 try 585 MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName, 586 fmOpenRead or fmShareExclusive); 585 MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive); 587 586 MapFile.Position := 0; 588 587 MapFile.read(s[1], 8); { file id } -
trunk/Global.pas
r304 r339 5 5 const 6 6 CevoExt = '.cevo'; 7 CevoMapExt = '.cevo 7 CevoMapExt = '.cevomap'; 8 8 CevoTribeExt = '.tribe.txt'; 9 9 CevoHomepageShort = 'app.zdechov.net/c-evo'; -
trunk/Install/win/Common.iss
r288 r339 55 55 Root: HKCR; Subkey: "{#FileTypeName}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1""" 56 56 57 #define FileTypeName "C-evo map" 58 Root: HKCR; Subkey: ".cevomap"; ValueType: string; ValueName: ""; ValueData: "{#FileTypeName}"; Flags: uninsdeletevalue 59 Root: HKCR; Subkey: "{#FileTypeName}"; ValueType: string; ValueName: ""; ValueData: "{#FileTypeName}"; Flags: uninsdeletekey 60 Root: HKCR; Subkey: "{#FileTypeName}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0" 61 Root: HKCR; Subkey: "{#FileTypeName}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1""" 62 57 63 [Components] 58 64 Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed -
trunk/Start.pas
r323 r339 865 865 s := Phrases.Lookup('MPMAP') 866 866 else if Page = pgStartMap then 867 s := Copy(MapFileName, 1, Length(MapFileName) - 9)867 s := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt)) 868 868 else if Page = pgEditMap then 869 869 s := List.Items[List.ItemIndex] … … 1008 1008 end; 1009 1009 pgEditMap: 1010 EditMap( MapFileName, lxmax, lymax, StartLandMass);1010 EditMap(GetMapsDir + DirectorySeparator + MapFileName, lxmax, lymax, StartLandMass); 1011 1011 pgEditRandom: // new map 1012 1012 begin … … 1023 1023 end; 1024 1024 MapFileName := Format(Phrases.Lookup('MAP'), [MapCount]) + CevoMapExt; 1025 EditMap(MapFileName, WorldSizes[WorldSize].X, WorldSizes[WorldSize].Y, StartLandMass); 1025 EditMap(GetMapsDir + DirectorySeparator + MapFileName, 1026 WorldSizes[WorldSize].X, WorldSizes[WorldSize].Y, StartLandMass); 1026 1027 end; 1027 1028 end; … … 1059 1060 if Page = pgEditMap then 1060 1061 MapFileName := List.Items[List.ItemIndex] + CevoMapExt; 1061 MiniMap.LoadFromMapFile(GetMapsDir + DirectorySeparator + MapFileName, nMapLandTiles, nMapStartPositions); 1062 MiniMap.LoadFromMapFile(GetMapsDir + DirectorySeparator + MapFileName, 1063 nMapLandTiles, nMapStartPositions); 1062 1064 if Page = pgEditMap then 1063 1065 SmartInvalidate(x0Mini - 112, y0Mini + 61, x0Mini + 112, y0Mini + 91); … … 1234 1236 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then 1235 1237 repeat 1236 Maps.Add(Copy(f.Name, 1, Length(f.Name) - 9));1238 Maps.Add(Copy(f.Name, 1, Length(f.Name) - Length(CevoMapExt))); 1237 1239 until FindNext(f) <> 0; 1238 1240 FindClose(F); 1239 1241 Maps.Sort; 1240 1242 Maps.Insert(0, Phrases.Lookup('RANMAP')); 1241 ListIndex[tbMain] := Maps.IndexOf(Copy(MapFileName, 1, Length(MapFileName) - 9));1243 ListIndex[tbMain] := Maps.IndexOf(Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))); 1242 1244 if ListIndex[tbMain] < 0 then 1243 1245 ListIndex[tbMain] := 0;
Note:
See TracChangeset
for help on using the changeset viewer.