//=============================================================================//
// ___ ___ _ _ _ __ _ ___ ___ __ __
// |_ _|| __| / \ | \_/ | / _| / \ | o \ o \\ V /
// | | | _| | o || \_/ | ( |_n| o || / / \ /
// |_| |___||_n_||_| |_| \__/|_n_||_|\\_|\\ |_| 2007
//
//=============================================================================//
local PANEL = {}
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:Init()
self.List:AddColumn( "Map Name" )
self.List:AddColumn( "Category" )
self.List:SetDataHeight( 17 )
self.List.OnRowSelected = function( list, itemid, line ) self:DoClick( itemid, line ) end
self.List.DoDoubleClick = function( list, itemid, line ) self:DoDoubleClick( itemid, line ) end
self.List:SetMultiSelect( false )
self:BuildMaps()
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:BuildMaps()
for k, v
in pairs( g_MapList
) do
local item
= self.List:AddLine
( v.
Name, v.Category
)
end
self.List:SortByColumn( 1, true )
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:PerformLayout()
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:DoClick( itemid, line )
self:GetController():SetMap( line.MapName )
end
/*---------------------------------------------------------
---------------------------------------------------------*/
function PANEL:DoDoubleClick( itemid )
// No need to set the map, it should be set
// by the first click..
self:GetController():LaunchGame()
end