This commit is contained in:
2024-05-24 22:01:27 +08:00
parent 7f124132ed
commit 3f54d1f79b
42 changed files with 11201 additions and 11796 deletions

View File

@@ -34,7 +34,8 @@ function UIBox:init(args)
major = args.config.major,
type = args.config.align or args.config.type or '',
bond = args.config.bond or 'Strong',
offset = args.config.offset or {x=0,y=0}
offset = args.config.offset or {x=0,y=0},
lr_clamp = args.config.lr_clamp
})
self:set_role{
xy_bond = args.config.xy_bond,
@@ -82,6 +83,10 @@ function UIBox:init(args)
self.VT.x = self.VT.x - self.Mid.role.offset.x + (self.Mid.parent.config.padding or 0)
self.VT.y = self.VT.y - self.Mid.role.offset.y + (self.Mid.parent.config.padding or 0)
end
if self.alignment and self.alignment.lr_clamp then
self:lr_clamp()
end
self.UIRoot:initialize_VT(true)
if getmetatable(self) == UIBox then
@@ -268,6 +273,7 @@ function UIBox:remove()
for k, v in pairs(G.I[self.config.instance_type or 'UIBOX']) do
if v == self then
table.remove(G.I[self.config.instance_type or 'UIBOX'], k)
break;
end
end
remove_all(self.children)
@@ -682,7 +688,6 @@ function UIElement:draw_self()
if self.config.button_UIE and not self.config.button_UIE.config.button then button_active = false end
end
if self.config.colour[4] > 0.01 then
if self.UIT == G.UIT.T and self.config.scale then
self.ARGS.text_parallax = self.ARGS.text_parallax or {}