Refactored Item display. Todo: auto doc gen debug loop
0
.gitignore
vendored
Normal file → Executable file
0
GlowItems.php
Normal file → Executable file
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
function getIscStrings($iscStat) {
|
||||
$sql = "
|
||||
SELECT
|
||||
(
|
||||
SELECT String
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS string1,
|
||||
(
|
||||
SELECT String
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.DescStr2 = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS string2,
|
||||
(
|
||||
SELECT descfunc
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS descfunc,
|
||||
(
|
||||
SELECT descval
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS descval
|
||||
";
|
||||
|
||||
return PDO_FetchRow($sql);
|
||||
}
|
3
ajax/config.php
Normal file → Executable file
@ -44,9 +44,6 @@
|
||||
session_start();
|
||||
error_reporting(E_ALL ^ E_WARNING);
|
||||
include "../_pdo.php";
|
||||
require_once "../src/D2Functions.php";
|
||||
require_once "../src/D2ItemDesc.php";
|
||||
require_once './D2AjaxFunctions.php';
|
||||
|
||||
define('DB_FILE', $_SESSION['modname'] . ".db");
|
||||
define('TXT_PATH', $_SESSION['path']);
|
||||
|
139
ajax/uniqueitems.php
Normal file → Executable file
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
include "./config.php";
|
||||
$idesc = new D2ItemDesc();
|
||||
require_once "../src/D2Functions.php";
|
||||
require_once '../src/D2ItemData.php';
|
||||
$idata = new D2ItemData();
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
@ -59,140 +61,7 @@ if (!empty($_GET['view']))
|
||||
// first search code in all 3 tables. Grab from where it exists.
|
||||
|
||||
if ($cmd == "getUniqueItem") {
|
||||
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
|
||||
$res = PDO_FetchRow($sql);
|
||||
|
||||
if (empty($res['invfile'])) {
|
||||
|
||||
// if no invfile, get from other tables
|
||||
// try to get from armor, weapons, misc
|
||||
|
||||
$sql = "SELECT invfile FROM armor WHERE code='{$res['code']}'";
|
||||
$invfile[] = PDO_FetchRow($sql);
|
||||
|
||||
$sql = "SELECT invfile FROM weapons WHERE code='{$res['code']}'";
|
||||
$invfile[] = PDO_FetchRow($sql);
|
||||
|
||||
$sql = "SELECT invfile FROM misc WHERE code='{$res['code']}'";
|
||||
$invfile[] = PDO_FetchRow($sql);
|
||||
|
||||
$invfile = array_filter($invfile);
|
||||
|
||||
foreach ($invfile as $i) {
|
||||
$x[] = $i;
|
||||
}
|
||||
|
||||
|
||||
$invClean = array_filter($x[0]);
|
||||
|
||||
$return = array_merge($res, $invClean);
|
||||
} else {
|
||||
$return = $res;
|
||||
}
|
||||
|
||||
// var_dump($return);
|
||||
// for all props for this unique item, get ISC strings
|
||||
|
||||
$props = array_filter([
|
||||
"Prop1" => array_filter(
|
||||
["prop1" => $return['prop1'], "par1" => $return['par1'], "min1" => $return['min1'], "max1" => $return['max1']]
|
||||
),
|
||||
"Prop2" => array_filter(
|
||||
["prop2" => $return['prop2'], "par1" => $return['par2'], "min1" => $return['min2'], "max1" => $return['max2']]
|
||||
),
|
||||
"Prop3" => array_filter(
|
||||
["prop3" => $return['prop3'], "par1" => $return['par3'], "min1" => $return['min3'], "max1" => $return['max3']]
|
||||
),
|
||||
"Prop4" => array_filter(
|
||||
["prop4" => $return['prop4'], "par1" => $return['par4'], "min1" => $return['min4'], "max1" => $return['max4']]
|
||||
),
|
||||
"Prop5" => array_filter(
|
||||
["prop5" => $return['prop5'], "par1" => $return['par5'], "min1" => $return['min5'], "max1" => $return['max5']]
|
||||
),
|
||||
"Prop6" => array_filter(
|
||||
["prop6" => $return['prop6'], "par1" => $return['par6'], "min1" => $return['min6'], "max1" => $return['max6']]
|
||||
),
|
||||
"Prop7" => array_filter(
|
||||
["prop7" => $return['prop7'], "par1" => $return['par7'], "min1" => $return['min7'], "max1" => $return['max7']]
|
||||
),
|
||||
"Prop8" => array_filter(
|
||||
["prop8" => $return['prop8'], "par1" => $return['par8'], "min1" => $return['min8'], "max1" => $return['max8']]
|
||||
),
|
||||
"Prop9" => array_filter(
|
||||
["prop9" => $return['prop9'], "par1" => $return['par9'], "min1" => $return['min9'], "max1" => $return['max9']]
|
||||
),
|
||||
"Prop10" => array_filter(
|
||||
["prop10" => $return['prop10'], "par1" => $return['par10'], "min1" => $return['min10'], "max1" => $return['max10']]
|
||||
)
|
||||
]);
|
||||
|
||||
// need par, min, max value for each prop
|
||||
// for each prop, get stat
|
||||
$counter = 1;
|
||||
foreach ($props as $key => $val) {
|
||||
// val = Prop1,Prop2 etc.
|
||||
// for each propr, get all 7 stats in ISC
|
||||
$sql = "SELECT stat1,stat2,stat3,stat4,stat5,stat6,stat7 FROM `properties` WHERE `code` = '{$val['prop' . $counter]}'";
|
||||
$props[$key]['stat'] = array_filter(PDO_FetchRow($sql));
|
||||
|
||||
$counter++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//each stat now goes into getIscStrings
|
||||
foreach ($props as $k => $v) {
|
||||
$props[$k]['desc'] = array_filter(getIscStrings($v['stat']['stat1']));
|
||||
}
|
||||
|
||||
// SELECT * FROM strings WHERE `Key`='ModStr3a' returns always Amazon Skills
|
||||
|
||||
// todo: put values in params, so I can get generated string for that prop
|
||||
|
||||
$counter = 1;
|
||||
foreach ($props as $k => $v) { // for each property Prop1 Prop2
|
||||
$params = [
|
||||
'string1' => $v['desc']['string1'],
|
||||
'string2' => $v['desc']['string2'],
|
||||
'descfunc' => $v['desc']['descfunc'],
|
||||
'descval' => $v['desc']['descval'],
|
||||
"prop" => $return['prop' . $counter],
|
||||
"par" => $return['par' . $counter],
|
||||
"min" => $return['min' . $counter],
|
||||
"max" => $return['max' . $counter]
|
||||
];
|
||||
|
||||
|
||||
/*
|
||||
* getDesc should process string1, not file guide copy pasta
|
||||
*
|
||||
*/
|
||||
if (!empty($v['desc'])) {
|
||||
$props[$k]['string'][] = $idesc->getDesc($params);
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$return['props'] = $props;
|
||||
|
||||
$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');
|
||||
echo json_encode($return, JSON_INVALID_UTF8_IGNORE|JSON_PRETTY_PRINT);
|
||||
echo $idata->uniqueItems($_GET['index']);
|
||||
}
|
||||
/*
|
||||
* @cmd = sortBy
|
||||
|
0
bin/sqlite3.exe
Normal file → Executable file
1
config.php
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
|
70764
docs/Ironman/uniqueitems.html
Normal file
243957
docs/Ironman/uniqueitems.json
Normal file
BIN
docs/Test2/img/Diablo2.png
Executable file
After Width: | Height: | Size: 21 KiB |
BIN
docs/Test2/img/bg.jpg
Executable file
After Width: | Height: | Size: 229 KiB |
BIN
docs/Test2/img/button.png
Executable file
After Width: | Height: | Size: 15 KiB |
BIN
docs/Test2/img/button.xcf
Executable file
BIN
docs/Test2/img/button_long.png
Executable file
After Width: | Height: | Size: 14 KiB |
BIN
docs/Test2/img/button_long.xcf
Executable file
BIN
docs/Test2/img/items/1.png
Executable file
After Width: | Height: | Size: 228 B |
BIN
docs/Test2/img/items/INVGLD.png
Executable file
After Width: | Height: | Size: 549 B |
BIN
docs/Test2/img/items/am1.png
Executable file
After Width: | Height: | Size: 417 B |
BIN
docs/Test2/img/items/am10.png
Executable file
After Width: | Height: | Size: 505 B |
BIN
docs/Test2/img/items/am11.png
Executable file
After Width: | Height: | Size: 568 B |
BIN
docs/Test2/img/items/am12.png
Executable file
After Width: | Height: | Size: 589 B |
BIN
docs/Test2/img/items/am13.png
Executable file
After Width: | Height: | Size: 546 B |
BIN
docs/Test2/img/items/am14.png
Executable file
After Width: | Height: | Size: 564 B |
BIN
docs/Test2/img/items/am15.png
Executable file
After Width: | Height: | Size: 527 B |
BIN
docs/Test2/img/items/am16.png
Executable file
After Width: | Height: | Size: 576 B |
BIN
docs/Test2/img/items/am17.png
Executable file
After Width: | Height: | Size: 579 B |
BIN
docs/Test2/img/items/am18.png
Executable file
After Width: | Height: | Size: 565 B |
BIN
docs/Test2/img/items/am19.png
Executable file
After Width: | Height: | Size: 575 B |
BIN
docs/Test2/img/items/am2.png
Executable file
After Width: | Height: | Size: 428 B |
BIN
docs/Test2/img/items/am3.png
Executable file
After Width: | Height: | Size: 451 B |
BIN
docs/Test2/img/items/am4.png
Executable file
After Width: | Height: | Size: 475 B |
BIN
docs/Test2/img/items/am5.png
Executable file
After Width: | Height: | Size: 487 B |
BIN
docs/Test2/img/items/am6.png
Executable file
After Width: | Height: | Size: 528 B |
BIN
docs/Test2/img/items/am7.png
Executable file
After Width: | Height: | Size: 486 B |
BIN
docs/Test2/img/items/am8.png
Executable file
After Width: | Height: | Size: 548 B |
BIN
docs/Test2/img/items/am9.png
Executable file
After Width: | Height: | Size: 487 B |
BIN
docs/Test2/img/items/bg.png
Executable file
After Width: | Height: | Size: 12 KiB |
BIN
docs/Test2/img/items/blood1.png
Executable file
After Width: | Height: | Size: 461 B |
BIN
docs/Test2/img/items/blood10.png
Executable file
After Width: | Height: | Size: 567 B |
BIN
docs/Test2/img/items/blood11.png
Executable file
After Width: | Height: | Size: 637 B |
BIN
docs/Test2/img/items/blood12.png
Executable file
After Width: | Height: | Size: 694 B |
BIN
docs/Test2/img/items/blood13.png
Executable file
After Width: | Height: | Size: 667 B |
BIN
docs/Test2/img/items/blood14.png
Executable file
After Width: | Height: | Size: 684 B |
BIN
docs/Test2/img/items/blood15.png
Executable file
After Width: | Height: | Size: 644 B |
BIN
docs/Test2/img/items/blood16.png
Executable file
After Width: | Height: | Size: 704 B |
BIN
docs/Test2/img/items/blood17.png
Executable file
After Width: | Height: | Size: 709 B |
BIN
docs/Test2/img/items/blood18.png
Executable file
After Width: | Height: | Size: 671 B |
BIN
docs/Test2/img/items/blood19.png
Executable file
After Width: | Height: | Size: 715 B |
BIN
docs/Test2/img/items/blood2.png
Executable file
After Width: | Height: | Size: 486 B |
BIN
docs/Test2/img/items/blood3.png
Executable file
After Width: | Height: | Size: 504 B |
BIN
docs/Test2/img/items/blood4.png
Executable file
After Width: | Height: | Size: 536 B |
BIN
docs/Test2/img/items/blood5.png
Executable file
After Width: | Height: | Size: 575 B |
BIN
docs/Test2/img/items/blood6.png
Executable file
After Width: | Height: | Size: 593 B |
BIN
docs/Test2/img/items/blood7.png
Executable file
After Width: | Height: | Size: 568 B |
BIN
docs/Test2/img/items/blood8.png
Executable file
After Width: | Height: | Size: 627 B |
BIN
docs/Test2/img/items/blood9.png
Executable file
After Width: | Height: | Size: 562 B |
BIN
docs/Test2/img/items/craft001.png
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
docs/Test2/img/items/craft002.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
docs/Test2/img/items/craft003.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
docs/Test2/img/items/craft004.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
docs/Test2/img/items/craft005.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
docs/Test2/img/items/craft006.png
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
docs/Test2/img/items/craft007.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
BIN
docs/Test2/img/items/craft008.png
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
docs/Test2/img/items/craft009.png
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
docs/Test2/img/items/craft010.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/Test2/img/items/craft011.png
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
docs/Test2/img/items/craft012.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/Test2/img/items/craft013.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
docs/Test2/img/items/craft014.png
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
docs/Test2/img/items/craft015.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/Test2/img/items/craft016.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/Test2/img/items/craft017.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/Test2/img/items/craft018.png
Executable file
After Width: | Height: | Size: 3.3 KiB |
BIN
docs/Test2/img/items/craft019.png
Executable file
After Width: | Height: | Size: 3.0 KiB |
BIN
docs/Test2/img/items/craft020.png
Executable file
After Width: | Height: | Size: 1.8 KiB |
BIN
docs/Test2/img/items/craft021.png
Executable file
After Width: | Height: | Size: 2.9 KiB |
BIN
docs/Test2/img/items/craft022.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
docs/Test2/img/items/craft023.png
Executable file
After Width: | Height: | Size: 2.9 KiB |
BIN
docs/Test2/img/items/craft024.png
Executable file
After Width: | Height: | Size: 2.7 KiB |
BIN
docs/Test2/img/items/craft025.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/Test2/img/items/craft026.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
BIN
docs/Test2/img/items/craft027.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/Test2/img/items/craft028.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
BIN
docs/Test2/img/items/craft029.png
Executable file
After Width: | Height: | Size: 3.1 KiB |
BIN
docs/Test2/img/items/craft030.png
Executable file
After Width: | Height: | Size: 2.1 KiB |
BIN
docs/Test2/img/items/craft031.png
Executable file
After Width: | Height: | Size: 3.0 KiB |
BIN
docs/Test2/img/items/craft032.png
Executable file
After Width: | Height: | Size: 2.6 KiB |
BIN
docs/Test2/img/items/craft033.png
Executable file
After Width: | Height: | Size: 3.2 KiB |
BIN
docs/Test2/img/items/crp.png
Executable file
After Width: | Height: | Size: 863 B |
BIN
docs/Test2/img/items/dm1.png
Executable file
After Width: | Height: | Size: 473 B |
BIN
docs/Test2/img/items/dm10.png
Executable file
After Width: | Height: | Size: 599 B |
BIN
docs/Test2/img/items/dm11.png
Executable file
After Width: | Height: | Size: 640 B |
BIN
docs/Test2/img/items/dm12.png
Executable file
After Width: | Height: | Size: 667 B |
BIN
docs/Test2/img/items/dm13.png
Executable file
After Width: | Height: | Size: 630 B |
BIN
docs/Test2/img/items/dm14.png
Executable file
After Width: | Height: | Size: 651 B |
BIN
docs/Test2/img/items/dm15.png
Executable file
After Width: | Height: | Size: 653 B |
BIN
docs/Test2/img/items/dm16.png
Executable file
After Width: | Height: | Size: 697 B |
BIN
docs/Test2/img/items/dm17.png
Executable file
After Width: | Height: | Size: 699 B |