Changeset 339


Ignore:
Timestamp:
Apr 1, 2021, 6:12:35 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: Cevo map extension ".cevo map" was not valid Windows file extension and it was not possible to associate an application with such extension. Changed to ".cevomap" without space character.
  • Added: .cevomap files associated with C-evo executable. Open map editor directly for the files.
Location:
trunk
Files:
1 deleted
5 edited
50 moved

Legend:

Unmodified
Added
Removed
  • trunk/Direct.pas

    r338 r339  
    4343
    4444uses
    45   ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back;
     45  ScreenTools, Protocol, Start, LocalPlayer, NoTerm, Back, Global;
    4646
    4747{$R *.lfm}
     
    204204  i: integer;
    205205  s: string;
     206  FileName: string;
    206207begin
    207208  Hide;
     
    229230      end;
    230231    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
    237246        SimpleMessage(Phrases.Lookup('LOADERR'));
    238247        Close;
  • trunk/GameServer.pas

    r338 r339  
    583583  MapFile := nil;
    584584  try
    585     MapFile := TFileStream.Create(GetMapsDir + DirectorySeparator + FileName,
    586       fmOpenRead or fmShareExclusive);
     585    MapFile := TFileStream.Create(FileName, fmOpenRead or fmShareExclusive);
    587586    MapFile.Position := 0;
    588587    MapFile.read(s[1], 8); { file id }
  • trunk/Global.pas

    r304 r339  
    55const
    66  CevoExt = '.cevo';
    7   CevoMapExt = '.cevo map';
     7  CevoMapExt = '.cevomap';
    88  CevoTribeExt = '.tribe.txt';
    99  CevoHomepageShort = 'app.zdechov.net/c-evo';
  • trunk/Install/win/Common.iss

    r288 r339  
    5555Root: HKCR; Subkey: "{#FileTypeName}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
    5656
     57#define FileTypeName "C-evo map"
     58Root: HKCR; Subkey: ".cevomap"; ValueType: string; ValueName: ""; ValueData: "{#FileTypeName}"; Flags: uninsdeletevalue
     59Root: HKCR; Subkey: "{#FileTypeName}"; ValueType: string; ValueName: ""; ValueData: "{#FileTypeName}"; Flags: uninsdeletekey
     60Root: HKCR; Subkey: "{#FileTypeName}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
     61Root: HKCR; Subkey: "{#FileTypeName}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
     62
    5763[Components]
    5864Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
  • trunk/Start.pas

    r323 r339  
    865865      s := Phrases.Lookup('MPMAP')
    866866    else if Page = pgStartMap then
    867       s := Copy(MapFileName, 1, Length(MapFileName) - 9)
     867      s := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))
    868868    else if Page = pgEditMap then
    869869      s := List.Items[List.ItemIndex]
     
    10081008      end;
    10091009    pgEditMap:
    1010       EditMap(MapFileName, lxmax, lymax, StartLandMass);
     1010      EditMap(GetMapsDir + DirectorySeparator + MapFileName, lxmax, lymax, StartLandMass);
    10111011    pgEditRandom: // new map
    10121012      begin
     
    10231023        end;
    10241024        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);
    10261027      end;
    10271028  end;
     
    10591060        if Page = pgEditMap then
    10601061          MapFileName := List.Items[List.ItemIndex] + CevoMapExt;
    1061         MiniMap.LoadFromMapFile(GetMapsDir + DirectorySeparator + MapFileName, nMapLandTiles, nMapStartPositions);
     1062        MiniMap.LoadFromMapFile(GetMapsDir + DirectorySeparator + MapFileName,
     1063          nMapLandTiles, nMapStartPositions);
    10621064        if Page = pgEditMap then
    10631065          SmartInvalidate(x0Mini - 112, y0Mini + 61, x0Mini + 112, y0Mini + 91);
     
    12341236  if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then
    12351237    repeat
    1236       Maps.Add(Copy(f.Name, 1, Length(f.Name) - 9));
     1238      Maps.Add(Copy(f.Name, 1, Length(f.Name) - Length(CevoMapExt)));
    12371239    until FindNext(f) <> 0;
    12381240  FindClose(F);
    12391241  Maps.Sort;
    12401242  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)));
    12421244  if ListIndex[tbMain] < 0 then
    12431245    ListIndex[tbMain] := 0;
Note: See TracChangeset for help on using the changeset viewer.