fork/m-overlay

git clone https://git.julia.blue/fork/m-overlay

BkacjiosStylize the Tabs on a TabPanel.be5d99b

settings-overhaul
1.0 KiB40 linesraw
1local PANEL = class.create("Panel", "BasePanel")
2
3PANEL:ACCESSOR("Enabled", "m_bEnabled", true)
4PANEL:ACCESSOR("BorderColor", "m_cBorderColor")
5PANEL:ACCESSOR("BackgroundColor", "m_cBackgroundColor")
6PANEL:ACCESSOR("BGColor", "m_cBackgroundColor")
7PANEL:ACCESSOR("TooltipTitle", "m_strTooltipTitle")
8PANEL:ACCESSOR("TooltipBody", "m_strTooltipBody")
9PANEL:ACCESSOR("DrawPanel", "m_bDrawPanel", true)
10
11function PANEL:Panel()
12	self:super() -- Initialize our baseclass
13	gui.skinHook("Init", "Panel", self)
14end
15
16function PANEL:Paint(w, h)
17	if self.m_bDrawPanel then
18		gui.skinHook("Paint", "Panel", self, w, h)
19	end
20end
21
22function PANEL:PaintOverlay(w, h)
23	if self.m_bDrawPanel then
24		gui.skinHook("PaintOverlay", "Panel", self, w, h)
25	end
26end
27
28function PANEL:PostPaint(w, h)
29	if not self:IsEnabled() then
30		graphics.setColor(color(0, 0, 0, 100))
31		graphics.rectangle("fill", 0, 0, w, h)
32	end
33end
34
35function PANEL:OnQuertyTooltip()
36	if self.m_strTooltipTitle and self.m_strTooltipBody then
37		gui.setTooltip(self.m_strTooltipTitle, self.m_strTooltipBody)
38		return true
39	end
40end