Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CONFIG
- local config = {}
- // END CONFIG
- surface.CreateFont("F4Title", {
- size = 27,
- weight = 800,
- antialias = true,
- shadow = false,
- font = "roboto"
- })
- surface.CreateFont("F4Button", {
- size = 24,
- weight = 800,
- antialias = true,
- font = "roboto",
- })
- surface.CreateFont("F4Text", {
- size = 18,
- weight = 800,
- antialias = true,
- shadow = false,
- font = "roboto"
- })
- surface.CreateFont("F4TextBigger", {
- size = 18,
- weight = 800,
- antialias = true,
- shadow = false,
- font = "roboto"
- })
- surface.CreateFont("F4TextFrameTitle", {
- size = 21,
- weight = 800,
- antialias = true,
- shadow = false,
- font = "roboto"
- })
- surface.CreateFont("F4TextSmall", {
- size = 13,
- weight = 800,
- antialias = true,
- shadow = false,
- font = "roboto"
- })
- local PANEL = {}
- function PANEL:generateTabs()
- DarkRP.hooks.F4MenuTabs()
- hook.Call("F4MenuTabs")
- self:InvalidateLayout()
- self.buttons[1].DoClick( self.buttons[1] )
- end
- function PANEL:Think()
- if ( self.delay < CurTime() and input.IsKeyDown( KEY_F4 ) ) then
- self:Close()
- end
- end
- function PANEL:Init()
- self.buttons = {}
- local avatar_panel = vgui.Create( "DPanel", self )
- avatar_panel:SetPos( 0, 30 )
- avatar_panel:SetSize( 185, 65 )
- function avatar_panel:Paint( w, h )
- local col = Color( 51, 57, 68 )
- draw.RoundedBox( 2, 0, 0, w, h, col )
- draw.SimpleText( string.upper( LocalPlayer():Nick() ), "F4Text", 55, h/2, Color( 230, 230, 230 ), TEXT_ALIGN_LEFT, 1 )
- end
- local ava = vgui.Create( "AvatarMask", avatar_panel )
- ava.Avatar:SetPlayer( LocalPlayer(), 48 )
- ava:SetSize( 42, 42 )
- ava:SetPos( 7, 12 )
- self:StretchToParent(150, 100, 150, 100)
- self:Center()
- self:SetVisible(true)
- self:MakePopup()
- self:SetTitle( "" )
- self:ShowCloseButton( false )
- local exit = vgui.Create( "DPanel", self )
- exit:SetPos( self:GetWide() - 24, 5 )
- exit:SetSize( 20, 20 )
- exit:SetCursor("hand")
- function exit:Paint( w, h )
- draw.SimpleText( "X", "F4Text", 2, 2, Color( 230, 230, 230 ) )
- end
- exit.OnMousePressed = function()
- self:Close()
- end
- local content = vgui.Create( "DPanel", self )
- content:SetPos( 190, 40 )
- content:SetSize( self:GetWide() - 200, self:GetTall() - 50 )
- function content:Paint( w, h )
- end
- self.content = content
- self.oldThink = self.Think
- self.delay = CurTime() + 1
- the_f4_menu = self
- end
- function PANEL:setView( pnl )
- if ( ValidPanel( self.content.pnl ) ) then
- self.content.pnl:SetVisible( false )
- end
- pnl:SetParent( self.content )
- pnl:SetPos( 5, 5 )
- pnl:SetVisible( true )
- pnl:SetSize( self.content:GetWide()-10, self.content:GetTall()-10 )
- if ( pnl.InvalidateLayout ) then
- pnl:InvalidateLayout()
- end
- self.content.pnl = pnl
- end
- local selected
- function PANEL:switchTabOrder(name, int)
- local key
- for k,v in pairs( self.buttons ) do
- if ( v.name == name ) then
- key = k
- break
- end
- end
- if ( !key ) then return end
- self.buttons[ int ], self.buttons[ key ] = self.buttons[ key ], self.buttons[ int ]
- self:InvalidateLayout(true)
- end
- local cnt = 0
- function PANEL:createTab( name, panel )
- if ( name == "Weapons" or name == "Ammo" or name == "Miscellaneous" or name == "Shipments" ) then
- panel:Remove()
- return
- end
- panel:SetVisible( false )
- if ( panel.shouldHide and panel:shouldHide() ) then
- return
- end
- local but = vgui.Create( "DButton", self )
- but:SetText( "" )
- but.name = name
- but:SetSize( 185, 45 )
- local upped = string.upper( name )
- function but:Paint( w, h )
- local col = Color( 51, 57, 68 )
- if ( but.other == true ) then
- col = Color( 45, 52, 66 )
- end
- draw.RoundedBox( 2, 0 ,0, w, h, col )
- draw.SimpleText( upped, "F4Button", w/2, h/2, Color( 225, 225, 225 ), 1, 1 )
- if ( selected == but ) then
- surface.SetDrawColor( 58, 94, 228 )
- surface.DrawRect( 0, 0, 5, h )
- end
- end
- but.da_name = name
- but.DoClick = function( pnl )
- self:setView( panel )
- selected = pnl
- end
- table.insert( self.buttons, but )
- end
- function PANEL:InvalidateLayout()
- local but_y = 95
- local but_x = 0
- for k, v in SortedPairs( self.buttons ) do
- v:SetPos( but_x, but_y )
- v.other = string.len( tostring( k / 2 ) ) == 1
- but_y = but_y + v:GetTall()
- end
- end
- function PANEL:Paint( w, h )
- draw.RoundedBox( 6, 0, 0, w, h, Color( 60, 60, 60, 220 ) )
- surface.SetDrawColor( 52, 60, 71 )
- surface.DrawRect( 0, 0, w, h )
- surface.SetDrawColor( 47, 52, 65 )
- surface.DrawRect(0,0,185,h)
- surface.SetDrawColor( 47, 58, 57 )
- surface.DrawRect( 0, 0, w, 35 )
- draw.SimpleText("REPUBLIC GAMING", "F4TextFrameTitle", 10, 5, Color( 230, 230, 230 ) )
- end
- vgui.Register( "F4MenuFrame", PANEL, "DFrame" )
- local PANEL = {}
- function PANEL:makeCate( name, color )
- self.cates[ name ] = {
- name = name,
- buttons = {},
- color = color
- }
- end
- function PANEL:makeButton( text, icon, cate, func )
- table.insert( self.cates[ cate ][ "buttons"], {
- icon = Material( icon ),
- func = func,
- text = text
- } )
- end
- function PANEL:Init()
- self.cates = {}
- self.actions = vgui.Create( "DPanelList", self )
- self.actions:EnableVerticalScrollbar( true )
- self.actions:SetSpacing( 2 )
- self:makeCate( "General", Color( 13,102,255, 200 ) )
- self:makeButton( "Give money to <lookingat>", "icon16/money.png", "General", function()
- Derma_StringRequest( "Give money", "how much?", "", function( txt )
- RunConsoleCommand( "say", "/give "..txt )
- end )
- end )
- self:makeButton( "Drop Money", "icon16/money.png", "General", function()
- Derma_StringRequest( "Drop money", "how much?", "", function( txt )
- RunConsoleCommand( "say", "/dropmoney "..txt )
- end )
- end )
- self:makeButton( "Call an admin", "icon16/shield.png", "General", function()
- RunConsoleCommand( "say", "!report" )
- end )
- self:makeButton( "Drop current weapon", "icon16/gun.png", "General", function()
- RunConsoleCommand( "say", "/dropweapon" )
- end )
- self:makeCate( "Roleplay Options", Color( 120, 120, 120 ) )
- self:makeButton( "Change your RPName", "icon16/page_white_edit.png", "Roleplay Options", function()
- Derma_StringRequest( "RPName", "whats the new name?", "", function( txt )
- RunConsoleCommand( "say", "/rpname "..txt )
- end )
- end )
- self:makeButton( "Change your job title", "icon16/page_white_edit.png", "Roleplay Options", function()
- Derma_StringRequest( "Job", "whats the new job name?", "", function( txt )
- RunConsoleCommand( "say", "/job "..txt )
- end )
- end )
- self:makeButton( "Demote a player", "icon16/user_delete.png", "Roleplay Options", function()
- local menu = DermaMenu()
- for k,v in pairs( player.GetAll() ) do
- menu:AddOption( v:Nick(), function()
- Derma_StringRequest( "Demote", "why are you trying to demote?", "", function( txt )
- RunConsoleCommand( "say", "/demote "..v:UserID().. " "..txt )
- end )
- end )
- end
- menu:Open()
- end )
- self:makeButton( "Sell all your doors", "icon16/door.png", "Roleplay Options", function()
- RunConsoleCommand( "say", "/unownalldoors" )
- end )
- self.info = vgui.Create( "DPanel", self )
- function self.info:Paint( w, h )
- end
- local top = vgui.Create( "DPanel", self.info )
- top:SetTall( 50 )
- function top:Paint( w, h )
- draw.RoundedBox( 4, 0, 0, w, h, team.GetColor( LocalPlayer():Team() ) )
- draw.SimpleText( LocalPlayer():Nick(), "F4Text", 5, 5, color_white )
- draw.SimpleText( team.GetName( LocalPlayer():Team()), "F4Text", 5, 25, color_white )
- end
- local job = vgui.Create( "DPanel", self.info )
- local desc = RPExtraTeams[ LocalPlayer():Team() ].description
- local lbl = vgui.Create( "DLabel", job )
- lbl:SetText( desc )
- lbl:SetPos( 5, 5 )
- lbl:SetTextColor( color_black )
- lbl:SizeToContents()
- function job:onResize()
- local max = self:GetWide()
- local cur_w = 0
- local new_txt = {}
- local last_space = 2
- for k,v in pairs( string.ToTable( desc ) ) do
- local tw, th = surface.GetTextSize( v )
- cur_w = cur_w + tw
- if ( v == " " ) then
- last_space = k
- end
- if ( cur_w >= max ) then
- new_txt[ last_space ] = "\n"
- cur_w = 0
- end
- new_txt[ k ] = v
- end
- local new_str = table.concat( new_txt )
- new_str = string.gsub( new_str, "\t", "" )
- lbl:SetText( new_str )
- lbl:SizeToContents()
- job:SetTall( lbl:GetTall() + 10 )
- end
- function job:Paint( w, h )
- draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200 ) )
- end
- end
- function PANEL:Setup()
- if ( !self.actions ) then return end
- self.actions:Clear()
- for k,v in pairs( self.cates ) do
- local pnl = vgui.Create( "DCollapsibleCategory" )
- pnl:SetLabel( v.name )
- function pnl:Paint( w, h )
- draw.RoundedBox( 2, 0, 0, w, h, v.color )
- end
- local dlist = vgui.Create( "DPanelList" )
- dlist:SetAutoSize( true )
- dlist:EnableHorizontal( true )
- dlist:SetPadding( 4 )
- dlist:SetSpacing( 2 )
- for a,b in pairs( v.buttons ) do
- local but = vgui.Create( "DPanel" )
- but:SetSize( self:GetWide()*.293, 35 )
- but:SetCursor( "hand" )
- function but:Paint( w, h )
- draw.RoundedBox( 2, 0, 0, w, h, Color( 190, 190, 190 ) )
- if ( self:IsHovered() ) then
- draw.RoundedBox( 2, 0, 0, w, h, Color( 100, 100, 100, 100 ) )
- end
- surface.SetDrawColor( 255, 255, 255 )
- surface.SetMaterial( b.icon )
- surface.DrawTexturedRect( 10, (h/2)-8, 16, 16 )
- draw.SimpleText( b.text, "F4TextSmall", w/2, h/2, Color( 30, 30, 30 ), 1, 1 )
- end
- function but:OnMousePressed()
- b.func()
- end
- dlist:AddItem( but )
- end
- pnl:SetContents( dlist )
- self.actions:AddItem( pnl )
- end
- end
- function PANEL:InvalidateLayout()
- self.actions:SetSize( self:GetWide()*.6, self:GetTall() )
- if ( self.info ) then
- self.info:SetSize( self:GetWide() - self.actions:GetWide() - 5, self:GetTall() )
- local x, y = self.actions:GetPos()
- self.info:SetPos( x + self.actions:GetWide() + 5, 0 )
- local y = 0
- for k,v in pairs( self.info:GetChildren() ) do
- v:SetPos( 0, y )
- v:SetWide( self.info:GetWide() )
- y = y + v:GetTall() + 5
- if ( v.onResize ) then
- v:onResize()
- end
- end
- end
- self:Setup()
- end
- vgui.Register( "F4MenuAction", PANEL )
- local PANEL = {}
- function PANEL:Init()
- self.cates = {}
- self.joblist = vgui.Create( "DPanelList", self )
- self.joblist:EnableVerticalScrollbar( true )
- self.joblist:SetSpacing( 7 )
- self.joblist:SetPadding( 7 )
- self.info = vgui.Create( "DPanel", self )
- function self.info:Paint( w, h )
- draw.RoundedBox( 6, 0, 0, w, h, Color( 50, 50, 50 ) )
- if ( !self.filled ) then
- draw.SimpleText( "<-- Select a job from the left", "F4Text", 5, 25, color_white )
- else
- surface.SetDrawColor( Color( self.data.color.r,self.data.color.g,self.data.color.b,150 ) )
- surface.DrawRect( 0, 0, w, 25 )
- end
- end
- end
- local function showJobModelSelect( data )
- local pre_w = 20 + ( table.Count( data.model ) * 65 )
- local frame = vgui.Create( "DFrame" )
- frame:SetTitle( "Job Model Select" )
- frame:SetSize( pre_w, 100 )
- frame:MakePopup()
- frame:Center()
- frame:SetSkin("DarkRP")
- local x_pos = 10
- for k,v in pairs( data.model ) do
- local icon = vgui.Create( "SpawnIcon", frame )
- icon:SetModel( v, 64 )
- icon:SetSize( 64, 64 )
- icon:SetPos( x_pos, 30 )
- function icon:DoClick()
- DarkRP.setPreferredJobModel( data.team, v )
- timer.Simple( .5, function()
- if ( data.vote ) then
- RunConsoleCommand( "say", "/vote"..data.command )
- else
- RunConsoleCommand( "say", "/"..data.command )
- end
- end )
- frame:Close()
- end
- x_pos = x_pos + icon:GetWide() + 1
- end
- end
- function PANEL:Setup()
- if ( !self.joblist ) then return end
- self.joblist:Clear()
- for k,v in pairs( RPExtraTeams ) do
- if ( v.team == LocalPlayer():Team() ) then continue end
- local pnl = vgui.Create( "DPanel" )
- pnl:SetTall( 84 )
- pnl:SetWide( (self.joblist:GetWide()/2) - 12 )
- pnl:SetCursor( "hand" )
- local path = ( type( v.model ) == "table" and table.Random( v.model ) ) or v.model
- local mdl = vgui.Create("SpawnIcon", pnl)
- mdl:SetModel( path, 64 )
- mdl:SetSize( 64, 64 )
- mdl:SetPos( 8, 10 )
- mdl:SetMouseInputEnabled( false )
- function pnl:Paint( w, h )
- draw.RoundedBox( 6, 0, 0, w, h, Color( 40, 47, 57 ) )
- if ( self:IsHovered() ) then
- draw.RoundedBox( 6, 0, 0, w, h, Color( 100, 100, 100, 100 ) )
- end
- draw.SimpleText( string.upper( v.name ), "F4TextBigger", 70, 25, Color( 235, 235, 235 ), TEXT_ALIGN_LEFT, 1 )
- end
- function pnl:OnMousePressed()
- if ( IsValid( the_f4_menu ) ) then
- the_f4_menu:Close()
- end
- if ( type( v.model ) == "table" and table.Count( v.model ) > 1 ) then
- showJobModelSelect( v )
- else
- if ( v.vote ) then
- RunConsoleCommand( "say", "/vote"..v.command )
- else
- RunConsoleCommand( "say", "/"..v.command )
- end
- end
- end
- pnl.OnCursorEntered = function()
- self.info:Clear()
- self.info.filled = true
- self.info.data = v
- local title = vgui.Create( "DLabel", self.info )
- title:SetText( v.name )
- title:SetPos( 5, 5 )
- title:SetFont( "F4Text" )
- title:SizeToContents()
- local desc = vgui.Create( "DLabel", self.info )
- desc:SetText( v.description )
- desc:SetPos( 5, 35 )
- desc:SizeToContents()
- local max = vgui.Create( "DLabel", self.info )
- max:SetText( "Salary: $"..v.salary.."\nMax: "..team.NumPlayers( v.team ).."/"..v.max.."\nWeapons: "..table.concat( v.weapons or {}, "\n" ) )
- max:SetPos( 5, 200 )
- max:SizeToContents()
- end
- pnl.OnCursorExited = function()
- self.info:Clear()
- self.info.filled = nil
- end
- self.joblist:AddItem( pnl )
- end
- end
- function PANEL:InvalidateLayout()
- self.joblist:SetSize( self:GetWide()*.6, self:GetTall() )
- if ( self.info ) then
- self.info:SetSize( self:GetWide() - self.joblist:GetWide() - 5, self:GetTall() )
- local x, y = self.joblist:GetPos()
- self.info:SetPos( x + self.joblist:GetWide() + 5, 0 )
- local y = 0
- for k,v in pairs( self.info:GetChildren() ) do
- v:SetPos( 0, y )
- v:SetWide( self.info:GetWide() )
- y = y + v:GetTall() + 5
- end
- end
- self:Setup()
- end
- vgui.Register( "F4MenuJobs", PANEL )
- local function sendURL( url )
- local p = vgui.Create( "DPanel" )
- function p:Paint( w, h )
- draw.RoundedBox( 2, 0, 0, w, h, Color( 0, 0, 0, 100 ) )
- draw.SimpleText( url, "F4Button", w/2, h/2, color_white, 1, 1 )
- end
- local but = vgui.Create( "DButton", p )
- but:SetText("Access page")
- but:SetSize( 100, 25 )
- function but:DoClick()
- gui.OpenURL( url )
- end
- function p:PerformLayout()
- but:SetPos( (p:GetWide()/2)-(but:GetWide()/2), (p:GetTall()/2)-(but:GetTall()/2)+35 )
- end
- return p
- end
- hook.Add("F4MenuTabs", "MOARTABSMOARPROBLEMS", function()
- DarkRP.addF4MenuTab("Actions", vgui.Create("F4MenuAction"))
- DarkRP.addF4MenuTab( "Entities", vgui.Create( "F4MenuEntities" ) )
- DarkRP.addF4MenuTab( "Forums", sendURL("https://republicgaming.net/") )
- DarkRP.addF4MenuTab( "Donate", sendURL("https://republicgaming.net/forums/forumdisplay.php?fid=12") )
- DarkRP.switchTabOrder("Actions", 1)
- DarkRP.switchTabOrder("Jobs", 2)
- DarkRP.switchTabOrder("Entities", 3)
- DarkRP.switchTabOrder("Forums", 4)
- end)
- local PANEL = {}
- function PANEL:Init()
- local help = vgui.Create( "DPanel", self )
- function help:Paint( w, h )
- draw.RoundedBox( 2, 0, 0, w, h, Color( 50, 50, 50 ) )
- draw.SimpleText( help.txt or "Please select an item from below", "F4Text", 30, 5, Color( 230, 230, 230 ) )
- draw.SimpleText( "Your money: "..DarkRP.formatMoney( LocalPlayer():getDarkRPVar("money")), "F4Text", 30, 30, Color( 50, 150, 100 ) )
- end
- self.help = help
- self.itemlist = vgui.Create( "DPanelList", self )
- self.itemlist:SetSpacing( 7 )
- self.itemlist:EnableVerticalScrollbar( true )
- end
- function PANEL:Setup()
- self.itemlist:Clear()
- local tab = {}
- for k,v in pairs( DarkRPEntities ) do
- tab[ #tab + 1 ] = v
- end
- for k,v in pairs( CustomShipments ) do
- tab[ #tab + 1 ] = v
- if ( v.seperate == false ) then
- tab[ #tab ].model = v.model
- tab[ #tab ].cmd = "buyshipment "..v.name
- else
- tab[ #tab ].cmd = "buy "..v.name
- end
- end
- for k,v in pairs( CustomVehicles ) do
- tab[ #tab + 1 ] = v
- end
- for k,v in pairs( GAMEMODE.AmmoTypes ) do
- tab[ #tab + 1 ] = v
- tab[ #tab ].cmd = "buyammo "..k
- end
- local cates = {}
- for k,v in pairs( tab ) do
- if ( v.allowed and !table.HasValue( v.allowed, LocalPlayer():Team() ) ) then continue end
- if ( !cates[ v.category ] ) then
- cates[ v.category ] = {}
- end
- table.insert( cates[ v.category ], v )
- end
- for name, data in pairs( cates ) do
- local cate = vgui.Create( "DCollapsibleCategory" )
- cate:SetLabel( name )
- function cate:Paint( w, h )
- draw.RoundedBox( 6, 0, 0, w, h, Color( 50, 50, 50 ) )
- end
- local catelist = vgui.Create( "DPanelList" )
- catelist:SetAutoSize( true )
- catelist:SetSpacing( 4 )
- catelist:EnableHorizontal( true )
- catelist:SetPadding( 4 )
- for k,v in pairs( data ) do
- local pnl = vgui.Create( "DPanel" )
- pnl:SetSize( 100, 74 )
- pnl:SetCursor( "hand" )
- pnl:SetToolTip( v.name.."\n"..DarkRP.formatMoney( v.pricesep or v.price ) )
- function pnl:OnMousePressed()
- RunConsoleCommand( "say", "/"..v.cmd )
- end
- local mdl = vgui.Create( "SpawnIcon", pnl )
- mdl:SetModel( v.model, 64 )
- mdl:SetSize( 64, 64 )
- mdl:SetMouseInputEnabled( false )
- mdl:SetPos( ( pnl:GetWide() / 2 ) - (mdl:GetWide()/2), 2 )
- pnl.OnCursorEntered = function()
- self.help.txt = v.name.." - "..DarkRP.formatMoney( v.pricesep or v.price )
- end
- pnl.OnCursorExited = function()
- self.help.txt = nil
- end
- mdl:SetMouseInputEnabled( false )
- function pnl:Paint() end
- function pnl:PaintOver( w, h )
- //surface.SetDrawColor( 0, 0, 0 )
- //surface.DrawLine( 0, 0, 0, h )
- //draw.RoundedBox( 2, 0, 0, w, h, Color( 150, 150, 150 ) )
- draw.SimpleText( v.name, "DermaDefault", w/2, h-10, Color( 235, 235, 235 ), 1, 1 )
- //draw.SimpleText( DarkRP.formatMoney( v.pricesep or v.price ), "F4Text", 70, 30, color_white )
- end
- catelist:AddItem( pnl )
- end
- cate:SetContents( catelist )
- self.itemlist:AddItem( cate )
- end
- end
- function PANEL:InvalidateLayout()
- self.help:SetSize( self:GetWide(), 60 )
- self.itemlist:SetPos( 0, 65 )
- self.itemlist:SetSize( self:GetWide(), self:GetTall() - 70 )
- self:Setup()
- end
- vgui.Register( "F4MenuEntities", PANEL )
- local function DrawRoundedBox( _r, _x, _y, _w, _h )
- _r = _r > 8 and 24 or 8
- local _u = ( _x + _r * 1 ) - _x
- local _v = ( _y + _r * 1 ) - _y
- local points = 64
- local slices = ( 2 * math.pi ) / points
- local poly = { }
- X, Y = _w-_r, _h-_r
- for i = 0, points-1 do
- local angle = ( slices * i ) % points
- local x = X + _r * math.cos( angle )
- local y = Y + _r * math.sin( angle )
- if i == points/4-1 then
- X, Y = _x+_r, _h-_r
- table.insert( poly, { x = X, y = Y, u = _u, v = _v } )
- elseif i == points/2-1 then
- X, Y = _x, _r
- table.insert( poly, { x = X, y = Y, u = _u, v = _v } )
- X = _x+_r
- elseif i == 3*points/4-1 then
- X, Y = _w-_r, 0
- table.insert( poly, { x = X, y = Y, u = _u, v = _v } )
- Y = _r
- end
- table.insert( poly, { x = x, y = y, u = _u, v = _v } )
- end
- return poly
- end
- local poly = DrawRoundedBox( 16, 0, 0, 44, 44 )
- local _material = Material( "effects/flashlight001" );
- local PANEL = {}
- function PANEL:Init()
- self.Avatar = vgui.Create("AvatarImage", self)
- self.Avatar:SetPaintedManually(true)
- end
- function PANEL:PerformLayout()
- self.Avatar:SetSize(self:GetWide(), self:GetTall())
- end
- function PANEL:Paint(w, h)
- render.ClearStencil()
- render.SetStencilEnable(true)
- render.SetStencilWriteMask( 1 )
- render.SetStencilTestMask( 1 )
- render.SetStencilFailOperation( STENCILOPERATION_REPLACE )
- render.SetStencilPassOperation( STENCILOPERATION_ZERO )
- render.SetStencilZFailOperation( STENCILOPERATION_ZERO )
- render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_NEVER )
- render.SetStencilReferenceValue( 1 )
- draw.NoTexture( );
- surface.SetMaterial( _material );
- surface.SetDrawColor( color_black )
- surface.DrawPoly( poly )
- render.SetStencilFailOperation( STENCILOPERATION_ZERO )
- render.SetStencilPassOperation( STENCILOPERATION_REPLACE )
- render.SetStencilZFailOperation( STENCILOPERATION_ZERO )
- render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL )
- render.SetStencilReferenceValue( 1 )
- self.Avatar:SetPaintedManually(false)
- self.Avatar:PaintManual()
- self.Avatar:SetPaintedManually(true)
- render.SetStencilEnable(false)
- render.ClearStencil()
- end
- vgui.Register("AvatarMask", PANEL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement