//=============================================================================//
// ___ ___ _ _ _ __ _ ___ ___ __ __
// |_ _|| __| / \ | \_/ | / _| / \ | o \ o \\ V /
// | | | _| | o || \_/ | ( |_n| o || / / \ /
// |_| |___||_n_||_| |_| \__/|_n_||_|\\_|\\ |_| 2007
//
//=============================================================================//
local PANEL = {}
g_SelectedMap = nil
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:Init()
self.
Label:SetTextColor
( Color( 255,
255,
255,
250 ) )
self.Icon:SetKeepAspect( true )
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:SetMap( MapTable )
self.Icon:SetOnViewMaterial
( MapTable.
Material )
self.Icon:SetFailsafeMatName( "maps/noicon.vmt" )
self.MapName
= MapTable.
Name
self:PerformLayout()
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:PerformLayout()
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:ApplySchemeSettings()
// self.Label:SetFont( "DefaultSmallDropShadow" )
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:Paint()
if ( g_SelectedMap == self ) then
else
end
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:PaintOver()
if ( g_SelectedMap == self ) then
else
end
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:OnMousePressed( mcode )
// Loop back if no VBar
if ( mcode != MOUSE_LEFT ) then
self:OpenMenu()
return
end
self:GetController():SetMap( self.MapName )
if ( g_SelectedMap
== self
&& self.LastPress
&& self.LastPress
> SysTime() -
0.3 ) then
self:GetController():LaunchGame()
end
self:GetController():SetMap( self.MapName )
g_SelectedMap = self
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:OpenMenu()
menu:AddOption
( "Copy to Clipboard",
function() SetClipboardText( self.MapName
) end )
if ( self.m_bFavourite ) then
menu:AddOption
( "Remove From Favourites",
function() map_favourites.
Remove( self.MapName
) end )
else
menu:AddOption
( "Add To Favourites",
function() map_favourites.
Add( self.MapName
) end )
end
menu:Open()
end