Sub XRTTops ( $KeyFlags, $id ) closeButtonRegex (GetCurrentPlayerVar("UserName"), "SinrsTop_*"); # close Top table # Set various vars for GUI size and location $TOL = 35; # TOL - Top Origin Left edge of main content window $TOT = 33; # Top Origin Top edge of main content window $TRH = 4; # TRH - Top Row Height # Draw the dialog box openPrivButton ("SinrsTop_topback",$TOL,$TOT,91,$TRH+123,1,-1,16,""); openPrivButton ("SinrsTop_toptitle",$TOL+1,$TOT+1,89,$TRH+1,5,-1,32,"^3Top XRT times on this server"); # Headings openPrivButton ("SinrsTop_toppos",$TOL+1,$TOT+6,8,$TRH+1,1,-1,35, langEngine ("%{built_pos}%")); openPrivButton ("SinrsTop_topcar",$TOL+9,$TOT+6,8,$TRH+1,1,-1,35, langEngine ("%{built_car}%")); openPrivButton ("SinrsTop_topnick",$TOL+17,$TOT+6,36,$TRH+1,1,-1,99, langEngine ("%{built_nick}%")); openPrivButton ("SinrsTop_toppb",$TOL+53,$TOT+6,12,$TRH+1,1,-1,35, "Laptime"); openPrivButton ("SinrsTop_topsplits",$TOL+65,$TOT+6,25,$TRH+1,1,-1,35, langEngine ("%{built_splits}%")); openPrivButton ("SinrsTop_close",$TOL+1,$TOT+121,89,$TRH+1,5,-1,35,"Close",CloseSinrsTop); $XRT = GetListTop( "XRT", FALSE,FALSE ); # Top List for XRT cars # GetListTop cam show 24 results, so we go through them now FOR( $i = 0; $i < 24; $i = $i + 1) # Only show the line if it has a valid username IF ( $XRT[$i,"UserName"] != "") THEN IF( ToLower( $currUName ) == ToLower( $XRT[$i,"UserName"] ) ) THEN $bStyle = ISB_DARK; ELSE $bStyle = ISB_LIGHT; ENDIF $TOT = $TOT + $TRH; # Go down to the next printable row openPrivButton ("SinrsTop_toppos_" . $i,$TOL+1,$TOT+7,8,$TRH,1,-1,$bStyle, $XRT[$i,"Pos"]); openPrivButton ("SinrsTop_topcar_" . $i,$TOL+9,$TOT+7,8,$TRH,1,-1,$bStyle, $XRT[$i,"CName"]); openPrivButton ("SinrsTop_topnick_" . $i,$TOL+17,$TOT+7,36,$TRH,1,-1,ISB_LEFT + $bStyle, $XRT[$i,"NickName"]); IF ($XRT[$i,"PbLapTime"] > 3599000) THEN $colpb = ((3600000 - $XRT[$i,"PbLapTime"]) / 10) . "/" . GetConfigVar( "LapTimeUsedForPb" ) + langEngine( "%{built_lapsdone}%" ); $colpos = "-"; ELSE $colpb = NumToMSH( $XRT[$i,"PbLapTime"] ); ENDIF openPrivButton ("SinrsTop_toppb_" . $i,$TOL+53,$TOT+7,12,$TRH,1,-1,$bStyle, $colpb); $colsplit = ""; FOR( $k = 0; $k < 3; $k = $k +1 ) $SplitTime = $XRT[$i,"SplitTime".$k]; IF ($SplitTime != 0) THEN IF ( $colsplit != "" ) THEN $colsplit = $colsplit . "/" . NumToMSH($SplitTime); ELSE $colsplit = NumToMSH($SplitTime); ENDIF ENDIF ENDFOR openPrivButton ("SinrsTop_topsplits_" . $i,$TOL+65,$TOT+7,25,$TRH,1,-1,$bStyle, $colsplit); ENDIF ENDFOR EndSub