Просмотр исходного кода

Rune Craft report updated to handle grouped rune craft items (game v5.2.6)

Iñigo Valentin 6 лет назад
Родитель
Сommit
2a265a92c6

+ 33 - 25
application/entity/Rune_Craft.php

@@ -96,6 +96,11 @@
          */
         public $value;
 
+        /**
+         * @var int Number of item of this type owned.
+         */
+        public $amount;
+
         /**
          * Constructor.
          *
@@ -109,31 +114,33 @@
 
             global $db;
 
-            $s =
-              "SELECT " .
-              "  rune_craft.id AS id, " .
-              "  rune_craft.quality As quality, " .
-              "  rune_craft.rune AS rune, " .
-              "  rune_craft.stat AS stat, " .
-              "  rune_craft.value AS value, " .
-              "  k_rune_craft_type.name AS name, " .
-              "  k_rune_craft_type.gem AS gem, " .
-              "  k_rune_craft_type.inmemorial AS inmemorial, " .
-              "  k_rune_craft_type.ancient AS ancient, " .
-              "  k_rune_craft_range.min AS min, " .
-              "  k_rune_craft_range.max AS max " .
-              "FROM " .
-              "  rune_craft, ".
-              "  k_rune_craft_type, " .
-              "  k_rune_craft_range " .
-              "WHERE " . 
-              "  rune_craft.id = $id AND " .
-              "  rune_craft.type = k_rune_craft_type.id AND " .
-              "  k_rune_craft_type.gem = k_rune_craft_range.gem AND " .
-              "  k_rune_craft_type.gem = k_rune_craft_range.gem AND " .
-              "  k_rune_craft_type.ancient = k_rune_craft_range.ancient AND " .
-              "  rune_craft.quality = k_rune_craft_range.quality AND " .
-              "  rune_craft.stat = k_rune_craft_range.stat;";
+            $s = "
+              SELECT
+                rune_craft.id AS id,
+                rune_craft.quality As quality,
+                rune_craft.rune AS rune,
+                rune_craft.stat AS stat,
+                rune_craft.value AS value,
+                rune_craft.amount AS amount,
+                k_rune_craft_type.name AS name,
+                k_rune_craft_type.gem AS gem,
+                k_rune_craft_type.inmemorial AS inmemorial,
+                k_rune_craft_type.ancient AS ancient,
+                k_rune_craft_range.min AS min,
+                k_rune_craft_range.max AS max
+              FROM
+                rune_craft,
+                k_rune_craft_type,
+                k_rune_craft_range
+              WHERE
+                rune_craft.id = $id AND
+                rune_craft.type = k_rune_craft_type.id AND
+                k_rune_craft_type.gem = k_rune_craft_range.gem AND
+                k_rune_craft_type.gem = k_rune_craft_range.gem AND
+                k_rune_craft_type.ancient = k_rune_craft_range.ancient AND
+                rune_craft.quality = k_rune_craft_range.quality AND
+                rune_craft.stat = k_rune_craft_range.stat;
+            ";
             $q = $db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
             if ($r){
@@ -155,6 +162,7 @@
                 $this->min = $r["min"];
                 $this->max = $r["max"];
                 $this->value = $r["value"];
+                $this->amount = $r["amount"];
             }
         }
 

+ 3 - 0
application/helper/HTML_Helper.php

@@ -392,6 +392,9 @@
             $html .= "<span class='craft_stat_name'>" . $stat_name . "</span>\n";
             $html .= "<span class='craft_stat_value'>" . $stat_value . "</span>\n";
             $html .= "</span>\n";
+            $html .= "<span class='craft_amount'>\n";
+            $html .= "x" . $craft->amount . "\n";
+            $html .= "</span>\n";
             $html .= "</div>\n";
             return $html;
         }

+ 1 - 0
application/view/report_runecraft.php

@@ -104,6 +104,7 @@
                                 }
 ?>
                             </div>
+                            <br/>
 <?php
                         }
 ?>

+ 19 - 9
public/css/ui.css

@@ -759,8 +759,8 @@ table.rune td.details table.table_details span.quality.quality_legend{background
  * Craft item panel
  */
 div.craft_panel{
-    width: 3em;
-    height: 3em;
+    width: 4em;
+    height: 4em;
     border: 0.1em solid #3c2929;
     border-radius: 0.5em;
     position: relative;
@@ -784,18 +784,18 @@ div.craft_panel.craft_quality_legend{ /* Legend */
 }
 div.craft_panel img.craft_base{
     position: absolute;
-    width: 3em;
-    height: 3em;
+    width: 4em;
+    height: 4em;
     margin: -0.5em;
     top: 0.1em;
     left: 0.5em;
 }
 div.craft_panel img.craft_icon{
     position: absolute;
-    width: 1em;
-    height: 1em;
-    top: 0.6em;
-    left: 1em;
+    width: 1.5em;
+    height: 1.5em;
+    top: 0.8em;
+    left: 1.25em;
 }
 div.craft_panel.craft_ancient_1 img.craft_base{filter: brightness(150%) contrast(90%) saturate(100%) drop-shadow(0 0 0.3em #ffffff) drop-shadow(0 0 0.1em #ffffff);}
 div.craft_panel.craft_quality_normal img.craft_base{filter: sepia(100%) saturate(500%) grayscale(100%);}
@@ -807,7 +807,7 @@ div.craft_panel span.craft_stat{
     display: block;
     width: 100%;
     text-align: center;
-    font-size: 60%;
+    font-size: 80%;
     text-shadow: 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000;
     position: absolute;
     top: 2.7em;
@@ -821,3 +821,13 @@ div.craft_panel span.craft_stat span.craft_stat_value{
     font-weight: bold;
     margin: 0;
 }
+
+div.craft_panel span.craft_amount{
+    display: block;
+    position: absolute;
+    top: 0;
+    right: 0.2em;
+    text-align: right;
+    font-size: 90%;
+    font-weight: bold;
+    text-shadow: 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000, 0 0 0.2em #000000;