mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
Upload
This commit is contained in:
73
lua/vgui/dlabelurl.lua
Normal file
73
lua/vgui/dlabelurl.lua
Normal file
@@ -0,0 +1,73 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc( PANEL, "m_colText", "TextColor" )
|
||||
AccessorFunc( PANEL, "m_colTextStyle", "TextStyleColor" )
|
||||
|
||||
AccessorFunc( PANEL, "m_bAutoStretchVertical", "AutoStretchVertical" )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self:SetTextStyleColor( Color( 0, 0, 255 ) )
|
||||
|
||||
-- Nicer default height
|
||||
self:SetTall( 20 )
|
||||
|
||||
-- This turns off the engine drawing
|
||||
self:SetPaintBackgroundEnabled( false )
|
||||
self:SetPaintBorderEnabled( false )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:ApplySchemeSettings()
|
||||
|
||||
self:UpdateFGColor()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SetTextColor( clr )
|
||||
|
||||
self.m_colText = clr
|
||||
self:UpdateFGColor()
|
||||
|
||||
end
|
||||
PANEL.SetColor = PANEL.SetTextColor
|
||||
|
||||
function PANEL:GetColor()
|
||||
|
||||
return self.m_colText or self.m_colTextStyle
|
||||
|
||||
end
|
||||
|
||||
function PANEL:OnCursorEntered()
|
||||
|
||||
self:SetTextStyleColor( Color( 0, 50, 255 ) )
|
||||
self:UpdateFGColor()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:OnCursorExited()
|
||||
|
||||
self:SetTextStyleColor( Color( 0, 0, 255 ) )
|
||||
self:UpdateFGColor()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:UpdateFGColor()
|
||||
|
||||
local col = self:GetColor()
|
||||
self:SetFGColor( col.r, col.g, col.b, col.a )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "DLabelURL", "A Label", PANEL, "URLLabel" )
|
||||
Reference in New Issue
Block a user