section.begin
   Name = ShowPause
   Code : struct.begin
      [*] = ;const cElmName = 'pause';
      [*] = ;var bupdate : Boolean = False;
      [*] = ;var cTextSave : String = GetLocaleTableListItemByID('gui', 'text.saving');
      [*] = ;var cTextPause : String = GetLocaleTableListItemByID('gui', 'text.pause');
      [*] = ;var cTextWaitingPlayers : String = GetLocaleTableListItemByID('gui', 'internet.waitplayerslist');
      [*] = ;var dpiscale : Float = _gui_GetAbsScaleByDPI(0, 0);
      [*] = ;var elmParent : Integer = _gui_CreateParent(cElmName, 0, gc_halParentLeft, gc_valParentTop, 0, 0, round(GetViewerWidth/dpiscale), round(GetViewerHeight/dpiscale), False);
      [*] = ;_gui_AbsScaleByDPI(elmParent);
      [*] = ;if (GetProgressingPauseMode) then
      [*] = ;begin
      [*] = ;   const cPadding = 16;
      [*] = ;   const cMinWidth = 145;
      [*] = ;   const cMinHeight = 68;
      [*] = ;   var font : Integer = gc_font_serif_21;
      [*] = ;   var text : String;
      [*] = ;   if (gbool_gui_saving) then
      [*] = ;   text := cTextSave
      [*] = ;   else
      [*] = ;   if (_net_IsOffline) or (gMap.gamestage>=gc_map_gamestage_started) then
      [*] = ;   text := cTextPause
      [*] = ;   else
      [*] = ;   begin
      [*] = ;      text := cTextWaitingPlayers;
      [*] = ;      var i : Integer;
      [*] = ;      for i:=0 to gc_MaxPlayerCount-1 do
      [*] = ;      begin
      [*] = ;         if (gMap.players[i].bhuman) then
      [*] = ;         begin
      [*] = ;            var name : String = gMap.players[i].name;
      [*] = ;            if (gbool_gui_hidenicks) then
      [*] = ;            name := GetLocaleTableListItemByID('misc', 'endgamestatistics.player')+' '+IntToStr(i+1);
      [*] = ;
      [*] = ;            if (gMap.players[i].bloaded) then
      [*] = ;            text := text+gc_gui_breakline+'%color(F0F0F0)%'+name+gc_font_color_default
      [*] = ;            else
      [*] = ;            text := text+gc_gui_breakline+'%color(191919)%'+name+gc_font_color_default;
      [*] = ;         end;
      [*] = ;      end;
      [*] = ;   end;
      [*] = ;
      [*] = ;   var textwidth : Integer = _gui_GetFontTextWidth(text, font);
      [*] = ;   var textheight : Integer = _gui_GetFontTextHeight(text, font);
      [*] = ;
      [*] = ;   var elmHnd : Integer = _gui_CreateImage('blackmask', elmParent, gc_gui_material_black, gc_halParentLeft, gc_valParentTop, 0, 0, GetViewerWidth, GetViewerHeight, 0, bupdate);
      [*] = ;   SetGUIElementUserBlend(elmHnd, 0.325);
      [*] = ;   //elmHnd := _gui_CreateWindowByTemplate('pausewnd', elmParent, gc_gui_material_window_template_deep, gc_halParentMiddle, gc_valParentMiddle, 0, 0, Max(cMinWidth, textwidth)+cPadding*2, textheight+cPadding, 0.875, False, False, False);
      [*] = ;   elmHnd := _gui_CreatePaperWindow('pausewnd', elmParent, gc_halParentMiddle, gc_valParentMiddle, 0, 0, Max(cMinWidth, textwidth)+cPadding*4, Max(cMinHeight, textheight)+cPadding*2, 1, False, bupdate);
      [*] = ;   //elmHnd := _gui_CreateSkinWindow('pausewnd', elmParent, gc_halParentMiddle, gc_valParentMiddle, 0, 0, Max(cMinWidth, textwidth+cPadding*2), Max(cMinHeight, textheight+cPadding), 1, bupdate);
      [*] = ;   var color : TColor;
      [*] = ;   _gui_ConvertHexToTColor('400000', color);
      [*] = ;   _gui_CreateText('pausetxt', elmHnd, text, gc_halParentLeft, gc_valParentTop, 0, 0, GetGUIElementWidth(elmHnd), GetGUIElementHeight(elmHnd), gc_halMiddle, gc_valMiddle, font, color, bupdate);
      [*] = ;end;
      [*] = ;gbool_gui_pausestate := GetProgressingPauseMode;
   struct.end
section.end

