hedgewars/ArgParsers.pas
changeset 15845 ad43384fbbe9
parent 15663 d92eeb468dad
equal deleted inserted replaced
15844:4e3c340eb766 15845:ad43384fbbe9
   242     zoom:= UserZoom;
   242     zoom:= UserZoom;
   243     ZoomValue:= UserZoom;
   243     ZoomValue:= UserZoom;
   244 end;
   244 end;
   245 
   245 
   246 function parseParameter(cmd:string; arg:string; var paramIndex:LongInt): Boolean;
   246 function parseParameter(cmd:string; arg:string; var paramIndex:LongInt): Boolean;
   247 const reallyAll: array[0..35] of shortstring = (
   247 const reallyAll: array[0..37] of shortstring = (
   248                 '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width',
   248                 '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width',
   249                 '--height', '--maximized', '--frame-interval', '--volume','--nomusic', '--nosound', '--nodampen',
   249                 '--height', '--maximized', '--frame-interval', '--volume','--nomusic', '--nosound', '--nodampen',
   250                 '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick',
   250                 '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick',
   251                 '--zoom',
   251                 '--zoom',
   252   {internal}    '--internal', '--port', '--recorder', '--landpreview',
   252   {internal}    '--internal', '--port', '--recorder', '--landpreview',
   253   {misc}        '--stats-only', '--gci', '--help','--protocol', '--no-teamtag','--no-hogtag','--no-healthtag','--translucent-tags','--lua-test','--no-holiday-silliness','--chat-size');
   253   {misc}        '--stats-only', '--gci', '--help','--protocol', '--no-teamtag','--no-hogtag','--no-healthtag','--translucent-tags','--lua-test','--no-holiday-silliness','--chat-size', '--prefix64', '--user-prefix64');
   254 var cmdIndex: byte;
   254 var cmdIndex: byte;
   255 begin
   255 begin
   256     parseParameter:= false;
   256     parseParameter:= false;
   257     cmdIndex:= 0;
   257     cmdIndex:= 0;
   258 
   258 
   297         {--no-healthtag}        31 : cTagsMask := cTagsMask and (not htHealth);
   297         {--no-healthtag}        31 : cTagsMask := cTagsMask and (not htHealth);
   298         {--translucent-tags}    32 : cTagsMask := cTagsMask or htTransparent;
   298         {--translucent-tags}    32 : cTagsMask := cTagsMask or htTransparent;
   299         {--lua-test}            33 : begin cTestLua := true; SetSound(false); cScriptName := getstringParameter(arg, paramIndex, parseParameter); WriteLn(stdout, 'Lua test file specified: ' + cScriptName);end;
   299         {--lua-test}            33 : begin cTestLua := true; SetSound(false); cScriptName := getstringParameter(arg, paramIndex, parseParameter); WriteLn(stdout, 'Lua test file specified: ' + cScriptName);end;
   300         {--no-holiday-silliness} 34 : cHolidaySilliness:= false;
   300         {--no-holiday-silliness} 34 : cHolidaySilliness:= false;
   301         {--chat-size}           35 : cDefaultChatScale := 1.0 * getLongIntParameter(arg, paramIndex, parseParameter) / 100;
   301         {--chat-size}           35 : cDefaultChatScale := 1.0 * getLongIntParameter(arg, paramIndex, parseParameter) / 100;
       
   302         {--prefix64}            36: PathPrefix := DecodeBase64(getstringParameter(arg, paramIndex, parseParameter));
       
   303         {--user-prefix64}       37: UserPathPrefix := DecodeBase64(getstringParameter(arg, paramIndex, parseParameter));
   302     else
   304     else
   303         begin
   305         begin
   304         //Assume the first "non parameter" is the demo file, anything else is invalid
   306         //Assume the first "non parameter" is the demo file, anything else is invalid
   305         if (recordFileName = '') and (Copy(cmd,1,2) <> '--') then
   307         if (recordFileName = '') and (Copy(cmd,1,2) <> '--') then
   306             recordFileName := cmd
   308             recordFileName := cmd