Misc Browser mostly working

This commit is contained in:
Hash Borgir 2022-03-27 10:43:17 -06:00
parent 5cc49b051f
commit a041997dc4
5 changed files with 167 additions and 10 deletions

View File

@ -216,6 +216,7 @@ body {
$('.utable').dataTable();
$('.gemtable').dataTable();
$('.rtable').dataTable();
// $('.mtable').dataTable();
userAgent = window.navigator.userAgent

View File

@ -143,7 +143,7 @@ body{
width: 48px;
}
.numrunes {
color:
}
.navbar a {
@ -163,8 +163,8 @@ padding:30px;
</style>
<script require_once "res/jquery-3.5.1.min.js"></script>
<script require_once "res/bootstrap.bundle.min.js"></script>
<script src="res/jquery-3.5.1.min.js"></script>
<script src= "res/bootstrap.bundle.min.js"></script>
<script>
@ -213,6 +213,8 @@ $(document).ready(function() {
</nav>
<div>
<hr>
<h1>Ironman Mod</h1>
<img style="text-align: center;" src="https://gitlab.com/hashborgir/d2-ironman/-/raw/master/Screenshots/TitleScreen.png">
<h1 id="what-is-the-ironman-style-of-diablo-ii-gameplay-">What is the Ironman style of Diablo II Gameplay?</h1>
<p>The Ironman style of gameplay is radically different from what you may have experienced.</p>
<ul>

View File

@ -54,6 +54,8 @@ require_once './src/D2ItemData.php';
require_once './src/D2ItemDesc.php';
require_once './src/D2DocGenerator.php';
$pre = "<pre>";
$idata = new D2ItemData();
$idesc = new D2ItemDesc();
// $idoc = new D2DocGenerator();
@ -478,7 +480,7 @@ EOT;
$output['mods'][$k]["str"] = $idesc->getDesc($params);
}
// var_dump($output);
// At this point, $output contains raw accurte data
// TODO: build output correctly
// input1-input7,output a,b,c item codes can be found in $strings
@ -486,6 +488,8 @@ EOT;
// Type code sare not in $strings (tbl files)
// Type codes are in ItemTypes in itemtypes.Code
// Type code's string name entry is in itemtypes.ItemType table--
// first find in $strings. if not there, look in itemtypes
//
$htmlRow = "<tr>";
$htmlRow .= "<td class='desc'>" . $output['desc'] . "</td>";
@ -510,9 +514,7 @@ EOT;
} else {
$ostr = implode("<br>", (array_reverse(explode('\n', $output["input $i"][0]))));
}
echo '<pre>';
$htmlRow .= $ostr . "<br>";
if (str_contains($output["input $i"][1], "=")) {
$htmlRow .= $output["input $i"][1] . "<br>";
@ -656,8 +658,8 @@ EOT;
$htmlFinal .= $tableBottom . $htmlbottom;
// save file and redirect to it
file_put_contents("$dir/cubemain.html", $htmlFinal);
header("Location: docs/{$_SESSION['modname']}/cubemain.html");
//file_put_contents("$dir/cubemain.html", $htmlFinal);
//header("Location: docs/{$_SESSION['modname']}/cubemain.html");
}
if ($cmd == "getImages") {
@ -1011,3 +1013,154 @@ if ($cmd == 'genDocRunewords') {
file_put_contents("$dir/runewords.html", $htmlFinal);
header("Location: docs/{$_SESSION['modname']}/runewords.html");
}
if ($cmd == "genDocMisc") {
$sql = "SELECT misc.*,gems.code
FROM misc
LEFT JOIN gems ON misc.code = gems.code
WHERE gems.code IS NULL AND misc.spawnable != 0";
$res = PDO_FetchAll($sql);
$tableTop = <<<EOT
<table border=1 class="mtable">
<thead>
<tr>
<th>Item</th>
<th>Stats</th>
<th>Properties</th>
</tr>
</thead>
<tbody>
EOT;
$htmlFinal = null;
$htmlFinal = $htmltop . $tableTop;
$tr = null;
foreach ($res as $r) {
$data['name'] = $strings[$r['namestr']];
if (str_contains($data['name'], "ÿc")) {
$p = "/ÿc[\d:;\/.]/i";
$data['name'] = preg_replace($p, "", $data['name']);
$data['spelldesc'] = preg_replace($p, "", $data['spelldesc']);
}
// later display these in a li
$img = "/img/items/{$r['invfile']}.png";
if ($r['level']) {
$data['level'] = "Item Level: <span class=''>{$r['level']}</span>";
}
if ($r['levelreq']) {
$data['levelreq'] = "Required Level: <span class=''>{$r['levelreq']}</span>";
}
if ($r['rarity']) {
$data['rarity'] = $armorRack = "Can drop from Armor Racks.";
}
if ($r['speed'] > 0) {
$data['speed'] = "Slow your character down.";
}
if ($r['durability']) {
$data['durability'] = "Base durability: <span class=''>{$r['durability']}</span>";
}
if ($r['hasinv']) {
if ($r['gemapplytype'] == 0) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Weapon</span>";
} else if ($r['gemapplytype'] == 1) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Armor/Helm</span>";
} else if ($r['gemapplytype'] == 2) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Shield</span>";
}
}
if ($r['Transmogrify']) {
$data['Transmogrify'] = "Can right click transmogrify into <p> {$strings[$r['namestr']]}</p>";
$p = "/ÿc[\d:;\/.]/i";
$data['Transmogrify'] = preg_replace($p, "", $data['Transmogrify']);
$data['Transmogrify'] = str_replace('\n', "<br>", $data['Transmogrify']);
}
if ($r['useable']) {
$data['useable'] = "Can be right clicked.";
}
if ($r['throwable']) {
$data['throwable'] = "Can be thrown.";
}
if ($r['unique']) {
$data['unique'] = "Can only spawn as a unique item.";
}
if ($r['stackable']) {
$data['stackable'] = "Can be stacked on top of each other.";
}
if ($r['quest']) {
$data['quest'] = "Quest Itemstats";
}
if ($r['spelldesc']) {
$data['spelldesc'] = $strings[$r['spelldesc']];
}
if ($r['nameable']) {
$data['nameable'] = "<span class=''>Can be personalized by Anya</span>";
}
if ($r['stat1']) {
$stats['stat1'] = "{$r['stat1']}";
}
if ($r['stat2']) {
$stats['stat2'] = "{$r['stat2']}";
}
if ($r['stat3']) {
$stats['stat3'] = "{$r['stat3']}";
}
if ($r['calc1']) {
$stats['calc1'] = "{$r['calc1']}";
}
if ($r['calc2']) {
$stats['calc2'] = "{$r['calc2']}";
}
if ($r['calc3']) {
$stats['calc3'] = "{$r['calc3']}";
}
$data = array_filter($data);
$li = '';
foreach ($data as $d){
$li .= "<li>$d</li>";
}
$tr .= <<<EOT
<tr>
<td><img style="height: 25%;" src="$img"><p>{$data['name']}</p><p>{$data['spelldesc']}</p></td>
<td style="min-width: 420px;font-family: Arial,Tahoma; font-weight: normal;">
<ul>
$li
</ul>
</td>
<td style="font-family: Arial,Tahoma">
<ul>
<li>{$stats['calc1']} {$stats['stat1']}</li>
<li>{$stats['calc2']} {$stats['stat2']}</li>
<li>{$stats['calc3']} {$stats['stat3']}</li>
</ul>
</td>
</tr>
EOT;
}
echo $htmlFinal . $tr . $tableBottom . $htmlbottom;
ob_flush();
}

View File

@ -28,7 +28,7 @@
<div class="col Doc-Gems"><?php require_once "Gems.php"; ?></div>
<div class="col Doc-Cube"><?php require_once "Cube.php"; ?></div>
<div class="col Doc-Runes"><?php require_once "Runewords.php"; ?></div>
<div class="col Doc-Misc"><?php require_once "Misc.php"; ?></div>
</div>

View File

@ -219,6 +219,7 @@ body {
$('.utable').dataTable();
$('.gemtable').dataTable();
$('.rtable').dataTable();
// $('.mtable').dataTable();
userAgent = window.navigator.userAgent