Initial Reupload
This commit is contained in:
111
gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua
Normal file
111
gamemodes/fretta/gamemode/vgui/vgui_gamenotice.lua
Normal file
@@ -0,0 +1,111 @@
|
||||
-- client cvars to control deathmsgs
|
||||
local hud_deathnotice_time = CreateClientConVar( "hud_deathnotice_time", "6", true, false )
|
||||
local hud_deathnotice_limit = CreateClientConVar( "hud_deathnotice_limit", "5", true, false )
|
||||
|
||||
/*
|
||||
This is the player death panel. This should be parented to a DeathMessage_Panel. The DeathMessage_Panel that
|
||||
it's parented to controls aspects such as the position on screen. All this panel's job is to print the
|
||||
specific death it's been given and fade out before its RetireTime.
|
||||
*/
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
Derma_Hook( PANEL, "Paint", "Paint", "GameNotice" )
|
||||
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "GameNotice" )
|
||||
Derma_Hook( PANEL, "PerformLayout", "Layout", "GameNotice" )
|
||||
|
||||
function PANEL:Init()
|
||||
self.m_bHighlight = false
|
||||
self.Padding = 8
|
||||
self.Spacing = 8
|
||||
self.Items = {}
|
||||
end
|
||||
|
||||
function PANEL:AddEntityText( txt )
|
||||
|
||||
if ( type( txt ) == "string" ) then return false end
|
||||
|
||||
if ( type( txt ) == "Player" ) then
|
||||
|
||||
self:AddText( txt:Nick(), GAMEMODE:GetTeamColor( txt ) )
|
||||
if ( txt == LocalPlayer() ) then self.m_bHighlight = true end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
if( txt:IsValid() ) then
|
||||
self:AddText( txt:GetClass(), GAMEMODE.DeathNoticeDefaultColor )
|
||||
else
|
||||
self:AddText( tostring( txt ) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:AddItem( item )
|
||||
|
||||
table.insert( self.Items, item )
|
||||
self:InvalidateLayout( true )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:AddText( txt, color )
|
||||
|
||||
if ( self:AddEntityText( txt ) ) then return end
|
||||
|
||||
local txt = tostring( txt )
|
||||
|
||||
local lbl = vgui.Create( "DLabel", self )
|
||||
|
||||
Derma_Hook( lbl, "ApplySchemeSettings", "Scheme", "GameNoticeLabel" )
|
||||
lbl:ApplySchemeSettings()
|
||||
lbl:SetText( txt )
|
||||
|
||||
if( string.Left( txt , 1 ) == "#" && !color ) then color = GAMEMODE.DeathNoticeDefaultColor end // localised ent death
|
||||
if( GAMEMODE.DeathNoticeTextColor && !color ) then color = GAMEMODE.DeathNoticeTextColor end // something else
|
||||
if ( !color ) then color = color_white end
|
||||
|
||||
lbl:SetTextColor( color )
|
||||
|
||||
self:AddItem( lbl )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:AddIcon( txt )
|
||||
|
||||
if ( killicon.Exists( txt ) ) then
|
||||
|
||||
local icon = vgui.Create( "DKillIcon", self )
|
||||
icon:SetName( txt )
|
||||
icon:SizeToContents()
|
||||
|
||||
self:AddItem( icon )
|
||||
|
||||
else
|
||||
|
||||
self:AddText( "killed" )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
local x = self.Padding
|
||||
local height = self.Padding * 0.5
|
||||
|
||||
for k, v in pairs( self.Items ) do
|
||||
|
||||
v:SetPos( x, self.Padding * 0.5 )
|
||||
v:SizeToContents()
|
||||
|
||||
x = x + v:GetWide() + self.Spacing
|
||||
height = math.max( height, v:GetTall() + self.Padding )
|
||||
|
||||
end
|
||||
|
||||
self:SetSize( x + self.Padding, height )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "GameNotice", "", PANEL, "DPanel" )
|
||||
47
gamemodes/fretta/gamemode/vgui/vgui_hudbase.lua
Normal file
47
gamemodes/fretta/gamemode/vgui/vgui_hudbase.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
local PANEL = {}
|
||||
|
||||
surface.CreateLegacyFont( "Roboto", 32, 800, true, false, "FHUDElement" )
|
||||
|
||||
AccessorFunc( PANEL, "m_bPartOfBar", "PartOfBar" )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self:SetText( "-" )
|
||||
self:SetTextColor( self:GetDefaultTextColor() )
|
||||
self:SetFont( "FHUDElement" )
|
||||
|
||||
self:ChooseParent()
|
||||
|
||||
end
|
||||
|
||||
// This makes it so that it's behind chat & hides when you're in the menu
|
||||
// But it also removes the ability to click on it. So override it if you want to.
|
||||
function PANEL:ChooseParent()
|
||||
self:ParentToHUD()
|
||||
end
|
||||
|
||||
function PANEL:GetPadding()
|
||||
return 16
|
||||
end
|
||||
|
||||
function PANEL:GetDefaultTextColor()
|
||||
return Color( 255, 255, 255, 255 )
|
||||
end
|
||||
|
||||
function PANEL:GetTextLabelColor()
|
||||
return Color( 255, 255, 0 )
|
||||
end
|
||||
|
||||
function PANEL:GetTextLabelFont()
|
||||
return "HudSelectionText"
|
||||
end
|
||||
|
||||
function PANEL:Paint()
|
||||
|
||||
if ( !self.m_bPartOfBar ) then
|
||||
draw.RoundedBox( 4, 0, 0, self:GetWide(), self:GetTall(), Color( 0, 0, 0, 100 ) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "HudBase", "A HUD Base Element (override to change the style)", PANEL, "DLabel" )
|
||||
107
gamemodes/fretta/gamemode/vgui/vgui_hudcommon.lua
Normal file
107
gamemodes/fretta/gamemode/vgui/vgui_hudcommon.lua
Normal file
@@ -0,0 +1,107 @@
|
||||
local PANEL = {}
|
||||
AccessorFunc( PANEL, "m_Items", "Items" )
|
||||
AccessorFunc( PANEL, "m_Horizontal", "Horizontal" )
|
||||
AccessorFunc( PANEL, "m_Spacing", "Spacing" )
|
||||
|
||||
AccessorFunc( PANEL, "m_AlignBottom", "AlignBottom" )
|
||||
AccessorFunc( PANEL, "m_AlignCenter", "AlignCenter" )
|
||||
|
||||
function PANEL:Init()
|
||||
self.m_Items = {}
|
||||
self:SetHorizontal( true )
|
||||
self:SetText( "" )
|
||||
self:SetAlignCenter( true )
|
||||
self:SetSpacing( 8 )
|
||||
end
|
||||
|
||||
function PANEL:AddItem( item )
|
||||
item:SetParent( self )
|
||||
table.insert( self.m_Items, item )
|
||||
self:InvalidateLayout()
|
||||
item:SetPaintBackgroundEnabled( false )
|
||||
item.m_bPartOfBar = true
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
if ( self.m_Horizontal ) then
|
||||
local x = self.m_Spacing
|
||||
local tallest = 0
|
||||
for k, v in pairs( self.m_Items ) do
|
||||
|
||||
v:SetPos( x, 0 )
|
||||
x = x + v:GetWide() + self.m_Spacing
|
||||
tallest = math.max( tallest, v:GetTall() )
|
||||
|
||||
if ( self.m_AlignBottom ) then v:AlignBottom() end
|
||||
if ( self.m_AlignCenter ) then v:CenterVertical() end
|
||||
|
||||
end
|
||||
self:SetSize( x, tallest )
|
||||
else
|
||||
// todo.
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "DHudBar", "", PANEL, "HudBase" )
|
||||
|
||||
local PANEL = {}
|
||||
AccessorFunc( PANEL, "m_ValueFunction", "ValueFunction" )
|
||||
AccessorFunc( PANEL, "m_ColorFunction", "ColorFunction" )
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: Init
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:Init()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:GetTextValueFromFunction()
|
||||
if (!self.m_ValueFunction) then return "-" end
|
||||
return tostring( self:m_ValueFunction() )
|
||||
end
|
||||
|
||||
function PANEL:GetColorFromFunction()
|
||||
if (!self.m_ColorFunction) then return self:GetDefaultTextColor() end
|
||||
return self:m_ColorFunction()
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
self:SetTextColor( self:GetColorFromFunction() )
|
||||
self:SetText( self:GetTextValueFromFunction() )
|
||||
end
|
||||
|
||||
derma.DefineControl( "DHudUpdater", "A HUD Element", PANEL, "DHudElement" )
|
||||
|
||||
|
||||
local PANEL = {}
|
||||
AccessorFunc( PANEL, "m_Function", "Function" )
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: Init
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:Init()
|
||||
HudBase.Init( self )
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
if ( !self.m_ValueFunction ) then return end
|
||||
|
||||
self:SetTextColor( self:GetColorFromFunction() )
|
||||
|
||||
local EndTime = self:m_ValueFunction()
|
||||
if ( EndTime == -1 ) then return end
|
||||
|
||||
if ( !EndTime || EndTime < CurTime() ) then
|
||||
self:SetText( "00:00" )
|
||||
return
|
||||
end
|
||||
|
||||
local Time = util.ToMinutesSeconds( EndTime - CurTime() )
|
||||
self:SetText( Time )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "DHudCountdown", "A HUD Element", PANEL, "DHudUpdater" )
|
||||
39
gamemodes/fretta/gamemode/vgui/vgui_hudelement.lua
Normal file
39
gamemodes/fretta/gamemode/vgui/vgui_hudelement.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local PANEL = {}
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: Init
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:Init()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SetLabel( text )
|
||||
|
||||
self.LabelPanel = vgui.Create( "DLabel", self )
|
||||
self.LabelPanel:SetText( text )
|
||||
self.LabelPanel:SetTextColor( self:GetTextLabelColor() )
|
||||
self.LabelPanel:SetFont( self:GetTextLabelFont() )
|
||||
|
||||
end
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: PerformLayout
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
self:SetContentAlignment( 5 )
|
||||
|
||||
if ( self.LabelPanel ) then
|
||||
self.LabelPanel:SetPos( self:GetPadding(), self:GetPadding() )
|
||||
self.LabelPanel:SizeToContents()
|
||||
self.LabelPanel:SetSize( self.LabelPanel:GetWide() + self:GetPadding() * 0.5, self.LabelPanel:GetTall() + self:GetPadding() * 0.5 )
|
||||
self:SetTextInset( self.LabelPanel:GetWide() + self:GetPadding(), 0 )
|
||||
self:SetContentAlignment( 4 )
|
||||
end
|
||||
|
||||
self:SizeToContents( )
|
||||
self:SetSize( self:GetWide() + self:GetPadding(), self:GetTall() + self:GetPadding() )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "DHudElement", "A HUD Element", PANEL, "HudBase" )
|
||||
161
gamemodes/fretta/gamemode/vgui/vgui_hudlayout.lua
Normal file
161
gamemodes/fretta/gamemode/vgui/vgui_hudlayout.lua
Normal file
@@ -0,0 +1,161 @@
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc( PANEL, "Spacing", "Spacing" )
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: Init
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:Init()
|
||||
|
||||
self.Items = {}
|
||||
|
||||
self:SetSpacing( 8 )
|
||||
|
||||
self:SetPaintBackgroundEnabled( false )
|
||||
self:SetPaintBorderEnabled( false )
|
||||
|
||||
self:ParentToHUD()
|
||||
|
||||
end
|
||||
|
||||
// This makes it so that it's behind chat & hides when you're in the menu
|
||||
// But it also removes the ability to click on it. So override it if you want to.
|
||||
function PANEL:ChooseParent()
|
||||
self:ParentToHUD()
|
||||
end
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: GetCanvas
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:Clear( bDelete )
|
||||
|
||||
for k, panel in pairs( self.Items ) do
|
||||
|
||||
if ( panel && panel:IsValid() ) then
|
||||
|
||||
panel:SetParent( panel )
|
||||
panel:SetVisible( false )
|
||||
|
||||
if ( bDelete ) then
|
||||
panel:Remove()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
self.Items = {}
|
||||
|
||||
end
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: AddItem
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:AddItem( item, relative, pos )
|
||||
|
||||
if (!item || !item:IsValid()) then return end
|
||||
|
||||
item.HUDPos = pos
|
||||
item.HUDrelative = relative
|
||||
|
||||
item:SetVisible( true )
|
||||
item:SetParent( self )
|
||||
table.insert( self.Items, item )
|
||||
|
||||
self:InvalidateLayout()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PositionItem( item )
|
||||
|
||||
if ( item.Positioned ) then return end
|
||||
if ( IsValid( item.HUDrelative ) && item != item.HUDrelative ) then self:PositionItem( item.HUDrelative ) end
|
||||
|
||||
local SPACING = self:GetSpacing()
|
||||
|
||||
item:InvalidateLayout( true )
|
||||
|
||||
if ( item.HUDPos == 7 || item.HUDPos == 8 || item.HUDPos == 9 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item:MoveAbove( item.HUDrelative, SPACING )
|
||||
else
|
||||
item:AlignTop()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 4 || item.HUDPos == 5 || item.HUDPos == 6 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item.y = item.HUDrelative.y
|
||||
else
|
||||
item:CenterVertical()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 1 || item.HUDPos == 2 || item.HUDPos == 3 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item:MoveBelow( item.HUDrelative, SPACING )
|
||||
else
|
||||
item:AlignBottom()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 7 || item.HUDPos == 4 || item.HUDPos == 1 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item.x = item.HUDrelative.x
|
||||
else
|
||||
item:AlignLeft()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 8 || item.HUDPos == 5 || item.HUDPos == 2 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item.x = item.HUDrelative.x + ( item.HUDrelative:GetWide() - item:GetWide() ) / 2
|
||||
else
|
||||
item:CenterHorizontal()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 9 || item.HUDPos == 6 || item.HUDPos == 3 ) then
|
||||
if ( IsValid( item.HUDrelative ) ) then
|
||||
item.x = item.HUDrelative.x + item.HUDrelative:GetWide() - item:GetWide()
|
||||
else
|
||||
item:AlignRight()
|
||||
end
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 4 && IsValid( item.HUDrelative ) ) then
|
||||
item:MoveLeftOf( item.HUDrelative, SPACING )
|
||||
end
|
||||
|
||||
if ( item.HUDPos == 6 && IsValid( item.HUDrelative ) ) then
|
||||
item:MoveRightOf( item.HUDrelative, SPACING )
|
||||
end
|
||||
|
||||
item.Positioned = true
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
self:InvalidateLayout()
|
||||
end
|
||||
|
||||
/*---------------------------------------------------------
|
||||
Name: PerformLayout
|
||||
---------------------------------------------------------*/
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
self:SetPos( 32, 32 )
|
||||
self:SetWide( ScrW() - 64 )
|
||||
self:SetTall( ScrH() - 64 )
|
||||
|
||||
for k, item in pairs( self.Items ) do
|
||||
item.Positioned = false
|
||||
end
|
||||
|
||||
for k, item in pairs( self.Items ) do
|
||||
self:PositionItem( item )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "DHudLayout", "A HUD Layout Base", PANEL, "Panel" )
|
||||
219
gamemodes/fretta/gamemode/vgui/vgui_scoreboard.lua
Normal file
219
gamemodes/fretta/gamemode/vgui/vgui_scoreboard.lua
Normal file
@@ -0,0 +1,219 @@
|
||||
include( "vgui_scoreboard_team.lua" )
|
||||
include( "vgui_scoreboard_small.lua" )
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
Derma_Hook( PANEL, "Paint", "Paint", "ScoreHeader" )
|
||||
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "ScoreHeader" )
|
||||
Derma_Hook( PANEL, "PerformLayout", "Layout", "ScoreHeader" )
|
||||
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self.Columns = {}
|
||||
self.iTeamID = 0
|
||||
|
||||
self.HostName = vgui.Create( "DLabel", self )
|
||||
self.HostName:SetText( GetHostName() )
|
||||
|
||||
self.GamemodeName = vgui.Create( "DLabel", self )
|
||||
self.GamemodeName:SetText( GAMEMODE.Name .. " | Version: ".. GAMEMODE._VERSION .. " - Rev. ".. GAMEMODE.REVISION )
|
||||
|
||||
self:SetHeight( 64 )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "ScoreboardHeader", "", PANEL, "Panel" )
|
||||
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
|
||||
AccessorFunc( PANEL, "m_bHorizontal", "Horizontal" )
|
||||
AccessorFunc( PANEL, "m_iPadding", "Padding" )
|
||||
AccessorFunc( PANEL, "m_iRowHeight", "RowHeight" )
|
||||
AccessorFunc( PANEL, "m_bShowScoreHeaders", "ShowScoreboardHeaders" )
|
||||
|
||||
Derma_Hook( PANEL, "Paint", "Paint", "ScorePanel" )
|
||||
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "ScorePanel" )
|
||||
Derma_Hook( PANEL, "PerformLayout", "Layout", "ScorePanel" )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self.SortDesc = true
|
||||
|
||||
self.Boards = {}
|
||||
self.SmallBoards = {}
|
||||
self.Columns = {}
|
||||
|
||||
self:SetRowHeight( 32 )
|
||||
self:SetHorizontal( false )
|
||||
self:SetPadding( 10 )
|
||||
self:SetShowScoreboardHeaders( true )
|
||||
|
||||
self.Header = vgui.Create( "ScoreboardHeader", self )
|
||||
|
||||
local teams = team.GetAllTeams()
|
||||
for k, v in pairs( teams ) do
|
||||
|
||||
local ScoreBoard = vgui.Create( "TeamScoreboard", self )
|
||||
ScoreBoard:Setup( k, self )
|
||||
self.Boards[ k ] = ScoreBoard
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SetAsBullshitTeam( iTeamID )
|
||||
|
||||
if ( IsValid( self.Boards[ iTeamID ] ) ) then
|
||||
self.Boards[ iTeamID ]:Remove()
|
||||
self.Boards[ iTeamID ] = nil
|
||||
end
|
||||
|
||||
self.SmallBoards[ iTeamID ] = vgui.Create( "TeamBoardSmall", self )
|
||||
self.SmallBoards[ iTeamID ]:Setup( iTeamID, self )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SetSortColumns( ... )
|
||||
|
||||
for k, v in pairs( self.Boards ) do
|
||||
v:SetSortColumns( ... )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:AddColumn( Name, iFixedSize, fncValue, UpdateRate, TeamID, HeaderAlign, ValueAlign, Font )
|
||||
|
||||
local Col = {}
|
||||
|
||||
Col.Name = Name
|
||||
Col.iFixedSize = iFixedSize
|
||||
Col.fncValue = fncValue
|
||||
Col.TeamID = TeamID
|
||||
Col.UpdateRate = UpdateRate
|
||||
Col.ValueAlign = ValueAlign
|
||||
Col.HeaderAlign = HeaderAlign
|
||||
Col.Font = Font
|
||||
|
||||
for k, v in pairs( self.Boards ) do
|
||||
v:AddColumn( Col )
|
||||
end
|
||||
|
||||
return Col
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Layout4By4( y )
|
||||
|
||||
local a = self.Boards[1]
|
||||
local b = self.Boards[2]
|
||||
local c = self.Boards[3]
|
||||
local d = self.Boards[4]
|
||||
|
||||
local widtheach = (self:GetWide() - ( self.m_iPadding * 3 )) / 2
|
||||
|
||||
for k, v in pairs( self.Boards ) do
|
||||
|
||||
v:SizeToContents()
|
||||
v:SetWide( widtheach )
|
||||
|
||||
end
|
||||
|
||||
a:SetPos( self.m_iPadding, y + self.m_iPadding )
|
||||
b:SetPos( a:GetPos() + a:GetWide() + self.m_iPadding, y + self.m_iPadding )
|
||||
|
||||
local height = a:GetTall() + a.y
|
||||
height = math.max( b:GetTall() + b.y, height )
|
||||
height = height + self.m_iPadding * 2
|
||||
|
||||
c:SetPos( self.m_iPadding, height )
|
||||
d:SetPos( c:GetPos() + c:GetWide() + self.m_iPadding, height )
|
||||
|
||||
local height = d:GetTall() + d.y
|
||||
height = math.max( c:GetTall() + c.y, height )
|
||||
height = height + self.m_iPadding * 2
|
||||
|
||||
return height
|
||||
|
||||
end
|
||||
|
||||
function PANEL:LayoutHorizontal( y )
|
||||
|
||||
local cols = table.Count( self.Boards )
|
||||
|
||||
if ( cols == 4 ) then
|
||||
return self:Layout4By4( y )
|
||||
end
|
||||
|
||||
local widtheach = (self:GetWide() - ( self.m_iPadding * (cols+1) )) / cols
|
||||
|
||||
local x = self.m_iPadding
|
||||
local tallest = 0
|
||||
for k, v in pairs( self.Boards ) do
|
||||
|
||||
v:SizeToContents()
|
||||
v:SetPos( x, y )
|
||||
v:SetWide( widtheach )
|
||||
|
||||
x = x + widtheach + self.m_iPadding
|
||||
tallest = math.max( tallest, y + v:GetTall() + self.m_iPadding )
|
||||
|
||||
end
|
||||
|
||||
return tallest
|
||||
|
||||
end
|
||||
|
||||
function PANEL:LayoutVertical( y )
|
||||
|
||||
for k, v in pairs( self.Boards ) do
|
||||
|
||||
v:SizeToContents()
|
||||
v:SetPos( self.m_iPadding, y )
|
||||
v:SetWide( self:GetWide() - self.m_iPadding * 2 )
|
||||
y = y + v:GetTall() + self.m_iPadding
|
||||
|
||||
end
|
||||
|
||||
return y
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
local y = 0
|
||||
|
||||
if ( IsValid( self.Header ) ) then
|
||||
|
||||
self.Header:SetPos( 0, 0 )
|
||||
self.Header:SetWidth( self:GetWide() )
|
||||
|
||||
y = y + self.Header:GetTall() + self.m_iPadding
|
||||
|
||||
end
|
||||
|
||||
if ( self.m_bHorizontal ) then
|
||||
y = self:LayoutHorizontal( y )
|
||||
else
|
||||
y = self:LayoutVertical( y )
|
||||
end
|
||||
|
||||
for k, v in pairs( self.SmallBoards ) do
|
||||
|
||||
if ( v:ShouldShow() ) then
|
||||
|
||||
v:SizeToContents()
|
||||
|
||||
v:SetPos( self.m_iPadding, y )
|
||||
v:CenterHorizontal()
|
||||
|
||||
y = y + v:GetTall() + self.m_iPadding
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "FrettaScoreboard", "", PANEL, "DPanel" )
|
||||
67
gamemodes/fretta/gamemode/vgui/vgui_scoreboard_small.lua
Normal file
67
gamemodes/fretta/gamemode/vgui/vgui_scoreboard_small.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
local PANEL = {}
|
||||
|
||||
Derma_Hook( PANEL, "Paint", "Paint", "SpectatorInfo" )
|
||||
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "SpectatorInfo" )
|
||||
Derma_Hook( PANEL, "PerformLayout", "Layout", "SpectatorInfo" )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self.LastThink = 0
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Setup( iTeam, pMainScoreboard )
|
||||
self.iTeam = iTeam
|
||||
end
|
||||
|
||||
function PANEL:GetPlayers()
|
||||
return team.GetPlayers( self.iTeam )
|
||||
end
|
||||
|
||||
function PANEL:ShouldShow()
|
||||
|
||||
local players = team.GetPlayers( self.iTeam )
|
||||
if ( !players || #players == 0 ) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
function PANEL:UpdateText( NewText )
|
||||
|
||||
local OldText = self:GetValue()
|
||||
if ( OldText == NewText ) then return end
|
||||
|
||||
self:SetText( NewText )
|
||||
self:SizeToContents()
|
||||
self:InvalidateLayout()
|
||||
self:GetParent():InvalidateLayout()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
if ( self.LastThink > RealTime() ) then return end
|
||||
self.LastThink = RealTime() + 1
|
||||
|
||||
local players = team.GetPlayers( self.iTeam )
|
||||
if ( !players || #players == 0 ) then
|
||||
local OldText = self:GetValue()
|
||||
self:UpdateText( "" )
|
||||
return
|
||||
end
|
||||
|
||||
local Str = team.GetName( self.iTeam ) .. ": "
|
||||
|
||||
for k, v in pairs( players ) do
|
||||
Str = Str .. v:Name() .. ", "
|
||||
end
|
||||
|
||||
Str = Str:sub( 0, -3 )
|
||||
self:UpdateText( Str )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "TeamBoardSmall", "", PANEL, "DLabel" )
|
||||
218
gamemodes/fretta/gamemode/vgui/vgui_scoreboard_team.lua
Normal file
218
gamemodes/fretta/gamemode/vgui/vgui_scoreboard_team.lua
Normal file
@@ -0,0 +1,218 @@
|
||||
local PANEL = {}
|
||||
|
||||
Derma_Hook( PANEL, "Paint", "Paint", "TeamScoreboardHeader" )
|
||||
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "TeamScoreboardHeader" )
|
||||
Derma_Hook( PANEL, "PerformLayout", "Layout", "TeamScoreboardHeader" )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self.Columns = {}
|
||||
self.iTeamID = 0
|
||||
self.PlayerCount = 0
|
||||
|
||||
self.TeamName = vgui.Create( "DLabel", self )
|
||||
self.TeamScore = vgui.Create( "DLabel", self )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Setup( iTeam, pMainScoreboard )
|
||||
|
||||
self.TeamName:SetText( team.GetName( iTeam ) )
|
||||
self.iTeamID = iTeam
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
local Count = #team.GetPlayers( self.iTeamID )
|
||||
if ( self.PlayerCount != Count ) then
|
||||
self.PlayerCount = Count
|
||||
self.TeamName:SetText( team.GetName( self.iTeamID ) .. " (" .. self.PlayerCount .. " Players)" )
|
||||
end
|
||||
|
||||
self.TeamScore:SetText( team.GetScore( self.iTeamID ) )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "TeamScoreboardHeader", "", PANEL, "Panel" )
|
||||
|
||||
|
||||
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self.Columns = {}
|
||||
|
||||
self.List = vgui.Create( "DListView", self )
|
||||
self.List:SetSortable( false )
|
||||
self.List:DisableScrollbar()
|
||||
|
||||
self.Header = vgui.Create( "TeamScoreboardHeader", self )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Setup( iTeam, pMainScoreboard )
|
||||
|
||||
self.iTeam = iTeam
|
||||
self.pMain = pMainScoreboard
|
||||
|
||||
self.Header:Setup( iTeam, pMainScoreboard )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SizeToContents()
|
||||
|
||||
self.List:SizeToContents()
|
||||
local tall = self.List:GetTall()
|
||||
|
||||
self:SetTall( tall + self.Header:GetTall() )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
if ( self.pMain:GetShowScoreboardHeaders() ) then
|
||||
|
||||
self.Header:SetPos( 0, 0 )
|
||||
self.Header:CopyWidth( self )
|
||||
|
||||
else
|
||||
|
||||
self.Header:SetTall( 0 )
|
||||
self.Header:SetVisible( false )
|
||||
|
||||
end
|
||||
|
||||
self:SizeToContents()
|
||||
self.List:StretchToParent( 0, self.Header:GetTall(), 0, 0 )
|
||||
self.List:SetDataHeight( self.pMain:GetRowHeight() )
|
||||
self.List:SetHeaderHeight( 16 )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:AddColumn( col )
|
||||
|
||||
table.insert( self.Columns, col )
|
||||
|
||||
local pnlCol = self.List:AddColumn( col.Name )
|
||||
|
||||
if (col.iFixedSize) then pnlCol:SetMinWidth( col.iFixedSize ) pnlCol:SetMaxWidth( col.iFixedSize ) end
|
||||
if (col.HeaderAlign) then
|
||||
pnlCol.Header:SetContentAlignment( col.HeaderAlign )
|
||||
end
|
||||
|
||||
-- Credits to dhantasmic on GitHub for this fix
|
||||
pnlCol:GetChildren()[1]:SetVisible( false )
|
||||
pnlCol:GetChildren()[2]:SetVisible( false )
|
||||
|
||||
Derma_Hook( pnlCol, "Paint", "Paint", "ScorePanelHeader" )
|
||||
|
||||
pnlCol.cTeamColor = team.GetColor( self.iTeam )
|
||||
|
||||
Derma_Hook( pnlCol.Header, "Paint", "Paint", "ScorePanelHeaderLabel" )
|
||||
Derma_Hook( pnlCol.Header, "ApplySchemeSettings", "Scheme", "ScorePanelHeaderLabel" )
|
||||
Derma_Hook( pnlCol.Header, "PerformLayout", "Layout", "ScorePanelHeaderLabel" )
|
||||
|
||||
pnlCol.Header:ApplySchemeSettings()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:SetSortColumns( ... )
|
||||
|
||||
self.SortArgs = ...
|
||||
|
||||
end
|
||||
|
||||
function PANEL:FindPlayerLine( ply )
|
||||
|
||||
for _, line in pairs( self.List.Lines ) do
|
||||
if ( line.pPlayer == ply ) then return line end
|
||||
end
|
||||
|
||||
local line = self.List:AddLine()
|
||||
line.pPlayer = ply
|
||||
line.UpdateTime = {}
|
||||
|
||||
Derma_Hook( line, "Paint", "Paint", "ScorePanelLine" )
|
||||
Derma_Hook( line, "ApplySchemeSettings", "Scheme", "ScorePanelLine" )
|
||||
Derma_Hook( line, "PerformLayout", "Layout", "ScorePanelLine" )
|
||||
|
||||
self.pMain:InvalidateLayout()
|
||||
|
||||
return line
|
||||
|
||||
end
|
||||
|
||||
function PANEL:UpdateColumn( i, col, pLine )
|
||||
|
||||
if ( !col.fncValue ) then return end
|
||||
|
||||
pLine.UpdateTime[i] = pLine.UpdateTime[i] or 0
|
||||
if ( col.UpdateRate == 0 && pLine.UpdateTime[i] != 0 ) then return end // 0 = only update once
|
||||
if ( pLine.UpdateTime[i] > RealTime() ) then return end
|
||||
|
||||
pLine.UpdateTime[i] = RealTime() + col.UpdateRate
|
||||
|
||||
local Value = col.fncValue( pLine.pPlayer )
|
||||
if ( Value == nil ) then return end
|
||||
|
||||
local lbl = pLine:SetColumnText( i, Value )
|
||||
if ( IsValid( lbl ) && !lbl.bScorePanelHooks ) then
|
||||
|
||||
lbl.bScorePanelHooks = true
|
||||
|
||||
if ( col.ValueAlign ) then lbl:SetContentAlignment( col.ValueAlign ) end
|
||||
if ( col.Font ) then lbl:SetFont( col.Font ) end
|
||||
|
||||
lbl.pPlayer = pLine.pPlayer
|
||||
|
||||
Derma_Hook( lbl, "Paint", "Paint", "ScorePanelLabel" )
|
||||
Derma_Hook( lbl, "ApplySchemeSettings", "Scheme", "ScorePanelLabel" )
|
||||
Derma_Hook( lbl, "PerformLayout", "Layout", "ScorePanelLabel" )
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function PANEL:UpdateLine( pLine )
|
||||
|
||||
for i, col in pairs( self.Columns ) do
|
||||
self:UpdateColumn( i, col, pLine )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:CleanLines( pLine )
|
||||
|
||||
for k, line in pairs( self.List.Lines ) do
|
||||
|
||||
if ( !IsValid( line.pPlayer ) || line.pPlayer:Team() != self.iTeam ) then
|
||||
self.List:RemoveLine( k )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
self:CleanLines()
|
||||
|
||||
local players = team.GetPlayers( self.iTeam )
|
||||
for _, player in pairs( players ) do
|
||||
|
||||
local line = self:FindPlayerLine( player )
|
||||
self:UpdateLine( line )
|
||||
|
||||
end
|
||||
|
||||
if ( self.SortArgs ) then
|
||||
self.List:SortByColumns( unpack(self.SortArgs) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "TeamScoreboard", "", PANEL, "Panel" )
|
||||
240
gamemodes/fretta/gamemode/vgui/vgui_vote.lua
Normal file
240
gamemodes/fretta/gamemode/vgui/vgui_vote.lua
Normal file
@@ -0,0 +1,240 @@
|
||||
local PANEL = {}
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
self:SetSkin( GAMEMODE.HudSkin )
|
||||
self:ParentToHUD()
|
||||
|
||||
self.ControlCanvas = vgui.Create( "Panel", self )
|
||||
self.ControlCanvas:MakePopup()
|
||||
self.ControlCanvas:SetKeyboardInputEnabled( false )
|
||||
|
||||
self.lblCountDown = vgui.Create( "DLabel", self.ControlCanvas )
|
||||
self.lblCountDown:SetText( "60" )
|
||||
|
||||
self.lblActionName = vgui.Create( "DLabel", self.ControlCanvas )
|
||||
|
||||
self.ctrlList = vgui.Create( "DPanelList", self.ControlCanvas )
|
||||
self.ctrlList:SetDrawBackground( false )
|
||||
self.ctrlList:SetSpacing( 2 )
|
||||
self.ctrlList:SetPadding( 2 )
|
||||
self.ctrlList:EnableHorizontal( true )
|
||||
self.ctrlList:EnableVerticalScrollbar()
|
||||
|
||||
self.Peeps = {}
|
||||
|
||||
for i =1, game.MaxPlayers() do
|
||||
|
||||
self.Peeps[i] = vgui.Create( "DImage", self.ctrlList:GetCanvas() )
|
||||
self.Peeps[i]:SetSize( 16, 16 )
|
||||
self.Peeps[i]:SetZPos( 1000 )
|
||||
self.Peeps[i]:SetVisible( false )
|
||||
self.Peeps[i]:SetImage( "icon16/emoticon_smile.png" )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
local cx, cy = chat.GetChatBoxPos()
|
||||
|
||||
self:SetPos( 0, 0 )
|
||||
self:SetSize( ScrW(), ScrH() )
|
||||
|
||||
self.ControlCanvas:StretchToParent( 0, 0, 0, 0 )
|
||||
self.ControlCanvas:SetWide( 550 )
|
||||
self.ControlCanvas:SetTall( cy - 30 )
|
||||
self.ControlCanvas:SetPos( 0, 30 )
|
||||
self.ControlCanvas:CenterHorizontal();
|
||||
self.ControlCanvas:SetZPos( 0 )
|
||||
|
||||
self.lblCountDown:SetFont( "FRETTA_MEDIUM_SHADOW" )
|
||||
self.lblCountDown:AlignRight()
|
||||
self.lblCountDown:SetTextColor( color_white )
|
||||
self.lblCountDown:SetContentAlignment( 6 )
|
||||
self.lblCountDown:SetWidth( 500 )
|
||||
|
||||
self.lblActionName:SetFont( "FRETTA_LARGE_SHADOW" )
|
||||
self.lblActionName:AlignLeft()
|
||||
self.lblActionName:SetTextColor( color_white )
|
||||
self.lblActionName:SizeToContents()
|
||||
self.lblActionName:SetWidth( 500 )
|
||||
|
||||
self.ctrlList:StretchToParent( 0, 60, 0, 0 )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:ChooseGamemode()
|
||||
|
||||
self.lblActionName:SetText( "Which Gamemode Next?" )
|
||||
self.ctrlList:Clear()
|
||||
|
||||
for name, gamemode in RandomPairs( g_PlayableGamemodes ) do
|
||||
|
||||
local lbl = vgui.Create( "DButton", self.ctrlList )
|
||||
lbl:SetText( gamemode.label )
|
||||
|
||||
Derma_Hook( lbl, "Paint", "Paint", "GamemodeButton" )
|
||||
Derma_Hook( lbl, "ApplySchemeSettings", "Scheme", "GamemodeButton" )
|
||||
Derma_Hook( lbl, "PerformLayout", "Layout", "GamemodeButton" )
|
||||
|
||||
lbl:SetTall( 24 )
|
||||
lbl:SetWide( 240 )
|
||||
|
||||
local desc = tostring( gamemode.description );
|
||||
if ( gamemode.author ) then desc = desc .. "\n\nBy: " .. tostring( gamemode.author ) end
|
||||
if ( gamemode.authorurl ) then desc = desc .. "\n" .. tostring( gamemode.authorurl ) end
|
||||
|
||||
lbl:SetTooltip( desc )
|
||||
|
||||
lbl.WantName = name
|
||||
lbl.NumVotes = 0
|
||||
lbl.DoClick = function() if GetGlobalFloat( "VoteEndTime", 0 ) - CurTime() <= 0 then return end RunConsoleCommand( "votegamemode", name ) end
|
||||
|
||||
self.ctrlList:AddItem( lbl )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:ChooseMap( gamemode )
|
||||
|
||||
self.lblActionName:SetText( "Which Map?" )
|
||||
self:ResetPeeps()
|
||||
self.ctrlList:Clear()
|
||||
|
||||
local gm = g_PlayableGamemodes[ gamemode ]
|
||||
if ( !gm ) then MsgN( "GAMEMODE MISSING, COULDN'T VOTE FOR MAP ", gamemode ) return end
|
||||
|
||||
for id, mapname in RandomPairs( gm.maps ) do
|
||||
local lbl = vgui.Create( "DButton", self.ctrlList )
|
||||
lbl:SetText( mapname )
|
||||
|
||||
Derma_Hook( lbl, "Paint", "Paint", "GamemodeButton" )
|
||||
Derma_Hook( lbl, "ApplySchemeSettings", "Scheme", "GamemodeButton" )
|
||||
Derma_Hook( lbl, "PerformLayout", "Layout", "GamemodeButton" )
|
||||
|
||||
lbl:SetTall( 24 )
|
||||
lbl:SetWide( 240 )
|
||||
|
||||
lbl.WantName = mapname
|
||||
lbl.NumVotes = 0
|
||||
lbl.DoClick = function() if GetGlobalFloat( "VoteEndTime", 0 ) - CurTime() <= 0 then return end RunConsoleCommand( "votemap", mapname ) end
|
||||
|
||||
--[[if file.Exists("maps/"..mapname..".png", "MOD") then
|
||||
lbl:SetTall(72)
|
||||
|
||||
local Image = vgui.Create("DImage", lbl)
|
||||
Image:SetImage("../maps/"..mapname..".png")
|
||||
Image:SizeToContents()
|
||||
Image:SetSize(math.min(Image:GetWide(), 64), math.min(Image:GetTall(), 64))
|
||||
Image:AlignRight(4)
|
||||
Image:CenterVertical()
|
||||
end]]
|
||||
|
||||
self.ctrlList:AddItem( lbl )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:ResetPeeps()
|
||||
|
||||
for i=1, game.MaxPlayers() do
|
||||
self.Peeps[i]:SetPos( math.random( 0, 600 ), -16 )
|
||||
self.Peeps[i]:SetVisible( false )
|
||||
self.Peeps[i].strVote = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:FindWantBar( name )
|
||||
|
||||
for k, v in pairs( self.ctrlList:GetItems() ) do
|
||||
if ( v.WantName == name ) then return v end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PeepThink( peep, ent )
|
||||
|
||||
if ( !IsValid( ent ) ) then
|
||||
peep:SetVisible( false )
|
||||
return
|
||||
end
|
||||
|
||||
peep:SetTooltip( ent:Nick() )
|
||||
peep:SetMouseInputEnabled( true )
|
||||
|
||||
if ( !peep.strVote ) then
|
||||
peep:SetVisible( true )
|
||||
peep:SetPos( math.random( 0, 600 ), -16 )
|
||||
if ( ent == LocalPlayer() ) then
|
||||
peep:SetImage( "icon16/star.png" )
|
||||
end
|
||||
end
|
||||
|
||||
peep.strVote = ent:GetNWString( "Wants", "" )
|
||||
local bar = self:FindWantBar( peep.strVote )
|
||||
if ( IsValid( bar ) ) then
|
||||
|
||||
bar.NumVotes = bar.NumVotes + 1
|
||||
local vCurrentPos = Vector( peep.x, peep.y, 0 )
|
||||
local vNewPos = Vector( (bar.x + bar:GetWide()) - 15 * bar.NumVotes - 4, bar.y + ( bar:GetTall() * 0.5 - 8 ), 0 )
|
||||
|
||||
if ( !peep.CurPos || peep.CurPos != vNewPos ) then
|
||||
|
||||
peep:MoveTo( vNewPos.x, vNewPos.y, 0.2 )
|
||||
peep.CurPos = vNewPos
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
local Seconds = GetGlobalFloat( "VoteEndTime", 0 ) - CurTime()
|
||||
if ( Seconds < 0 ) then Seconds = 0 end
|
||||
|
||||
self.lblCountDown:SetText( Format( "%i", Seconds ) )
|
||||
|
||||
for k, v in pairs( self.ctrlList:GetItems() ) do
|
||||
v.NumVotes = 0
|
||||
end
|
||||
|
||||
for i=1, game.MaxPlayers() do
|
||||
self:PeepThink( self.Peeps[i], Entity(i) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Paint()
|
||||
|
||||
Derma_DrawBackgroundBlur( self )
|
||||
|
||||
local CenterY = ScrH() / 2.0
|
||||
local CenterX = ScrW() / 2.0
|
||||
|
||||
surface.SetDrawColor( 0, 0, 0, 200 );
|
||||
surface.DrawRect( 0, 0, ScrW(), ScrH() );
|
||||
|
||||
end
|
||||
|
||||
function PANEL:FlashItem( itemname )
|
||||
|
||||
local bar = self:FindWantBar( itemname )
|
||||
if ( !IsValid( bar ) ) then return end
|
||||
|
||||
timer.Simple( 0.0, function() bar.bgColor = Color( 0, 255, 255 ) surface.PlaySound( "hl1/fvox/blip.wav" ) end )
|
||||
timer.Simple( 0.2, function() bar.bgColor = nil end )
|
||||
timer.Simple( 0.4, function() bar.bgColor = Color( 0, 255, 255 ) surface.PlaySound( "hl1/fvox/blip.wav" ) end )
|
||||
timer.Simple( 0.6, function() bar.bgColor = nil end )
|
||||
timer.Simple( 0.8, function() bar.bgColor = Color( 0, 255, 255 ) surface.PlaySound( "hl1/fvox/blip.wav" ) end )
|
||||
timer.Simple( 1.0, function() bar.bgColor = Color( 100, 100, 100 ) end )
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "VoteScreen", "", PANEL, "DPanel" )
|
||||
Reference in New Issue
Block a user