From 933fc3e9fff67aebeb8f926c46ca9fcf746e3ab3 Mon Sep 17 00:00:00 2001 From: lopar Date: Sun, 5 Jul 2020 01:05:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D1=80=D1=82=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BE=D1=81=D0=B0=20showinf=5Fpers();=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20(=D0=BD=D0=B0=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D0=B5=D1=86!=5F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/User.php | 95 +++++++++++++++++++++++++++++-- views/user-info-doll.php | 119 ++++++++++----------------------------- 2 files changed, 120 insertions(+), 94 deletions(-) diff --git a/classes/User.php b/classes/User.php index 0ac9882..2813e2b 100644 --- a/classes/User.php +++ b/classes/User.php @@ -46,14 +46,23 @@ class User protected function showItem(array $item) { - if ($item) { - echo sprintf('%s', $item['image'], $item['name']); + $itemSlot = $item['dressed_slot'] ?? 0; + $itemName = $item['name'] ?? ''; + $itemImage = $item['image'] ?? ''; + if ($itemSlot) { + echo << +{$itemName} +SLOT; } else { - echo ""; + echo << + align): ?> + Склонность + + block): ?> + {$this->login} + + {$this->login} + + clan): ?> + {$this->clan} + + +
+ добавить здоровье 🤔 +
+ + + + + + +
+ + + + + + + + + + + + + +
+ {$this->showItem($dressed_item[1])} +
+ {$this->showItem($dressed_item[2])} +
+ {$this->showItem($dressed_item[3])} +
+ {$this->showItem($dressed_item[4])} +
+
+ + + + + + + + + + + + + + + +
+ {$this->showItem($dressed_item[5])} +
+ {$this->showItem($dressed_item[6])} +
+ {$this->showItem($dressed_item[7])} +
+ {$this->showItem($dressed_item[8])} +
+
+
+ {$this->showItem($dressed_item[9])} + {$this->showItem($dressed_item[10])} + {$this->showItem($dressed_item[11])} +
+ Имя {$this->login}
Сила {$this->strength}
Ловкость {$this->dexterity}
@@ -69,7 +155,6 @@ class User Интеллект {$this->intelligence}
Мудрость {$this->wisdom}
Находится в {$this->getRoomName($this->room)}
-Предметы на тушке:
USERINFO; // if (isset($dressed_item[1])) { diff --git a/views/user-info-doll.php b/views/user-info-doll.php index c963b9f..56ecd60 100644 --- a/views/user-info-doll.php +++ b/views/user-info-doll.php @@ -1,3 +1,21 @@ + +{$dressed_item[$slot]['name']} +SLOT; + } else { + echo << align)): ?> Склонность @@ -11,7 +29,7 @@ <?= $user->clan ?> -
+
добавить здоровье 🤔
@@ -20,50 +38,22 @@
- - Слот [1] - - - - - Пустой слот [1]>
-                        <?php endif; ?>
+                        <?= showItemInSlot(1) ?>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <?php if (isset($dressed_item[2])): ?>
-                            <img src=" class="item-wrap-normal tip" alt="Слот [2]"> - - - - - Пустой слот [2] - +
- - Слот [3] - - - - - Пустой слот [3] - +
- - Слот [4] - - - - - Пустой слот [4] - +
@@ -75,50 +65,22 @@
- - Слот [5] - - - - - Пустой слот [5]>
-                        <?php endif; ?>
+                        <?= showItemInSlot(5) ?>
                     </td>
                 </tr>
                 <tr>
                     <td>
-                        <?php if (isset($dressed_item[6])): ?>
-                            <img src=" class="item-wrap-normal tip" alt="Слот [6]"> - - - - - Пустой слот [6] - +
- - Слот [7] - - - - - Пустой слот [7] - +
- - Слот [8] - - - - - Пустой слот [8] - +
@@ -126,28 +88,7 @@
- - Слот [9] - - - - - Пустой слот [9] - - - Слот [10] - - - - - Пустой слот [10] - - - Слот [11] - - - - - Пустой слот [11] - + + +
\ No newline at end of file