mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-04-27 14:55:38 +00:00
Item preview upgrade
This commit is contained in:
parent
21546a57db
commit
f92a59dcc5
@ -175,7 +175,20 @@ if ($cmd == "getUniqueItem") {
|
||||
|
||||
$return['props'] = $props;
|
||||
|
||||
//ddump($return);
|
||||
$sqlArmor = "SELECT * FROM armor WHERE code='{$res['code']}'";
|
||||
$sqlMisc = "SELECT * FROM misc WHERE code='{$res['code']}'";
|
||||
$sqlWeapons = "SELECT * FROM weapons WHERE code='{$res['code']}'";
|
||||
|
||||
$baseItemInfo = PDO_FetchRow($sqlArmor);
|
||||
|
||||
if (empty($baseItemInfo)) {
|
||||
$baseItemInfo = PDO_FetchRow($sqlMisc);
|
||||
}
|
||||
if (empty($baseItemInfo)) {
|
||||
$baseItemInfo = PDO_FetchRow($sqlWeapons);
|
||||
}
|
||||
|
||||
$return['baseItemInfo'] = array_filter($baseItemInfo);
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
11
res/app.js
11
res/app.js
@ -202,14 +202,17 @@ $(document).ready(function () {
|
||||
type = data["*type"];
|
||||
lvlreq = data["lvl req"];
|
||||
|
||||
base = data.baseItemInfo;
|
||||
|
||||
|
||||
$('.item_stats p').append(`<li class="statindex">${data.index}</li>`);
|
||||
$('.item_stats p').append(`<li class="stattype">${type}</li>`);
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Level: ${base.level}</li>`);
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Level Required: ${lvlreq}</li>`);
|
||||
// $('.item_stats p').append(`<li class="index">${data.index}</li>`);
|
||||
// $('.item_stats p').append(`<li class="index">${data.index}</li>`);
|
||||
// $('.item_stats p').append(`<li class="index">${data.index}</li>`);
|
||||
// $('.item_stats p').append(`<li class="index">${data.index}</li>`);
|
||||
|
||||
$('.item_stats p').append(`<li class="code" style="color:grey;">Item Code: ${base.code}</li>`);
|
||||
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Durability: ${base.durability}</li>`);
|
||||
|
||||
|
||||
$.each(props, function (i, v) {
|
||||
|
@ -232,3 +232,29 @@ pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
|
||||
.statlvlreq {
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
COLOR classes
|
||||
|
||||
|
||||
Text Colors
|
||||
#FFA500 Crafted items
|
||||
#4169E1 Magic items
|
||||
#FFFF00 Rare items
|
||||
#A59263 Unique items
|
||||
|
||||
*/
|
||||
|
||||
.green {
|
||||
color: #00FF00; /*Set items*/
|
||||
}
|
||||
.gold{
|
||||
color: #A59263; /*Set items*/
|
||||
}
|
||||
.orange{
|
||||
color: #FFA500; /*Set items*/
|
||||
}
|
||||
.yellow {
|
||||
color: #FFFF00; /*Set items*/
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ class D2ItemDesc {
|
||||
if ($params['descfunc'] == 15) {
|
||||
$sql = "SELECT skill FROM `skills` WHERE `Id`='$par'";
|
||||
$skill = PDO_FetchOne($sql);
|
||||
$this->str = sprintf($s1, $min, $max, $skill);
|
||||
$this->str = sprintf($s1, $min, $params['max'], $skill);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 16) {
|
||||
|
@ -52,10 +52,13 @@
|
||||
<link rel="stylesheet" href="/res/font-awesome.min.css">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://bootswatch.com/4/sketchy/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/res/style.css">
|
||||
<link rel="stylesheet" href="/res/<?php echo $css ?>">
|
||||
<style>
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
}
|
||||
</style>
|
||||
<script src="/res/jquery-3.6.0.min.js"></script>
|
||||
<script src="/res/bootstrap.bundle.min.js"></script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user