From 03c5edcdba7eab3ccd110ceeb673712c0340142f Mon Sep 17 00:00:00 2001 From: AlmTech Date: Sat, 2 Nov 2019 23:15:29 +0100 Subject: [PATCH] Added sound file & cinematic intro stuff --- gamemode/engine/core/client/cl_sounds.lua | 13 +++++++++++ .../engine/derma/lib/cl_menu_dialogueBox.lua | 20 ++++++++++------ gamemode/engine/derma/menus/menu_intro.lua | 23 +++++++++++++++++-- 3 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 gamemode/engine/core/client/cl_sounds.lua diff --git a/gamemode/engine/core/client/cl_sounds.lua b/gamemode/engine/core/client/cl_sounds.lua new file mode 100644 index 0000000..702704b --- /dev/null +++ b/gamemode/engine/core/client/cl_sounds.lua @@ -0,0 +1,13 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +sound.Add( { + name = "Quantum_Music_TriangeAtDawn", + channel = CHAN_STATIC, + volume = 0.75, + sound = "music/HL2_song23_SuitSong3.mp3" +} ) \ No newline at end of file diff --git a/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua b/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua index ac62a44..423e783 100644 --- a/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua +++ b/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua @@ -31,12 +31,14 @@ function log.createinfobox( logdata, parent ) header.w, header.h = header:GetSize() header:SetPos( box.x, ( box.y - header.h ) - padding/2 ) header.Think = function( self ) - if( logdata[Quantum.Client.Cam.Temp.scene_index].title ~= nil ) then - self:SetVisible( true ) - self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].title ) - surface.SetFont( self:GetFont() ) - local tw, th = surface.GetTextSize( self:GetText() ) - self:SetSize( tw * 1.1, th * 1.1 ) + if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then + if( logdata[Quantum.Client.Cam.Temp.scene_index].title ~= nil ) then + self:SetVisible( true ) + self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].title ) + surface.SetFont( self:GetFont() ) + local tw, th = surface.GetTextSize( self:GetText() ) + self:SetSize( tw * 1.1, th * 1.1 ) + end end end header.Paint = function( self ) @@ -67,7 +69,11 @@ function log.createinfobox( logdata, parent ) text:SetPos( scroll.w/2 - text.w/2, 0 ) - text.Think = function( self ) self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].text ) end + text.Think = function( self ) + if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then + self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].text ) + end + end return box end diff --git a/gamemode/engine/derma/menus/menu_intro.lua b/gamemode/engine/derma/menus/menu_intro.lua index e36cf2c..b110eed 100644 --- a/gamemode/engine/derma/menus/menu_intro.lua +++ b/gamemode/engine/derma/menus/menu_intro.lua @@ -43,10 +43,27 @@ local scenes = { -- 5031.821777 3866.334961 120.090790;setang 0.898059 56.421352 pos2 = Vector( 10881.356445, 5483.074219, 132.792114 ), ang1 = Angle( 0.052806, 85.319626, 0.000000 ), ang2 = Angle( -0.105593, 90.978638, 0.000000 ) + }, + [5] = { + fov = 60, + velocity = 12, + pos1 = Vector( 3114.608887, -13817.962891, 82.778885 ), + pos2 = Vector( 5247.718262, -14413.496094, 74.946350 ), + ang1 = Angle( 0.844603, -15.770578, 0.000000 ), + ang2 = Angle( 2.006202, 37.927032, 0.000000 ) + }, + [6] = { + fov = 60, + velocity = 12, + pos1 = Vector( 6830.229004, 9614.283203, 105.920792 ), + pos2 = Vector( 6675.346191, 9711.740234, 102.549484 ), + ang1 = Angle( 1.055771, 147.803604, 0.000000 ), + ang2 = Angle( 1.055771, 149.803604, 0.000000 ) } } } + function intro.open( dt ) local chars = dt.cont local resScale = Quantum.Client.ResolutionScale @@ -76,8 +93,10 @@ function intro.open( dt ) end f.w, f.h = f:GetSize() - --- MUSIC --- - surface.PlaySound( "music/HL1_song10.mp3" ) -- get some better music + --- MUSIC --- + --surface.PlaySound( "music/HL1_song11.mp3" ) -- too short + --surface.PlaySound( "music/HL2_song23_SuitSong3.mp3" ) + --LocalPlayer():EmitSound("Quantum_Music_TriangeAtDawn") local skip = vgui.Create( "DButton", f ) skip:SetText( "Skip Intro" )