mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-11-24 14:06:29 +08:00
fixed # 新增药水机制
This commit is contained in:
+21
-1
@@ -1,5 +1,6 @@
|
||||
import { collectCombatStatuses } from './status-model.js';
|
||||
import { createOverlayLayout } from './overlays.js';
|
||||
import { potionSkillIds } from '../../potions/battle.js';
|
||||
|
||||
// Native cards, players and controls stay under their original parents.
|
||||
export function mountBattleHUD(player, battle, env) {
|
||||
@@ -315,7 +316,26 @@ export function mountBattleHUD(player, battle, env) {
|
||||
// The actual action controls stay horizontal above the hand; skill references get their own rail.
|
||||
const candidates = [...new Set([ui.skills, ui.skills2, ui.skills3, ui.skillControl, ui.gskillControl])]
|
||||
.filter(node => node?.isConnected && node !== ui.control);
|
||||
const external = candidates.filter(node => !candidates.some(other => other !== node && other.contains(node)));
|
||||
// The potion slots submit these engine skills directly, so the skill bar has no buttons for them.
|
||||
const hiddenClass = 'mengsan-hud-potion-action-shuying';
|
||||
const visible = candidates.filter(control => {
|
||||
const skinned = control === ui.skillControl || control === ui.gskillControl;
|
||||
const items = [...(skinned ? control.querySelectorAll('.skillitem[data-id]') : control.children)];
|
||||
let hiddenCount = 0;
|
||||
for (const item of items) {
|
||||
if (potionSkillIds.includes(item.dataset.id ?? item.link)) {
|
||||
ownClass(item, hiddenClass);
|
||||
hiddenCount++;
|
||||
} else item.classList.remove(hiddenClass);
|
||||
}
|
||||
if (hiddenCount && hiddenCount === items.length) {
|
||||
ownClass(control, hiddenClass);
|
||||
return false;
|
||||
}
|
||||
control.classList.remove(hiddenClass);
|
||||
return true;
|
||||
});
|
||||
const external = visible.filter(node => !visible.some(other => other !== node && other.contains(node)));
|
||||
const hudHeight = hudHeightFor();
|
||||
const rail = layout === 'wide' ? 142 : layout === 'short' ? 112 : 96;
|
||||
const actionBottom = layout === 'narrow' ? hudHeight - 48 : hudHeight + 8;
|
||||
|
||||
@@ -55,6 +55,8 @@ body.mengsan-hud-active-shuying #arena>.mengsan-hud-controls-shuying>.control>di
|
||||
.mengsan-hud-skin-skills-shuying>.enable>.skillitem { width:100%!important;min-height:34px!important;text-align:center; }
|
||||
.mengsan-hud-skin-skills-shuying .skillitem { -webkit-text-fill-color:currentColor!important;-webkit-text-stroke:0!important;background-clip:border-box!important;-webkit-background-clip:border-box!important; }
|
||||
.mengsan-hud-skin-skills-shuying .skillitem::before,.mengsan-hud-skin-skills-shuying .skillitem-child { display:none!important; }
|
||||
body.mengsan-hud-active-shuying #arena>.mengsan-hud-controls-shuying>.control.mengsan-hud-potion-action-shuying,
|
||||
body.mengsan-hud-active-shuying .mengsan-hud-potion-action-shuying { display:none!important; }
|
||||
.mengsan-hud-skin-skills-shuying .skillitem:is(.select,.selected) { outline:1px solid #e6cb93;outline-offset:-2px; }
|
||||
.mengsan-hud-skin-skills-shuying>.enable>.skillitem:not(.usable):not(.select),.mengsan-hud-skin-skills-shuying .skillitem.shixiao { opacity:.55; }
|
||||
.mengsan-hud-skin-skills-shuying>.trigger>.skillitem { color:#c2c7c8!important;font-size:12px!important; }
|
||||
|
||||
Reference in New Issue
Block a user