hedgewars/hwengine.pas
changeset 5616 a96231121eac
parent 5565 1a326ba319c9
child 5644 4ad07103cfae
child 5662 99083392cd4f
equal deleted inserted replaced
5614:a281dce3fafc 5616:a96231121eac
   219     val(gameArgs[0], ipcPort);
   219     val(gameArgs[0], ipcPort);
   220     val(gameArgs[1], cScreenWidth);
   220     val(gameArgs[1], cScreenWidth);
   221     val(gameArgs[2], cScreenHeight);
   221     val(gameArgs[2], cScreenHeight);
   222     val(gameArgs[3], cReducedQuality);
   222     val(gameArgs[3], cReducedQuality);
   223     cLocaleFName:= gameArgs[4];
   223     cLocaleFName:= gameArgs[4];
       
   224     if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
       
   225     else cLocale := Copy(cLocaleFName,1,2);
   224     UserNick:= gameArgs[5];
   226     UserNick:= gameArgs[5];
   225     isSoundEnabled:= gameArgs[6] = '1';
   227     isSoundEnabled:= gameArgs[6] = '1';
   226     isMusicEnabled:= gameArgs[7] = '1';
   228     isMusicEnabled:= gameArgs[7] = '1';
   227     cAltDamage:= gameArgs[8] = '1';
   229     cAltDamage:= gameArgs[8] = '1';
   228     val(gameArgs[9], rotationQt);
   230     val(gameArgs[9], rotationQt);
   265     InitKbdKeyTable();
   267     InitKbdKeyTable();
   266     AddProgress();
   268     AddProgress();
   267 
   269 
   268     LoadLocale(UserPathz[ptLocale] + '/en.txt');  // Do an initial load with english
   270     LoadLocale(UserPathz[ptLocale] + '/en.txt');  // Do an initial load with english
   269     LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
   271     LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
   270     if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
       
   271     else cLocale := Copy(cLocaleFName,1,2);
       
   272     if cLocaleFName <> 'en.txt' then
   272     if cLocaleFName <> 'en.txt' then
   273         begin
   273         begin
   274         // Try two letter locale first before trying specific locale overrides
   274         // Try two letter locale first before trying specific locale overrides
   275         if (Length(cLocale) > 2) and (Copy(cLocale,1,2) <> 'en') then
   275         if (Length(cLocale) > 2) and (Copy(cLocale,1,2) <> 'en') then
   276             begin
   276             begin
   477 ////////////////////////////////////////////////////////////////////////////////
   477 ////////////////////////////////////////////////////////////////////////////////
   478 /////////////////////////////// m a i n ////////////////////////////////////////
   478 /////////////////////////////// m a i n ////////////////////////////////////////
   479 ////////////////////////////////////////////////////////////////////////////////
   479 ////////////////////////////////////////////////////////////////////////////////
   480 begin
   480 begin
   481     GetParams();
   481     GetParams();
       
   482     if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
       
   483     else cLocale := Copy(cLocaleFName,1,2);
   482 
   484 
   483     if GameType = gmtLandPreview then GenLandPreview()
   485     if GameType = gmtLandPreview then GenLandPreview()
   484     else if GameType = gmtSyntax then DisplayUsage()
   486     else if GameType = gmtSyntax then DisplayUsage()
   485     else Game();
   487     else Game();
   486 
   488