Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PANEL = {}
- function PANEL:Init()
- self:SetSize( 200, 100 )
- self:Center()
- self.title = "coffeeinv_frame"
- self.theme = coffeeInventory.config.themes[ coffeeInventory.config.theme ]
- end
- function PANEL:Paint( w, h )
- //Background
- draw.RoundedBox( 0, 0, 0, w, h, Color( self.theme.frameBackground.r - 20, self.theme.frameBackground.g - 20, self.theme.frameBackground.b - 20, self.theme.frameBackground.a or 255 ) )
- draw.RoundedBox( 0, 1, 1, w - 2, h - 2, self.theme.frameBackground )
- draw.RoundedBox( 0, 2, 2, w - 4, h - 4, Color( self.theme.frameBackground.r - 10, self.theme.frameBackground.g - 10, self.theme.frameBackground.b - 10, self.theme.frameBackground.a or 255 ) )
- //Bar
- draw.RoundedBox( 0, 0, 0, w, 16, self.theme.frameBar )
- draw.RoundedBox( 0, 0, 16, w, 4, Color( self.theme.frameBar.r - 50, self.theme.frameBar.g - 50, self.theme.frameBar.b - 50, self.theme.frameBackground.a or 255 ) )
- //Title
- draw.SimpleText( self.title, "coffeeinventory_little", w / 2, 8, self.theme.titleText, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
- end
- function PANEL:setTitle( text )
- self.title = text
- end
- function PANEL:addCloseButton()
- self.closeButton = vgui.Create( "coffeeinv_textButton", self )
- self.closeButton:SetSize( 20, 20 )
- self.closeButton:SetPos( self:GetWide() - 25, 0 )
- self.closeButton:setText( "X" )
- self.closeButton.OnMousePressed = function()
- surface.PlaySound( "buttons/button14.wav" )
- self:Remove()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement