mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
45
lua/sui/vgui/sui_number_slider.lua
Normal file
45
lua/sui/vgui/sui_number_slider.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| 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 surface = surface
|
||||
|
||||
local SUI, NAME = CURRENT_SUI, CURRENT_SUI.name
|
||||
|
||||
local NUMBER_SLIDER_FONT = SUI.CreateFont("NumberSlider", "Roboto Regular", 14)
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
sui.scaling_functions(PANEL)
|
||||
|
||||
function PANEL:Init()
|
||||
self:ScaleInit()
|
||||
|
||||
local slider = vgui.Create(NAME .. ".Slider", self, "NumberSlider")
|
||||
slider:Dock(FILL)
|
||||
|
||||
self.slider = slider
|
||||
|
||||
local label = self:Add(NAME .. ".Label")
|
||||
label:Dock(RIGHT)
|
||||
label:DockMargin(3, 0, 0, 0)
|
||||
label:SetFont(NUMBER_SLIDER_FONT)
|
||||
self.label = label
|
||||
|
||||
function label:Think()
|
||||
self:SetText(slider:GetValue())
|
||||
|
||||
self:SizeToContents()
|
||||
end
|
||||
|
||||
self:SetSize(100, 12)
|
||||
self:InvalidateLayout(true)
|
||||
end
|
||||
|
||||
sui.register("NumberSlider", PANEL, "Panel")
|
||||
Reference in New Issue
Block a user