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
@ -61,7 +61,7 @@ if (!empty($_GET['view']))
|
|||||||
if ($cmd == "getUniqueItem") {
|
if ($cmd == "getUniqueItem") {
|
||||||
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
|
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
|
||||||
$res = PDO_FetchRow($sql);
|
$res = PDO_FetchRow($sql);
|
||||||
|
|
||||||
if (empty($res['invfile'])) {
|
if (empty($res['invfile'])) {
|
||||||
|
|
||||||
// if no invfile, get from other tables
|
// if no invfile, get from other tables
|
||||||
@ -175,8 +175,21 @@ if ($cmd == "getUniqueItem") {
|
|||||||
|
|
||||||
$return['props'] = $props;
|
$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');
|
header('Content-Type: application/json');
|
||||||
echo json_encode($return, JSON_INVALID_UTF8_IGNORE|JSON_PRETTY_PRINT);
|
echo json_encode($return, JSON_INVALID_UTF8_IGNORE|JSON_PRETTY_PRINT);
|
||||||
|
11
res/app.js
11
res/app.js
@ -201,16 +201,19 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
type = data["*type"];
|
type = data["*type"];
|
||||||
lvlreq = data["lvl req"];
|
lvlreq = data["lvl req"];
|
||||||
|
|
||||||
|
base = data.baseItemInfo;
|
||||||
|
|
||||||
|
|
||||||
$('.item_stats p').append(`<li class="statindex">${data.index}</li>`);
|
$('.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="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="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) {
|
$.each(props, function (i, v) {
|
||||||
|
|
||||||
|
@ -231,4 +231,30 @@ pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
|
|||||||
|
|
||||||
.statlvlreq {
|
.statlvlreq {
|
||||||
color: white;
|
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*/
|
||||||
|
}
|
||||||
|
@ -192,7 +192,7 @@ class D2ItemDesc {
|
|||||||
$par = $params['par'];
|
$par = $params['par'];
|
||||||
$min = (int) $params['min'];
|
$min = (int) $params['min'];
|
||||||
$v = $min;
|
$v = $min;
|
||||||
|
|
||||||
$max = (int) $params['max'];
|
$max = (int) $params['max'];
|
||||||
|
|
||||||
if ($min == $max) {
|
if ($min == $max) {
|
||||||
@ -290,7 +290,7 @@ class D2ItemDesc {
|
|||||||
if ($params['descfunc'] == 15) {
|
if ($params['descfunc'] == 15) {
|
||||||
$sql = "SELECT skill FROM `skills` WHERE `Id`='$par'";
|
$sql = "SELECT skill FROM `skills` WHERE `Id`='$par'";
|
||||||
$skill = PDO_FetchOne($sql);
|
$skill = PDO_FetchOne($sql);
|
||||||
$this->str = sprintf($s1, $min, $max, $skill);
|
$this->str = sprintf($s1, $min, $params['max'], $skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($params['descfunc'] == 16) {
|
if ($params['descfunc'] == 16) {
|
||||||
@ -329,7 +329,7 @@ class D2ItemDesc {
|
|||||||
$sql = "SELECT skill FROM `skills` WHERE `Id`='$par'";
|
$sql = "SELECT skill FROM `skills` WHERE `Id`='$par'";
|
||||||
$skill = PDO_FetchOne($sql);
|
$skill = PDO_FetchOne($sql);
|
||||||
$this->str = "+$min to Skill Charges Or Something";
|
$this->str = "+$min to Skill Charges Or Something";
|
||||||
$this->str = sprintf("Level $max $skill ".$string,$min,$min);
|
$this->str = sprintf("Level $max $skill " . $string, $min, $min);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($params['descfunc'] == 25) {
|
if ($params['descfunc'] == 25) {
|
||||||
|
@ -52,10 +52,13 @@
|
|||||||
<link rel="stylesheet" href="/res/font-awesome.min.css">
|
<link rel="stylesheet" href="/res/font-awesome.min.css">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
|
<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/style.css">
|
||||||
<link rel="stylesheet" href="/res/<?php echo $css ?>">
|
<link rel="stylesheet" href="/res/<?php echo $css ?>">
|
||||||
<style>
|
<style>
|
||||||
|
a {
|
||||||
|
color: #007bff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="/res/jquery-3.6.0.min.js"></script>
|
<script src="/res/jquery-3.6.0.min.js"></script>
|
||||||
<script src="/res/bootstrap.bundle.min.js"></script>
|
<script src="/res/bootstrap.bundle.min.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user