Jump to content

[HELP] Toptimes


Reflex#

Recommended Posts

search in toptimes_client.lua

function CToptimes:doOnServerSentToptimes( data, serverRevision, playerPosition ) 

and use

local yourLines = 10 
for i=1,yourLines do 
    outputChatBox ( data[i].dateRecorded ); 
end 

Change outputChatBox on dxDrawText or guiSetText

Link to comment
function CToptimes:doOnServerSentToptimes( data, serverRevision, playerPosition ) 
    outputDebug( 'TOPTIMES', 'CToptimes:doOnServerSentToptimes ' .. tostring(#data) ) 
  
    -- Calc number lines to use and height of window 
    local numLines = math.clamp( 0, #data, 50 ) 
    self.size.y = 46 + 15 * numLines 
  
    -- Set height of window 
    local sizeX = self.size.x 
    local sizeY = self.size.y 
    guiSetSize( self.gui['windowbg'], sizeX, sizeY, false ) 
  
    -- Make listTimes contains the correct number of labels 
    self:updateLabelCount(numLines) 
  
    -- Update the list items 
    for i=1,numLines do 
        local d = data[i].dateRecorded 
        local timeText = data[i].timeText 
        if timeText:sub(1,1) == '0' then 
            timeText = '  ' .. timeText:sub(2) 
        end 
        local line = string.format( '%d.  %s   %s   %s', i, timeText, data[i].playerName, d ) 
        guiSetText ( self.gui['listTimes'][i], line ) 
  
        if i == playerPosition then 
            guiLabelSetColor ( self.gui['listTimes'][i], 0, 255, 255 ) 
        else 
            guiLabelSetColor ( self.gui['listTimes'][i], 255, 255, 255 ) 
        end 
  
    end 
  
    -- Debug 
    if _DEBUG_CHECK then 
        outputDebug( 'TOPTIMES', 'toptimes', string.format('crev:%s  srev:%s', tostring(self.clientRevision), tostring(serverRevision) ) ) 
        if self.clientRevision == serverRevision then 
            outputDebug( 'TOPTIMES', 'Already have this revision' ) 
        end 
    end 
  
    -- Update status 
    self.clientRevision = serverRevision 
    self.listStatus = 'Full' 
    self:updateShow() 
end 

Link to comment
function CToptimes:doOnServerSentToptimes( data, serverRevision, playerPosition ) 
    outputDebug( 'TOPTIMES', 'CToptimes:doOnServerSentToptimes ' .. tostring(#data) ) 
  
    -- Calc number lines to use and height of window 
    local numLines = math.clamp( 0, #data, 50 ) 
    self.size.y = 46 + 15 * numLines 
  
    -- Set height of window 
    local sizeX = self.size.x 
    local sizeY = self.size.y 
    guiSetSize( self.gui['windowbg'], sizeX, sizeY, false ) 
  
    -- Make listTimes contains the correct number of labels 
    self:updateLabelCount(numLines) 
  
    -- Update the list items 
    for i=1,numLines do 
        local d = data[i].dateRecorded 
        local timeText = data[i].timeText 
        if timeText:sub(1,1) == '0' then 
            timeText = '  ' .. timeText:sub(2) 
        end 
        local line = string.format( '%d.  %s   %s   %s', i, timeText, data[i].playerName, d ) 
        guiSetText ( self.gui['listTimes'][i], line ) 
  
        if i == playerPosition then 
            guiLabelSetColor ( self.gui['listTimes'][i], 0, 255, 255 ) 
        else 
            guiLabelSetColor ( self.gui['listTimes'][i], 255, 255, 255 ) 
        end 
  
    end 
  
    -- Debug 
    if _DEBUG_CHECK then 
        outputDebug( 'TOPTIMES', 'toptimes', string.format('crev:%s  srev:%s', tostring(self.clientRevision), tostring(serverRevision) ) ) 
        if self.clientRevision == serverRevision then 
            outputDebug( 'TOPTIMES', 'Already have this revision' ) 
        end 
    end 
  
    -- Update status 
    self.clientRevision = serverRevision 
    self.listStatus = 'Full' 
    self:updateShow() 
end 

I put it in the end of toptimes_client.lua and debugscript 3 showed me :

@ 784 : bad argument #5 to 'format' (string expected,got nil)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...