Tooltips/TimeFMT

* use strings from globalstrings.lua to format time in item and spell tooltips
 * fixed item filter ItemCooldown
 * fixed timeAgo format
 * move item duration to correct position in tooltip
This commit is contained in:
Sarjuuk
2023-03-18 21:30:55 +01:00
parent 6ee0d63766
commit d77e459da3
11 changed files with 273 additions and 40 deletions

View File

@@ -573,7 +573,7 @@ abstract class Util
return $money;
}
private static function parseTime(int $msec) : array
public static function parseTime(int $msec) : array
{
$time = [0, 0, 0, 0, 0];
@@ -671,7 +671,7 @@ abstract class Util
else if ($h) // hours, minutes ago
return Lang::main('timeAgo', [$h . ' ' . Lang::timeUnits('ab', 4) . ' ' . $m . ' ' . Lang::timeUnits('ab', 5)]);
else if ($m) // minutes, seconds ago
return Lang::main('timeAgo', [$m . ' ' . Lang::timeUnits('ab', 5) . ' ' . $m . ' ' . Lang::timeUnits('ab', 6)]);
return Lang::main('timeAgo', [$m . ' ' . Lang::timeUnits('ab', 5) . ' ' . $s . ' ' . Lang::timeUnits('ab', 6)]);
else // seconds ago
return Lang::main('timeAgo', [$s . ' ' . Lang::timeUnits($s == 1 ? 'sg' : 'pl', 6)]);
}