Move subfolders of the content folder to the root addon folder
BIN
design/Icons/back.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/close.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/delete.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/fav_star.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
design/Icons/fav_star_outline.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
design/Icons/forward.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/home.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
design/Icons/pause.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/play.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
design/Icons/plus.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
design/Icons/refresh.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
design/Icons/skip.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
design/Icons/thumbs_down.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
design/Icons/thumbs_up.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
design/Icons/volume.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
design/Services/reddit.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
design/Services/shoutcast.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
design/Services/soundcloud.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
design/Services/twitch.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
design/Services/vimeo.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
design/Services/youtube.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
design/media-queue.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -14,6 +14,14 @@ local LastPress = nil
|
||||
local LastKey = nil
|
||||
local KeyControls = {}
|
||||
|
||||
local function getEventArgs( a, b, c )
|
||||
if c == nil then
|
||||
return a, b
|
||||
else
|
||||
return b, c
|
||||
end
|
||||
end
|
||||
|
||||
local function InputThink()
|
||||
|
||||
if IsGameUIVisible() or IsConsoleVisible() then return end
|
||||
@ -99,6 +107,36 @@ function control.Add( key, name, onToggle )
|
||||
|
||||
end
|
||||
|
||||
function control.AddKeyPress( key, name, onToggle )
|
||||
|
||||
control.Add( key, name, function( a, b, c )
|
||||
local down, held = getEventArgs(a, b, c)
|
||||
|
||||
-- ignore if key down, but held OR key is not down
|
||||
if down then
|
||||
if held then return end
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
onToggle( a, b, c )
|
||||
end )
|
||||
|
||||
end
|
||||
|
||||
function control.AddKeyRelease( key, name, onToggle )
|
||||
|
||||
control.Add( key, name, function( a, b, c )
|
||||
local down, held = getEventArgs(a, b, c)
|
||||
|
||||
-- ignore if key is down
|
||||
if down then return end
|
||||
|
||||
onToggle( a, b, c )
|
||||
end )
|
||||
|
||||
end
|
||||
|
||||
---
|
||||
-- Removes a registered key callback.
|
||||
--
|
||||
|
@ -13,6 +13,9 @@ include "controls/dmediaplayerrequest.lua"
|
||||
include "shared.lua"
|
||||
include "cl_idlescreen.lua"
|
||||
|
||||
-- menu
|
||||
include "menu/sidebar.lua"
|
||||
|
||||
function MediaPlayer.Volume( volume )
|
||||
|
||||
if volume then
|
||||
|
@ -19,6 +19,10 @@ AddCSLuaFile "sh_mediaplayer.lua"
|
||||
AddCSLuaFile "sh_services.lua"
|
||||
AddCSLuaFile "sh_history.lua"
|
||||
|
||||
-- menu
|
||||
AddCSLuaFile "menu/sidebar.lua"
|
||||
AddCSLuaFile "menu/volume_control.lua"
|
||||
|
||||
include "shared.lua"
|
||||
include "sv_metadata.lua"
|
||||
|
||||
|
@ -7,11 +7,11 @@ function PANEL:Init()
|
||||
self:SetPaintBackgroundEnabled( true )
|
||||
self:SetPaintBorderEnabled( false )
|
||||
|
||||
self:SetKeyboardInputEnabled( false )
|
||||
self:SetMouseInputEnabled( true )
|
||||
self:SetSize( 385, 580 )
|
||||
|
||||
self.VolumeControls = vgui.Create( "MP.VolumeControl", self )
|
||||
self.VolumeControls:Dock( BOTTOM )
|
||||
self.VolumeControls:SetHeight( 48 )
|
||||
|
||||
end
|
||||
|
||||
@ -44,7 +44,11 @@ function MediaPlayer.ShowSidebar()
|
||||
sidebar = vgui.CreateFromTable( MP_SIDEBAR )
|
||||
end
|
||||
|
||||
sidebar:Show()
|
||||
sidebar:MakePopup()
|
||||
sidebar:ParentToHUD()
|
||||
|
||||
sidebar:SetKeyboardInputEnabled( false )
|
||||
sidebar:SetMouseInputEnabled( true )
|
||||
|
||||
MediaPlayer._Sidebar = sidebar
|
||||
|
||||
|
@ -4,6 +4,7 @@ local color_white = color_white
|
||||
local PANEL = {}
|
||||
|
||||
PANEL.Margin = 12
|
||||
PANEL.BackgroundColor = Color( 28, 100, 157 )
|
||||
|
||||
function PANEL:Init()
|
||||
|
||||
@ -18,7 +19,7 @@ function PANEL:Init()
|
||||
-- self.VolumeSlider:DockMargin( lrMargin, 0, lrMargin, 0 )
|
||||
|
||||
self.VolumeLabel = vgui.Create( "DLabel", self )
|
||||
self.VolumeLabel:SetContentAlignment( 5 ) -- center
|
||||
self.VolumeLabel:SetContentAlignment( 6 ) -- center right
|
||||
|
||||
self.Volume = -1
|
||||
|
||||
@ -26,7 +27,7 @@ end
|
||||
|
||||
function PANEL:Think()
|
||||
|
||||
local volume = MediaPlayer.Volume()
|
||||
local volume = math.Round( MediaPlayer.Volume() * 100 )
|
||||
|
||||
if self.Volume ~= volume then
|
||||
-- self.VolumeSlider:SetValue( volume )
|
||||
@ -37,18 +38,21 @@ function PANEL:Think()
|
||||
|
||||
end
|
||||
|
||||
function PANEL:Paint(w, h)
|
||||
function PANEL:Paint( w, h )
|
||||
|
||||
surface.SetDrawColor( self.BackgroundColor )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
end
|
||||
|
||||
function PANEL:PerformLayout()
|
||||
|
||||
-- self.VolumeButton:CenterVertical()
|
||||
-- self.VolumeButton:AlignLeft( self.Margin )
|
||||
self.VolumeButton:CenterVertical()
|
||||
self.VolumeButton:AlignLeft( self.Margin )
|
||||
|
||||
-- self.VolumeLabel:SizeToContents()
|
||||
-- self.VolumeLabel:CenterVertical()
|
||||
-- self.VolumeLabel:AlignLeft( self.Margin )
|
||||
self.VolumeLabel:SizeToContents()
|
||||
self.VolumeLabel:CenterVertical()
|
||||
self.VolumeLabel:AlignRight( self.Margin )
|
||||
|
||||
end
|
||||
|
||||
@ -57,29 +61,24 @@ derma.DefineControl( "MP.VolumeControl", "", PANEL, "DPanel" )
|
||||
|
||||
local VOLUME_BUTTON = {}
|
||||
|
||||
local VolumeIconMat = Material( "mediaplayer/ui/volume.png" )
|
||||
|
||||
function VOLUME_BUTTON:Init()
|
||||
|
||||
self.BaseClass.Init( self )
|
||||
|
||||
end
|
||||
self:SetSize( 18, 17 )
|
||||
|
||||
function VOLUME_BUTTON:Paint(w, h)
|
||||
|
||||
surface.SetDrawColor( color_white )
|
||||
surface.SetMaterial( VolumeIconMat )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
self:SetImage( "mediaplayer/ui/volume.png" )
|
||||
|
||||
end
|
||||
|
||||
function VOLUME_BUTTON:DoClick()
|
||||
|
||||
-- TODO: Toggle mute
|
||||
print "CLICKED VOLUME BUTTON"
|
||||
|
||||
end
|
||||
|
||||
derma.DefineControl( "MP.VolumeButton", "", VOLUME_BUTTON, "DLabel" )
|
||||
derma.DefineControl( "MP.VolumeButton", "", VOLUME_BUTTON, "DImageButton" )
|
||||
|
||||
|
||||
local VOLUME_SLIDER = {}
|
||||
@ -90,7 +89,7 @@ function VOLUME_SLIDER:Init()
|
||||
|
||||
end
|
||||
|
||||
function VOLUME_SLIDER:Paint(w, h)
|
||||
function VOLUME_SLIDER:Paint( w, h )
|
||||
|
||||
-- TODO
|
||||
|
||||
|
BIN
materials/mediaplayer/ui/back.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/close.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/delete.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/fav_star.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
materials/mediaplayer/ui/fav_star_outline.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
materials/mediaplayer/ui/forward.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/home.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
materials/mediaplayer/ui/pause.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/play.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
materials/mediaplayer/ui/plus.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
materials/mediaplayer/ui/refresh.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
materials/mediaplayer/ui/skip.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
materials/mediaplayer/ui/thumbs_down.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
materials/mediaplayer/ui/thumbs_up.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
materials/mediaplayer/ui/volume.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
materials/mediaplayer/ui/volume_mute.png
Normal file
After Width: | Height: | Size: 2.8 KiB |