Item Preview Done. Todo: Stat Rendering

This commit is contained in:
color.diff=auto 2021-05-02 05:35:38 -06:00
parent 65b3980c44
commit efa7f8f28e
987 changed files with 816 additions and 122 deletions

116
GlowItems.php Normal file
View File

@ -0,0 +1,116 @@
<?php
ini_set('post_max_size', '2M');
ini_set('upload_max_filesize', '2M');
if (!empty($_FILES)) {
var_dump($_FILES);
die();
$path = getcwd() . "/";
$range = range(1, 2.5, mt_rand(3, 8) / 100);
$item = $_FILES['tmp_name'];
$tmpdir = pathinfo($path . $item)['filename'];
// undelee and create directory if doing same item over again
@unlink($tmpdir);
@mkdir($tmpdir);
$cmd = "convert ";
// Generate glow frames for item
foreach ($range as $r) {
$tmpfile = $path . "$tmpdir/$r-$item";
exec("glow -a $r -s 40 $item $tmpfile");
}
// Generate build command to process glow frames for item
// into frame1 glowing up
foreach ($range as $r) {
$tmpfile = "$tmpdir/$r-$item";
$cmd .= "$tmpfile ";
}
$cmd .= " +append $tmpdir/frame1.png";
exec($cmd);
$cmd = "convert ";
// Generate build command to process glow frames for item
// into frame1 glowing up
foreach (array_reverse($range) as $r) {
$tmpfile = "$tmpdir/$r-$item";
$cmd .= "$tmpfile ";
}
$cmd .= "+append $tmpdir/frame2.png";
exec($cmd);
$cmd = '';
$cmd = "convert $tmpdir/frame1.png $tmpdir/frame2.png +append $tmpdir/frame_final.png";
exec($cmd);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Hash Borgir">
<title>Diablo 2 Animated Item Creator</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!-- Favicons -->
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="starter-template.css" rel="stylesheet">
</head>
<body>
<main role="main" class="container">
<div class="row">
<div class="col">
<h1>Diablo 2 Animated Item Creator</h1>
<p>Upload an item graphic in png/bmp/jpg/pcx format. Tool will generate a large file containing all the frames in a row which can be loaded into SixDice, and split at whatever size you need, to generate a DC6 with frames.</p>
<form action="/GlowItems.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" class="file">
<input type="submit" name="submit" value="Upload">
</form>
</div>
</div>
</main><!-- /.container -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="/docs/4.4/assets/js/vendor/jquery.slim.min.js"><\/script>')</script><script src="/docs/4.4/dist/js/bootstrap.bundle.min.js" integrity="sha384-6khuMg9gaYr5AxOqhkVIODVIvm9ynTT5J4V1cfthmT+emCG6yVmEZsRHdxlotUnm" crossorigin="anonymous"></script></body>
</html>

View File

@ -49,18 +49,52 @@ if (!empty($_GET['sort']))
$sort = $_GET['sort']; $sort = $_GET['sort'];
if (!empty($_GET['view'])) if (!empty($_GET['view']))
$view = $_GET['view']; $view = $_GET['view'];
/* /*
* @cmd = getUniqueItem * @cmd = getUniqueItem
* *
* *
* */ * */
// first search code in all 3 tables. Grab from where it exists.
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 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;
}
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode($res, JSON_INVALID_UTF8_IGNORE); echo json_encode($return, JSON_INVALID_UTF8_IGNORE);
} }
/* /*
* @cmd = sortBy * @cmd = sortBy
* *
* *
@ -79,7 +113,7 @@ if ($cmd == "sortBy") {
} }
echo $html; echo $html;
} }
/* /*
* @cmd = viewOnly * @cmd = viewOnly
* *
* *
@ -120,14 +154,14 @@ WHERE `type` IS NOT NULL AND uniqueitems.`code`= $table.`code` AND $table.`code`
echo $html; echo $html;
} }
/* /*
* @cmd = search * @cmd = search
* *
* *
* *
* *
*/ */
if ($cmd == 'search'){ if ($cmd == 'search') {
$search = $_GET['search']; $search = $_GET['search'];
$sql = "SELECT * FROM uniqueitems WHERE `index` LIKE '%$search%' OR `code` LIKE '%$search%' AND `enabled`=1 ORDER BY `index`"; $sql = "SELECT * FROM uniqueitems WHERE `index` LIKE '%$search%' OR `code` LIKE '%$search%' AND `enabled`=1 ORDER BY `index`";
$res = PDO_FetchAll($sql); $res = PDO_FetchAll($sql);
@ -139,8 +173,5 @@ if ($cmd == 'search'){
$html .= "<option value=\"{$r['index']}\">{$r['index']}</option>"; $html .= "<option value=\"{$r['index']}\">{$r['index']}</option>";
} }
} }
echo $html; echo $html;
} }

BIN
img/items/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
img/items/INVGLD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

BIN
img/items/am1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

BIN
img/items/am10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

BIN
img/items/am11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

BIN
img/items/am12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
img/items/am13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/items/am14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

BIN
img/items/am15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

BIN
img/items/am16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
img/items/am17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

BIN
img/items/am18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

BIN
img/items/am19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

BIN
img/items/am2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

BIN
img/items/am3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

BIN
img/items/am4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

BIN
img/items/am5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

BIN
img/items/am6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
img/items/am7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

BIN
img/items/am8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

BIN
img/items/am9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

BIN
img/items/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
img/items/blood1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

BIN
img/items/blood10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

BIN
img/items/blood11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

BIN
img/items/blood12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

BIN
img/items/blood13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

BIN
img/items/blood14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

BIN
img/items/blood15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

BIN
img/items/blood16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
img/items/blood17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

BIN
img/items/blood18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

BIN
img/items/blood19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

BIN
img/items/blood2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

BIN
img/items/blood3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

BIN
img/items/blood4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

BIN
img/items/blood5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

BIN
img/items/blood6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

BIN
img/items/blood7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

BIN
img/items/blood8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
img/items/blood9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

BIN
img/items/craft001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
img/items/craft002.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/items/craft003.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/items/craft004.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/items/craft005.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
img/items/craft006.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/items/craft007.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
img/items/craft008.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
img/items/craft009.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
img/items/craft010.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/items/craft011.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/items/craft012.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/items/craft013.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/items/craft014.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/items/craft015.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
img/items/craft016.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/items/craft017.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/items/craft018.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
img/items/craft019.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
img/items/craft020.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
img/items/craft021.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
img/items/craft022.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
img/items/craft023.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
img/items/craft024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
img/items/craft025.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
img/items/craft026.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
img/items/craft027.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
img/items/craft028.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
img/items/craft029.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
img/items/craft030.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
img/items/craft031.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
img/items/craft032.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
img/items/craft033.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
img/items/crp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

BIN
img/items/dm1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

BIN
img/items/dm10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

BIN
img/items/dm11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

BIN
img/items/dm12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

BIN
img/items/dm13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

BIN
img/items/dm14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

BIN
img/items/dm15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
img/items/dm16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

BIN
img/items/dm17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

BIN
img/items/dm18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

BIN
img/items/dm19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

BIN
img/items/dm2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
img/items/dm3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

BIN
img/items/dm4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/items/dm5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

BIN
img/items/dm6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

BIN
img/items/dm7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/items/dm8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
img/items/dm9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

BIN
img/items/em1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

BIN
img/items/em10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

BIN
img/items/em11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

BIN
img/items/em12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Some files were not shown because too many files have changed in this diff Show More