Skip to content

Commit cfee8d2

Browse files
committed
update
the proxy expressions panel class now uses the auto-scrolling behavior quick setup option to clone model for layering small fix (prevents using properties without a getter when gathering the backup properties before opening bulk morph properties menu)
1 parent 123c8a2 commit cfee8d2

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

lua/pac3/editor/client/panels/extra_properties.lua

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,10 @@ do -- script proxy
12571257
pnl.Paint = function(...)
12581258
if not self:IsValid() then pnl:Remove() return end
12591259
local x, y = self:LocalToScreen()
1260-
y = math.Clamp(y,0,ScrH() - self:GetTall())
1260+
local _,prop_y = pace.properties:LocalToScreen(0,0)
1261+
local overflow = y < prop_y or y > ScrH() - self:GetTall()
1262+
y = math.Clamp(y,prop_y,ScrH() - self:GetTall())
1263+
12611264
pnl:SetPos(x + 5 + inset_x, y)
12621265
surface.SetFont(pnl:GetFont())
12631266
local w = surface.GetTextSize(pnl:GetText()) + 6
@@ -1271,6 +1274,34 @@ do -- script proxy
12711274
old(...)
12721275
end
12731276

1277+
local skincolor = self:GetSkin().Colours.Category.Line.Button
1278+
local col = Color(skincolor.r,skincolor.g,skincolor.b, 255)
1279+
1280+
pac.AddHook('PostRenderVGUI', hookID .. "2", function(code)
1281+
if not IsValid(self) or not IsValid(pnl) then pac.RemoveHook('Think', hookID .. "2") return end
1282+
local _,prop_y = pace.properties:LocalToScreen(0,0)
1283+
local x, y = self:LocalToScreen()
1284+
local overflow = y < prop_y or y > ScrH() - self:GetTall()
1285+
if overflow then
1286+
local str = ""
1287+
if y > ScrH() then
1288+
str = "↓↓"
1289+
else
1290+
str = "↑↑"
1291+
end
1292+
local container = self:GetParent()
1293+
y = math.Clamp(y,prop_y,ScrH() - self:GetTall())
1294+
surface.SetFont(pnl:GetFont())
1295+
local w2 = surface.GetTextSize(str .. " " .. self.CurrentKey .. " " .. str)
1296+
1297+
surface.SetDrawColor(col)
1298+
surface.DrawRect(x - w2, y, w2, pnl:GetTall())
1299+
surface.SetTextColor(self:GetSkin().Colours.Category.Line.Text)
1300+
surface.SetTextPos(x - w2, y)
1301+
surface.DrawText(str .. " " .. self.CurrentKey .. " " .. str)
1302+
end
1303+
end)
1304+
12741305
pace.BusyWithProperties = pnl
12751306
end
12761307

lua/pac3/editor/client/parts.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,9 @@ do -- menu
19551955
parts_backup_properties_values[v] = {}
19561956
for _,prop in pairs(v:GetProperties()) do
19571957
if not excluded_properties[prop.key] then
1958-
parts_backup_properties_values[v][prop.key] = v["Get"..prop.key](v)
1958+
if v["Get"..prop.key] then
1959+
parts_backup_properties_values[v][prop.key] = v["Get"..prop.key](v)
1960+
end
19591961
end
19601962
end
19611963
end
@@ -3098,6 +3100,15 @@ function pace.AddQuickSetupsToPartMenu(menu, obj)
30983100
end)
30993101
end):SetIcon("icon16/text_align_center.png")
31003102

3103+
main:AddOption("clone model inside itself", function()
3104+
local copiable_properties = {
3105+
"Model", "Size", "Scale", "Alpha", "Material", "Materials", "NoLighting", "NoCulling", "Invert", "Skin", "IgnoreZ", "Translucent", "Brightness", "BlendMode"
3106+
}
3107+
local clone = obj:CreatePart("model2")
3108+
for i,v in ipairs(copiable_properties) do
3109+
clone:SetProperty(v, obj:GetProperty(v))
3110+
end
3111+
end):SetIcon("icon16/shape_group.png")
31013112
elseif obj.ClassName == "group" then
31023113
main:AddOption("Assign to viewmodel", function()
31033114
obj:SetParent()

0 commit comments

Comments
 (0)