When armo/weap/misc drop down are selected, item display is properly updated, and item is properly saved, so far

This commit is contained in:
Hash Borgir 2023-05-30 18:43:17 -06:00
parent 87a9ca1658
commit ec45a9c1b6
3 changed files with 16 additions and 22 deletions

View File

@ -190,6 +190,8 @@ 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']);

View File

@ -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 () {

View File

@ -118,15 +118,6 @@
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #fec;">
<p>Code</p>
<div class="input-group">
<input name="code" type="text" aria-describedby="codeHelpBlock" required="required" class="form-control input-ucode">
</div><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">Enter a 3 or 4 letter unique item code</span>
</div>
<div class="col-2" style="background: #eed;">
<p>Version:</p>
@ -217,7 +208,7 @@
<div class="col-2" style="background: #bbb;">
<p>Armor</p>
<select class="a-select custom-select code" name="code" required="required">
<select class="a-select custom-select code" name="code[]" required="required">
<option value=""></option>
<?php
foreach ($armor as $a)