地下城强化,从自己获取值,切换为 FormData
This commit is contained in:
parent
31061299c1
commit
614f890f99
12
multi.html
12
multi.html
|
@ -1552,15 +1552,15 @@ const teamsCount = 2;
|
|||
<li><input type="checkbox" class="type-check" name="dungeon-types" value="15" id="dungeon-type-15" /><label class="type-icon" data-type-icon="15" for="dungeon-type-15"><!--販賣用--></label></li>
|
||||
</ul>
|
||||
<ul class="collab-list">
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" type="text" /></li>
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" name="dungeon-collab-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="gacha-list">
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" type="text" /></li>
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" name="dungeon-gacha-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="stats-list">
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" name="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" name="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" name="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
</ul>
|
||||
<ul class="benefit-list"><!--阴阳加护-->
|
||||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="0" id="dungeon-benefit-0" checked /><label class="awoken-icon" data-awoken-icon="0" for="dungeon-benefit-0"></label></li><!--无-->
|
||||
|
@ -1569,7 +1569,7 @@ const teamsCount = 2;
|
|||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="3" id="dungeon-benefit-3" /><label class="awoken-icon yinyang" data-awoken-icon="128" for="dungeon-benefit-3"></label></li><!--阴阳-->
|
||||
</ul>
|
||||
<ul class="current-stage-list"><!--当前层数-->
|
||||
<li><label for="current-stage"></label><input id="current-stage" type="number" min=1 step=1 /></li>
|
||||
<li><label for="current-stage"></label><input id="current-stage" name="current-stage" type="number" min=1 step=1 /></li>
|
||||
</ul>
|
||||
<div class="dialog-control">
|
||||
<button class="dialog-clear brown-button" type="reset"></button>
|
||||
|
|
42
script.js
42
script.js
|
@ -4123,11 +4123,10 @@ function initialize() {
|
|||
|
||||
//添加徽章
|
||||
const badgeDialog = document.getElementById("badge-choose");
|
||||
const badgeDialogConfirm = badgeDialog.querySelector(".dialog-confirm");
|
||||
const badgeDialogForm = badgeDialog.querySelector("form");
|
||||
// const badgeDialogConfirm = badgeDialog.querySelector(".dialog-confirm");
|
||||
const badgeChooseName = "choose-team-badge";
|
||||
const teamBadgeUl = badgeDialog.querySelector(".team-badges");
|
||||
const changeBadgeDialogConfirmValue = function(e){
|
||||
badgeDialogConfirm.value = this.value;
|
||||
}
|
||||
|
||||
official_badge_sorting.forEach(bgId=>{
|
||||
const li = document.createElement("li");
|
||||
|
@ -4135,8 +4134,7 @@ function initialize() {
|
|||
radio.type="radio";
|
||||
radio.className = "hide-radio";
|
||||
radio.value = bgId;
|
||||
radio.onchange = changeBadgeDialogConfirmValue;
|
||||
radio.name = "choose-team-badge";
|
||||
radio.name = badgeChooseName;
|
||||
radio.id = `${radio.name}-${bgId}`;
|
||||
|
||||
const label = li.appendChild(document.createElement("label"));
|
||||
|
@ -4150,12 +4148,14 @@ function initialize() {
|
|||
//徽章
|
||||
const teamBadge = teamBigBox.querySelector(".team-badge");
|
||||
const returnFunc = function(event){
|
||||
const returnValue = event.target.returnValue;
|
||||
const returnValue = this.returnValue;
|
||||
if (returnValue === "cancel") return;
|
||||
_badgeThis.setAttribute("data-badge-icon", returnValue);
|
||||
_badgeThis.value = returnValue;
|
||||
const formData = new FormData(badgeDialogForm);
|
||||
const badgeValue = formData.get(badgeChooseName) || 0;
|
||||
_badgeThis.setAttribute("data-badge-icon", badgeValue);
|
||||
_badgeThis.value = badgeValue;
|
||||
const team = formation.teams[teamIdx];
|
||||
team[2] = parseInt(returnValue, 10);
|
||||
team[2] = parseInt(badgeValue, 10);
|
||||
refreshAll(formation);
|
||||
createNewUrl();
|
||||
//badgeDialog.removeEventListener("close", returnFunc);
|
||||
|
@ -4273,6 +4273,7 @@ function initialize() {
|
|||
|
||||
//设置地下城倍率
|
||||
const dungeonEnchanceDialog = document.getElementById("dialog-dungeon-enchance");
|
||||
const dungeonEnchanceForm = dungeonEnchanceDialog.querySelector("form");
|
||||
const dialogContent = dungeonEnchanceDialog.querySelector(".dialog-content");
|
||||
const rareDoms = Array.from(dialogContent.querySelectorAll(".rare-list .rare-check"));
|
||||
const attrDoms = Array.from(dialogContent.querySelectorAll(".attr-list .attr-check"));
|
||||
|
@ -4329,17 +4330,18 @@ function initialize() {
|
|||
const returnValue = event.target.returnValue;
|
||||
if (returnValue === "cancel") return;
|
||||
|
||||
const formData = new FormData(dungeonEnchanceForm);
|
||||
const dge = formation.dungeonEnchance;
|
||||
dge.rarities = returnCheckBoxsValues(rareDoms).map(Str2Int);
|
||||
dge.attrs = returnCheckBoxsValues(attrDoms).map(Str2Int);
|
||||
dge.types = returnCheckBoxsValues(typeDoms).map(Str2Int);
|
||||
dge.rate.hp = returnCheckBoxsValues(typeDoms).map(Str2Int)(dialogContent.querySelector("#dungeon-hp").value);
|
||||
dge.rate.atk = Number(dialogContent.querySelector("#dungeon-atk").value);
|
||||
dge.rate.rcv = Number(dialogContent.querySelector("#dungeon-rcv").value);
|
||||
dge.collabs = collabIdIpt.value.split(',').map(str=>parseInt(str,10)).filter(Boolean);
|
||||
dge.gachas = gachaIdIpt.value.split(',').map(str=>parseInt(str,10)).filter(Boolean);
|
||||
dge.benefit = Str2Int(returnRadiosValue(benefitDoms));
|
||||
dge.stage = parseInt(currentStageIpt.value, 10);
|
||||
dge.rarities = formData.getAll("dungeon-rare").map(Str2Int);
|
||||
dge.attrs = formData.getAll("dungeon-attrs").map(Str2Int);
|
||||
dge.types = formData.getAll("dungeon-types").map(Str2Int);
|
||||
dge.rate.hp = Number(formData.get("dungeon-hp"));
|
||||
dge.rate.atk = Number(formData.get("dungeon-atk"));
|
||||
dge.rate.rcv = Number(formData.get("dungeon-rcv"));
|
||||
dge.collabs = formData.get("dungeon-collab-id").split(',').map(str=>parseInt(str,10)).filter(Boolean);
|
||||
dge.gachas = formData.get("dungeon-gacha-id").split(',').map(str=>parseInt(str,10)).filter(Boolean);
|
||||
dge.benefit = Str2Int(formData.get("dungeon-benefit"));
|
||||
dge.stage = Str2Int(formData.get("current-stage"));
|
||||
|
||||
refreshAll(formation);
|
||||
createNewUrl();
|
||||
|
|
|
@ -24347,7 +24347,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"multi.html",
|
||||
"255d38665bf0a7bbdcde58d0824d88e0"
|
||||
"475bd7b4755f476d625e34082c4a780a"
|
||||
],
|
||||
[
|
||||
"script-custom_elements.js",
|
||||
|
@ -24363,15 +24363,15 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"script-universal_function.js",
|
||||
"fe5c5892ce3df85b1c3f0777183771f3"
|
||||
"c0d955c4ccf7c86f7a8443bfdee8c800"
|
||||
],
|
||||
[
|
||||
"script.js",
|
||||
"075aa361ba83128863f63351923e2014"
|
||||
"39b9115f6c7e98e88f0804c0322dbbc9"
|
||||
],
|
||||
[
|
||||
"solo.html",
|
||||
"520a497bef09dd94295b10ced945475f"
|
||||
"fd72b47437620ac3d36c1c14c6dca18b"
|
||||
],
|
||||
[
|
||||
"style-monsterimages.css",
|
||||
|
@ -24379,7 +24379,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"style.css",
|
||||
"ce2f2b8cfd87e15275c5be72355279dc"
|
||||
"2a628de603e42da367d89ade3af351c4"
|
||||
],
|
||||
[
|
||||
"temp.js",
|
||||
|
@ -24387,11 +24387,11 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"triple.html",
|
||||
"a27f67a57a6e64f7afeec0d70ef7df9b"
|
||||
"a09e3bf9f4d43be385ec83b772a33ff8"
|
||||
],
|
||||
[
|
||||
"languages/en.css",
|
||||
"838ee4e93bbc8a19a69e0d1e111c7e32"
|
||||
"919a649d677ac1afdf25f0a4197075c3"
|
||||
],
|
||||
[
|
||||
"languages/en.js",
|
||||
|
@ -24399,7 +24399,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"languages/ja.css",
|
||||
"f221688808e0cffc199432656dead702"
|
||||
"9ecc35c10d4f10c126b19f22d1be69fe"
|
||||
],
|
||||
[
|
||||
"languages/ja.js",
|
||||
|
@ -24407,7 +24407,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"languages/ko.css",
|
||||
"e625ad19cdba9d4c1968371a790b32bd"
|
||||
"68fe4df171c902a47a5e21f1074d5491"
|
||||
],
|
||||
[
|
||||
"languages/ko.js",
|
||||
|
@ -24419,7 +24419,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"languages/zh-hans.css",
|
||||
"28a0fb4c3050fd280baf0fa24521f95e"
|
||||
"17398d5e7c0a9260fd4ca9b7d2734a8d"
|
||||
],
|
||||
[
|
||||
"languages/zh-hans.js",
|
||||
|
@ -24427,7 +24427,7 @@ const cachesMap = new Map([
|
|||
],
|
||||
[
|
||||
"languages/zh-hant.css",
|
||||
"fef3569f9cb35f940379d8be9d81f0e4"
|
||||
"0b98cf3dbc71374bacdd73f2c0ed9909"
|
||||
],
|
||||
[
|
||||
"languages/zh-hant.js",
|
||||
|
|
12
solo.html
12
solo.html
|
@ -1290,15 +1290,15 @@ const teamsCount = 1;
|
|||
<li><input type="checkbox" class="type-check" name="dungeon-types" value="15" id="dungeon-type-15" /><label class="type-icon" data-type-icon="15" for="dungeon-type-15"><!--販賣用--></label></li>
|
||||
</ul>
|
||||
<ul class="collab-list">
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" type="text" /></li>
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" name="dungeon-collab-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="gacha-list">
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" type="text" /></li>
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" name="dungeon-gacha-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="stats-list">
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" name="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" name="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" name="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
</ul>
|
||||
<ul class="benefit-list"><!--阴阳加护-->
|
||||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="0" id="dungeon-benefit-0" checked /><label class="awoken-icon" data-awoken-icon="0" for="dungeon-benefit-0"></label></li><!--无-->
|
||||
|
@ -1307,7 +1307,7 @@ const teamsCount = 1;
|
|||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="3" id="dungeon-benefit-3" /><label class="awoken-icon yinyang" data-awoken-icon="128" for="dungeon-benefit-3"></label></li><!--阴阳-->
|
||||
</ul>
|
||||
<ul class="current-stage-list"><!--当前层数-->
|
||||
<li><label for="current-stage"></label><input id="current-stage" type="number" min=1 step=1 /></li>
|
||||
<li><label for="current-stage"></label><input id="current-stage" name="current-stage" type="number" min=1 step=1 /></li>
|
||||
</ul>
|
||||
<div class="dialog-control">
|
||||
<button class="dialog-clear brown-button" type="reset"></button>
|
||||
|
|
12
triple.html
12
triple.html
|
@ -2234,15 +2234,15 @@ const teamsCount = 3;
|
|||
<li><input type="checkbox" class="type-check" name="dungeon-types" value="15" id="dungeon-type-15" /><label class="type-icon" data-type-icon="15" for="dungeon-type-15"><!--販賣用--></label></li>
|
||||
</ul>
|
||||
<ul class="collab-list">
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" type="text" /></li>
|
||||
<li><label for="dungeon-collab-id"></label><input id="dungeon-collab-id" name="dungeon-collab-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="gacha-list">
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" type="text" /></li>
|
||||
<li><label for="dungeon-gacha-id"></label><input id="dungeon-gacha-id" name="dungeon-gacha-id" type="text" /></li>
|
||||
</ul>
|
||||
<ul class="stats-list">
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-hp"></label><input id="dungeon-hp" name="dungeon-hp" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-atk"></label><input id="dungeon-atk" name="dungeon-atk" type="number" min=0 step=1 value=1 /></li>
|
||||
<li><label for="dungeon-rcv"></label><input id="dungeon-rcv" name="dungeon-rcv" type="number" min=0 step=1 value=1 /></li>
|
||||
</ul>
|
||||
<ul class="benefit-list"><!--阴阳加护-->
|
||||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="0" id="dungeon-benefit-0" checked /><label class="awoken-icon" data-awoken-icon="0" for="dungeon-benefit-0"></label></li><!--无-->
|
||||
|
@ -2251,7 +2251,7 @@ const teamsCount = 3;
|
|||
<li><input type="radio" class="benefit-check" name="dungeon-benefit" value="3" id="dungeon-benefit-3" /><label class="awoken-icon yinyang" data-awoken-icon="128" for="dungeon-benefit-3"></label></li><!--阴阳-->
|
||||
</ul>
|
||||
<ul class="current-stage-list"><!--当前层数-->
|
||||
<li><label for="current-stage"></label><input id="current-stage" type="number" min=1 step=1 /></li>
|
||||
<li><label for="current-stage"></label><input id="current-stage" name="current-stage" type="number" min=1 step=1 /></li>
|
||||
</ul>
|
||||
<div class="dialog-control">
|
||||
<button class="dialog-clear brown-button" type="reset"></button>
|
||||
|
|
Loading…
Reference in New Issue