section.begin
   Name = ShowInternetShell
   Code : struct.begin
      [*] = ;// _gui_CreateCheckBox
      [*] = ;//
      [*] = ;function _gui_CreateCheckBoxSmall(const elementName : String; parent : Integer; bChecked : Boolean; hAlign, vAlign : Integer; posX, posY : Integer; var eventState, hint : String; tag : Integer; bGetUpdate : Boolean) : Integer;
      [*] = ;begin
      [*] = ;   const cMaterialCheckbox = 'checkbox';
      [*] = ;   const cxOff = 0;
      [*] = ;   const cyOff = 0;
      [*] = ;   const ctxOff = 0;
      [*] = ;   const ctyOff = 0;
      [*] = ;   //const cLogicWidth = 182;
      [*] = ;   //const cLogicHeight = 23;
      [*] = ;   var curind : Integer = GetGUICursorIndexByName('crPress');
      [*] = ;   {var tmpText : String = text;
      [*] = ;   _misc_StringToText(text, tmpText);}
      [*] = ;   var elmHnd : Integer = _gui_CreateButton(elementName, parent, cMaterialCheckbox, hAlign, vAlign, posX, posY, 16, 16, eventState, hint, tag, bGetUpdate);
      [*] = ;   SetGUIElementChecked(elmHnd, bChecked);
      [*] = ;   SetGUIElementTextFormatted(elmHnd, True);
      [*] = ;   {SetGUIElementTextAlign(elmHnd, 'halLeft', 'valMiddle', 0, 0);
      [*] = ;   SetGUIElementText(elmHnd, tmpText);
      [*] = ;   SetGUIElementTextFormatted(elmHnd, True);
      [*] = ;   SetGUIElementFont(elmHnd, gUIConst.font[gc_font_default_serif]);
      [*] = ;   SetGUIElementLogicRect(elmHnd, cLogicWidth, cLogicHeight);}
      [*] = ;   var cTColorNormal : TColor;
      [*] = ;   var cTColorHover : TColor;
      [*] = ;   var cTColorPressed : TColor;
      [*] = ;   var cTColorDisabled : TColor;
      [*] = ;   var cTColorChecked : TColor;
      [*] = ;   _gui_ConvertHexToTColor(gc_font_hex_color_lightgrey, cTColorNormal);
      [*] = ;   _gui_ConvertHexToTColor(gc_font_hex_color_darkgrey, cTColorHover);
      [*] = ;   _gui_ConvertHexToTColor(gc_font_hex_color_lightgrey, cTColorPressed);
      [*] = ;   _gui_ConvertHexToTColor(gc_font_hex_color_lightgrey, cTColorDisabled);
      [*] = ;   _gui_ConvertHexToTColor(gc_font_hex_color_lightgrey, cTColorChecked);
      [*] = ;   SetGUIElementVisibleProperties(elmHnd, 'UpProperty', cMaterialCheckbox+'.normal', cxOff, cyOff, ctxOff, ctyOff, -1, cTColorNormal.r, cTColorNormal.g, cTColorNormal.b, cTColorNormal.a);
      [*] = ;   SetGUIElementVisibleProperties(elmHnd, 'HoverProperty', cMaterialCheckbox+'.hover', cxOff, cyOff, ctxOff, ctyOff, curind, cTColorHover.r, cTColorHover.g, cTColorHover.b, 1);
      [*] = ;   SetGUIElementVisibleProperties(elmHnd, 'DownProperty', cMaterialCheckbox+'.pressed', cxOff, cyOff, ctxOff, ctyOff, curind, cTColorPressed.r, cTColorPressed.g, cTColorPressed.b, 1);
      [*] = ;   SetGUIElementVisibleProperties(elmHnd, 'DisableProperty', cMaterialCheckbox+'.disabled', cxOff, cyOff, ctxOff, ctyOff, -1, cTColorDisabled.r, cTColorDisabled.g, cTColorDisabled.b, 1);
      [*] = ;   SetGUIElementVisibleProperties(elmHnd, 'CheckOnProperty', cMaterialCheckbox+'.checked', cxOff, cyOff, ctxOff, ctyOff, curind, cTColorChecked.r, cTColorChecked.g, cTColorChecked.b, 1);
      [*] = ;   Result := elmHnd;
      [*] = ;end;
      [*] = ;
      [*] = ;if (gInterface.gamemode<>gc_gamemode_mainmenu) or (gInternetShell.bshowroom) then
      [*] = ;exit;
      [*] = ;
      [*] = ;var cMedal1W : Integer = GetGUITextureWidth('net.client.award.3');
      [*] = ;var cMedal2W : Integer = GetGUITextureWidth('net.client.award.rank1');
      [*] = ;var cMedal3W : Integer = GetGUITextureWidth('net.client.award.seasonclash.medal.1');
      [*] = ;var cMedal4W : Integer = GetGUITextureWidth('net.client.award.streamer.1');
      [*] = ;var cMedal5W : Integer = GetGUITextureWidth('net.client.award.seasonclash.medal.1');
      [*] = ;var cMedal6W : Integer = GetGUITextureWidth('net.client.award.seasonclash.medal.1');
      [*] = ;
      [*] = ;procedure FormatePlayerMedalsString(lanid : Integer; bShowEB, bIsEB : Boolean; var medals : String);
      [*] = ;begin
      [*] = ;   var cMedal1 : String = 'net.client.award.3'; // early-bird
      [*] = ;   var cMedal2 : String = 'net.client.award.rank'; // rank + suffix
      [*] = ;   var cMedal3 : String = 'net.client.award.seasonclash.medal.'; // + suffix, seasonclash 02.07.17
      [*] = ;   var cMedal4 : String = 'net.client.award.streamer.2'; // stream
      [*] = ;   var cMedal5 : String = 'net.client.award.seasonclash.medal.'; // + suffix, seasonclash 02.07.17
      [*] = ;   var cMedal6 : String = 'net.client.award.seasonclash.medal.'; // + suffix, seasonclash 02.07.17
      [*] = ;   var medal1 : String;
      [*] = ;   if (bIsEB) then
      [*] = ;   medal1 := cMedal1;
      [*] = ;   var medal2, medal3, medal4, medal5, medal6 : String;
      [*] = ;
      [*] = ;   var bestplace : Integer = 100;
      [*] = ;   case lanid of // season 1
      [*] = ;      2734 : begin // [GFF]Petru_BwM
      [*] = ;         medal2 := cMedal2+'1';
      [*] = ;         medal3 := cMedal3+'2';
      [*] = ;         bestplace := 1;
      [*] = ;      end;
      [*] = ;      40409 : begin // HYPPS
      [*] = ;         medal2 := cMedal2+'2';
      [*] = ;         bestplace := 2;
      [*] = ;      end;
      [*] = ;      32356 : begin // nazariy81
      [*] = ;         medal2 := cMedal2+'3';
      [*] = ;         bestplace := 3;
      [*] = ;      end;
      [*] = ;      44833 : begin // [1S]SecretPlayer
      [*] = ;         medal2 := cMedal2+'4.10';
      [*] = ;         medal6 := cMedal6+'3';
      [*] = ;         bestplace := 4;
      [*] = ;      end;
      [*] = ;      1718 : begin // [-RA-]SAnek_PCT
      [*] = ;         medal2 := cMedal2+'11.30';
      [*] = ;         medal3 := cMedal3+'1';
      [*] = ;         bestplace := 5;
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      32628, 7055, 66299, 10808, 3293, 31947 : begin
      [*] = ;         medal2 := cMedal2+'4.10';
      [*] = ;         bestplace := 4;
      [*] = ;      end;
      [*] = ;      74517, 30397, 20555, 3492, 63322, 15393, 67030, 24599, 19967, 65328, 71845, 56564, 1312, 23380, 34112, 32218, 6333, 45522, 52981 : begin
      [*] = ;         medal2 := cMedal2+'11.30';
      [*] = ;         bestplace := 5;
      [*] = ;      end;
      [*] = ;      8157 : begin // Antik
      [*] = ;         medal2 := cMedal2+'31.60';
      [*] = ;         medal4 := cMedal4;
      [*] = ;         bestplace := 6;
      [*] = ;      end;
      [*] = ;      6214 : begin // LordEagle
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      23930 : begin // AHATOJLb
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      3387, 47227, 2408, 25232, 1107, 9518, 32064, 11985, 75956, 24924, 8699, 12131, 2666, 453, 857, {8157,} 23969, 35633, 23262, 58003, 56643, 362, 77507, 398, 20471, 13563, 343, 9691, 34175, 85494 : begin
      [*] = ;         medal2 := cMedal2+'31.60';
      [*] = ;         bestplace := 6;
      [*] = ;      end;
      [*] = ;      76572, 50002, 53107, 18896, 78090, 48500, 30239, 13229, 69390, 10897, 50568, 14033, 24508, 2042, 79403, 72654, 2502, 27126, 5978, 43811, 38324, 7619, 33512, 74029, 35623, 24358, 13189, 55708, 19553, 38022, 32966, 21496, 32943, 65931, 15694, 33407, 26642, 5438, 24200, 69549 : begin
      [*] = ;         medal2 := cMedal2+'61.100';
      [*] = ;         bestplace := 7;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   case lanid of // Season 2
      [*] = ;      3293 : begin // [-NF-]Baton
      [*] = ;         if (bestplace>1) then
      [*] = ;         medal2 := cMedal2+'1';
      [*] = ;         medal3 := cMedal3+'3';
      [*] = ;         if (bestplace>1) then
      [*] = ;         bestplace := 1;
      [*] = ;      end;
      [*] = ;      20555 : begin // [-UNION-]Artempro
      [*] = ;         if (bestplace>2) then
      [*] = ;         medal2 := cMedal2+'2';
      [*] = ;         if (bestplace>2) then
      [*] = ;         bestplace := 2;
      [*] = ;      end;
      [*] = ;      6397 : begin // [BRP]Balin
      [*] = ;         if (bestplace>3) then
      [*] = ;         medal2 := cMedal2+'3';
      [*] = ;         if (bestplace>3) then
      [*] = ;         bestplace := 3;
      [*] = ;      end;
      [*] = ;      1718 : begin // [-RA-]SAnek_PCT
      [*] = ;         if (bestplace>4) then
      [*] = ;         medal2 := cMedal2+'4.10';
      [*] = ;         medal5 := cMedal5+'1';
      [*] = ;         if (bestplace>4) then
      [*] = ;         bestplace := 4;
      [*] = ;         //medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      44833 : begin // [-UNION-]Fenrir
      [*] = ;         //medal2 := cMedal2+'4.10';
      [*] = ;         medal5 := cMedal5+'2';
      [*] = ;         if (bestplace>4) then
      [*] = ;         bestplace := 4;
      [*] = ;      end;
      [*] = ;      2408, 2734, 1718, 16787, 44833, 95551, 42235 : begin
      [*] = ;         if (bestplace>4) then
      [*] = ;         medal2 := cMedal2+'4.10';
      [*] = ;         if (bestplace>4) then
      [*] = ;         bestplace := 4;
      [*] = ;      end;
      [*] = ;      50407, 14033, 1312, 9005, 172, 91715, 32628, 21983, 6444, 82655, 96611, 1043, 37118, 97298, 95267, 18896, 44262, 412, 4877, 14162 : begin
      [*] = ;         if (bestplace>5) then
      [*] = ;         medal2 := cMedal2+'11.30';
      [*] = ;         if (bestplace>5) then
      [*] = ;         bestplace := 5;
      [*] = ;      end;
      [*] = ;      16692, 3492, 857, 34112, 8157, 34406, 42131, 67030, 45024, 83110, 758, 9691, 72654, 48509, 81706, 75266, 362, 58003, 86806, 69380, 21496, 46821, 10808, 157, 15393, 7619, 93473, 63322, 82831, 28326 : begin
      [*] = ;         if (bestplace>6) then
      [*] = ;         medal2 := cMedal2+'31.60';
      [*] = ;         if (bestplace>6) then
      [*] = ;         bestplace := 6;
      [*] = ;      end;
      [*] = ;      1851, 28611, 51424, 78572, 98884, 8330, 2042, 79403, 43945, 87975, 37952, 38021, 25232, 70183, 52981, 4087, 1451, 77863, 89295, 17735, 7505, 91731, 867, 24924, 563, 94014, 41143, 77809, 35633, 74517, 32690, 6904, 97417, 87860, 54850, 30397, 32064, 45446, 51322, 23533 : begin
      [*] = ;         if (bestplace>7) then
      [*] = ;         medal2 := cMedal2+'61.100';
      [*] = ;         if (bestplace>7) then
      [*] = ;         bestplace := 7;
      [*] = ;      end;
      [*] = ;      35657 : begin // Miyconst
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      6152 : begin // Konda
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      5779 : begin // [-UNION-]VOIN
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   case lanid of // Season 3
      [*] = ;      20555 : begin // [-UNION-]Artempro
      [*] = ;         if (bestplace>1) then
      [*] = ;         medal2 := cMedal2+'1';
      [*] = ;         medal3 := cMedal3+'1';
      [*] = ;      end;
      [*] = ;      2734 : begin // [GFF]Petru_BwM
      [*] = ;         if (bestplace>2) then
      [*] = ;         medal2 := cMedal2+'2';
      [*] = ;      end;
      [*] = ;      50478 : begin // XXX-LEX
      [*] = ;         if (bestplace>3) then
      [*] = ;         medal2 := cMedal2+'3';
      [*] = ;      end;
      [*] = ;      44833 : begin // [-UNION-]Fenrir
      [*] = ;         //medal2 := cMedal2+'11.30';
      [*] = ;         medal3 := cMedal3+'2';
      [*] = ;      end;
      [*] = ;      14033 : begin // colourfit
      [*] = ;         //medal2 := cMedal2+'11.30';
      [*] = ;         medal3 := cMedal3+'3';
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;      42235, 37118, 78823, 100022, 21983, 412, 69380 : begin
      [*] = ;         if (bestplace>4) then
      [*] = ;         medal2 := cMedal2+'4.10';
      [*] = ;      end;
      [*] = ;      6444, 4877, 1718, 77863, 14033, 44833, 1312, 16787, 70035, 3492, 7505, 3293, 74550, 89295, 86806, 111978, 105740, 78572, 362, 82655: begin
      [*] = ;         if (bestplace>5) then
      [*] = ;         medal2 := cMedal2+'11.30';
      [*] = ;      end;
      [*] = ;      67030, 58003, 91715, 32628, 107668, 81706, 66299, 6904, 104201, 3639, 82678, 82831, 48270, 83110, 86504, 34968, 867, 85429, 9005, 7619, 34112, 51424, 107400, 758, 77809, 157, 13723, 63322, 95618, 51322: begin
      [*] = ;         if (bestplace>6) then
      [*] = ;         medal2 := cMedal2+'31.60';
      [*] = ;      end;
      [*] = ;      82714, 6397, 6152, 3730, 1043, 58816, 32218, 95551, 43945, 43346, 72446, 32927, 97417, 112572, 42131, 16022, 114089, 83951, 1451, 53731, 56264, 109361, 23919, 13064, 79809, 17735, 94336, 70183, 74637, 45446, 104621, 99442, 47227, 29320, 110615, 62008, 5978, 5340, 4769, 28326 : begin
      [*] = ;         if (bestplace>7) then
      [*] = ;         medal2 := cMedal2+'61.100';
      [*] = ;      end;
      [*] = ;      35657 : begin // search for AlexD20
      [*] = ;         medal4 := cMedal4;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   case lanid of // season 4
      [*] = ;      1718 : begin
      [*] = ;         medal6 := cMedal6+'1';
      [*] = ;         if (bestplace>5) then
      [*] = ;         begin
      [*] = ;            bestplace := 5;
      [*] = ;            medal2 := cMedal2+'11.30';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      27204 : begin
      [*] = ;         medal3 := cMedal3+'1';
      [*] = ;         if (bestplace>6) then
      [*] = ;         begin
      [*] = ;            bestplace := 6;
      [*] = ;            medal2 := cMedal2+'31.60';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      45024 : begin
      [*] = ;         if (bestplace>1) then
      [*] = ;         begin
      [*] = ;            bestplace := 1;
      [*] = ;            medal2 := cMedal2+'1';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      69519 : begin
      [*] = ;         if (bestplace>2) then
      [*] = ;         begin
      [*] = ;            bestplace := 2;
      [*] = ;            medal2 := cMedal2+'2';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      2734 : begin
      [*] = ;         medal5 := cMedal5+'2';
      [*] = ;         if (bestplace>3) then
      [*] = ;         begin
      [*] = ;            bestplace := 3;
      [*] = ;            medal2 := cMedal2+'3';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      27126 : begin
      [*] = ;         medal3 := cMedal3+'2';
      [*] = ;         if (bestplace>5) then
      [*] = ;         begin
      [*] = ;            bestplace := 5;
      [*] = ;            medal2 := cMedal2+'11.30';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      83951 : begin
      [*] = ;         medal3 := cMedal3+'3';
      [*] = ;         if (bestplace>5) then
      [*] = ;         begin
      [*] = ;            bestplace := 5;
      [*] = ;            medal2 := cMedal2+'11.30';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      74582 : begin
      [*] = ;         medal3 := cMedal3+'3';
      [*] = ;         if (bestplace>5) then
      [*] = ;         begin
      [*] = ;            bestplace := 5;
      [*] = ;            medal2 := cMedal2+'11.30';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      //4-10
      [*] = ;      78572, 4877, 31947, 70035, 5340, 14033, 109361 : begin
      [*] = ;         if (bestplace>4) then
      [*] = ;         begin
      [*] = ;            bestplace := 4;
      [*] = ;            medal2 := cMedal2+'4.10';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      //11-30
      [*] = ;      95502, 108828, 42235, 20555, 32356, {27126, }{1718, }{83951,} 77863, 1312, 58003, 56264, 26027, 1851, 89295, 86806, 96611, 3293, 74934{, 74582} : begin
      [*] = ;         if (bestplace>5) then
      [*] = ;         begin
      [*] = ;            bestplace := 5;
      [*] = ;            medal2 := cMedal2+'11.30';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      //31-60
      [*] = ;      130075, 88204, 9005, 86869, 82655, 44833, 101781, 92169, 133760, 41353, 43346, 75956, 48951, 85429, 128765, {27204,} 32218, 69380, 116382, 113532, 412, 133841, 43945, 41208, 7665, 125989, 50676, 107668, 48270, 111899 : begin
      [*] = ;         if (bestplace>6) then
      [*] = ;         begin
      [*] = ;            bestplace := 6;
      [*] = ;            medal2 := cMedal2+'31.60';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      //61-100
      [*] = ;      49769, 11113, 2408, 9493, 115657, 17119, 79809, 3875, 89248, 64668, 127212, 92620, 10808, 2042, 52981, 89152, 78823, 135649, 107992, 103477, 78838, 22468, 124328, 121099, 104621, 37118, 32875, 24796, 75266, 98040, 88559, 48500, 75876, 51424, 27651, 19841, 21813, 95732, 103543, 3387 : begin
      [*] = ;         if (bestplace>7) then
      [*] = ;         begin
      [*] = ;            bestplace := 7;
      [*] = ;            medal2 := cMedal2+'61.100';
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   if medal2='' and medal4<>'' then
      [*] = ;   begin
      [*] = ;      medal2 := medal4;
      [*] = ;      medal4 := '';
      [*] = ;   end;
      [*] = ;   if bShowEB then
      [*] = ;   medals := medal4+#9+medal6+#9+medal5+#9+medal3+#9+medal2+#9+medal1
      [*] = ;   else
      [*] = ;   medals := #9+medal4+#9+medal6+#9+medal5+#9+medal3+#9+medal2;
      [*] = ;end;
      [*] = ;
      [*] = ;procedure CalcQuickPlayCount();
      [*] = ;begin
      [*] = ;   var p : Pointer = gQuickPlay;
      [*] = ;   if p<>nil then
      [*] = ;   FillMem(p, SizeOf(gQuickPlay), 0);
      [*] = ;
      [*] = ;   var bexists : Boolean;
      [*] = ;   var i : Integer;
      [*] = ;   for i:=0 to gInternetShell.sessions.GetCount-1 do
      [*] = ;   begin
      [*] = ;      var psession : Pointer = gInternetShell.sessions.Get(i);
      [*] = ;      if (psession<>nil) then
      [*] = ;      begin
      [*] = ;         var visiblename, pass, roomchecksum : String;
      [*] = ;         _misc_GetGameNameAndPasswordBySession(psession, visiblename, pass, roomchecksum);
      [*] = ;         if (not TInternetShellSession(psession).blocked) then
      [*] = ;         begin
      [*] = ;            if (pass=gc_quickplay_roompass) then
      [*] = ;            begin
      [*] = ;               var code : String = SubStr(visiblename, 0, 3);
      [*] = ;               var searchcode, altsearchcode : String;
      [*] = ;               if gInternetShell.qprankedgame then
      [*] = ;               begin
      [*] = ;                  searchcode := 'qs=';
      [*] = ;                  altsearchcode := 'qz=';
      [*] = ;               end
      [*] = ;               else
      [*] = ;               begin
      [*] = ;                  searchcode := 'qz=';
      [*] = ;                  altsearchcode := 'qs=';
      [*] = ;               end;
      [*] = ;               if (code=searchcode) or (code=altsearchcode) then // quick search - alone player that looking for quick play
      [*] = ;               begin
      [*] = ;                  var str : String = SubStr(visiblename, 4, StrLength(visiblename)-3);
      [*] = ;                  if IsDelimiterCharExists(str, gc_gui_dotchar) then
      [*] = ;                  begin
      [*] = ;                     var masterid, time : Integer;
      [*] = ;                     case GetDelimiterStringCount(str, gc_gui_dotchar, gc_gui_quotechar) of
      [*] = ;                        1 : masterid := StrToInt(GetDelimiterStringByIndex(str, gc_gui_dotchar, gc_gui_quotechar, 0));
      [*] = ;                        2 : begin
      [*] = ;                           masterid := StrToInt(GetDelimiterStringByIndex(str, gc_gui_dotchar, gc_gui_quotechar, 0));
      [*] = ;                           time := StrToInt(GetDelimiterStringByIndex(str, gc_gui_dotchar, gc_gui_quotechar, 1));
      [*] = ;                        end;
      [*] = ;                     end;
      [*] = ;                     var checksum : String = SubStr(roomchecksum, 2, 4);
      [*] = ;                     if (checksum=gstring_checksum) then
      [*] = ;                     begin
      [*] = ;                        if code=searchcode then
      [*] = ;                        begin
      [*] = ;                           if masterid=LanMyInfoID then
      [*] = ;                           bexists := True;
      [*] = ;                           gQuickPlay.AddPlayer(masterid, time, checksum);
      [*] = ;                        end
      [*] = ;                        else
      [*] = ;                        gQuickPlayHideIcon.Add(masterid);
      [*] = ;                     end;
      [*] = ;                  end;
      [*] = ;               end;
      [*] = ;            end
      [*] = ;            else
      [*] = ;            if (SubStr(roomchecksum, 1, 1)='r') then // quick custom - custom room for quick search, contains list of ids in name
      [*] = ;            begin
      [*] = ;               var sclientid1, sclientid2, stime, sqpstate, checksum : String;
      [*] = ;               var mapname : String = TInternetShellSession(psession).mapname;
      [*] = ;               if (GetDelimiterStringCount(mapname, gc_gui_delimiterchar, gc_gui_quotechar)>8) then
      [*] = ;               begin
      [*] = ;                  sclientid1 := GetDelimiterStringByIndex(mapname, gc_gui_delimiterchar, gc_gui_quotechar, 6);
      [*] = ;                  sclientid2 := GetDelimiterStringByIndex(mapname, gc_gui_delimiterchar, gc_gui_quotechar, 7);
      [*] = ;                  stime := GetDelimiterStringByIndex(mapname, gc_gui_delimiterchar, gc_gui_quotechar, 8);
      [*] = ;                  sqpstate := GetDelimiterStringByIndex(mapname, gc_gui_delimiterchar, gc_gui_quotechar, 9);
      [*] = ;               end;
      [*] = ;               checksum := SubStr(roomchecksum, 2, 4);;
      [*] = ;               var qpstate : Integer = StrToInt(sqpstate);
      [*] = ;               if (qpstate>0) and ((checksum='') or (checksum=gstring_checksum)) then
      [*] = ;               begin
      [*] = ;                  var masterid : Integer = TInternetShellSession(psession).masterid;
      [*] = ;                  var clientid1 : Integer = StrToInt(sclientid1);
      [*] = ;                  var clientid2 : Integer = StrToInt(sclientid2);
      [*] = ;                  var time : Integer = StrToInt(stime);
      [*] = ;                  var count : Integer;
      [*] = ;                  if not bexists and ((masterid=LanMyInfoID) or (clientid1=LanMyInfoID) or (clientid2=LanMyInfoID)) then
      [*] = ;                  bexists := True;
      [*] = ;                  if (masterid>0) then count := count+1;
      [*] = ;                  if (clientid1>0) then count := count+1;
      [*] = ;                  if (clientid2>0) then count := count+1;
      [*] = ;                  if (masterid<>0) and (count=TInternetShellSession(psession).clientscount) and (masterid=TInternetShellSession(psession).masterid) then
      [*] = ;                  begin
      [*] = ;                     if (count>1) then
      [*] = ;                     gQuickPlay.AddSession(masterid, clientid1, clientid2, time)
      [*] = ;                     else
      [*] = ;                     gQuickPlay.AddPlayer(masterid, time, checksum);
      [*] = ;                  end;
      [*] = ;               end;
      [*] = ;            end;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;   if (not bexists) and (gInternetShell.bautosearch) then
      [*] = ;   gQuickPlay.AddPlayer(LanMyInfoID, 0, gstring_checksum);
      [*] = ;end;
      [*] = ;
      [*] = ;// _gui_CreateListBox
      [*] = ;//
      [*] = ;function _gui_CreateListBox(const elementName : String; parent : Integer; hAlign, vAlign : Integer; posX, posY, width, height : Integer; textHAlign, textVAlign : Integer; tOffX, tOffY, font : Integer; var eventState : String; bAddScroller, bGetUpdate : Boolean) : Integer;
      [*] = ;begin
      [*] = ;   Result := 0;
      [*] = ;   if (bGetUpdate) and (elementName='') then log('_gui_Create function with bGet flag must have specified elementName, to work properly');
      [*] = ;   if (elementName<>'') and (StrExists(elementName, '.')) then ErrorLog('_gui_Create element name should not have dot char. I this ca.se we are not able to get element handle by name. elmname='+elementName);
      [*] = ;
      [*] = ;   var rfont : String = gUIConst.font[font];
      [*] = ;   if (font=gc_font_none) then
      [*] = ;   rfont := gUIConst.font[gc_font_serif_12];
      [*] = ;   var cMaterialMiddle : String = 'combobox.background.'+IntToStr(floor(1+RandomExt*6));
      [*] = ;   const cMaterialBtn = 'combobox.btn.pressed';
      [*] = ;   const cMaterialListSelected = 'combobox.list.selected';
      [*] = ;   const cMaterialListHover = 'combobox.list.hover';
      [*] = ;   const cMaterialListBackground = 'combobox.list.background';
      [*] = ;   const cMaterialScrollerUp = 'scroller.btn.up';
      [*] = ;   const cMaterialScrollerTile = 'scroller.tile';
      [*] = ;   const cMaterialScrollerDown = 'scroller.btn.down';
      [*] = ;   var rowHeight : Integer = GetGUIElementFontHeight(rfont)+4;
      [*] = ;
      [*] = ;   var iposX : Integer = posX;
      [*] = ;   var iposY : Integer = posY;
      [*] = ;
      [*] = ;   var iwidth : Integer;
      [*] = ;   if (width<>0) then
      [*] = ;   iwidth := width
      [*] = ;   else
      [*] = ;   iwidth := GetGUIElementWidth(parent);
      [*] = ;
      [*] = ;   iwidth := iwidth-GetGUITextureWidth(cMaterialScrollerTile);
      [*] = ;
      [*] = ;   var iheight : Integer;
      [*] = ;   if (height<>0) then
      [*] = ;   iheight := height
      [*] = ;   else
      [*] = ;   iheight := GetGUIElementHeight(parent);
      [*] = ;
      [*] = ;   var color : TColor;
      [*] = ;   var colorhover : TColor;
      [*] = ;   _gui_SetupTColorInteger(255, 220, 170, 255, 0.875, color);
      [*] = ;   _gui_SetupTColorInteger(255, 220, 170, 255, 1, colorhover);
      [*] = ;
      [*] = ;   // - setup combobox
      [*] = ;   if (bGetUpdate) then
      [*] = ;   Result := GetGUIElementIndexByNameParent(elementName, parent);
      [*] = ;
      [*] = ;   if (Result=0) then
      [*] = ;   Result := AddNewElementByClassNameParent(elementName, 'TXGuiListBox', 0, parent);
      [*] = ;   SetGUIElementCursorByName(Result, 'crPress');
      [*] = ;   SetGUIElementPressState(Result, eventState);
      [*] = ;   SetGUIElementFont(Result, rfont);
      [*] = ;   SetGUIElementColor(Result, color.r, color.g, color.b, color.a);
      [*] = ;   SetGUIElementTextAlign(Result, gUIConst.halign[textHAlign], gUIConst.valign[textVAlign], tOffX, tOffY-1);
      [*] = ;   SetGUIElementTextFormatted(Result, True);
      [*] = ;   SetGUIElementAlign(Result, gUIConst.halign[hAlign], gUIConst.valign[vAlign]);
      [*] = ;   SetGUIElementPosition(Result, iposX, iposY);
      [*] = ;   SetGUIElementLogicRect(Result, iwidth, iheight);
      [*] = ;   SetGUIElementRect(Result, iwidth, iheight);
      [*] = ;   SetGUIElementMaterial(Result, gc_gui_material_blank{cMaterialMiddle});
      [*] = ;
      [*] = ;   SetGUIListBoxSelectedMaterialName(Result, cMaterialListSelected); // selected
      [*] = ;   SetGUIListBoxRowHeight(Result, rowHeight);
      [*] = ;   SetGUIListBoxVisibleRows(Result, -1);
      [*] = ;   SetGUIListBoxItemIndexSilent(Result, -1);
      [*] = ;
      [*] = ;   SetGUIListBoxMouseTrack(Result, 3); // 1 - only text change color on hover, 2 - only material appears, 3 - text and material on hover
      [*] = ;   SetGUIListBoxMouseTrackMaterialName(Result, cMaterialListHover); // hover
      [*] = ;   SetGUIListBoxMouseTrackFontColor(Result, colorhover.r, colorhover.g, colorhover.b, colorhover.a);
      [*] = ;
      [*] = ;   if (bAddScroller) then
      [*] = ;   _gui_AddScroller(Result, gc_halParentRightWidth, gc_valParentTop, GetGUITextureWidth(cMaterialScrollerTile), GetGUITextureHeight(cMaterialScrollerUp), GetGUITextureWidth(cMaterialScrollerTile), GetGUIElementHeight(Result), True);
      [*] = ;end;
      [*] = ;
      [*] = ;const bupdate = True;
      [*] = ;const currentstatename = 'ShowInternetShell';
      [*] = ;var elmname, showstate, eventstate : String;
      [*] = ;_misc_GetGUIShowEventStateNames(currentstatename, elmname, showstate, eventstate);
      [*] = ;
      [*] = ;dbgstatename := showstate;
      [*] = ;
      [*] = ;const cmargin = 6;
      [*] = ;const cmargin0 = cmargin*0;
      [*] = ;const cmargin1 = cmargin*1;
      [*] = ;const cmargin2 = cmargin*2;
      [*] = ;const cmargin3 = cmargin*3;
      [*] = ;const cmargin4 = cmargin*4;
      [*] = ;const cmargin5 = cmargin*5;
      [*] = ;const cmargin6 = cmargin*6;
      [*] = ;const cmargin7 = cmargin*7;
      [*] = ;const cmargin8 = cmargin*8;
      [*] = ;const cmargin9 = cmargin*9;
      [*] = ;const cmargin10 = cmargin*10;
      [*] = ;
      [*] = ;const cTagCreateRoom = 102;
      [*] = ;const cTagJoinRoom = 103;
      [*] = ;const cTagLeaveRoom = 104;
      [*] = ;const cTagCloseRoom = 106;
      [*] = ;const cTagSwitchToRoom = 107;
      [*] = ;const cTagRanking = 108;
      [*] = ;const cTagProfile = 109;
      [*] = ;const cTagToSimple = 110;
      [*] = ;const cTagToAdvanced = 111;
      [*] = ;const cTagAutoSearch = 112;
      [*] = ;const cTagStopAutoSearch = 113;
      [*] = ;const cTagAutoSearchSettings = 114;
      [*] = ;const cTagAutoSearchApprove = 115;
      [*] = ;const cTagAutoSearchCancel = 116;
      [*] = ;const cTagAutoSearchJoin = 117;
      [*] = ;const cTagToRooms = 118;
      [*] = ;const cTagNotTraining = 119;
      [*] = ;const cTagChangeProfile = 120;
      [*] = ;
      [*] = ;//var cWidth : Integer = 1018;//GetViewerWidth-10;
      [*] = ;//var cHeight : Integer = 624;//GetViewerHeight-12;
      [*] = ;var cHeadOffset : Integer = 22;
      [*] = ;var cWidth : Integer = 1280{GetViewerWidth}-18;
      [*] = ;var cHeight : Integer = 782{GetViewerHeight}-12-cHeadOffset;
      [*] = ;//cWidth := floor(1018*1.2);
      [*] = ;//cHeight := floor(624*1.2); //624
      [*] = ;//cWidth := 1200;
      [*] = ;cWidth := 1018+220;
      [*] = ;cHeight := 750;
      [*] = ;cHeadOffset := 0;
      [*] = ;//cwidth{1018}, cheight{624}
      [*] = ;const cSessionsMarginLeft = 58+4;
      [*] = ;const cSessionsMarginTop = 56+1;
      [*] = ;const cSessionsPlayersStep = 24;
      [*] = ;const cSessionsChatMinStep = 64;
      [*] = ;const cPlayersMarginRight = 58+3;
      [*] = ;const cPlayersMarginBottom = 64;
      [*] = ;const cChatMarginBottom = 64-1;
      [*] = ;const cInputBoxHeight = 39;
      [*] = ;const cScrollWOff = 26;
      [*] = ;const cPlayersW = 290-cScrollWOff+18;
      [*] = ;var cSessionW : Integer = cWidth-(cSessionsMarginLeft+cScrollWOff+cSessionsPlayersStep+cPlayersW+cScrollWOff+cmargin*2+cPlayersMarginRight);
      [*] = ;
      [*] = ;var cTextInternetShellHeader : String = GetLocaleTableListItemByID('gui', 'menu.btn.internetshell');
      [*] = ;var cTextCreateRoom : String = 'gui|menu.btn.createroom';
      [*] = ;var cTextJoinRoom : String = 'gui|menu.btn.joinroom';
      [*] = ;var cTextLeaveRoom : String = 'gui|customgame.btn.leaveroom';
      [*] = ;var cTextStartRoom : String = 'gui|menu.btn.startgame';
      [*] = ;var cTextCloseRoom : String = 'gui|customgame.btn.closeroom';
      [*] = ;var cTextSwitchToRoom : String = 'gui|customgame.btn.switchtoroom';
      [*] = ;
      [*] = ;var cTextRanking : String; _misc_GetNewTextLocale('internetshell.btn.ranking', cTextRanking);
      [*] = ;var cTextProfile : String; _misc_GetNewTextLocale('internetshell.btn.profile', cTextProfile);
      [*] = ;var cTextToSimple : String; _misc_GetNewTextLocale('internetshell.btn.switchtosimple', cTextToSimple);
      [*] = ;var cTextToAdvanced : String; _misc_GetNewTextLocale('internetshell.btn.switchtoadvanced', cTextToAdvanced);
      [*] = ;var cTextAutoSearch : String; _misc_GetNewTextLocale('internetshell.btn.autosearch', cTextAutoSearch);
      [*] = ;var cTextStopAutoSearch : String; _misc_GetNewTextLocale('internetshell.btn.stopautosearch', cTextStopAutoSearch);
      [*] = ;var cTextAutoSearchSettings : String; _misc_GetNewTextLocale('internetshell.btn.autosearchsettings', cTextAutoSearchSettings);
      [*] = ;var cTextAutoSearchApprove : String; _misc_GetNewTextLocale('internetshell.btn.autosearchapprove', cTextAutoSearchApprove);
      [*] = ;var cTextAutoSearchCancel : String; _misc_GetNewTextLocale('internetshell.btn.autosearchcancel', cTextAutoSearchCancel);
      [*] = ;var cTextAutoSearchRoom : String; _misc_GetNewTextLocale('internetshell.text.autosearchroom', cTextAutoSearchRoom);
      [*] = ;var cTextAutoSearchJoin : String; _misc_GetNewTextLocale('internetshell.btn.joinautosearch', cTextAutoSearchJoin);
      [*] = ;var cTextApproxTime : String; _misc_GetNewTextLocale('internetshell.text.approxtime', cTextApproxTime);
      [*] = ;var cTextApproxTimeUnknown : String; _misc_GetNewTextLocale('internetshell.text.approxtimeunknown', cTextApproxTimeUnknown);
      [*] = ;var cTextToRooms : String; _misc_GetNewTextLocale('internetshell.btn.torooms', cTextToRooms);
      [*] = ;var cTextDisabledWhenMods : String; _misc_GetNewTextLocale('internet.button.disabledwhenmods', cTextDisabledWhenMods);
      [*] = ;var cTextHeaderChangeProfile : String = GetLocaleTableListItemByID('gui', 'internet.changeprofile');
      [*] = ;
      [*] = ;var cTextRatingRoom : String; _misc_GetNewTextLocale('internet.button.makeratingroom', cTextRatingRoom);
      [*] = ;var cTextRatingRoomHint : String; _misc_GetNewTextLocale('internet.button.makeratingroomhint', cTextRatingRoomHint);
      [*] = ;
      [*] = ;var cTextQuickPlayHint : String;
      [*] = ;if (gint_quickplay_countofplayers=4) then
      [*] = ;_misc_GetNewTextLocale('internetshell.btn.quickplay.hint2', cTextQuickPlayHint)
      [*] = ;else
      [*] = ;_misc_GetNewTextLocale('internetshell.btn.quickplay.hint', cTextQuickPlayHint);
      [*] = ;var cTextCreateRoomHint : String; _misc_GetNewTextLocale('internetshell.btn.createroom.hint', cTextCreateRoomHint);
      [*] = ;var cTextJoinRoomHint : String; _misc_GetNewTextLocale('internetshell.btn.joinroom.hint', cTextJoinRoomHint);
      [*] = ;var cTextRankingHint : String; _misc_GetNewTextLocale('internetshell.btn.ranking.hint', cTextRankingHint);
      [*] = ;var cTextChangeProfileHint : String = GetLocaleTableListItemByID('gui', 'internet.changeprofile.hint');
      [*] = ;
      [*] = ;gInternetShell.showrankingseasonoffset := 1;
      [*] = ;var bShowNewSeason : Boolean = (gInternetShell.showrankingseasonoffset=1);
      [*] = ;if (not bShowNewSeason) then
      [*] = ;begin
      [*] = ;   var cTextRatingClosedHint : String; _misc_GetNewTextLocale('ratingisclosed.season4', cTextRatingClosedHint);
      [*] = ;   cTextRankingHint := cTextRatingClosedHint+gc_gui_breakline+gc_gui_breakline+cTextRankingHint;
      [*] = ;   cTextQuickPlayHint := cTextRatingClosedHint+gc_gui_breakline+gc_gui_breakline+cTextQuickPlayHint;
      [*] = ;   cTextRatingRoomHint := cTextRatingClosedHint+gc_gui_breakline+gc_gui_breakline+cTextRatingRoomHint;
      [*] = ;end;
      [*] = ;
      [*] = ;const bTestMode = False;
      [*] = ;const bSeason4GoingToEnd = False;
      [*] = ;if (bTestMode) then
      [*] = ;begin
      [*] = ;   var cTextTestModeHint : String; _misc_GetNewTextLocale('internetshell.quickplay.testmode', cTextTestModeHint);
      [*] = ;   //var cTextTestModeSoonHint : String; _misc_GetNewTextLocale('internetshell.quickplay.testmode.soon', cTextTestModeSoonHint);
      [*] = ;   cTextQuickPlayHint := cTextQuickPlayHint+gc_gui_breakline+gc_gui_breakline+cTextTestModeHint{+gc_gui_breakline+gc_gui_breakline+cTextTestModeSoonHint};
      [*] = ;end;
      [*] = ;
      [*] = ;if (bSeason4GoingToEnd) then
      [*] = ;begin
      [*] = ;   var cTextSeason4GoingToEndHint : String; _misc_GetNewTextLocale('internetshell.season5.start', cTextSeason4GoingToEndHint);
      [*] = ;   //var cTextTestModeSoonHint : String; _misc_GetNewTextLocale('internetshell.quickplay.testmode.soon', cTextTestModeSoonHint);
      [*] = ;   cTextQuickPlayHint := cTextSeason4GoingToEndHint+gc_gui_breakline+gc_gui_breakline+cTextQuickPlayHint;
      [*] = ;   cTextRankingHint := cTextSeason4GoingToEndHint+gc_gui_breakline+gc_gui_breakline+cTextRankingHint;
      [*] = ;end;
      [*] = ;
      [*] = ;// variables
      [*] = ;var elmHnd : Integer;
      [*] = ;var nul, text : String;
      [*] = ;var color : TColor;
      [*] = ;//var color, btncolor : TColor;
      [*] = ;//_gui_SetupTColorInteger(48, 32, 32, 255, 1, color);
      [*] = ;//_gui_SetupTColorInteger(255, 220, 170, 255, 0.9, btncolor);
      [*] = ;_gui_SetupTColorInteger(255, 220, 170, 255, 0.9, color);
      [*] = ;
      [*] = ;// parent
      [*] = ;var dpiscale : Float = _gui_GetAbsScaleByDPI(0, 0);
      [*] = ;
      [*] = ;const cminwidth = 1280;
      [*] = ;if ((GetViewerWidth/dpiscale)<cminwidth) then
      [*] = ;dpiscale := GetViewerWidth/cminwidth;
      [*] = ;
      [*] = ;var elmParent : Integer = _gui_CreateParent(elmname, 0, gc_halMiddle, gc_valMiddle, 0, cHeadOffset div 2, cWidth, cHeight, bupdate);
      [*] = ;_gui_AbsScaleByDPI(elmParent);
      [*] = ;_gui_SetAbsScale(elmParent, dpiscale);
      [*] = ;
      [*] = ;//var elmMask : Integer = _gui_CreateImage('blackmask', elmParent, gc_gui_material_black, gc_halParentLeft, gc_valParentTop, 0, 0, GetViewerWidth, GetViewerHeight, 0, bupdate);
      [*] = ;var elmBackgroundParent : Integer = _gui_CreateParent('backgroundparent', elmParent, gc_halMiddle, gc_valMiddle, 0, 0, cWidth, cHeight, bupdate);
      [*] = ;var elmPlayers, elmSessions, elmRankings, elmChat : Integer;
      [*] = ;SetGUIElementUserBlend(elmHnd, 0.65);
      [*] = ;SetGUIElementPressState(elmParent, eventstate);
      [*] = ;
      [*] = ;CalcQuickPlayCount;
      [*] = ;
      [*] = ;const cPadding = cmargin1+1;
      [*] = ;const cStatusW = 25;
      [*] = ;const cLanIDW = 32+6;
      [*] = ;const cScrollW = 22;
      [*] = ;const cHeadTextFont = gc_font_serif_10;
      [*] = ;var skinHeadOffset : Integer = GetGUITextureHeight('skin.header.l')+5;
      [*] = ;var rowHeight : Integer = GetGUIElementFontHeight(gUIConst.font[gc_font_serif_12])+4;
      [*] = ;// players list
      [*] = ;begin
      [*] = ;   //const cClientsCountInList = 18;
      [*] = ;   var cClientsCountInList : Integer = (GetGUIElementHeight(elmParent)-(cPlayersMarginBottom+cSessionsMarginTop+skinHeadOffset)) div rowHeight;
      [*] = ;   const cClanW = 36;
      [*] = ;   elmPlayers := _gui_CreateSkinWindow('playersback', elmParent, gc_halParentRightWidth, gc_valParentTop, -cPlayersMarginRight-cScrollWOff, cSessionsMarginTop+skinHeadOffset, cPlayersW, rowHeight*cClientsCountInList+cPadding*2, 1, bupdate);
      [*] = ;   elmHnd := _gui_CreateSkinHeadWindow('sh_0', elmPlayers, gc_halParentLeft, gc_valParentTop, 0, -skinHeadOffset, GetGUIElementWidth(elmPlayers)+cScrollWOff, bupdate);
      [*] = ;   var nickW : Integer = GetGUIElementWidth(elmPlayers)-cPadding-cStatusW-cMedal6W-cMedal4W-cMedal3W-cMedal2W-cMedal1W-cClanW-cPadding-cPadding{-cLanIDW}-7-cScrollW;
      [*] = ;   text := GetLocaleTableListItemByID('misc', 'internetshell.status'); _gui_CreateText('t0', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, 0, 0, cStatusW+cPadding*2, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   text := GetLocaleTableListItemByID('misc', 'internetshell.players'); _gui_CreateText('t1', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+cPadding*3, 0, GetGUIElementWidth(elmHnd), 0, gc_halLeft, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   text := GetLocaleTableListItemByID('misc', 'internetshell.total')+': '+IntToStr(gInternetShell.clients.GetCount); _gui_CreateText('t2', elmHnd, text, gc_halParentRightWidth, gc_valParentMiddle, -cPadding, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_10, color, bupdate);
      [*] = ;   var elmPlayersList : Integer = _gui_CreateListBox('clients', elmPlayers, gc_halParentLeft, gc_valParentTop, 2, cmargin1, GetGUIElementWidth(elmPlayers)-cPadding*2+cPadding-2+cScrollWOff, GetGUIElementHeight(elmPlayers)-cPadding*2+1, gc_halLeft, gc_valMiddle, 0, 0, gc_font_serif_12, eventstate, False, bupdate);
      [*] = ;   // debug
      [*] = ;   //var k : Integer;
      [*] = ;   //for k:=GetGUIListBoxTabsCount(elmPlayersList) downto 0 do
      [*] = ;   //DeleteGUIListBoxTab(elmPlayersList, k);
      [*] = ;   var topIndex : Integer = GetGUIListBoxTopIndex(elmPlayersList);
      [*] = ;   var itemIndex : Integer = GetGUIListBoxItemIndex(elmPlayersList);
      [*] = ;   var bScrollToEnd : Boolean = (topIndex=(GetGUIListBoxItemsCount(elmPlayersList)-cClientsCountInList));
      [*] = ;   //var nickW : Integer = GetGUIElementWidth(elmPlayersList)-cPadding-cStatusW-cClanW-cScrollW;
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cPadding-2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cStatusW, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cPadding*2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, nickW, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cClanW, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal4W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal5W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal6W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal3W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal2W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cMedal1W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cPadding div 2, 'tsText');
      [*] = ;   //AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cLanIDW, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmPlayersList, 1, 1, 1, 1, cScrollW, 'tsText');
      [*] = ;   GUIListBoxClearSilent(elmPlayersList);
      [*] = ;
      [*] = ;   gShellSortOnlineMarked.Clear;
      [*] = ;   gShellSortOnline.Clear;
      [*] = ;   gShellSortPlayMarked.Clear;
      [*] = ;   gShellSortPlay.Clear;
      [*] = ;   var i, j, k : Integer;
      [*] = ;   for i:=0 to gInternetShell.clients.GetCount-1 do
      [*] = ;   begin
      [*] = ;      var pclient : Pointer = gInternetShell.clients.Get(i);
      [*] = ;      if (pclient<>nil) then
      [*] = ;      begin
      [*] = ;         var lanid : Integer = TInternetShellClient(pclient).lanid;
      [*] = ;         var icon : String;
      [*] = ;         var bShowMark : Boolean;
      [*] = ;         TInternetShellClient(pclient).ApplyDataFromInfo; // prepare .dlc, .pur, .score
      [*] = ;         var dlc : Integer = TInternetShellClient(pclient).dlc;
      [*] = ;         var pur : Integer = TInternetShellClient(pclient).pur;
      [*] = ;         if (dlc>0) and ((dlc and gc_lastknowndlc_earlybird)<>0) then
      [*] = ;         bShowMark := True
      [*] = ;         else
      [*] = ;         if (pur>0) and (pur<=gc_unixtime_earlybirdend) then
      [*] = ;         bShowMark := True;
      [*] = ;         if TInternetShellClient(pclient).states.bplay then
      [*] = ;         begin
      [*] = ;            if (bShowMark) then
      [*] = ;            gShellSortPlayMarked.Add(i)
      [*] = ;            else
      [*] = ;            gShellSortPlay.Add(i);
      [*] = ;         end
      [*] = ;         else
      [*] = ;         begin
      [*] = ;            if (bShowMark) then
      [*] = ;            gShellSortOnlineMarked.Add(i)
      [*] = ;            else
      [*] = ;            gShellSortOnline.Add(i);
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   var ind : Integer;
      [*] = ;   for k:=0 to 3 do
      [*] = ;   begin
      [*] = ;      var count : Integer;
      [*] = ;      var list : Pointer;
      [*] = ;      case k of
      [*] = ;         0 : list := gShellSortOnlineMarked;
      [*] = ;         1 : list := gShellSortOnline;
      [*] = ;         2 : list := gShellSortPlayMarked;
      [*] = ;         3 : list := gShellSortPlay;
      [*] = ;      end;
      [*] = ;
      [*] = ;      var bShowMark : Boolean = (k=0) or (k=2);
      [*] = ;      count := TIntegerList(list).GetCount;
      [*] = ;      for i:=0 to count-1 do
      [*] = ;      begin
      [*] = ;         var pclient : Pointer = gInternetShell.clients.Get(TIntegerList(list).Get(i));
      [*] = ;         if (pclient<>nil) then
      [*] = ;         begin
      [*] = ;            var lanid : Integer = TInternetShellClient(pclient).lanid;
      [*] = ;            var icon : String;
      [*] = ;            var clanicon : String;
      [*] = ;            //clanicon := gc_hud_icons_keycolor+IntToStr(i+2);
      [*] = ;            if (gQuickPlay.IndexOf(lanid)>=0) or (gQuickPlayHideIcon.IndexOf(lanid)>=0) then
      [*] = ;            //icon := 'net.client.state.quickplaysearch'
      [*] = ;            icon := ''
      [*] = ;            else
      [*] = ;            if TInternetShellClient(pclient).bmute then
      [*] = ;            icon := 'net.client.state.mute'
      [*] = ;            else
      [*] = ;            if TInternetShellClient(pclient).states.bplay then
      [*] = ;            icon := 'net.client.state.play'
      [*] = ;            else
      [*] = ;            if TInternetShellClient(pclient).states.bmaster then
      [*] = ;            icon := 'net.client.state.master'
      [*] = ;            else
      [*] = ;            if TInternetShellClient(pclient).states.bsession then
      [*] = ;            icon := 'net.client.state.session'
      [*] = ;            else
      [*] = ;            icon := ''; //'net.client.state.online';
      [*] = ;
      [*] = ;            var medals, uniqcolor : String;
      [*] = ;            FormatePlayerMedalsString(lanid, True, bShowMark, medals);
      [*] = ;            text := #9+icon+#9+#9+uniqcolor+TInternetShellClient(pclient).nick+gc_font_color_default+#9+#9+clanicon+#9+medals+#9+{#9+'%color(646464)%'+'#'+IntToStr(lanid)}+#9;
      [*] = ;            GUIListBoxAddItem(elmPlayersList, text, lanid);
      [*] = ;            if (lanid=gInternetShell.selclientid) then
      [*] = ;            SetGUIListBoxItemIndexSilent(elmPlayersList, ind);
      [*] = ;            ind := ind+1;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;   if (bScrollToEnd) then
      [*] = ;   SetGUIListBoxTopIndex(elmPlayersList, GetGUIListBoxItemsCount(elmPlayersList)-1)
      [*] = ;   else
      [*] = ;   SetGUIListBoxTopIndex(elmPlayersList, topIndex);
      [*] = ;
      [*] = ;   var bNeedScroll : Boolean = _gui_SetListBoxHeight(elmPlayersList, cClientsCountInList);
      [*] = ;   _gui_AddScroller(elmPlayersList, gc_halParentRightWidth, gc_valParentTop, 28-4+5, 14+3-2, 0, GetGUIElementHeight(elmPlayers), bNeedScroll);
      [*] = ;   _gui_UpdateListBoxScrollerPos(elmPlayersList);
      [*] = ;
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_0', elmPlayers, gc_halParentLeft, gc_valParentTop, -4, -4, GetGUIElementWidth(elmPlayers)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_1', elmPlayers, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-3, GetGUIElementWidth(elmPlayers)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfb_0', elmPlayers, gc_halParentLeft, gc_valParentBottom, -4, 1, GetGUIElementWidth(elmPlayers)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfl_0', elmPlayers, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-2, 0, GetGUIElementHeight(elmPlayers)+skinHeadOffset+3, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_0', elmPlayers, gc_halParentLeft, gc_valParentTop, cPadding*2+cStatusW-2, -skinHeadOffset-2, 0, GetGUIElementHeight(elmPlayers)+skinHeadOffset+3, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_1', elmPlayers, gc_halParentRight, gc_valParentTop, -0, -3, 0, GetGUIElementHeight(elmPlayers)+4, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_2', elmPlayers, gc_halParentRight, gc_valParentTop, 3+cScrollWOff, -skinHeadOffset-3, 0, GetGUIElementHeight(elmPlayers)+skinHeadOffset+4, True, bupdate);
      [*] = ;end;
      [*] = ;
      [*] = ;// chat
      [*] = ;var elmChatPlace : Integer;
      [*] = ;begin
      [*] = ;   elmChatPlace := _gui_CreateParent('chatplace', elmParent, gc_halParentLeft, gc_valParentBottomHeight, cSessionsMarginLeft, -cChatMarginBottom-36, cSessionW, 0, bupdate);
      [*] = ;   IntRegister0 := elmChatPlace;
      [*] = ;   IntRegister1 := cSessionW;
      [*] = ;   ExecuteState('ShowMultiplayerChat');
      [*] = ;   elmChat := IntRegister2;
      [*] = ;   {
      [*] = ;   elmChat := _gui_CreateSkinWindow('chatback', elmParent, gc_halParentLeft, gc_valParentBottomHeight, cSessionsMarginLeft, -cChatMarginBottom-36, cSessionW, rowHeight*gc_gui_chat_linescount+cPadding*2, 1, bupdate);
      [*] = ;
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_0', elmChat, gc_halParentLeft, gc_valParentTop, -4, -4, GetGUIElementWidth(elmChat)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfb_0', elmChat, gc_halParentLeft, gc_valParentBottom, -4, 1, GetGUIElementWidth(elmChat)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfl_0', elmChat, gc_halParentLeft, gc_valParentTop, -4, -3, 0, GetGUIElementHeight(elmChat)+4, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_0', elmChat, gc_halParentRight, gc_valParentTop, 0, -3, 0, GetGUIElementHeight(elmChat)+4, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_1', elmChat, gc_halParentRight, gc_valParentTop, 3+cScrollWOff, -3, 0, GetGUIElementHeight(elmChat)+4, True, bupdate);
      [*] = ;
      [*] = ;   var elmChatList : Integer = _gui_CreateListBox('chat', elmChat, gc_halParentLeft, gc_valParentTop, 1, cmargin1, GetGUIElementWidth(elmChat)-cPadding*2+cPadding-1+cScrollWOff, GetGUIElementHeight(elmChat)-cPadding*2+1, gc_halLeft, gc_valMiddle, cPadding, 0, gc_font_serif_12, eventstate, False, bupdate);
      [*] = ;   _misc_FillChatList(False);
      [*] = ;
      [*] = ;   var elmChatInputBox : Integer = _gui_CreateInputBox('chatinput', elmChat, nul, gc_halParentLeft, gc_valParentBottom, -cPadding, 0, GetGUIElementWidth(elmChat)+cPadding*2+cScrollWOff, 255, eventstate, nul, True, 12, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, 1, 1, 1, 1, bupdate);
      [*] = ;   }
      [*] = ;end;
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('bchangeprofile', elmChatPlace, 'btn.nodecor', gc_halParentRight, gc_valParentBottom, 58+70, 42, 0, 0, eventstate, cTextChangeProfileHint, cTagChangeProfile, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextHeaderChangeProfile, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;
      [*] = ;var cursessioncount, cursessionmaxcount, cursessionmods : Integer;
      [*] = ;var cSessionsCountInList : Integer = (GetGUIElementHeight(elmParent)-(cChatMarginBottom+cSessionsMarginTop+skinHeadOffset+GetGUIElementHeight(elmChat)+cSessionsChatMinStep+cInputBoxHeight+cPadding*2)) div rowHeight;
      [*] = ;elmSessions := _gui_CreateSkinWindow('sessionsback', elmParent, gc_halParentLeft, gc_valParentTop, cSessionsMarginLeft, cSessionsMarginTop+skinHeadOffset, cSessionW, rowHeight*cSessionsCountInList+cPadding*3-1, 1, bupdate);
      [*] = ;elmRankings := _gui_CreateSkinWindow('rankingsback', elmParent, gc_halParentLeft, gc_valParentTop, cSessionsMarginLeft, cSessionsMarginTop+skinHeadOffset, cSessionW, rowHeight*cSessionsCountInList+cPadding*3-1, 1, bupdate);
      [*] = ;// ranking list
      [*] = ;if (gInternetShell.bshowranking) then
      [*] = ;begin
      [*] = ;   SetGUIElementVisible(elmSessions, False);
      [*] = ;   SetGUIElementVisible(elmRankings, True);
      [*] = ;   //var cRankingsCountInList : Integer = (GetGUIElementHeight(elmParent)-(cPlayersMarginBottom+cSessionsMarginTop+skinHeadOffset)) div rowHeight;
      [*] = ;   var cRankingsCountInList : Integer = cSessionsCountInList;
      [*] = ;
      [*] = ;   var cTextStatus : String = 'Status';
      [*] = ;   var cTextPlace : String = '#';
      [*] = ;   var cTextNick : String = 'Nickname';
      [*] = ;   var cTextRank : String = 'Rank';
      [*] = ;   var cTextWins : String = 'Wins';
      [*] = ;   var cTextScores : String = 'Score';
      [*] = ;
      [*] = ;   var statusW : Integer = cStatusW;
      [*] = ;   var placeW : Integer = 30+cPadding*2;
      [*] = ;   var rankW : Integer = 130+cPadding*2;
      [*] = ;   var winsW : Integer = 60+cPadding*2;
      [*] = ;   var scoresW : Integer = 60+cPadding*2;
      [*] = ;   var lanidW : Integer = cLanIDW;
      [*] = ;   var nickW : Integer = GetGUIElementWidth(elmRankings)-cPadding-statusW-placeW-rankW-winsW-scoresW-lanidW;
      [*] = ;
      [*] = ;   elmHnd := _gui_CreateSkinHeadWindow('sh_0', elmRankings, gc_halParentLeft, gc_valParentTop, 0, -skinHeadOffset, GetGUIElementWidth(elmRankings)+cScrollWOff, bupdate);
      [*] = ;   var posX : Integer = cPadding*2;
      [*] = ;   var textwalign : Integer = gc_halLeft;
      [*] = ;   text := cTextStatus;
      [*] = ;   var textw : Integer = _gui_GetFontTextWidth(text, cHeadTextFont);
      [*] = ;   _gui_CreateText('t0', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cpadding div 2, 0, textw, 0, textwalign, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   posX := posX+statusW+cPadding*2-4;
      [*] = ;   text := cTextPlace; _gui_CreateText('t1', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, posX+9, 0, placeW, 0, textwalign, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   posX := posX+placeW;
      [*] = ;   text := cTextNick; _gui_CreateText('t2', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, posX, 0, nickW, 0, textwalign, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   posX := posX+nickW;
      [*] = ;   text := cTextRank; _gui_CreateText('t3', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, posX, 0, rankW, 0, textwalign, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   posX := posX+rankW;
      [*] = ;   text := cTextWins; _gui_CreateText('t4', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, posX, 0, winsW-cPadding*2-5, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   posX := posX+winsW;
      [*] = ;   text := cTextScores; _gui_CreateText('t5', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, posX+4, 0, scoresW, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;
      [*] = ;   // LIST START
      [*] = ;
      [*] = ;   var elmRankingsList : Integer = _gui_CreateListBox('rankings', elmRankings, gc_halParentLeft, gc_valParentTop, 1, cmargin1, cPadding+GetGUIElementWidth(elmRankings)-cPadding*2+cScrollWOff, GetGUIElementHeight(elmRankings)-cPadding*2+1, gc_halLeft, gc_valMiddle, 0, 0, gc_font_serif_12, eventstate, False, bupdate);
      [*] = ;   var topIndex : Integer = GetGUIListBoxTopIndex(elmRankingsList);
      [*] = ;   var itemIndex : Integer = GetGUIListBoxItemIndex(elmRankingsList);
      [*] = ;   var bScrollToEnd : Boolean = (topIndex=(GetGUIListBoxItemsCount(elmRankingsList)-cRankingsCountInList));
      [*] = ;
      [*] = ;   var tmp : Integer;
      [*] = ;   for tmp:=GetGUIListBoxTabsCount(elmRankingsList)-1 downto 0 do
      [*] = ;   DeleteGUIListBoxTab(elmRankingsList, tmp);
      [*] = ;   //SetGUIElementTextAlign(elmRankingsList, 'halMiddle', 'valMiddle', 0, 0);
      [*] = ;
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding-2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cStatusW, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding*2+4, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, placeW-cPadding-4, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, nickW{-lanidW}-cMedal6W-cMedal5W-cMedal4W-cMedal3W-cMedal2W-cMedal1W-cPadding*2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal1W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal4W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal5W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal6W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal3W, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cMedal2W, 'tsImage');
      [*] = ;   //AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, lanidW, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding*2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, 25, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, 6, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, rankW-cPadding-25-6, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding+14, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, winsW-cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding+13, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, scoresW-cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmRankingsList, 1, 1, 1, 1, cScrollW, 'tsText');
      [*] = ;   GUIListBoxClearSilent(elmRankingsList);
      [*] = ;
      [*] = ;   var bMyIDInTop : Boolean;
      [*] = ;   var i, ind : Integer;
      [*] = ;   if bShowNewSeason then
      [*] = ;   begin
      [*] = ;      for i:=0 to gInternetShell.rankings.GetCount-1 do
      [*] = ;      begin
      [*] = ;         var pranking : Pointer = gInternetShell.rankings.Get(i);
      [*] = ;         if (pranking<>nil) then
      [*] = ;         begin
      [*] = ;            var lanid : Integer = TInternetShellRanking(pranking).lanid;
      [*] = ;            var nick : String = TInternetShellRanking(pranking).nick;
      [*] = ;            var score : Integer = TInternetShellRanking(pranking).score;
      [*] = ;            var rank : Integer = _misc_GetRankByScoreELO(score)-3;
      [*] = ;            if (rank<0) then
      [*] = ;            rank := 0;
      [*] = ;            var srank : String = GetLocaleTableListItemByID('misc', 'inet.rank.'+IntToStr(rank));
      [*] = ;            var simgrank : String = 'net.client.rank.'+IntToStr(rank+1);
      [*] = ;            var wins : Integer = TInternetShellRanking(pranking).wins;
      [*] = ;            var games : Integer = TInternetShellRanking(pranking).games;
      [*] = ;            //wins := floor(random*2000);
      [*] = ;            //score := floor(random*20000);
      [*] = ;            var swins, sscore : String;
      [*] = ;            if (wins>=0) then
      [*] = ;            begin
      [*] = ;               if wins<10 then
      [*] = ;               swins := ' ';
      [*] = ;               if wins<100 then
      [*] = ;               swins := swins+' ';
      [*] = ;               if wins<1000 then
      [*] = ;               swins := swins+' ';
      [*] = ;            end;
      [*] = ;            swins := swins+IntToStr(wins);
      [*] = ;            if (score>=0) then
      [*] = ;            begin
      [*] = ;               if score<10 then
      [*] = ;               sscore := ' ';
      [*] = ;               if score<100 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<1000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<10000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;            end;
      [*] = ;            sscore := sscore+IntToStr(score);
      [*] = ;            var icon : String;
      [*] = ;            if TInternetShellRanking(pranking).states.bplay then
      [*] = ;            icon := 'net.client.state.play'
      [*] = ;            else
      [*] = ;            if (gQuickPlay.IndexOf(lanid)>=0) or (gQuickPlayHideIcon.IndexOf(lanid)>=0) then
      [*] = ;            begin
      [*] = ;               icon := '';
      [*] = ;               log(nick);
      [*] = ;            end
      [*] = ;            else
      [*] = ;            if TInternetShellRanking(pranking).states.bmaster then
      [*] = ;            icon := 'net.client.state.master'
      [*] = ;            else
      [*] = ;            if TInternetShellRanking(pranking).states.bsession then
      [*] = ;            icon := 'net.client.state.session'
      [*] = ;            else
      [*] = ;            icon := ''; //'net.client.state.online';
      [*] = ;            text := #9+icon+#9+#9;
      [*] = ;            if i<9 then
      [*] = ;            text := text+' ';
      [*] = ;            if i<99 then
      [*] = ;            text := text+' ';
      [*] = ;
      [*] = ;            {if (lanid=412) then
      [*] = ;            begin
      [*] = ;               text := '%color(FFFFFF)%';
      [*] = ;               bMyIDInTop := True;
      [*] = ;            end;
      [*] = ;            }
      [*] = ;            var fstyle : String;
      [*] = ;            var slanid : String;
      [*] = ;            if (lanid=LanMyInfoID) then
      [*] = ;            begin
      [*] = ;               fstyle := '%color(FFEECC)%';
      [*] = ;               bMyIDInTop := True;
      [*] = ;            end;
      [*] = ;            {if lanid>0 then
      [*] = ;            begin
      [*] = ;               if fstyle='' then
      [*] = ;               slanid := '%color(646464)%'
      [*] = ;               else
      [*] = ;               slanid := fstyle;
      [*] = ;               slanid := slanid+'#'+IntToStr(TInternetShellRanking(pranking).lanid)+gc_font_color_default;
      [*] = ;            end;}
      [*] = ;
      [*] = ;            var medals, uniqcolor : String;
      [*] = ;            FormatePlayerMedalsString(lanid, False, False, medals);
      [*] = ;
      [*] = ;            if gbool_lan_debug then
      [*] = ;            text := text+fstyle+IntToStr(i+1)+#9+#9+fstyle+TInternetShellRanking(pranking).nick+#9+medals{+#9+slanid}+#9+#9+simgrank+#9+#9+fstyle+srank+#9+#9+fstyle+swins+'/'+IntToStr(games)+#9+#9+fstyle+sscore+' '+FloatToStr(wins/games)+#9
      [*] = ;            else
      [*] = ;            text := text+fstyle+IntToStr(i+1)+#9+#9+fstyle+TInternetShellRanking(pranking).nick+#9+medals{+#9+slanid}+#9+#9+simgrank+#9+#9+fstyle+srank+#9+#9+fstyle+swins+#9+#9+fstyle+sscore+#9;
      [*] = ;            GUIListBoxAddItem(elmRankingsList, text, i);
      [*] = ;            if (lanid=gInternetShell.selrankingid) then
      [*] = ;            SetGUIListBoxItemIndexSilent(elmRankingsList, ind);
      [*] = ;            ind := ind+1;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;      if (not bMyIDInTop) then
      [*] = ;      begin
      [*] = ;         var pclient : Pointer = gInternetShell.clients.GetByLanID(LanMyInfoID);
      [*] = ;         if pclient<>nil then
      [*] = ;         begin
      [*] = ;            var icon : String;
      [*] = ;            if _net_IsServer then
      [*] = ;            icon := 'net.client.state.master'
      [*] = ;            else
      [*] = ;            if _net_IsClient then
      [*] = ;            icon := 'net.client.state.session';
      [*] = ;
      [*] = ;            //var score : Integer = TInternetShellClient(pclient).score;
      [*] = ;            var score : Integer = LanPublicServerProfScore;
      [*] = ;            var rank : Integer = _misc_GetRankByScoreELO(score)-3;
      [*] = ;            if (rank<0) then
      [*] = ;            rank := 0;
      [*] = ;            var srank : String = GetLocaleTableListItemByID('misc', 'inet.rank.'+IntToStr(rank));
      [*] = ;            var simgrank : String = 'net.client.rank.'+IntToStr(rank+1);
      [*] = ;            var wins : Integer = LanPublicServerProfGamesWin;
      [*] = ;            //var wins : Integer = TInternetShellClient(pclient).gameswin;
      [*] = ;            var games : Integer = TInternetShellClient(pclient).gamesplayed;
      [*] = ;
      [*] = ;            var swins, sscore : String;
      [*] = ;            if (wins>=0) then
      [*] = ;            begin
      [*] = ;               if wins<10 then
      [*] = ;               swins := ' ';
      [*] = ;               if wins<100 then
      [*] = ;               swins := swins+' ';
      [*] = ;               if wins<1000 then
      [*] = ;               swins := swins+' ';
      [*] = ;            end;
      [*] = ;            swins := swins+IntToStr(wins);
      [*] = ;            if (score>=0) then
      [*] = ;            begin
      [*] = ;               if score<10 then
      [*] = ;               sscore := ' ';
      [*] = ;               if score<100 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<1000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<10000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;            end;
      [*] = ;            sscore := sscore+IntToStr(score);
      [*] = ;
      [*] = ;            var bShowMark : Boolean;
      [*] = ;            var medals, uniqcolor : String;
      [*] = ;            var pclient : Pointer = gInternetShell.clients.GetByLanID(LanMyInfoID);
      [*] = ;            if pclient<>nil then
      [*] = ;            begin
      [*] = ;               var dlc : Integer = TInternetShellClient(pclient).dlc;
      [*] = ;               var pur : Integer = TInternetShellClient(pclient).pur;
      [*] = ;               if (dlc>0) and ((dlc and gc_lastknowndlc_earlybird)<>0) then
      [*] = ;               bShowMark := True
      [*] = ;               else
      [*] = ;               if (pur>0) and (pur<=gc_unixtime_earlybirdend) then
      [*] = ;               bShowMark := True;
      [*] = ;            end;
      [*] = ;            FormatePlayerMedalsString(LanMyInfoID, False, False, medals);
      [*] = ;
      [*] = ;            var fstyle : String = '%color(FFEECC)%';
      [*] = ;            text := #9+icon+#9+#9+fstyle+'???'+#9+#9+fstyle+LanMyInfoName+#9+medals{+#9+fstyle+'#'+IntToStr(LanMyInfoID)}+#9+#9+simgrank+#9+#9+fstyle+srank+#9+#9+fstyle+swins+#9+#9+fstyle+sscore+#9;
      [*] = ;
      [*] = ;            GUIListBoxAddItem(elmRankingsList, text, LanMyInfoID);
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end
      [*] = ;   else
      [*] = ;   begin
      [*] = ;      var pTopUsers : Integer = _parser_ParserTopUsers(True);
      [*] = ;      if ParserGetCountByHandle(pTopUsers)=0 then
      [*] = ;      ParserLoadFromFileByHandle(pTopUsers, '.\data\images\cached\top100_season4.cfg');
      [*] = ;      for i:=0 to ParserGetCountByHandle(pTopUsers)-1 do
      [*] = ;      begin
      [*] = ;         var pTopUser : Integer = ParserSelectByHandleByIndex(pTopUsers, i);
      [*] = ;         if (pTopUser<>0) then
      [*] = ;         begin
      [*] = ;            var lanid : Integer = ParserGetIntValueByKeyByHandle(pTopUser, 'lanid');
      [*] = ;            var nick : String = ParserGetValueByKeyByHandle(pTopUser, 'nick');
      [*] = ;            var score : Integer = ParserGetIntValueByKeyByHandle(pTopUser, 'score');
      [*] = ;            var rank : Integer = _misc_GetRankByScoreELO(score)-3;
      [*] = ;            if (rank<0) then
      [*] = ;            rank := 0;
      [*] = ;            var srank : String = GetLocaleTableListItemByID('misc', 'inet.rank.'+IntToStr(rank));
      [*] = ;            var simgrank : String = 'net.client.rank.'+IntToStr(rank+1);
      [*] = ;            var wins : Integer = ParserGetIntValueByKeyByHandle(pTopUser, 'wins');
      [*] = ;            var games : Integer = ParserGetIntValueByKeyByHandle(pTopUser, 'games');
      [*] = ;
      [*] = ;            var swins, sscore : String;
      [*] = ;            if (wins>=0) then
      [*] = ;            begin
      [*] = ;               if wins<10 then
      [*] = ;               swins := ' ';
      [*] = ;               if wins<100 then
      [*] = ;               swins := swins+' ';
      [*] = ;               if wins<1000 then
      [*] = ;               swins := swins+' ';
      [*] = ;            end;
      [*] = ;            swins := swins+IntToStr(wins);
      [*] = ;            if (score>=0) then
      [*] = ;            begin
      [*] = ;               if score<10 then
      [*] = ;               sscore := ' ';
      [*] = ;               if score<100 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<1000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;               if score<10000 then
      [*] = ;               sscore := sscore+' ';
      [*] = ;            end;
      [*] = ;            sscore := sscore+IntToStr(score);
      [*] = ;
      [*] = ;            text := #9+#9+#9;
      [*] = ;            if i<9 then
      [*] = ;            text := text+' ';
      [*] = ;            if i<99 then
      [*] = ;            text := text+' ';
      [*] = ;
      [*] = ;            {if (lanid=412) then
      [*] = ;            begin
      [*] = ;               text := '%color(FFFFFF)%';
      [*] = ;               bMyIDInTop := True;
      [*] = ;            end;
      [*] = ;            }
      [*] = ;            var fstyle : String;
      [*] = ;            var slanid : String;
      [*] = ;            if (lanid=LanMyInfoID) then
      [*] = ;            begin
      [*] = ;               fstyle := '%color(FFEECC)%';
      [*] = ;               bMyIDInTop := True;
      [*] = ;            end;
      [*] = ;            {if lanid>0 then
      [*] = ;            begin
      [*] = ;               if fstyle='' then
      [*] = ;               slanid := '%color(646464)%'
      [*] = ;               else
      [*] = ;               slanid := fstyle;
      [*] = ;               slanid := slanid+'#'+IntToStr(lanid)+gc_font_color_default;
      [*] = ;            end;}
      [*] = ;
      [*] = ;            var medals, uniqcolor : String;
      [*] = ;            FormatePlayerMedalsString(lanid, False, False, medals);
      [*] = ;
      [*] = ;            if gbool_lan_debug then
      [*] = ;            text := text+fstyle+IntToStr(i+1)+#9+#9+fstyle+nick+#9+medals{+#9+slanid}+#9+#9+simgrank+#9+#9+fstyle+srank+#9+#9+fstyle+swins+'/'+IntToStr(games)+#9+#9+fstyle+sscore+' '+FloatToStr(wins/games)+#9
      [*] = ;            else
      [*] = ;            text := text+fstyle+IntToStr(i+1)+#9+#9+fstyle+nick+#9+medals{+#9+slanid}+#9+#9+simgrank+#9+#9+fstyle+srank+#9+#9+fstyle+swins+#9+#9+fstyle+sscore+#9;
      [*] = ;            GUIListBoxAddItem(elmRankingsList, text, i);
      [*] = ;            if (lanid=gInternetShell.selrankingid) then
      [*] = ;            SetGUIListBoxItemIndexSilent(elmRankingsList, ind);
      [*] = ;            ind := ind+1;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;   //if (masterid=gInternetShell.selsessionid) then
      [*] = ;   var selInd : Integer = GetGUIListBoxItemIndexOfTag(elmRankingsList, gInternetShell.selsessionid);
      [*] = ;   if (selInd>=0) then
      [*] = ;   SetGUIListBoxItemIndexSilent(elmRankingsList, selInd);
      [*] = ;   if (bScrollToEnd) then
      [*] = ;   SetGUIListBoxTopIndex(elmRankingsList, GetGUIListBoxItemsCount(elmRankingsList)-1)
      [*] = ;   else
      [*] = ;   SetGUIListBoxTopIndex(elmRankingsList, topIndex);
      [*] = ;
      [*] = ;   var bNeedScroll : Boolean = _gui_SetListBoxHeight(elmRankingsList, cRankingsCountInList);
      [*] = ;   _gui_AddScroller(elmRankingsList, gc_halParentRightWidth, gc_valParentTop, 29, 15, 0, GetGUIElementHeight(elmRankings), bNeedScroll);
      [*] = ;   _gui_UpdateListBoxScrollerPos(elmRankingsList);
      [*] = ;
      [*] = ;   // LIST FINISH
      [*] = ;
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_0', elmRankings, gc_halParentLeft, gc_valParentTop, -4, -4, GetGUIElementWidth(elmRankings)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_1', elmRankings, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-3, GetGUIElementWidth(elmRankings)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfb_0', elmRankings, gc_halParentLeft, gc_valParentBottom, -4, 1, GetGUIElementWidth(elmRankings)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfl_0', elmRankings, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-2, 0, GetGUIElementHeight(elmRankings)+skinHeadOffset+3, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_0', elmRankings, gc_halParentLeft, gc_valParentTop, cPadding*2+statusW-2, -skinHeadOffset-2, 0, GetGUIElementHeight(elmRankings)+skinHeadOffset+3, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_1', elmRankings, gc_halParentLeft, gc_valParentTop, cPadding*2+statusW+placeW-2, -skinHeadOffset-2, 0, GetGUIElementHeight(elmRankings)+skinHeadOffset+3, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_2', elmRankings, gc_halParentLeft, gc_valParentTop, cPadding*3+statusW+placeW+nickW-3+16-cScrollW, -2-skinHeadOffset, 0, GetGUIElementHeight(elmRankings)+3+skinHeadOffset, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_3', elmRankings, gc_halParentLeft, gc_valParentTop, cPadding*3+statusW+placeW+nickW+rankW-3+16-cScrollW, -2-skinHeadOffset, 0, GetGUIElementHeight(elmRankings)+3+skinHeadOffset, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_4', elmRankings, gc_halParentLeft, gc_valParentTop, cPadding*3+statusW+placeW+nickW+rankW+winsW-3+16-cScrollW, -2-skinHeadOffset, 0, GetGUIElementHeight(elmRankings)+3+skinHeadOffset, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_5', elmRankings, gc_halParentRight, gc_valParentTop, -0, -3, 0, GetGUIElementHeight(elmRankings)+4, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_6', elmRankings, gc_halParentRight, gc_valParentTop, 3+cScrollWOff, -skinHeadOffset-3, 0, GetGUIElementHeight(elmRankings)+skinHeadOffset+4, True, bupdate);
      [*] = ;end
      [*] = ;// sessions list
      [*] = ;else
      [*] = ;begin
      [*] = ;   SetGUIElementVisible(elmRankings, False);
      [*] = ;   SetGUIElementVisible(elmSessions, True);
      [*] = ;   //const cSessionsCountInList = 8;
      [*] = ;   var cTextPlayers : String = GetLocaleTableListItemByID('gui', 'internet.players');
      [*] = ;   var cTextPing : String = GetLocaleTableListItemByID('gui', 'internet.ping');
      [*] = ;   var cTextRank : String = GetLocaleTableListItemByID('gui', 'internet.rank');
      [*] = ;   var playersW : Integer = _gui_GetFontTextWidth(cTextPlayers, cHeadTextFont)+cPadding*2;
      [*] = ;   var pingW : Integer = Max(38, _gui_GetFontTextWidth(cTextPing, cHeadTextFont)+cPadding*2);
      [*] = ;   var rankW : Integer = {pingW+}Max(25+12+cScrollWOff, _gui_GetFontTextWidth(cTextRank, cHeadTextFont)+cPadding*2);
      [*] = ;   const modsimgsize = 25;
      [*] = ;   const dlcsimgsize = 25;
      [*] = ;   //const cDifficultyW = 70;
      [*] = ;   //var elmSessions : Integer = _gui_CreatePaperWindow('sessionsback', elmParent, gc_halParentMiddle, gc_valParentMiddle, -146-8, -110, cSessionW, rowHeight*cSessionsCountInList+cPadding*2, 1, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateSkinHeadWindow('sh_0', elmSessions, gc_halParentLeft, gc_valParentTop, 0, -skinHeadOffset, GetGUIElementWidth(elmSessions)+cScrollWOff, bupdate);
      [*] = ;   var gamesW : Integer = GetGUIElementWidth(elmSessions)-cPadding*2-cStatusW-playersW-{pingW-}rankW;
      [*] = ;
      [*] = ;   text := ' '; _gui_CreateText('t0', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, 0, 0, cStatusW+cPadding*2, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   text := GetLocaleTableListItemByID('gui', 'internet.games'); _gui_CreateText('t1', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+cPadding*3, 0, gamesW+cPadding*2, 0, gc_halLeft, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   text := GetLocaleTableListItemByID('gui', 'internet.total')+' '+IntToStr(gInternetShell.sessions.GetCount); _gui_CreateText('t2', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+cPadding, 0, gamesW, 0, gc_halRight, gc_valMiddle, gc_font_serif_10, color, bupdate);
      [*] = ;   text := cTextPlayers; _gui_CreateText('t3', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+gamesW+cPadding*2, 0, playersW, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   //text := cTextPing; _gui_CreateText('t4', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+gamesW+playersW+cPadding*2, 0, pingW, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;   text := cTextRank; _gui_CreateText('t5', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, cStatusW+gamesW+playersW+{pingW+}cPadding*2, 0, rankW, 0, gc_halMiddle, gc_valMiddle, cHeadTextFont, color, bupdate);
      [*] = ;
      [*] = ;   var elmSessionsList : Integer = _gui_CreateListBox('sessions', elmSessions, gc_halParentLeft, gc_valParentTop, 1, cmargin1, cPadding+GetGUIElementWidth(elmSessions)-cPadding*2+cScrollWOff, GetGUIElementHeight(elmSessions)-cPadding*2+1, gc_halLeft, gc_valMiddle, 0, 0, gc_font_serif_12, eventstate, False, bupdate);
      [*] = ;   var topIndex : Integer = GetGUIListBoxTopIndex(elmSessionsList);
      [*] = ;   var itemIndex : Integer = GetGUIListBoxItemIndex(elmSessionsList);
      [*] = ;   var bScrollToEnd : Boolean = (topIndex=(GetGUIListBoxItemsCount(elmSessionsList)-cSessionsCountInList));
      [*] = ;
      [*] = ;   var tmp : Integer;
      [*] = ;   for tmp:=GetGUIListBoxTabsCount(elmSessionsList)-1 downto 0 do
      [*] = ;   DeleteGUIListBoxTab(elmSessionsList, tmp);
      [*] = ;   //SetGUIElementTextAlign(elmSessionsList, 'halMiddle', 'valMiddle', 0, 0);
      [*] = ;   var nickW : Integer = GetGUIElementWidth(elmSessionsList)-cPadding-cStatusW-cClanW-cScrollW;
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, 16, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, -14+cPadding+cStatusW, 'tsText');
      [*] = ;   //AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, cPadding+cStatusW, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, 2+cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, gamesW-cPadding-modsimgsize-2-42, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, 42, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, modsimgsize, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, 2, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, cPadding*2+2+6, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, playersW-cPadding*2, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   //AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, pingW-cPadding, 'tsText');
      [*] = ;   //AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, cPadding, 'tsText');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, 30, 'tsImage');
      [*] = ;   AddGUIListBoxTabProperty(elmSessionsList, 1, 1, 1, 1, rankW-cPadding+cScrollW, 'tsText');
      [*] = ;   GUIListBoxClearSilent(elmSessionsList);
      [*] = ;
      [*] = ;   const modscompatible = 'net.client.mods.green';
      [*] = ;   const gothcompatible = 'net.client.dlcs.exp1';
      [*] = ;   const modsuncompatible = 'net.client.mods.red';
      [*] = ;
      [*] = ;   var bAutoSearchExists : Boolean;
      [*] = ;   var autosearchClientsCount : Integer;
      [*] = ;
      [*] = ;   var i, j : Integer;
      [*] = ;   for i:=gInternetShell.sessions.GetCount-1 downto 0 do
      [*] = ;   //for i:=0 to gInternetShell.sessions.GetCount-1 do
      [*] = ;   begin
      [*] = ;      var psessions : Pointer = gInternetShell.sessions.Get(i);
      [*] = ;      if (psessions<>nil) then
      [*] = ;      begin
      [*] = ;         if (TInternetShellSession(psessions).blocked) and (not gbool_lan_debug) then
      [*] = ;         gInternetShell.sessions.Delete(i)
      [*] = ;         else
      [*] = ;         begin
      [*] = ;            var statetag, humancount, aicount, closecount, ping, rank : Integer;
      [*] = ;            var visiblename, pass, roomchecksum : String;
      [*] = ;            _misc_GetGameNameAndPasswordBySession(psessions, visiblename, pass, roomchecksum);
      [*] = ;            visiblename := StrReplace(visiblename, gc_gui_breakline, '');
      [*] = ;
      [*] = ;            var bquickplay : Boolean = SubStr(roomchecksum, 1, 1)='r';
      [*] = ;            var bhistorical : Boolean = SubStr(roomchecksum, 1, 1)='h';
      [*] = ;            _misc_LanGetMapNameData(psessions, statetag, humancount, aicount, closecount, ping, rank);
      [*] = ;            var bfull : Boolean = ((statetag and (1 shl 1))<>0);
      [*] = ;            var blocked : Boolean = ((statetag and (1 shl 2))<>0);
      [*] = ;            //var bclosed : Boolean = TInternetShellSession(psessions).bclosed;
      [*] = ;            var masterid : Integer = TInternetShellSession(psessions).masterid;
      [*] = ;            if bquickplay then
      [*] = ;            bAutoSearchExists := True
      [*] = ;            else
      [*] = ;            if pass=gc_quickplay_roompass then
      [*] = ;            begin
      [*] = ;               bAutoSearchExists := True;
      [*] = ;               autosearchClientsCount := autosearchClientsCount+TInternetShellSession(psessions).clientscount;
      [*] = ;               if (not gbool_lan_debug) then
      [*] = ;               continue;
      [*] = ;            end;
      [*] = ;            //else
      [*] = ;            begin
      [*] = ;               text := '';
      [*] = ;               if (bquickplay) then
      [*] = ;               begin
      [*] = ;                  if pass<>'' then
      [*] = ;                  text := text+'!#'
      [*] = ;                  else
      [*] = ;                  text := '!';
      [*] = ;               end
      [*] = ;               else
      [*] = ;               if pass=gc_quickplay_roompass then
      [*] = ;               text := '!'
      [*] = ;               else
      [*] = ;               if pass<>'' then
      [*] = ;               text := '#';
      [*] = ;
      [*] = ;               var dlcs : String;
      [*] = ;               var mastertext : String;
      [*] = ;               var score : Integer;
      [*] = ;               var pclient : Pointer = gInternetShell.clients.GetByLanID(masterid);
      [*] = ;               if (pclient<>nil) then
      [*] = ;               begin
      [*] = ;                  if bhistorical then
      [*] = ;                  text := text+'B';
      [*] = ;                  //mastertext := ' : ';
      [*] = ;                  mastertext := mastertext+'['+TInternetShellClient(pclient).nick+'] ';
      [*] = ;                  score := TInternetShellClient(pclient).score;
      [*] = ;                  //if ((TInternetShellClient(pclient).dlc>0) and (TInternetShellClient(pclient).dlc and gc_lastknowndlc_exp1)<>0) then
      [*] = ;                  //dlcs := gothcompatible;
      [*] = ;               end;
      [*] = ;               var maxplayers : Integer = TInternetShellSession(psessions).maxplayers-closecount;
      [*] = ;               var mapname : String = TInternetShellSession(psessions).mapname;
      [*] = ;               if bquickplay and bfull then
      [*] = ;               maxplayers := humancount+aicount;
      [*] = ;               if (gInternetShell.selsessionid=masterid) then
      [*] = ;               begin
      [*] = ;                  cursessionmods := 0;
      [*] = ;                  cursessioncount := TInternetShellSession(psessions).clientscount+aicount;
      [*] = ;                  cursessionmaxcount := maxplayers;
      [*] = ;               end;
      [*] = ;               rank := _misc_GetRankByScoreELO(score)-3;
      [*] = ;               if (rank<0) then
      [*] = ;               rank := 0;
      [*] = ;
      [*] = ;               var modsimg : String;
      [*] = ;               var modsexists : Boolean = StrLength(roomchecksum)=4;
      [*] = ;               if (modsexists) then
      [*] = ;               begin
      [*] = ;                  if roomchecksum=gstring_checksum then
      [*] = ;                  begin
      [*] = ;                     if (gInternetShell.selsessionid=masterid) then
      [*] = ;                     cursessionmods := 1;
      [*] = ;                     modsimg := modscompatible;
      [*] = ;                  end
      [*] = ;                  else
      [*] = ;                  begin
      [*] = ;                     if (gInternetShell.selsessionid=masterid) then
      [*] = ;                     cursessionmods := 2;
      [*] = ;                     modsimg := modsuncompatible;
      [*] = ;                  end;
      [*] = ;               end;
      [*] = ;               var srank : String;
      [*] = ;               srank := 'net.client.rank.'+IntToStr(rank+1);
      [*] = ;
      [*] = ;               if (TInternetShellSession(psessions).blocked) and (gbool_lan_debug) then
      [*] = ;               begin
      [*] = ;                  if pass=gc_quickplay_roompass then
      [*] = ;                  text := 'R'
      [*] = ;                  else
      [*] = ;                  text := 'x';
      [*] = ;               end;
      [*] = ;               text := #9+text+#9+#9+mastertext+visiblename+#9+dlcs+#9+modsimg+#9+pass+#9+#9+IntToStr(humancount+aicount)+'/'+IntToStr(maxplayers)+#9+#9+#9+srank;
      [*] = ;               GUIListBoxAddItem(elmSessionsList, text, masterid);
      [*] = ;            end;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;   if bAutoSearchExists or gInternetShell.bautosearch then
      [*] = ;   begin
      [*] = ;      var count : Integer = gQuickPlay.count+gQuickPlay.sessionplayercount;
      [*] = ;      if (count>0) then
      [*] = ;      GUIListBoxInsertItem(elmSessionsList, 0, #9+'!'+#9+#9+GetLocaleTableListItemByID('new', 'internetshell.text.autosearchroom')+#9+#9+#9+#9+#9+' '+IntToStr(count), -1);
      [*] = ;   end;
      [*] = ;   var selInd : Integer = GetGUIListBoxItemIndexOfTag(elmSessionsList, gInternetShell.selsessionid);
      [*] = ;   if (selInd>=0) then
      [*] = ;   SetGUIListBoxItemIndexSilent(elmSessionsList, selInd);
      [*] = ;   if (bScrollToEnd) then
      [*] = ;   SetGUIListBoxTopIndex(elmSessionsList, GetGUIListBoxItemsCount(elmSessionsList)-1)
      [*] = ;   else
      [*] = ;   SetGUIListBoxTopIndex(elmSessionsList, topIndex);
      [*] = ;
      [*] = ;   var bNeedScroll : Boolean = _gui_SetListBoxHeight(elmSessionsList, cSessionsCountInList);
      [*] = ;   _gui_AddScroller(elmSessionsList, gc_halParentRightWidth, gc_valParentTop, 29, 15, 0, GetGUIElementHeight(elmSessions), bNeedScroll);
      [*] = ;   _gui_UpdateListBoxScrollerPos(elmSessionsList);
      [*] = ;
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_0', elmSessions, gc_halParentLeft, gc_valParentTop, -4, -4, GetGUIElementWidth(elmSessions)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mft_1', elmSessions, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-3, GetGUIElementWidth(elmSessions)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfb_0', elmSessions, gc_halParentLeft, gc_valParentBottom, -4, 1, GetGUIElementWidth(elmSessions)+8+cScrollWOff, 0, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfl_0', elmSessions, gc_halParentLeft, gc_valParentTop, -4, -skinHeadOffset-2, 0, GetGUIElementHeight(elmSessions)+skinHeadOffset+3, True, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_0', elmSessions, gc_halParentLeft, gc_valParentTop, cPadding*2+cStatusW-2, -skinHeadOffset-2, 0, GetGUIElementHeight(elmSessions)+skinHeadOffset+3, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_1', elmSessions, gc_halParentLeft, gc_valParentTop, cPadding*2+cStatusW+gamesW-2, -skinHeadOffset-2, 0, GetGUIElementHeight(elmSessions)+skinHeadOffset+3, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_2', elmSessions, gc_halParentLeft, gc_valParentTop, cPadding*3+cStatusW+gamesW+playersW-3+16-cScrollW, -2-skinHeadOffset, 0, GetGUIElementHeight(elmSessions)+3+skinHeadOffset, False, bupdate);
      [*] = ;   //ping//elmHnd := _gui_CreateMetalLine('mfr_3', elmSessions, gc_halParentLeft, gc_valParentTop, cPadding*3+cStatusW+gamesW+playersW+pingW-3+16-cScrollW, -2-skinHeadOffset, 0, GetGUIElementHeight(elmSessions)+3+skinHeadOffset, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_4', elmSessions, gc_halParentRight, gc_valParentTop, -0, -3, 0, GetGUIElementHeight(elmSessions)+4, False, bupdate);
      [*] = ;   elmHnd := _gui_CreateMetalLine('mfr_5', elmSessions, gc_halParentRight, gc_valParentTop, 3+cScrollWOff, -skinHeadOffset-3, 0, GetGUIElementHeight(elmSessions)+skinHeadOffset+4, True, bupdate);
      [*] = ;end;
      [*] = ;
      [*] = ;// buttons
      [*] = ;const bSimple = False;
      [*] = ;var bAutoSearch : Boolean = gInternetShell.bautosearch and not gInternetShell.bcustomautosearch;
      [*] = ;var bAutoSearchRoomSelected : Boolean = False;//(gInternetShell.selsessionid=-1);
      [*] = ;
      [*] = ;const cBtnPosY = 18-8;
      [*] = ;var btnwidth : Integer = 200;
      [*] = ;var btncount : Integer = 1+_misc_SwitchInt(2, 2, _net_IsOnline);
      [*] = ;//if (bAutoSearch) then
      [*] = ;//btncount := btncount+1;
      [*] = ;//if (not bSimple) then
      [*] = ;btncount := btncount+1;
      [*] = ;var posX : Integer = -floor(btnwidth*(btncount-1)/2)+16;
      [*] = ;
      [*] = ;var btnind : Integer;
      [*] = ;
      [*] = ;// add if in room
      [*] = ;if (_net_IsOnline) and (not bAutoSearch) then
      [*] = ;btnind := btnind+1;
      [*] = ;var elmCurrent : Integer;
      [*] = ;if gInternetShell.bshowranking then
      [*] = ;elmCurrent := elmRankings
      [*] = ;else
      [*] = ;elmCurrent := elmSessions;
      [*] = ;
      [*] = ;text := cTextAutoSearch;
      [*] = ;if gQuickPlay.count>0 then
      [*] = ;text := text+' ('+IntToStr(gQuickPlay.count)+')';
      [*] = ;elmHnd := _gui_CreateButton('bautosearch', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, cTextQuickPlayHint, cTagAutoSearch, bupdate);
      [*] = ;SetGUIElementUseUserColor(elmHnd, True);
      [*] = ;SetGUIElementUserColor(elmHnd, 1, 0.7, 0.2, 1);
      [*] = ;text := text+'* 2x2';
      [*] = ;var tmpcolor : TColor;
      [*] = ;//_gui_ConvertHexToTColor('FFEEBB', tmpcolor);
      [*] = ;_gui_ConvertHexToTColor('FFFFCC', tmpcolor);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, text, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, tmpcolor, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (not bAutoSearch));
      [*] = ;if (not _net_IsOnline) and (not bAutoSearch) then
      [*] = ;btnind := btnind+1;
      [*] = ;SetGUIElementEnabled(elmHnd, not gbool_modsscript);
      [*] = ;if (gbool_modsscript) then
      [*] = ;SetGUIElementHint(elmHnd, cTextDisabledWhenMods);
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('bstopautosearch', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagStopAutoSearch, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextStopAutoSearch, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, bAutoSearch);
      [*] = ;if bAutoSearch then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;btnind := 0;
      [*] = ;elmHnd := _gui_CreateButton('bswitchtoroom', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagSwitchToRoom, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextSwitchToRoom, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, _net_IsOnline and (not bAutoSearch));
      [*] = ;if (_net_IsOnline) and (not bAutoSearch) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('bjoinautosearch', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagAutoSearchJoin, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextAutoSearchJoin, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (not bAutoSearch) and (bAutoSearchRoomSelected));
      [*] = ;if (not bAutoSearch) and (bAutoSearchRoomSelected) then
      [*] = ;btnind := btnind+1;
      [*] = ;SetGUIElementEnabled(elmHnd, not gbool_modsscript);
      [*] = ;if (gbool_modsscript) then
      [*] = ;SetGUIElementHint(elmHnd, cTextDisabledWhenMods)
      [*] = ;else
      [*] = ;SetGUIElementHint(elmHnd, '');
      [*] = ;
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;// not in room
      [*] = ;var hint : String;
      [*] = ;if cursessionmods=1 then
      [*] = ;hint := 'new|mods.hintroomreadytoplay'
      [*] = ;else
      [*] = ;if cursessionmods=2 then
      [*] = ;hint := 'new|mods.hintroomneedsync'
      [*] = ;else
      [*] = ;hint := cTextJoinRoomHint;
      [*] = ;elmHnd := _gui_CreateButton('bjoin', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, hint, cTagJoinRoom, bupdate);
      [*] = ;if (gInternetShell.selsessionid>0) then
      [*] = ;begin
      [*] = ;   var psessions : Pointer = gInternetShell.sessions.GetByMasterID(gInternetShell.selsessionid);
      [*] = ;   if (psessions<>nil) then
      [*] = ;   begin
      [*] = ;      var bfull : Boolean = (cursessionmaxcount>0) and (cursessioncount>=cursessionmaxcount);
      [*] = ;      var bclosed : Boolean = TInternetShellSession(psessions).bclosed;
      [*] = ;      var blocked : Boolean = TInternetShellSession(psessions).blocked;
      [*] = ;      SetGUIElementEnabled(elmHnd, (not bAutoSearch) and (not bclosed) and (not blocked) and (not bfull));
      [*] = ;   end
      [*] = ;   else
      [*] = ;   SetGUIElementEnabled(elmHnd, not bAutoSearch);
      [*] = ;end
      [*] = ;else
      [*] = ;SetGUIElementEnabled(elmHnd, False);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextJoinRoom, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (not gInternetShell.bshowranking) and (not bAutoSearch) and (not bSimple) and (not bAutoSearchRoomSelected) and (not gInternetShell.bratingroom));
      [*] = ;if (not bSimple) and (not bAutoSearchRoomSelected) and (not gInternetShell.bratingroom) and (not _net_IsOnline) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;if (_net_IsOnline) and (bAutoSearchRoomSelected) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('bcreate', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, cTextCreateRoomHint, cTagCreateRoom, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextCreateRoom, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementEnabled(elmHnd, not bAutoSearch);
      [*] = ;SetGUIElementVisible(elmHnd, (not gInternetShell.bshowranking) and (not bAutoSearch) and (not bSimple) and (gInternetShell.currentsessionid=0));
      [*] = ;if (not bSimple) and (gInternetShell.currentsessionid=0) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;if (_net_IsOnline) {and (not bAutoSearch)} then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;btnind := 3;
      [*] = ;
      [*] = ;_misc_TimeToStr(_misc_GetRealTime-gInternetShell.autosearchrealstarttime, text, True);
      [*] = ;elmHnd := _gui_CreateText('quickplaytimer', elmCurrent, text, gc_halParentMiddle, gc_valParentBottom, posX+btnwidth+btnwidth div 2, cBtnPosY+8-14, 400, 50, gc_halMiddle, gc_valMiddle, gc_font_serif_16, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (gInternetShell.autosearchrealstarttime>0));
      [*] = ;
      [*] = ;{if (bShowNewSeason) then
      [*] = ;begin
      [*] = ;   _misc_GetNewTextLocale('ratingisclosed.rankingpage', text);
      [*] = ;   text := GetGUIWrappedTextFormatByFont(gUIConst.font[gc_font_serif_11], text, 420);
      [*] = ;   elmHnd := _gui_CreateText('endofseason', elmCurrent, text, gc_halParentMiddle, gc_valParentBottom, posX+btnwidth+btnwidth div 2, cBtnPosY+8-14, 420, 50, gc_halMiddle, gc_valMiddle, gc_font_serif_11, color, bupdate);
      [*] = ;   SetGUIElementVisible(elmHnd, (gInternetShell.bshowranking));
      [*] = ;end;}
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('branking', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagRanking, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextRanking, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, not gInternetShell.bshowranking);
      [*] = ;SetGUIElementHint(elmHnd, cTextRankingHint);
      [*] = ;// rating finished
      [*] = ;//SetGUIElementEnabled(elmHnd, False);
      [*] = ;//_misc_GetNewTextLocale('ratingisclosed', hint);
      [*] = ;//SetGUIElementHint(elmHnd, hint);
      [*] = ;// rating finished
      [*] = ;
      [*] = ;if (not gInternetShell.bshowranking) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;//SetGUIElementEnabled(elmHnd, LanMyInfoID=1);
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('btorooms', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagToRooms, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextToRooms, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, gInternetShell.bshowranking);
      [*] = ;if (gInternetShell.bshowranking) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;text := cTextRatingRoom;
      [*] = ;const cCheckboxOffset = 32+4;
      [*] = ;const cCheckboxTextOffsetY = 0;
      [*] = ;elmHnd := _gui_CreateCheckBoxSmall('braitinggame', elmCurrent, False, gc_halParentLeft, gc_valParentTop, 22+12-27, 300-2, eventstate, nul, cTagNotTraining, bupdate);
      [*] = ;SetGUIElementLogicWidth(elmHnd, _gui_GetFontTextWidth(text, gc_font_serif_12)+cCheckboxOffset);
      [*] = ;_gui_CreateText('t', elmHnd, text, gc_halParentLeft, gc_valParentMiddle, 29, 0, 0, 0, gc_halLeft, gc_valTop, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementChecked(elmHnd, gInternetShell.qprankedgame);
      [*] = ;SetGUIElementEnabled(elmHnd, not bAutoSearch);
      [*] = ;//elmHnd := ShowButton('bratingroom', elmHnd, elmMain, 'btn.medium', cTextRatingRoom, cmargin2, cTagRatingRoom, True);
      [*] = ;SetGUIElementHint(elmHnd, cTextRatingRoomHint);
      [*] = ;
      [*] = ;{elmHnd := _gui_CreateButton('bprofile', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagProfile, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextProfile, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (bSimple));
      [*] = ;if (not _net_IsOnline) and (bSimple) then
      [*] = ;btnind := btnind+1;
      [*] = ;
      [*] = ;elmHnd := _gui_CreateButton('btoadvanced', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagToAdvanced, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextToAdvanced, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (bSimple));
      [*] = ;if (not _net_IsOnline) and (bSimple) then
      [*] = ;btnind := btnind+1;}
      [*] = ;
      [*] = ;{elmHnd := _gui_CreateButton('btosimple', elmCurrent, 'btn.small', gc_halParentMiddle, gc_valParentBottom, posX+btnwidth*btnind, cBtnPosY, 0, 0, eventstate, nul, cTagToSimple, bupdate);
      [*] = ;_gui_CreateText('txtbtn', elmHnd, cTextToSimple, gc_halParentMiddle, gc_valParentMiddle, 0, 0, 0, 0, gc_halLeft, gc_valMiddle, gc_font_serif_12, color, bupdate);
      [*] = ;SetGUIElementVisible(elmHnd, (not _net_IsOnline) and (not bSimple));
      [*] = ;if (not _net_IsOnline) and (not bSimple) then
      [*] = ;btnind := btnind+1;}
      [*] = ;
      [*] = ;var elmBackground : Integer = _gui_CreateMainWindow('background', elmBackgroundParent, gc_halParentMiddle, gc_valParentMiddle, 0, cHeadOffset div 2, cwidth{1018}, cheight{624}, 1, bupdate);
      [*] = ;SetGUIElementPositionY(elmBackgroundParent, 0);
      [*] = ;_gui_CreateButton('bback', elmBackground, 'btn.close', gc_halParentRightWidth, gc_valParentTop, 4, -4, 0, 0, eventstate, nul, gc_gui_event_tagClose, bupdate);
      [*] = ;
      [*] = ;var elmHead : Integer = GetGUIElementIndexByNameParent('head.head', elmBackground);
      [*] = ;elmHnd := _gui_CreateText('thead', elmHead, cTextInternetShellHeader, gc_halParentMiddle, gc_valParentMiddle, 9, 3, 0, 28, gc_halMiddle, gc_valMiddle, gc_font_serif_16, color, bupdate);
      [*] = ;
      [*] = ;_gui_InvokeMouseMove;
   struct.end
section.end

