fix(ui): render deck popups above monster hp
This commit is contained in:
@@ -658,7 +658,7 @@
|
|||||||
"Name": "kind"
|
"Name": "kind"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Code": "self.DeckInspectKind = kind\nlocal pile = {}\nlocal title = \"\"\nif kind == \"discard\" then\n\tpile = self.DiscardPile or {}\n\ttitle = \"버린 덱\"\nelse\n\tpile = self.DrawPile or {}\n\ttitle = \"뽑을 덱\"\nend\nself:RenderDeckInspect(pile, title)\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif hud ~= nil then\n\thud.Enable = true\nend",
|
"Code": "self.DeckInspectKind = kind\nif self.DeckAllOpen == true then\n\tself.DeckAllOpen = false\n\tlocal allHud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckAllHud\")\n\tif allHud ~= nil then\n\t\tallHud.Enable = false\n\tend\nend\nlocal pile = {}\nlocal title = \"\"\nif kind == \"discard\" then\n\tpile = self.DiscardPile or {}\n\ttitle = \"버린 덱\"\nelse\n\tpile = self.DrawPile or {}\n\ttitle = \"뽑을 덱\"\nend\nself:RenderDeckInspect(pile, title)\nlocal hud = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/DeckInspectHud\")\nif hud ~= nil then\n\thud.Enable = true\nend",
|
||||||
"Scope": 2,
|
"Scope": 2,
|
||||||
"ExecSpace": 6,
|
"ExecSpace": 6,
|
||||||
"Attributes": [],
|
"Attributes": [],
|
||||||
|
|||||||
@@ -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 }) {
|
function entity({ id, path, modelId, entryId, componentNames, components, displayOrder }) {
|
||||||
const parts = path.split('/');
|
const parts = path.split('/');
|
||||||
const name = parts[parts.length - 1];
|
const name = parts[parts.length - 1];
|
||||||
|
const sortedComponents = applySortingOverride(path, components, displayOrder);
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
path,
|
path,
|
||||||
@@ -261,7 +290,7 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
|
|||||||
enable: true,
|
enable: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
localize: true,
|
localize: true,
|
||||||
displayOrder,
|
displayOrder: displayOrderFor(path, displayOrder),
|
||||||
pathConstraints: '/'.repeat(parts.length - 1),
|
pathConstraints: '/'.repeat(parts.length - 1),
|
||||||
revision: 1,
|
revision: 1,
|
||||||
origin: {
|
origin: {
|
||||||
@@ -272,7 +301,7 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
|
|||||||
replaced_model_id: null,
|
replaced_model_id: null,
|
||||||
},
|
},
|
||||||
modelId,
|
modelId,
|
||||||
'@components': components,
|
'@components': sortedComponents,
|
||||||
'@version': 1,
|
'@version': 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1626,6 +1655,13 @@ if inspect ~= nil and inspect.Enable == true and self.DeckInspectKind ~= "" then
|
|||||||
self:OpenDeckInspect(self.DeckInspectKind)
|
self:OpenDeckInspect(self.DeckInspectKind)
|
||||||
end`),
|
end`),
|
||||||
method('OpenDeckInspect', `self.DeckInspectKind = kind
|
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 pile = {}
|
||||||
local title = ""
|
local title = ""
|
||||||
if kind == "discard" then
|
if kind == "discard" then
|
||||||
|
|||||||
9132
ui/DefaultGroup.ui
9132
ui/DefaultGroup.ui
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user