File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
workshop/gamemodes/cinema_modded/gamemode/modules/scoreboard/controls Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,19 @@ function SEEKBOX:Init()
4646
4747 RunConsoleCommand ( " cinema_seek" , seekTime )
4848 end
49-
49+
50+ -- Handling mouse clicks on the slider because some silly people not knows you need to hold the knob like me
51+ self .SeekBar .OnMousePressed = function (panel , mousecode )
52+ local x , y = panel :CursorPos ()
53+ local newSlideX = x / panel :GetWide ()
54+ panel :SetSlideX (newSlideX )
55+
56+ local seekTime = ceil (newSlideX * self .Media .duration )
57+ self .TimeLbl :SetText (FormatSeconds (seekTime ))
58+
59+ RunConsoleCommand (" cinema_seek" , seekTime )
60+ end
61+
5062 for _ , child in pairs ( self .SeekBar :GetChildren () ) do
5163 if child ~= self .SeekBar .Knob then
5264 child :Remove ()
@@ -192,4 +204,4 @@ function SEEKBUTTONS:Paint( w, h )
192204
193205end
194206
195- derma .DefineControl ( " TheaterSeekButtons" , " " , SEEKBUTTONS , " Panel" )
207+ derma .DefineControl ( " TheaterSeekButtons" , " " , SEEKBUTTONS , " Panel" )
You can’t perform that action at this time.
0 commit comments