|
@@ -158,10 +158,10 @@ export class App {
|
|
|
const fire = st.envFactors && st.envFactors.fire ? ` · 火种 ${Math.floor(this.s._fireAcc || 0)}/10` : '';
|
|
const fire = st.envFactors && st.envFactors.fire ? ` · 火种 ${Math.floor(this.s._fireAcc || 0)}/10` : '';
|
|
|
const boost = (this.s._fireBoost || 0) > Date.now() / 1000 ? ' · 星火 ×2.5' : '';
|
|
const boost = (this.s._fireBoost || 0) > Date.now() / 1000 ? ' · 星火 ×2.5' : '';
|
|
|
const set = (sel, v) => { const e = strip.querySelector(sel); if (e && e.textContent !== v) e.textContent = v; };
|
|
const set = (sel, v) => { const e = strip.querySelector(sel); if (e && e.textContent !== v) e.textContent = v; };
|
|
|
- strip.querySelector('.env-dot').style.background = env.color;
|
|
|
|
|
|
|
+ const dot = strip.querySelector('.env-dot'); if (dot) dot.style.background = env.color;
|
|
|
set('b', env.name);
|
|
set('b', env.name);
|
|
|
set('.env-eff', env.eff);
|
|
set('.env-eff', env.eff);
|
|
|
- strip.querySelector('.env-prog i').style.cssText = `width:${(prog * 100).toFixed(0)}%;background:${env.color}`;
|
|
|
|
|
|
|
+ const bar = strip.querySelector('.env-prog i'); if (bar) bar.style.cssText = `width:${(prog * 100).toFixed(0)}%;background:${env.color}`;
|
|
|
set('.env-left', env.desc + fire + boost);
|
|
set('.env-left', env.desc + fire + boost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -557,6 +557,7 @@ export class App {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bindEvents() {
|
|
bindEvents() {
|
|
|
|
|
+ $('#env-strip').addEventListener('click', (e) => { const d = e.target.closest('.env-dot, b, .env-eff, .env-left'); if (!d) return; e.stopPropagation(); this.toast('当前地质环境:' + ((this.stats && this.stats.env && this.stats.env.desc) || '') ); });
|
|
|
$('#main').addEventListener('click', (e) => {
|
|
$('#main').addEventListener('click', (e) => {
|
|
|
const rb = e.target.closest('[data-r]');
|
|
const rb = e.target.closest('[data-r]');
|
|
|
if (rb) { this.riftAction(rb.dataset.r, rb.dataset.k, rb.dataset.i); return; }
|
|
if (rb) { this.riftAction(rb.dataset.r, rb.dataset.k, rb.dataset.i); return; }
|