Skip to content

Commit e7de05b

Browse files
committed
revert previous commit
I'll investigate more later
1 parent 14d7991 commit e7de05b

File tree

2 files changed

+3
-50
lines changed

2 files changed

+3
-50
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,7 @@ do -- script proxy
12561256
local old = pnl.Paint
12571257
pnl.Paint = function(...)
12581258
if not self:IsValid() then pnl:Remove() return end
1259-
local x, y = self:LocalToScreen()
1260-
y = math.Clamp(y,0,ScrH() - self:GetTall())
1261-
pnl:SetPos(x + 5 + inset_x, y)
1259+
12621260
surface.SetFont(pnl:GetFont())
12631261
local w = surface.GetTextSize(pnl:GetText()) + 6
12641262

lua/pac3/editor/client/panels/properties.lua

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,7 @@ do -- list
839839
if prop.udata and prop.udata.editor_panel then
840840
T = prop.udata.editor_panel or T
841841
elseif pace.PanelExists("properties_" .. prop.key:lower()) then
842-
--is it code bloat to fix weird edge cases like bodygroups on specific models???
843-
--idk but it's more egregious to allow errors just because of what bodygroups the model has
844-
if prop.key:lower() ~= "container" then
845-
T = prop.key:lower()
846-
end
842+
T = prop.key:lower()
847843
elseif not pace.PanelExists("properties_" .. T) then
848844
T = "string"
849845
end
@@ -2076,7 +2072,6 @@ do -- base editable
20762072
local hookID = tostring({})
20772073
local textEntry = pnl
20782074
local delay = os.clock() + 0.1
2079-
local inset_x = self:GetTextInset()
20802075

20812076
pac.AddHook('Think', hookID, function(code)
20822077
if not IsValid(self) or not IsValid(textEntry) then return pac.RemoveHook('Think', hookID) end
@@ -2095,6 +2090,7 @@ do -- base editable
20952090
--pnl:SetPos(x+3,y-4)
20962091
--pnl:Dock(FILL)
20972092
local x, y = self:LocalToScreen()
2093+
local inset_x = self:GetTextInset()
20982094
pnl:SetPos(x+5 + inset_x, y)
20992095
pnl:SetSize(self:GetSize())
21002096
pnl:SetWide(ScrW())
@@ -2113,11 +2109,6 @@ do -- base editable
21132109
local old = pnl.Paint
21142110
pnl.Paint = function(...)
21152111
if not self:IsValid() then pnl:Remove() return end
2116-
local x, y = self:LocalToScreen()
2117-
local _,prop_y = pace.properties:LocalToScreen(0,0)
2118-
y = math.Clamp(y,prop_y,ScrH() - self:GetTall())
2119-
2120-
pnl:SetPos(x + 5 + inset_x, y)
21212112

21222113
surface.SetFont(pnl:GetFont())
21232114
local w = surface.GetTextSize(pnl:GetText()) + 6
@@ -2131,35 +2122,6 @@ do -- base editable
21312122
old(...)
21322123
end
21332124

2134-
local skincolor = self:GetSkin().Colours.Category.Line.Button
2135-
local col = Color(skincolor.r,skincolor.g,skincolor.b, 255)
2136-
2137-
--draw a rectangle with property key's name and arrows to show where the line is scrolling out of bounds
2138-
pac.AddHook('PostRenderVGUI', hookID .. "2", function(code)
2139-
if not IsValid(self) or not IsValid(pnl) then pac.RemoveHook('Think', hookID .. "2") return end
2140-
local _,prop_y = pace.properties:LocalToScreen(0,0)
2141-
local x, y = self:LocalToScreen()
2142-
local overflow = y < prop_y or y > ScrH() - self:GetTall()
2143-
if overflow then
2144-
local str = ""
2145-
if y > ScrH() then
2146-
"↓↓ " .. self.CurrentKey .. " ↓↓"
2147-
else
2148-
"↑↑ " .. self.CurrentKey .. " ↑↑"
2149-
end
2150-
local container = self:GetParent()
2151-
y = math.Clamp(y,prop_y,ScrH() - self:GetTall())
2152-
surface.SetFont(pnl:GetFont())
2153-
local w2 = surface.GetTextSize(str)
2154-
2155-
surface.SetDrawColor(col)
2156-
surface.DrawRect(x - w2, y, w2, pnl:GetTall())
2157-
surface.SetTextColor(self:GetSkin().Colours.Category.Line.Text)
2158-
surface.SetTextPos(x - w2, y)
2159-
surface.DrawText(str)
2160-
end
2161-
end)
2162-
21632125
pace.BusyWithProperties = pnl
21642126
end
21652127

@@ -2235,13 +2197,6 @@ do -- vector
22352197
local left = pace.CreatePanel("properties_number", self)
22362198
local middle = pace.CreatePanel("properties_number", self)
22372199
local right = pace.CreatePanel("properties_number", self)
2238-
--a hack so that the scrolling out-of-bounds indicator rectangle with arrows has the key
2239-
timer.Simple(0, function()
2240-
if not IsValid(left) then return end
2241-
left.CurrentKey = self.CurrentKey
2242-
middle.CurrentKey = self.CurrentKey
2243-
right.CurrentKey = self.CurrentKey
2244-
end)
22452200

22462201
left.PopulateContextMenu = function(_, menu) self:PopulateContextMenu(menu) end
22472202
middle.PopulateContextMenu = function(_, menu) self:PopulateContextMenu(menu) end

0 commit comments

Comments
 (0)