From ec45a9c1b6f4da826eee6050f84de9f0184accac Mon Sep 17 00:00:00 2001 From: Hash Borgir Date: Tue, 30 May 2023 18:43:17 -0600 Subject: [PATCH] When armo/weap/misc drop down are selected, item display is properly updated, and item is properly saved, so far --- ajax/uniqueitems.php | 4 +++- res/app.js | 21 +++++++++++---------- src/tabs/UniqueItems.php | 13 ++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/ajax/uniqueitems.php b/ajax/uniqueitems.php index 6c599bb..631347c 100755 --- a/ajax/uniqueitems.php +++ b/ajax/uniqueitems.php @@ -190,11 +190,13 @@ if ($cmd == 'delete') { if ($cmd == "save") { + $_GET['code'] = array_filter($_GET['code']); + $_GET['code'] = $_GET['code'][0]; unset($_GET['formtype']); unset($_GET['submit']); unset($_GET['item']); unset($_GET['cmd']); - + // if ladder or carry1 is 0, set empty field. $_GET['ladder'] = $_GET['ladder'] ?? ''; $_GET['carry1'] = $_GET['carry1'] ?? ''; diff --git a/res/app.js b/res/app.js index da1df04..addb397 100755 --- a/res/app.js +++ b/res/app.js @@ -89,15 +89,15 @@ $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip() }) - // armor/misc/weapons select dropdown chagne function + // armor/misc/weapons select dropdown change function $('.w-select').change(function () { $('.a-select,.m-select').each(function (i, v) { v.value = ''; v.required = ''; }); - x = $(this).find(':selected').text(); - y = document.getElementById('item'); - y.value = x; + x = $(this).find('option:selected').text(); + $("*[name='*type']").val(x); + $('.itemtype').html("("+x+")"); }); $('.a-select').change(function () { @@ -105,18 +105,18 @@ $(document).ready(function () { v.value = ''; v.required = ''; }); - x = $(this).find(':selected').text(); - y = document.getElementById('item'); - y.value = x; + x = $(this).find('option:selected').text(); + $("*[name='*type']").val(x); + $('.itemtype').html("("+x+")"); }); $('.m-select').change(function () { $('.w-select,.a-select').each(function (i, v) { v.value = ''; v.required = ''; }); - x = $(this).find(':selected').text(); - y = document.getElementById('item'); - y.value = x; + x = $(this).find('option:selected').text(); + $("*[name='*type']").val(x); + $('.itemtype').html("("+x+")"); }); $(".btnconfig").click(function () { @@ -197,6 +197,7 @@ $(document).ready(function () { }); + // cmd = getUniqueItem $('.uniqueitems-select').change(function () { diff --git a/src/tabs/UniqueItems.php b/src/tabs/UniqueItems.php index 55d0e48..0a439ee 100755 --- a/src/tabs/UniqueItems.php +++ b/src/tabs/UniqueItems.php @@ -118,16 +118,7 @@ Index: the ID pointer that is referenced by the game in TreasureClassEx.txt and CubeMain.txt, this column also contains the string-key used in the TBL files. -
-

Code

-
- -
- - Enter a 3 or 4 letter unique item code -
- - +

Version:

@@ -217,7 +208,7 @@

Armor

-