Кривое позиционирование слотов. Разворот лишней функции.
This commit is contained in:
parent
566d8356d0
commit
5ef6696614
@ -49,14 +49,14 @@ class User
|
||||
}
|
||||
}
|
||||
|
||||
protected function showItem($item = 0)
|
||||
protected function showItem($item)
|
||||
{
|
||||
$itemSlot = $item['dressed_slot'] ?? 0;
|
||||
$itemName = $item['name'] ?? '';
|
||||
$itemImage = $item['image'] ?? '';
|
||||
if ($itemSlot) {
|
||||
echo <<<SLOT
|
||||
<img src="/i/sh/{$itemImage}" class="item-wrap-normal tip" alt="Слот [{$itemSlot}]">
|
||||
<img src="/i/sh/{$itemImage}" class="item-wrap-normal tip" alt="{$itemName}">
|
||||
<span class="tiptext"><strong>{$itemName}</strong></span>
|
||||
SLOT;
|
||||
} else {
|
||||
@ -75,9 +75,11 @@ EMPTY_SLOT;
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
echo sprintf('<div class="slot-%s">', $i);
|
||||
if (isset($dressed_item[$i])) {
|
||||
$this->showItem($dressed_item[$i]);
|
||||
//$this->showItem($dressed_item[$i]);
|
||||
$itemString = '<img src="/i/sh/%s" class="item-wrap-normal tip" alt="%s"><span class="tiptext"><strong>%s</strong></span>';
|
||||
echo sprintf($itemString, $dressed_item[$i]['image'], $dressed_item[$i]['name'], $dressed_item[$i]['name']);
|
||||
} else {
|
||||
$this->showItem($i);
|
||||
echo sprintf('<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [%s]" alt="Пустой слот [%s]">', $i, $i);
|
||||
}
|
||||
echo sprintf('</div><!-- slot-%s -->', $i);
|
||||
}
|
||||
|
@ -358,10 +358,10 @@ div.user-info-container > div.slot-8 {
|
||||
grid-row: 4;
|
||||
}
|
||||
|
||||
div.user-info-container > div.slot-5,
|
||||
div.user-info-container > div.slot-6,
|
||||
div.user-info-container > div.slot-7,
|
||||
div.user-info-container > div.slot-8 {
|
||||
div.user-info-container > div.slot-9,
|
||||
div.user-info-container > div.slot-10,
|
||||
div.user-info-container > div.slot-11,
|
||||
div.user-info-container > div.slot-12 {
|
||||
grid-row: 5;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user