latest copy

This commit is contained in:
color.diff=auto
2021-03-22 02:59:48 -06:00
parent b3ae4e008d
commit cfc857bf80
100 changed files with 22780 additions and 56 deletions

View File

@@ -7,7 +7,8 @@
<body>
<div class="container container-top">
<h1><img src="img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<h1><img src="img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<form action="/index.php" method="post">
<div class="form-group row">
@@ -227,10 +228,11 @@
<input type="hidden" name="*eol" value="0">
</div>
<div class="form-group row" style="background: none;">
<div class="form-group row options" style="background: none;">
<div class="col-9" style="background: none;">
<p>Options: <br>
(Hide 'unspawnable' items) <input type="checkbox" id="op1" name="opt-hide-disabled" checked>
<a style="font-weight: bold;" class="btn" href="/src/config.php">Recofigure Mod Path</a>
</p>
</div>

30
src/config.php Normal file
View File

@@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<?php
/* Require the <head> section */
require_once "head.php";
?>
<body style="text-align: center; background: white;">
<div class="container container-top">
<h1><img src="/img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<hr style="margin: 60px;">
<h2>Select Mod TXT folder</h2>
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
<div style="margin-top: 20px;">
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 11px;" action="" method="post">
<label for="path">Choose PATH</label>
<input id="path" style="width: 420px;" required="required" name="path" type="text">
<input type="submit" value="Write Config" name="submit">
</form>
</div>
</body>
</html>
<?php
if (!empty($_POST)) {
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
header('Location: /');
}

View File

@@ -28,7 +28,7 @@ along with D2UM. If not, see <http://www.gnu.org/licenses/>.
<link rel="stylesheet" href="https://bootswatch.com/4/materia/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="res/style.css">
<link rel="stylesheet" href="/res/style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
<style>
@@ -40,7 +40,7 @@ along with D2UM. If not, see <http://www.gnu.org/licenses/>.
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<script src="res/app.js"></script>
<script src="/res/app.js"></script>
</script>
<title>Unique Maker</title>

View File

@@ -22,6 +22,8 @@
class saveFile {
public $path;
public function saveTxt($file) {
$post = $_POST;
if (!empty($post['code'])) {
@@ -41,27 +43,32 @@ class saveFile {
}
public function saveBackup($file){
public function saveBackup($file){
if (!is_dir(TXT_DIR."backup")) mkdir(TXT_DIR."backup", 0700);
if (!is_dir($this->path."backup")) mkdir($this->path."backup", 0777);
$newfile = TXT_DIR."backup".DIRECTORY_SEPARATOR.$file.".d2um";
$newfile = $this->path."backup".DIRECTORY_SEPARATOR.$file.".d2um";
if (!copy($file, $newfile)) {
echo "Failed to create backup of $file...\n";
}
}
public function saveTblEnries($path) {
public function saveTblEnries() {
$post = $_POST;
if (!is_dir($this->path."tblEntries")) mkdir($this->path."tblEntries", 0777);
// write for .tbl
$str[0] = $post['index'];
$str[1] = $post['index'];
$fp = fopen($path . "UniqueItemsTblEntries.txt", 'a+');
fputcsv($fp, $str, "\t");
$fp = fopen($this->path.DIRECTORY_SEPARATOR.'tblEntries'. DIRECTORY_SEPARATOR. "UniqueItemsTblEntries.txt", 'a+');
fputcsv($fp, $str, "\t");
}
public function __construct() {
$this->path = TXT_PATH;
}
}

View File

@@ -25,7 +25,7 @@
class txtParser {
public $path = TXT_DIR;
public $path = TXT_PATH;
// Files specific to Unique Items
public $u = "UniqueItems.txt";
@@ -38,7 +38,7 @@ class txtParser {
}
function toPHP($file) {
$file = TXT_DIR . $file;
$file = $this->path . $file;
$rows = array_map(function ($v) {
return str_getcsv($v, "\t");
}