This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-web/legacyworlds-web-main/WebContent/WEB-INF/fm/en/game.ftl

66 lines
1.7 KiB
Text
Raw Normal View History

2018-10-23 09:38:02 +02:00
<#macro game_time record>
<#if record.years == 1>
1 year,
<#elseif record.years gt 1 >
${record.years?string(",##0")} years,
</#if>
<#if record.weeks == 1>
1 week,
<#elseif record.weeks gt 1 >
${record.weeks?string} weeks,
</#if>
<#if record.days == 1>
1 day
<#elseif record.days gt 1 >
${record.days?string} days,
<#else>
first day,
</#if>
${record.hours?string("00")}:00
</#macro>
<#macro game_duration record>
<#if record.years == 1>
1 year
<#elseif record.years gt 1 >
${record.years?string(",##0")} years
</#if>
<#if record.weeks == 1>
1 week
<#elseif record.weeks gt 1 >
${record.weeks?string} weeks
</#if>
<#if record.days == 1>
1 day
<#elseif record.days gt 1 >
${record.days?string} days
</#if>
<#if record.hours == 1>
1 hour
<#elseif record.hours gt 1 >
${record.hours?string} hours
</#if>
</#macro>
<#macro rl_duration rTime>
<#local rlDays = (rTime / 1440)?floor>
<#local rlHours = ((rTime - rlDays * 1440) / 60)?floor>
<#local rlMinutes = (rTime - rlDays * 1440 - rlHours * 60)>
<#if rlDays gt 0>
<#if rlDays = 1>1 day<#else>${rlDays} days</#if>
</#if>
<#if rlHours gt 0>
<#if rlHours = 1>1 hour<#else>${rlHours} hours</#if>
</#if>
<#if rlMinutes gt 0>
<#if rlMinutes = 1>1 minute<#else>${rlMinutes} minutes</#if>
</#if>
</#macro>
<#macro duration rTime gTime>
<#if data.page.useRLTime>
<@rl_duration rTime=rTime />
<#else>
<span title="<@rl_duration rTime=rTime />"><@game_duration record=gTime /></span>
</#if>
</#macro>
<#macro abbr_bgc><abbr title="billion galactic credits">bgc</abbr></#macro>
<#macro abbr_st><abbr title="Server time">ST</abbr></#macro>
<#macro abbr_gt><abbr title="Time in the game universe">GT</abbr></#macro>