5 Commits

Author SHA1 Message Date
Vick Scarlet
84785f3e40 bug fix 2021-09-06 14:40:05 +08:00
Vick Scarlet
1b7ae5f1ff update new build 2021-09-06 14:12:17 +08:00
shadowdreamer
4a5127fecf feat: 选三个天赋之后按钮文案变化,加点页面显示已选天赋 2021-09-06 14:08:16 +08:00
Vick Scarlet
1c8628bb3d update new build 2021-09-06 10:11:24 +08:00
liuxu
160aab5bc2 fix SPR 2021-09-06 09:33:55 +08:00
2 changed files with 32 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -101,6 +101,9 @@ class App{
if(li.hasClass('selected')) { if(li.hasClass('selected')) {
li.removeClass('selected') li.removeClass('selected')
this.#talentSelected.delete(talent); this.#talentSelected.delete(talent);
if(this.#talentSelected.size<3) {
talentPage.find('#next').text('请选择3个')
}
} else { } else {
if(this.#talentSelected.size==3) { if(this.#talentSelected.size==3) {
this.hint('只能选3个天赋'); this.hint('只能选3个天赋');
@@ -122,6 +125,9 @@ class App{
} }
li.addClass('selected'); li.addClass('selected');
this.#talentSelected.add(talent); this.#talentSelected.add(talent);
if(this.#talentSelected.size==3) {
talentPage.find('#next').text('开始新人生')
}
} }
}); });
}); });
@@ -139,18 +145,31 @@ class App{
}) })
// Property // Property
const propertyPage = $(` // hint of extension tobermory.es6-string-html
const propertyPage = $(/*html*/`
<div id="main"> <div id="main">
<div class="head" style="font-size: 1.6rem"> <div class="head" style="font-size: 1.6rem">
调整初始属性<br> 调整初始属性<br>
<div id="total" style="font-size:1rem; font-weight:normal;">可用属性点0</div> <div id="total" style="font-size:1rem; font-weight:normal;">可用属性点0</div>
</div> </div>
<ul id="propertyAllocation" class="propinitial"></ul> <ul id="propertyAllocation" class="propinitial"></ul>
<ul class="propinitial" style="top:auto; bottom:23rem">
<li>已选天赋</li>
</ul>
<ul class="selectlist" id="talentSelectedView" style="top:auto; bottom:16rem"></ul>
<button id="random" class="mainbtn" style="top:auto; bottom:7rem">随机分配</button> <button id="random" class="mainbtn" style="top:auto; bottom:7rem">随机分配</button>
<button id="start" class="mainbtn" style="top:auto; bottom:0.1rem">开始新人生</button> <button id="start" class="mainbtn" style="top:auto; bottom:0.1rem">开始新人生</button>
</div> </div>
`); `);
propertyPage.mounted = ()=>{
propertyPage
.find('#talentSelectedView').append(
`<li>已选天赋</li>` +
Array.from(this.#talentSelected)
.map(({name,description})=>`<li class="grade0b">${name}(${description})</li>`)
.join('')
)
}
const groups = {}; const groups = {};
const total = ()=>{ const total = ()=>{
let t = 0; let t = 0;
@@ -303,11 +322,11 @@ class App{
// Update properties if not die yet // Update properties if not die yet
const property = this.#life.getLastRecord(); const property = this.#life.getLastRecord();
$("#lifeProperty").html(` $("#lifeProperty").html(`
<li>颜值:${property.CHR} </li> <li>颜值:${property.CHR} </li>
<li>智力:${property.INT} </li> <li>智力:${property.INT} </li>
<li>体质:${property.STR} </li> <li>体质:${property.STR} </li>
<li>家境:${property.MNY} </li> <li>家境:${property.MNY} </li>
<li>快乐:${property.STR} </li>`); <li>快乐:${property.SPR} </li>`);
} }
}); });
@@ -389,6 +408,9 @@ class App{
page: propertyPage, page: propertyPage,
clear: ()=>{ clear: ()=>{
freshTotal(); freshTotal();
propertyPage
.find('#talentSelectedView')
.empty();
}, },
}, },
trajectory: { trajectory: {
@@ -478,6 +500,9 @@ class App{
$('#main').detach(); $('#main').detach();
p.clear(); p.clear();
p.page.appendTo('body'); p.page.appendTo('body');
if(typeof p.page.mounted === 'function'){
p.page.mounted()
}
} }
hint(message, type='info') { hint(message, type='info') {