fix(ui): render deck popups above monster hp

This commit is contained in:
2026-06-10 20:20:42 +09:00
parent 683ea88271
commit f4b349532d
3 changed files with 5883 additions and 3291 deletions

View File

@@ -247,9 +247,38 @@ function scrollLayoutGroup({ cellSize, spacing, columns }) {
};
}
function displayOrderFor(path, displayOrder) {
if (path.startsWith('/ui/DefaultGroup/DeckAllHud')) return 2000 + displayOrder;
if (path.startsWith('/ui/DefaultGroup/DeckInspectHud')) return 1900 + displayOrder;
return displayOrder;
}
function sortingOrderFor(path) {
if (path.startsWith('/ui/DefaultGroup/DeckAllHud')) return 2000;
if (path.startsWith('/ui/DefaultGroup/DeckInspectHud')) return 1900;
return null;
}
function applySortingOverride(path, components, displayOrder) {
const baseOrder = sortingOrderFor(path);
if (baseOrder == null) return components;
return components.map((component) => {
if (component['@type'] !== 'MOD.Core.SpriteGUIRendererComponent' && component['@type'] !== 'MOD.Core.TextComponent') {
return component;
}
return {
...component,
OverrideSorting: true,
SortingLayer: 'UI',
OrderInLayer: baseOrder + displayOrder,
};
});
}
function entity({ id, path, modelId, entryId, componentNames, components, displayOrder }) {
const parts = path.split('/');
const name = parts[parts.length - 1];
const sortedComponents = applySortingOverride(path, components, displayOrder);
return {
id,
path,
@@ -261,7 +290,7 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
enable: true,
visible: true,
localize: true,
displayOrder,
displayOrder: displayOrderFor(path, displayOrder),
pathConstraints: '/'.repeat(parts.length - 1),
revision: 1,
origin: {
@@ -272,7 +301,7 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
replaced_model_id: null,
},
modelId,
'@components': components,
'@components': sortedComponents,
'@version': 1,
},
};
@@ -1626,6 +1655,13 @@ if inspect ~= nil and inspect.Enable == true and self.DeckInspectKind ~= "" then
self:OpenDeckInspect(self.DeckInspectKind)
end`),
method('OpenDeckInspect', `self.DeckInspectKind = kind
if self.DeckAllOpen == true then
self.DeckAllOpen = false
local allHud = _EntityService:GetEntityByPath("/ui/DefaultGroup/DeckAllHud")
if allHud ~= nil then
allHud.Enable = false
end
end
local pile = {}
local title = ""
if kind == "discard" then