本文整理汇总了PHP中ItemList::renderTooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP ItemList::renderTooltip方法的具体用法?PHP ItemList::renderTooltip怎么用?PHP ItemList::renderTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemList
的用法示例。
在下文中一共展示了ItemList::renderTooltip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderTooltip
public function renderTooltip($interactive = false, $subOf = 0, $enhance = [])
{
if ($this->error) {
return;
}
$_name = $this->getField('name', true);
$_reqLvl = $this->curTpl['requiredLevel'];
$_quality = $this->curTpl['quality'];
$_flags = $this->curTpl['flags'];
$_class = $this->curTpl['class'];
$_subClass = $this->curTpl['subClass'];
$_slot = $this->curTpl['slot'];
$causesScaling = false;
if (!empty($enhance['r'])) {
if ($this->getRandEnchantForItem($enhance['r'])) {
$_name .= ' ' . Util::localizedString($this->enhanceR, 'name');
$randEnchant = '';
for ($i = 1; $i < 6; $i++) {
if ($this->enhanceR['enchantId' . $i] <= 0) {
continue;
}
$enchant = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?d', $this->enhanceR['enchantId' . $i]);
if ($this->enhanceR['allocationPct' . $i] > 0) {
$amount = intVal($this->enhanceR['allocationPct' . $i] * $this->generateEnchSuffixFactor());
$randEnchant .= '<span>' . str_replace('$i', $amount, Util::localizedString($enchant, 'name')) . '</span><br />';
} else {
$randEnchant .= '<span>' . Util::localizedString($enchant, 'name') . '</span><br />';
}
}
} else {
unset($enhance['r']);
}
}
if (isset($enhance['s']) && !in_array($_slot, [INVTYPE_WRISTS, INVTYPE_WAIST, INVTYPE_HANDS])) {
unset($enhance['s']);
}
// IMPORTAT: DO NOT REMOVE THE HTML-COMMENTS! THEY ARE REQUIRED TO UPDATE THE TOOLTIP CLIENTSIDE
$x = '';
// upper table: stats
if (!$subOf) {
$x .= '<table><tr><td>';
}
// name; quality
if ($subOf) {
$x .= '<span class="q' . $_quality . '"><a href="?item=' . $this->id . '">' . $_name . '</a></span>';
} else {
$x .= '<b class="q' . $_quality . '">' . $_name . '</b>';
}
// heroic tag
if ($_flags & ITEM_FLAG_HEROIC && $_quality == ITEM_QUALITY_EPIC) {
$x .= '<br /><span class="q2">' . Lang::item('heroic') . '</span>';
}
// requires map (todo: reparse ?_zones for non-conflicting data; generate Link to zone)
if ($_ = $this->curTpl['map']) {
$map = DB::Aowow()->selectRow('SELECT * FROM ?_zones WHERE mapId = ?d LIMIT 1', $_);
$x .= '<br /><a href="?zone=' . $_ . '" class="q1">' . Util::localizedString($map, 'name') . '</a>';
}
// requires area
if ($this->curTpl['area']) {
$area = DB::Aowow()->selectRow('SELECT * FROM ?_zones WHERE Id=?d LIMIT 1', $this->curTpl['area']);
$x .= '<br />' . Util::localizedString($area, 'name');
}
// conjured
if ($_flags & ITEM_FLAG_CONJURED) {
$x .= '<br />' . Lang::item('conjured');
}
// bonding
if ($_flags & ITEM_FLAG_ACCOUNTBOUND) {
$x .= '<br /><!--bo-->' . Lang::item('bonding', 0);
} else {
if ($this->curTpl['bonding']) {
$x .= '<br /><!--bo-->' . Lang::item('bonding', $this->curTpl['bonding']);
}
}
// unique || unique-equipped || unique-limited
if ($this->curTpl['maxCount'] > 0) {
$x .= '<br />' . Lang::item('unique');
if ($this->curTpl['maxCount'] > 1) {
$x .= ' (' . $this->curTpl['maxCount'] . ')';
}
} else {
if ($_flags & ITEM_FLAG_UNIQUEEQUIPPED) {
$x .= '<br />' . Lang::item('uniqueEquipped');
} else {
if ($this->curTpl['itemLimitCategory']) {
$limit = DB::Aowow()->selectRow("SELECT * FROM ?_itemlimitcategory WHERE id = ?", $this->curTpl['itemLimitCategory']);
$x .= '<br />' . ($limit['isGem'] ? Lang::item('uniqueEquipped') : Lang::item('unique')) . Lang::main('colon') . Util::localizedString($limit, 'name') . ' (' . $limit['count'] . ')';
}
}
}
// max duration
if ($dur = $this->curTpl['duration']) {
$x .= "<br />" . Lang::game('duration') . Lang::main('colon') . Util::formatTime(abs($dur) * 1000) . ($this->curTpl['flagsCustom'] & 0x1 ? ' (' . Lang::item('realTime') . ')' : null);
}
// required holiday
if ($eId = $this->curTpl['eventId']) {
if ($hName = DB::Aowow()->selectRow('SELECT h.* FROM ?_holidays h JOIN ?_events e ON e.holidayId = h.id WHERE e.id = ?d', $eId)) {
$x .= '<br />' . sprintf(Lang::game('requires'), '<a href="' . $eId . '" class="q1">' . Util::localizedString($hName, 'name') . '</a>');
}
}
//.........这里部分代码省略.........