Przeglądaj źródła

Team icon in monster view.

Iñigo Valentin 6 lat temu
rodzic
commit
32466b9c2b
2 zmienionych plików z 32 dodań i 1 usunięć
  1. 11 0
      application/helper/html.php
  2. 21 1
      public/css/ui.css

+ 11 - 0
application/helper/html.php

@@ -12,11 +12,13 @@
             $k = $unit->unit;
             $stars = $unit->stars;
             $level = true;
+            $teams = (sizeof($unit->teams) > 0);
         }
         elseif ($unit instanceof K_Unit){
             $k = $unit;
             $stars = $unit->base_stars;
             $level = false;
+            $teams = 0;
         }
         else{
             return "";
@@ -52,6 +54,15 @@
             $html .= $unit->level . "\n";
             $html .= "</span>\n";
         }
+        $html .= "<span class='badges'>\n";
+        if ($teams > 0){
+            $title = $teams . " teams";
+            if ($teams == 1){
+                $title = "1 team: " . $unit->teams[0]->name;
+            }
+            $html .= "<img title='$title' src='" . $path["img"]["icon"] . "team.png'>";
+        }
+        $html .= "</span>\n";
         return $html;
     }
 

+ 21 - 1
public/css/ui.css

@@ -555,7 +555,7 @@ div.monster_panel span.level{
     font-weight: bold;
     color: #000;
     text-shadow: 0 0 0.1em #fff, 0 0 0.1em #fff, 0 0 0.2em #fff, 0 0 0.2em #fff, 0 0 0.5em #fff, 0 0 0.5em #fff;
-    font-size: 2.5em;
+    font-size: 2em;
     width: 90%;
     text-align: right;
     bottom: 1.3em;
@@ -564,6 +564,26 @@ div.monster_panel span.level{
     display: block;
 }
 
+div.monster_panel span.badges{
+    position: absolute;
+    width: 90%;
+    text-align: left;
+    bottom: 0.2em;
+    left: 0.2em;
+    z-index: 1;
+    pointer-events: none;
+    display: block;
+}
+
+div.monster_panel span.badges img{
+    width: 1.4em;
+    height: 1.4em;
+    /* filter: drop-shadow(0 0 0.3em #ffffff) drop-shadow(0 0 0.1em #ffffff); */
+    border-radius: 50%;
+    border: 0.15em solid #000000;
+    background-color: #ffffff;
+}
+
 /**
  * /Monster panel
  */