Fix Ryzom Client scripts for lua 5.2

This commit is contained in:
kaetemi 2013-06-25 23:57:23 +02:00
parent 5fa4beab46
commit 3df3fb730b
7 changed files with 12 additions and 12 deletions

View file

@ -84,7 +84,7 @@ function bgdownloader:setPatchProgress(progress)
self:getPrioCB().active = true
local progressPercentText = string.format("%d%%", 100 * progress)
local progressPostfix = math.mod(os.time(), 3)
local progressPostfix = math.fmod(os.time(), 3)
local progressDate = nltime.getLocalTime() / 500
local colValue = math.floor(230 + 24 * math.sin(progressDate))
local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255)

View file

@ -521,7 +521,7 @@ function GameR2Loading:validateLoading()
local filename = GameR2Loading.CurrentFile
if string.find(filename, '\.r2', -3) == nil then
if string.find(filename, '.r2', -3) == nil then
messageBox(i18n.get("uiR2EDLoadScenario_InvalidFileName"))
return
end

View file

@ -131,7 +131,7 @@ local function levelToForceRegion(level)
end
local function levelToLevelForce(level)
return math.floor(math.mod(level, 50) * 5 / 50) + 1
return math.floor(math.fmod(level, 50) * 5 / 50) + 1
end

View file

@ -135,7 +135,7 @@ end
--function outgame:setPatchProgress(progress)
-- --debugInfo("*** 3 ***")
-- local progressPercentText = string.format("%d%%", 100 * progress)
-- local progressPostfix = math.mod(os.time(), 3)
-- local progressPostfix = math.fmod(os.time(), 3)
-- --debugInfo("Patch in progress : " .. tostring(progress))
-- local progressDate = nltime.getLocalTime() / 500
-- local colValue = math.floor(230 + 24 * math.sin(progressDate))

View file

@ -56,7 +56,7 @@ function game:outpostAdjustHour(uiLocal, prop)
local h = runExpr(prop);
-- add time zone and clamp hour
h = math.mod(h + tz + 24, 24);
h = math.fmod(h + tz + 24, 24);
uiGroup[uiLocal].uc_hardtext = string.format('%02d:00', h);
end
@ -288,8 +288,8 @@ function game:outpostActiveDefenderHourButton()
local timeRangeDef= getDbProp(path .. ':TIME_RANGE_DEF');
local timeRangeDefWanted= getDbProp(path .. ':TIME_RANGE_DEF_WANTED');
timeRangeDef= secondsSince1970ToHour( timeRangeDef );
timeRangeDef= math.mod(timeRangeDef+24, 24);
timeRangeDefWanted= math.mod(timeRangeDefWanted+24, 24);
timeRangeDef= math.fmod(timeRangeDef+24, 24);
timeRangeDefWanted= math.fmod(timeRangeDefWanted+24, 24);
-- if time required is the one obtained, or if we are in peace
if( timeRangeDef == timeRangeDefWanted or status<=game.OutpostEnums.Peace ) then
@ -323,8 +323,8 @@ function game:outpostActiveAttackerHourButton()
local timeRangeAtt= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ACK_TIME_RANGE_ATT');
local timeRangeAttWanted= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ATTACK_PERIOD');
timeRangeAtt= secondsSince1970ToHour( timeRangeAtt );
timeRangeAtt= math.mod(timeRangeAtt+24, 24);
timeRangeAttWanted= math.mod(timeRangeAttWanted+24, 24);
timeRangeAtt= math.fmod(timeRangeAtt+24, 24);
timeRangeAttWanted= math.fmod(timeRangeAttWanted+24, 24);
-- if time required is the one obtained
if( timeRangeAtt == timeRangeAttWanted ) then

View file

@ -803,8 +803,8 @@ end
function game:timeInSecondsToReadableTime(regenTime)
local seconds = math.mod(regenTime, 60)
local minutes = math.mod(math.floor(regenTime / 60), 60)
local seconds = math.fmod(regenTime, 60)
local minutes = math.fmod(math.floor(regenTime / 60), 60)
local hours = math.floor(regenTime / 3600)
local result = ""
if seconds > 0 then result = concatUCString(tostring(seconds), i18n.get("uittSecondsShort")) end

View file

@ -904,7 +904,7 @@ function RingAccessPoint:onDraw()
self.LastRefreshTime = nltime.getLocalTime() / 1000
--self:getWindow():find("refreshText").active = false
else
local waitText = i18n.get("uiRAP_WaitMsg" .. math.mod(os.time(), 3))
local waitText = i18n.get("uiRAP_WaitMsg" .. math.fmod(os.time(), 3))
self:setInfoMessage(waitText)
--local refreshText = self:getWindow():find("refreshText")
--if not self.ListReceived then