From d858c85465200adb793b1d00dbb4401f121e0f14 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 7 Jun 2020 21:52:11 +0200 Subject: [PATCH] Items/Tooltips * display ppm in tooltip --- includes/types/item.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 80b4c46f..639765fb 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -934,9 +934,14 @@ class ItemList extends BaseType if ($cd < $this->curTpl['spellCategoryCooldown'.$j]) $cd = $this->curTpl['spellCategoryCooldown'.$j]; - $cd = $cd < 5000 ? null : ' ('.sprintf(Lang::game('cooldown'), Util::formatTime($cd)).')'; + $extra = []; + if ($cd >= 5000) + $extra[] = Lang::game('cooldown', [Util::formatTime($cd, true)]); + if ($this->curTpl['spellTrigger'.$j] == 2) + if ($ppm = $this->curTpl['spellppmRate'.$j]) + $extra[] = Lang::spell('ppm', [$ppm]); - $itemSpellsAndTrigger[$this->curTpl['spellId'.$j]] = [$this->curTpl['spellTrigger'.$j], $cd]; + $itemSpellsAndTrigger[$this->curTpl['spellId'.$j]] = [$this->curTpl['spellTrigger'.$j], $extra ? ' ('.implode(', ', $extra).')' : '']; } }