View Single Post
Old 01-12-2008, 02:53 PM   #7
[FX]Storm
Контр-адмиралПользователь
 
[FX]Storm's Avatar
 
Faction:
Кушане - киит Сомтау

Join Date: Feb 2007
Location: Пенза
Posts: 514
Re: Таймер в Homeworld2

Спасибо, AVE. Тэн поможешь разобраться с таймером из FX18 (хочу засунуть его в обычный). Вот содержание:

Code:
InGameRunTimeTimerDisplay = 0

function GameTimerDisplay()
    InGameRunTimeTimerDisplay = InGameRunTimeTimerDisplay + 1
    local iSeconds = mod(InGameRunTimeTimerDisplay,60)
    local iMinutes = (InGameRunTimeTimerDisplay - iSeconds) / 60
    local iHours = iMinutes
    iMinutes = mod(iMinutes, 60)
    iHours = iHours - iMinutes
    iHours = iHours / 60
    local sStrToDisplay = ""
    if (iHours < 10) then
        sStrToDisplay = sStrToDisplay.."0"..iHours..":"
    else
        sStrToDisplay = sStrToDisplay..iHours..":"
    end
    if (iMinutes < 10) then
        sStrToDisplay = sStrToDisplay.."0"..iMinutes..":"
    else
        sStrToDisplay = sStrToDisplay..iMinutes..":"
    end
    if (iSeconds < 10) then
        sStrToDisplay = sStrToDisplay.."0"..iSeconds
    else
        sStrToDisplay = sStrToDisplay..iSeconds
    end
    UI_SetTextLabelText("ResourceMenu", "lblTimerSize", sStrToDisplay)
end
[FX]Storm is offline   Reply With Quote