diff options
| -rw-r--r-- | data/artery/global/cl_goldenskin.lua | 824 | ||||
| -rw-r--r-- | data/artery/global/sv_goldenskin.lua | 2 |
2 files changed, 413 insertions, 413 deletions
diff --git a/data/artery/global/cl_goldenskin.lua b/data/artery/global/cl_goldenskin.lua index eca729b..879cfcb 100644 --- a/data/artery/global/cl_goldenskin.lua +++ b/data/artery/global/cl_goldenskin.lua @@ -1,412 +1,412 @@ -local surface = surface -local Color = Color - -local mskin = SKIN -SKIN = {} -setmetatable(SKIN,{__index = mskin}) - -SKIN.PrintName = "Golden Skin" -SKIN.Author = "Apickx" -SKIN.DermaVersion = 1 -SKIN.GwenTexture = Material("golden.png") - -local gctn = GWEN.CreateTextureNormal - ---Panel -SKIN.tex.Panels.tl = gctn(0,0,32,32) -SKIN.tex.Panels.t = gctn(32,0,32,32) -SKIN.tex.Panels.tr = gctn(64,0,32,32) -SKIN.tex.Panels.ml = gctn(0,32,32,32) -SKIN.tex.Panels.m = gctn(32,32,32,32) -SKIN.tex.Panels.mr = gctn(64,32,32,32) -SKIN.tex.Panels.bl = gctn(0,64,32,32) -SKIN.tex.Panels.bm = gctn(32,64,32,32) -SKIN.tex.Panels.br = gctn(64,64,32,32) - ---Button up -SKIN.tex.bu = {} -SKIN.tex.bu.left = gctn(0,96,24,24) -SKIN.tex.bu.mid = gctn(24,96,24,24) -SKIN.tex.bu.right = gctn(48,96,24,24) -SKIN.tex.bu.left_b = gctn(0,224,48,24) ---Button down -SKIN.tex.bd = {} -SKIN.tex.bd.left = gctn(0,120,24,24) -SKIN.tex.bd.mid = gctn(24,120,24,24) -SKIN.tex.bd.right = gctn(48,120,24,24) -SKIN.tex.bd.left_b = gctn(0,200,48,24) - ---Frame -SKIN.tex.fr = {} -SKIN.tex.fr.tl = gctn(0,144,32,56) -SKIN.tex.fr.t = gctn(32,144,32,56) -SKIN.tex.fr.tr = gctn(64,144,32,56) -SKIN.tex.fr.t_b = gctn(92,144,32,56) -SKIN.tex.fr.tr_b = gctn(128,144,32,56) - ---Property sheet tab -SKIN.tex.tab = {} -SKIN.tex.tab.right = gctn(96,48,16,32) -SKIN.tex.tab.left = gctn(112,48,16,32) -for k,v in pairs({"down","up"}) do - SKIN.tex.tab[v] = {} - for i,j in pairs({"start","mid","end_c","start_c","end"}) do - local sx = 128 + ((i - 1) * 16) - local sy = 48 + ((k - 1) * 32) - SKIN.tex.tab[v][j] = gctn(sx,sy,16,32) - end -end - --- Progress bar -SKIN.tex.bar = {} -SKIN.tex.bar.back = {} -for k,v in pairs({"start","mid","fin"}) do - SKIN.tex.bar.back[v] = gctn(128 + ((k - 1) * 24),112,24,24) -end -SKIN.tex.bar.fill = {} -for k,v in pairs({"start","mid","fin"}) do - SKIN.tex.bar.fill[v] = gctn(200 + ((k - 1) * 8),112,8,24) -end - ---Round buttons ---[[ -frame = vgui.Create("DFrame") -frame.Paint = function(s,w,h) GWEN.CreateTextureNormal(0,0,1024,1024)(0,0,w,h) end -frame:SetSize(300,300) -]] -SKIN.tex.buttons = {} -for k,v in pairs({"green","blue","red","gray"}) do - SKIN.tex.buttons[v] = {} - for i,j in pairs({"off","on","down"}) do - local sx = 96 + (16 * (k - 1)) - local sy = 16 * (i - 1) - SKIN.tex.buttons[v][j] = gctn(sx, sy, 16, 16) - end -end -SKIN.tex.buttonframe = gctn(72,120,24,24) - --- Button icons -SKIN.tex.icons = {} -for k,v in pairs({ - "save", - "search", - "talk", - "plus", - "minus", - "left", - "right", - "check", - "close", - "up", - "down", - "square" -}) do - SKIN.tex.icons[v] = gctn(162 + ((k-1) * 16),0,16,16) -end - --- hook.Add( "HUDPaint", "PaintStuff", function() --- local i = 1 --- for k,v in pairs(SKIN.tex.bu) do --- v(i,0,24,24,Color(255,255,255,255)) --- i = i + 24 --- end --- end ) - -function SKIN:PaintPanel(panel,w,h) - if not panel.m_bBackground then return end - if w >= 64 and h >= 64 then - self.tex.Panels.tl(0,0,32,32) - self.tex.Panels.t(32,0,w-64,32) - self.tex.Panels.tr(w-32,0,32,32) - self.tex.Panels.ml(0,32,32,h-64) - self.tex.Panels.m(32,32,w-64,h-64) - self.tex.Panels.mr(w-32,32,32,h-64) - self.tex.Panels.bl(0,h-32,32,32) - self.tex.Panels.bm(32,h-32,w-64,32) - self.tex.Panels.br(w-32,h-32,32,32) - end - -- self.tex.Panels.Normal(0,0,w,h,panel.m_bgColor) -end - -function SKIN:PaintButton(panel,w,h) - --print("Golden PaintButton called") - local bt = self.tex.bu - if panel.Depressed || panel:IsSelected() || panel:GetToggle() then - bt = self.tex.bd - end - - if panel.m_Image then - bt.left_b(0,0,48,h) - bt.mid(48,0,w - 48,h) - bt.right(w - 24,0,24,h) - - if panel.Hovered then - self.tex.buttons.blue.on(5,5,16,16) - elseif panel.Depressed || panel:IsSelected() || panel:GetToggle() then - self.tex.buttons.blue.down(5,5,16,16) - else - self.tex.buttons.blue.off(5,5,16,16) - end - else - bt.left(0,0,24,h) - bt.mid(24,0,w-48,h) - bt.right(w-24,0,24,h) - end -end - -function SKIN:PaintFrame( panel, w, h ) - if ( panel.m_bPaintShadow ) then - - DisableClipping( true ) - SKIN.tex.Shadow( -4, -4, w+10, h+10 ) - DisableClipping( false ) - - end - - self.tex.fr.tl(0,0,32,56) - self.tex.fr.t(32,0,w-(32 * 4),56) - - if panel.btnMinim:IsEnabled() then - self.tex.fr.t_b(w - (32 * 3), 0, 32, 56) - else - self.tex.fr.t(w - (32 * 3), 0, 32, 56) - end - - if panel.btnMaxim:IsEnabled() then - self.tex.fr.t_b(w - (32 * 2), 0, 32, 56) - else - self.tex.fr.t(w - (32 * 2), 0, 32, 56) - end - - if panel.btnClose:IsEnabled() then - self.tex.fr.tr_b(w - 32,0,32,56) - else - self.tex.fr.tr(w - 32,0,32,56) - end - - -- The rest of the frame - self.tex.Panels.ml(0,56,32,h - (32 + 56)) - self.tex.Panels.m(32,56,w-64,h - (32 + 56)) - self.tex.Panels.mr(w-32,56,32,h - (32 + 56)) - self.tex.Panels.bl(0,h-32,32,32) - self.tex.Panels.bm(32,h-32,w-64,32) - self.tex.Panels.br(w-32,h-32,32,32) - - -- if ( panel:HasHierarchicalFocus() ) then - -- - -- --self.tex.Window.Normal( 0, 0, w, h ) - -- - -- else - -- - -- --self.tex.Window.Inactive( 0, 0, w, h ) - -- - -- end - -end - ---Helper function for frame buttons -local function draw_colored_button(panel,w,h,t,x,y) - x = x or 0 - y = y or 0 - if ( panel.Depressed || panel:IsSelected() ) then - t.down(x,y,w,h) - elseif ( panel.Hovered ) then - t.on( x, y, w, h ) - else - t.off( x, y, w, h ) - end -end -function SKIN:PaintWindowCloseButton( panel, w, h ) - if ( panel:GetDisabled() ) then return end - draw_colored_button(panel,w,h,self.tex.buttons.red) - self.tex.icons.close(0,0,w,h) -end - -function SKIN:PaintWindowMinimizeButton( panel, w, h ) - if ( panel:GetDisabled() ) then return end - draw_colored_button(panel,w,h,self.tex.buttons.blue) - self.tex.icons.minus(0,0,w,h) -end - -function SKIN:PaintWindowMaximizeButton( panel, w, h ) - if ( panel:GetDisabled() ) then return end - draw_colored_button(panel,w,h,self.tex.buttons.blue) - self.tex.icons.square(0,0,w,h, tbt) -end - -function SKIN:PaintPropertySheet( panel, w, h ) - - -- local ActiveTab = panel:GetActiveTab() - -- local Offset = 0 - -- if ( ActiveTab ) then Offset = ActiveTab:GetTall() - 8 end - - --self.tex.Tab_Control( 0, Offset, w, h-Offset ) - -end - -function SKIN:PaintTab( panel, w, h ) - local tp - if ( panel:IsActive() ) then - tp = self.tex.tab.down - else - tp = self.tex.tab.up - end - local sf,mf,ef - mf = tp.mid - if panel:IsFirst() then - sf = tp.start - ef = tp.end_c - elseif panel:IsLast() then - sf = tp.start_c - ef = tp["end"] --Bad field name choice - else - sf = tp.start_c - ef = tp.end_c - end - sf(0,0,16,32) - mf(16,0,w-32,32) - ef(w-16,0,16,32) - -end - -function SKIN:PaintButtonLeft( panel, w, h ) - if ( !panel.m_bBackground ) then return end - draw_colored_button(panel,16,16,self.tex.buttons.blue,4,4) - self.tex.icons.left(4,4,16,16) - self.tex.buttonframe(0,0,24,24) -end - -function SKIN:PaintButtonRight( panel, w, h ) - if ( !panel.m_bBackground ) then return end - draw_colored_button(panel,16,16,self.tex.buttons.blue,4,4) - self.tex.icons.right(4,4,16,16) - self.tex.buttonframe(0,0,24,24) -end -function SKIN:PaintMenuRightArrow( panel, w, h ) - self.tex.tab.right(0,0,w,h) -end - -function SKIN:PaintMenuLeftArrow( panel, w, h) - self.tex.tab.left(0,0,w,h) -end - ---Progressbar -function SKIN:PaintProgress(panel, w,h) - - self.tex.bar.back.start(0,0,24,h) - self.tex.bar.back.mid(24,0,w-48,h) - self.tex.bar.back.fin(w-24,0,24,h) - local barlen = (w - 18) * panel:GetFraction() - self.tex.bar.fill.start(9,0,8,h) - if barlen > 8 then - self.tex.bar.fill.fin(barlen-8 + 9,0,8,h) - if barlen > 16 then - self.tex.bar.fill.mid(8 + 9,0,barlen - 16 + 9,h) - end - end - -- self.tex.ProgressBar.Back( 0, 0, w, h ) - -- self.tex.ProgressBar.Front( 0, 0, w * panel:GetFraction(), h ) -end - -function SKIN:PaintScrollBarGrip(panel, width, height) - draw.RoundedBox(0, 0, 0, width, height, Color(0, 0, 0, 200)) -end - --- SKIN.PaintButtonDown = SKIN.PaintButton --- SKIN.PaintButtonUp = SKIN.PaintButton --- SKIN.PaintButtonLeft = SKIN.PaintButton --- SKIN.PaintButtonRight = SKIN.PaintButton - -print("Golden skin defined") -derma.DefineSkin( "Golden", "Media Acie ", SKIN ) - ---Change some elements to work with the new skin visuals - ---Frame -do - local dframetbl = vgui.GetControlTable("DFrame") - local odfpl = dframetbl.PerformLayout - function dframetbl:PerformLayout() - odfpl(self) - self.btnClose:SetPos( self:GetWide() - 26, 4 ) - self.btnClose:SetSize( 16, 16 ) - - self.btnMaxim:SetPos(self:GetWide() - 32 - 26, 4) - self.btnMaxim:SetSize( 16, 16) - - self.btnMinim:SetPos(self:GetWide() - 64 - 26, 4) - self.btnMinim:SetSize( 16, 16) - - self.lblTitle:SetPos(8,4) - end - local odfpi = dframetbl.Init - function dframetbl:Init() - odfpi(self) - self:DockPadding(6,58-32+6,6,6) - end -end - ---Panel -do - local dpaneltbl = vgui.GetControlTable("DPanel") - local odpi = dpaneltbl.Init - function dpaneltbl:Init() - odpi(self) - self:DockPadding(6,6,6,6) - end -end ---[[ -frame = vgui.Create("DFrame") -frame:SetSize(300,300) -vsheet = vgui.Create("DPropertySheet",frame) -vsheet:Dock(FILL) -for i = 1,10 do - vsheet:AddSheet("Sheet " .. tostring(i), vgui.Create("DPanel")) -end -]] ---Property sheet -do - local dproptbl = vgui.GetControlTable("DPropertySheet") -end ---DTab -do - local dtab = vgui.GetControlTable("DTab") - function dtab:GetPosition() - local vsheet = self:GetPropertySheet() - for i = 1,#vsheet.Items do - if vsheet.Items[i].Tab == self then - return i - end - end - end - function dtab:IsFirst() - return self:GetPosition() == 1 - end - function dtab:IsLast() - local vsheet = self:GetPropertySheet() - return self:GetPosition() == #vsheet.Items - end -end ---Horizontal scroller -do - local dhs = vgui.GetControlTable("DHorizontalScroller") - local odhspl = dhs.PerformLayout - function dhs:PerformLayout() - odhspl(self) - self.btnLeft:SetSize(24,24) - self.btnRight:SetSize(24,24) - - self.btnRight:AlignTop(0) - self.btnRight:AlignRight(0) - self.btnLeft:AlignTop(0) - self.btnLeft:AlignLeft(0) - end -end - ---Detour vgui.Create to always use golden skin -local ovgc = vgui.Create -function vgui.Create(...) - local r = ovgc(...) - r:SetSkin("Golden") - return r -end +local surface = surface
+local Color = Color
+
+local mskin = SKIN
+SKIN = {}
+setmetatable(SKIN,{__index = mskin})
+
+SKIN.PrintName = "Golden Skin"
+SKIN.Author = "Apickx"
+SKIN.DermaVersion = 1
+SKIN.GwenTexture = Material("golden.png")
+
+local gctn = GWEN.CreateTextureNormal
+
+--Panel
+SKIN.tex.Panels.tl = gctn(0,0,32,32)
+SKIN.tex.Panels.t = gctn(32,0,32,32)
+SKIN.tex.Panels.tr = gctn(64,0,32,32)
+SKIN.tex.Panels.ml = gctn(0,32,32,32)
+SKIN.tex.Panels.m = gctn(32,32,32,32)
+SKIN.tex.Panels.mr = gctn(64,32,32,32)
+SKIN.tex.Panels.bl = gctn(0,64,32,32)
+SKIN.tex.Panels.bm = gctn(32,64,32,32)
+SKIN.tex.Panels.br = gctn(64,64,32,32)
+
+--Button up
+SKIN.tex.bu = {}
+SKIN.tex.bu.left = gctn(0,96,24,24)
+SKIN.tex.bu.mid = gctn(24,96,24,24)
+SKIN.tex.bu.right = gctn(48,96,24,24)
+SKIN.tex.bu.left_b = gctn(0,224,48,24)
+--Button down
+SKIN.tex.bd = {}
+SKIN.tex.bd.left = gctn(0,120,24,24)
+SKIN.tex.bd.mid = gctn(24,120,24,24)
+SKIN.tex.bd.right = gctn(48,120,24,24)
+SKIN.tex.bd.left_b = gctn(0,200,48,24)
+
+--Frame
+SKIN.tex.fr = {}
+SKIN.tex.fr.tl = gctn(0,144,32,56)
+SKIN.tex.fr.t = gctn(32,144,32,56)
+SKIN.tex.fr.tr = gctn(64,144,32,56)
+SKIN.tex.fr.t_b = gctn(92,144,32,56)
+SKIN.tex.fr.tr_b = gctn(128,144,32,56)
+
+--Property sheet tab
+SKIN.tex.tab = {}
+SKIN.tex.tab.right = gctn(96,48,16,32)
+SKIN.tex.tab.left = gctn(112,48,16,32)
+for k,v in pairs({"down","up"}) do
+ SKIN.tex.tab[v] = {}
+ for i,j in pairs({"start","mid","end_c","start_c","end"}) do
+ local sx = 128 + ((i - 1) * 16)
+ local sy = 48 + ((k - 1) * 32)
+ SKIN.tex.tab[v][j] = gctn(sx,sy,16,32)
+ end
+end
+
+-- Progress bar
+SKIN.tex.bar = {}
+SKIN.tex.bar.back = {}
+for k,v in pairs({"start","mid","fin"}) do
+ SKIN.tex.bar.back[v] = gctn(128 + ((k - 1) * 24),112,24,24)
+end
+SKIN.tex.bar.fill = {}
+for k,v in pairs({"start","mid","fin"}) do
+ SKIN.tex.bar.fill[v] = gctn(200 + ((k - 1) * 8),112,8,24)
+end
+
+--Round buttons
+--[[
+frame = vgui.Create("DFrame")
+frame.Paint = function(s,w,h) GWEN.CreateTextureNormal(0,0,1024,1024)(0,0,w,h) end
+frame:SetSize(300,300)
+]]
+SKIN.tex.buttons = {}
+for k,v in pairs({"green","blue","red","gray"}) do
+ SKIN.tex.buttons[v] = {}
+ for i,j in pairs({"off","on","down"}) do
+ local sx = 96 + (16 * (k - 1))
+ local sy = 16 * (i - 1)
+ SKIN.tex.buttons[v][j] = gctn(sx, sy, 16, 16)
+ end
+end
+SKIN.tex.buttonframe = gctn(72,120,24,24)
+
+-- Button icons
+SKIN.tex.icons = {}
+for k,v in pairs({
+ "save",
+ "search",
+ "talk",
+ "plus",
+ "minus",
+ "left",
+ "right",
+ "check",
+ "close",
+ "up",
+ "down",
+ "square"
+}) do
+ SKIN.tex.icons[v] = gctn(162 + ((k-1) * 16),0,16,16)
+end
+
+-- hook.Add( "HUDPaint", "PaintStuff", function()
+-- local i = 1
+-- for k,v in pairs(SKIN.tex.bu) do
+-- v(i,0,24,24,Color(255,255,255,255))
+-- i = i + 24
+-- end
+-- end )
+
+function SKIN:PaintPanel(panel,w,h)
+ if not panel.m_bBackground then return end
+ if w >= 64 and h >= 64 then
+ self.tex.Panels.tl(0,0,32,32)
+ self.tex.Panels.t(32,0,w-64,32)
+ self.tex.Panels.tr(w-32,0,32,32)
+ self.tex.Panels.ml(0,32,32,h-64)
+ self.tex.Panels.m(32,32,w-64,h-64)
+ self.tex.Panels.mr(w-32,32,32,h-64)
+ self.tex.Panels.bl(0,h-32,32,32)
+ self.tex.Panels.bm(32,h-32,w-64,32)
+ self.tex.Panels.br(w-32,h-32,32,32)
+ end
+ -- self.tex.Panels.Normal(0,0,w,h,panel.m_bgColor)
+end
+
+function SKIN:PaintButton(panel,w,h)
+ --print("Golden PaintButton called")
+ local bt = self.tex.bu
+ if panel.Depressed || panel:IsSelected() || panel:GetToggle() then
+ bt = self.tex.bd
+ end
+
+ if panel.m_Image then
+ bt.left_b(0,0,48,h)
+ bt.mid(48,0,w - 48,h)
+ bt.right(w - 24,0,24,h)
+
+ if panel.Hovered then
+ self.tex.buttons.blue.on(5,5,16,16)
+ elseif panel.Depressed || panel:IsSelected() || panel:GetToggle() then
+ self.tex.buttons.blue.down(5,5,16,16)
+ else
+ self.tex.buttons.blue.off(5,5,16,16)
+ end
+ else
+ bt.left(0,0,24,h)
+ bt.mid(24,0,w-48,h)
+ bt.right(w-24,0,24,h)
+ end
+end
+
+function SKIN:PaintFrame( panel, w, h )
+ if ( panel.m_bPaintShadow ) then
+
+ DisableClipping( true )
+ SKIN.tex.Shadow( -4, -4, w+10, h+10 )
+ DisableClipping( false )
+
+ end
+
+ self.tex.fr.tl(0,0,32,56)
+ self.tex.fr.t(32,0,w-(32 * 4),56)
+
+ if panel.btnMinim:IsEnabled() then
+ self.tex.fr.t_b(w - (32 * 3), 0, 32, 56)
+ else
+ self.tex.fr.t(w - (32 * 3), 0, 32, 56)
+ end
+
+ if panel.btnMaxim:IsEnabled() then
+ self.tex.fr.t_b(w - (32 * 2), 0, 32, 56)
+ else
+ self.tex.fr.t(w - (32 * 2), 0, 32, 56)
+ end
+
+ if panel.btnClose:IsEnabled() then
+ self.tex.fr.tr_b(w - 32,0,32,56)
+ else
+ self.tex.fr.tr(w - 32,0,32,56)
+ end
+
+ -- The rest of the frame
+ self.tex.Panels.ml(0,56,32,h - (32 + 56))
+ self.tex.Panels.m(32,56,w-64,h - (32 + 56))
+ self.tex.Panels.mr(w-32,56,32,h - (32 + 56))
+ self.tex.Panels.bl(0,h-32,32,32)
+ self.tex.Panels.bm(32,h-32,w-64,32)
+ self.tex.Panels.br(w-32,h-32,32,32)
+
+ -- if ( panel:HasHierarchicalFocus() ) then
+ --
+ -- --self.tex.Window.Normal( 0, 0, w, h )
+ --
+ -- else
+ --
+ -- --self.tex.Window.Inactive( 0, 0, w, h )
+ --
+ -- end
+
+end
+
+--Helper function for frame buttons
+local function draw_colored_button(panel,w,h,t,x,y)
+ x = x or 0
+ y = y or 0
+ if ( panel.Depressed || panel:IsSelected() ) then
+ t.down(x,y,w,h)
+ elseif ( panel.Hovered ) then
+ t.on( x, y, w, h )
+ else
+ t.off( x, y, w, h )
+ end
+end
+function SKIN:PaintWindowCloseButton( panel, w, h )
+ if ( panel:GetDisabled() ) then return end
+ draw_colored_button(panel,w,h,self.tex.buttons.red)
+ self.tex.icons.close(0,0,w,h)
+end
+
+function SKIN:PaintWindowMinimizeButton( panel, w, h )
+ if ( panel:GetDisabled() ) then return end
+ draw_colored_button(panel,w,h,self.tex.buttons.blue)
+ self.tex.icons.minus(0,0,w,h)
+end
+
+function SKIN:PaintWindowMaximizeButton( panel, w, h )
+ if ( panel:GetDisabled() ) then return end
+ draw_colored_button(panel,w,h,self.tex.buttons.blue)
+ self.tex.icons.square(0,0,w,h, tbt)
+end
+
+function SKIN:PaintPropertySheet( panel, w, h )
+
+ -- local ActiveTab = panel:GetActiveTab()
+ -- local Offset = 0
+ -- if ( ActiveTab ) then Offset = ActiveTab:GetTall() - 8 end
+
+ --self.tex.Tab_Control( 0, Offset, w, h-Offset )
+
+end
+
+function SKIN:PaintTab( panel, w, h )
+ local tp
+ if ( panel:IsActive() ) then
+ tp = self.tex.tab.down
+ else
+ tp = self.tex.tab.up
+ end
+ local sf,mf,ef
+ mf = tp.mid
+ if panel:IsFirst() then
+ sf = tp.start
+ ef = tp.end_c
+ elseif panel:IsLast() then
+ sf = tp.start_c
+ ef = tp["end"] --Bad field name choice
+ else
+ sf = tp.start_c
+ ef = tp.end_c
+ end
+ sf(0,0,16,32)
+ mf(16,0,w-32,32)
+ ef(w-16,0,16,32)
+
+end
+
+function SKIN:PaintButtonLeft( panel, w, h )
+ if ( !panel.m_bBackground ) then return end
+ draw_colored_button(panel,16,16,self.tex.buttons.blue,4,4)
+ self.tex.icons.left(4,4,16,16)
+ self.tex.buttonframe(0,0,24,24)
+end
+
+function SKIN:PaintButtonRight( panel, w, h )
+ if ( !panel.m_bBackground ) then return end
+ draw_colored_button(panel,16,16,self.tex.buttons.blue,4,4)
+ self.tex.icons.right(4,4,16,16)
+ self.tex.buttonframe(0,0,24,24)
+end
+function SKIN:PaintMenuRightArrow( panel, w, h )
+ self.tex.tab.right(0,0,w,h)
+end
+
+function SKIN:PaintMenuLeftArrow( panel, w, h)
+ self.tex.tab.left(0,0,w,h)
+end
+
+--Progressbar
+function SKIN:PaintProgress(panel, w,h)
+
+ self.tex.bar.back.start(0,0,24,h)
+ self.tex.bar.back.mid(24,0,w-48,h)
+ self.tex.bar.back.fin(w-24,0,24,h)
+ local barlen = (w - 18) * panel:GetFraction()
+ self.tex.bar.fill.start(9,0,8,h)
+ if barlen > 8 then
+ self.tex.bar.fill.fin(barlen-8 + 9,0,8,h)
+ if barlen > 16 then
+ self.tex.bar.fill.mid(8 + 9,0,barlen - 16 + 9,h)
+ end
+ end
+ -- self.tex.ProgressBar.Back( 0, 0, w, h )
+ -- self.tex.ProgressBar.Front( 0, 0, w * panel:GetFraction(), h )
+end
+
+function SKIN:PaintScrollBarGrip(panel, width, height)
+ draw.RoundedBox(0, 0, 0, width, height, Color(0, 0, 0, 200))
+end
+
+-- SKIN.PaintButtonDown = SKIN.PaintButton
+-- SKIN.PaintButtonUp = SKIN.PaintButton
+-- SKIN.PaintButtonLeft = SKIN.PaintButton
+-- SKIN.PaintButtonRight = SKIN.PaintButton
+
+print("Golden skin defined")
+derma.DefineSkin( "Golden", "Media Acie ", SKIN )
+
+--Change some elements to work with the new skin visuals
+
+--Frame
+do
+ local dframetbl = vgui.GetControlTable("DFrame")
+ local odfpl = dframetbl.PerformLayout
+ function dframetbl:PerformLayout()
+ odfpl(self)
+ self.btnClose:SetPos( self:GetWide() - 26, 4 )
+ self.btnClose:SetSize( 16, 16 )
+
+ self.btnMaxim:SetPos(self:GetWide() - 32 - 26, 4)
+ self.btnMaxim:SetSize( 16, 16)
+
+ self.btnMinim:SetPos(self:GetWide() - 64 - 26, 4)
+ self.btnMinim:SetSize( 16, 16)
+
+ self.lblTitle:SetPos(8,4)
+ end
+ local odfpi = dframetbl.Init
+ function dframetbl:Init()
+ odfpi(self)
+ self:DockPadding(6,58-32+6,6,6)
+ end
+end
+
+--Panel
+do
+ local dpaneltbl = vgui.GetControlTable("DPanel")
+ local odpi = dpaneltbl.Init
+ function dpaneltbl:Init()
+ odpi(self)
+ self:DockPadding(6,6,6,6)
+ end
+end
+--[[
+frame = vgui.Create("DFrame")
+frame:SetSize(300,300)
+vsheet = vgui.Create("DPropertySheet",frame)
+vsheet:Dock(FILL)
+for i = 1,10 do
+ vsheet:AddSheet("Sheet " .. tostring(i), vgui.Create("DPanel"))
+end
+]]
+--Property sheet
+do
+ local dproptbl = vgui.GetControlTable("DPropertySheet")
+end
+--DTab
+do
+ local dtab = vgui.GetControlTable("DTab")
+ function dtab:GetPosition()
+ local vsheet = self:GetPropertySheet()
+ for i = 1,#vsheet.Items do
+ if vsheet.Items[i].Tab == self then
+ return i
+ end
+ end
+ end
+ function dtab:IsFirst()
+ return self:GetPosition() == 1
+ end
+ function dtab:IsLast()
+ local vsheet = self:GetPropertySheet()
+ return self:GetPosition() == #vsheet.Items
+ end
+end
+--Horizontal scroller
+do
+ local dhs = vgui.GetControlTable("DHorizontalScroller")
+ local odhspl = dhs.PerformLayout
+ function dhs:PerformLayout()
+ odhspl(self)
+ self.btnLeft:SetSize(24,24)
+ self.btnRight:SetSize(24,24)
+
+ self.btnRight:AlignTop(0)
+ self.btnRight:AlignRight(0)
+ self.btnLeft:AlignTop(0)
+ self.btnLeft:AlignLeft(0)
+ end
+end
+
+--Detour vgui.Create to always use golden skin
+local ovgc = vgui.Create
+function vgui.Create(...)
+ local r = ovgc(...)
+ r:SetSkin("Golden")
+ return r
+end
diff --git a/data/artery/global/sv_goldenskin.lua b/data/artery/global/sv_goldenskin.lua index 9fd3e45..ecc6af4 100644 --- a/data/artery/global/sv_goldenskin.lua +++ b/data/artery/global/sv_goldenskin.lua @@ -1 +1 @@ -resource.AddFile("materials/golden.png") +resource.AddFile("materials/golden.png")
|
