Finished intro cinematic & added main menu

master
AlmTech Software 5 years ago
parent e08205fb05
commit 546a1beaf8
  1. 78
      gamemode/cl_init.lua
  2. 64
      gamemode/engine/core/client/cl_fonts.lua
  3. 8
      gamemode/engine/core/client/cl_sounds.lua
  4. 58
      gamemode/engine/core/server/sv_player_damage.lua
  5. 42
      gamemode/engine/core/server/sv_player_init.lua
  6. 52
      gamemode/engine/core/server/sv_player_spawning.lua
  7. 2
      gamemode/engine/core/server/sv_player_voice.lua
  8. 29
      gamemode/engine/core/sh_player_binds.lua
  9. 36
      gamemode/engine/derma/cl_menu.lua
  10. 110
      gamemode/engine/derma/lib/cl_menu_dialogueBox.lua
  11. 78
      gamemode/engine/derma/lib/cl_menu_pages.lua
  12. 115
      gamemode/engine/derma/lib/cl_menu_theme.lua
  13. 8
      gamemode/engine/derma/lib/cl_network.lua
  14. 826
      gamemode/engine/derma/menus/menu_character.lua
  15. 250
      gamemode/engine/derma/menus/menu_intro.lua
  16. 77
      gamemode/engine/derma/menus/menu_main.lua
  17. 85
      gamemode/engine/lib/client/cl_cinematic.lua
  18. 140
      gamemode/engine/lib/server/sv_character.lua
  19. 40
      gamemode/engine/lib/server/sv_inventory.lua
  20. 2
      gamemode/engine/lib/server/sv_networking.lua
  21. 16
      gamemode/engine/lib/server/sv_openmenu.lua
  22. 22
      gamemode/engine/lib/sh_items.lua
  23. 20
      gamemode/engine/sh_debug.lua
  24. 190
      gamemode/init.lua
  25. 86
      gamemode/settings/sh_settings.lua
  26. 60
      gamemode/settings/sv_settings.lua

@ -6,56 +6,56 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
if CLIENT then if CLIENT then
include( "shared.lua" ) include( "shared.lua" )
--local gmfolder = GAMEMODE.FolderName || GM.FolderName --local gmfolder = GAMEMODE.FolderName || GM.FolderName
Quantum.Client = {} Quantum.Client = {}
Quantum.Client.Cache = {} Quantum.Client.Cache = {}
Quantum.Client.ResolutionScale = ScrH() / 1080 Quantum.Client.ResolutionScale = ScrH() / 1080
Quantum.Client.ServerBannerPath = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png" Quantum.Client.ServerBannerPath = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png"
local function loadCoreFiles() local function loadCoreFiles()
local fol = GM.FolderName .. "/gamemode/engine/core/" local fol = GM.FolderName .. "/gamemode/engine/core/"
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do for _, file in pairs( shFiles ) do
include( fol .. file ) include( fol .. file )
end end
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do for _, file in pairs( clFiles ) do
include( fol .. "client/" .. file ) include( fol .. "client/" .. file )
end end
end end
local function loadLibFiles() local function loadLibFiles()
local fol = GM.FolderName .. "/gamemode/engine/lib/" local fol = GM.FolderName .. "/gamemode/engine/lib/"
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do for _, file in pairs( shFiles ) do
AddCSLuaFile( fol .. file ) AddCSLuaFile( fol .. file )
include( fol .. file ) include( fol .. file )
end end
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do for _, file in pairs( clFiles ) do
include( fol .. "client/" .. file ) include( fol .. "client/" .. file )
end end
end end
local function loadAllDermaMenus() local function loadAllDermaMenus()
local fol = GM.FolderName .. "/gamemode/engine/derma/" local fol = GM.FolderName .. "/gamemode/engine/derma/"
include( fol .. "cl_menu.lua" ) include( fol .. "cl_menu.lua" )
end end
function Quantum.Client.Load() function Quantum.Client.Load()
local fol = GM.FolderName .. "/gamemode/engine/core/" local fol = GM.FolderName .. "/gamemode/engine/core/"
loadCoreFiles() loadCoreFiles()
loadLibFiles() loadLibFiles()
loadAllDermaMenus() loadAllDermaMenus()
Quantum.Debug( "Loaded all files." ) Quantum.Debug( "Loaded all files." )
end end
Quantum.Client.Load() Quantum.Client.Load()
end end

@ -6,63 +6,63 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
surface.CreateFont( "q_HUD", { surface.CreateFont( "q_HUD", {
font = "Arial", font = "Arial",
size = 30 * Quantum.Client.ResolutionScale, size = 30 * Quantum.Client.ResolutionScale,
antialias = true, antialias = true,
outline = true outline = true
}) })
surface.CreateFont( "q_text", { surface.CreateFont( "q_text", {
font = "Arial", font = "Arial",
size = 22 * Quantum.Client.ResolutionScale, size = 22 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_text2", { surface.CreateFont( "q_text2", {
font = "Arial", font = "Arial",
size = 26 * Quantum.Client.ResolutionScale, size = 26 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_button", { surface.CreateFont( "q_button", {
font = "Arial", font = "Arial",
size = 27 * Quantum.Client.ResolutionScale, size = 27 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_button_m", { surface.CreateFont( "q_button_m", {
font = "Arial", font = "Arial",
size = 30 * Quantum.Client.ResolutionScale, size = 30 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_button2", { surface.CreateFont( "q_button2", {
font = "Arial", font = "Arial",
size = 35 * Quantum.Client.ResolutionScale, size = 35 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_charNameText", { surface.CreateFont( "q_charNameText", {
font = "Arial", font = "Arial",
outline = true, outline = true,
size = 28 * Quantum.Client.ResolutionScale, size = 28 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_info", { surface.CreateFont( "q_info", {
font = "Arial", font = "Arial",
size = 30 * Quantum.Client.ResolutionScale, size = 30 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_header", { surface.CreateFont( "q_header", {
font = "Constantia Bold Italic", font = "Constantia Bold Italic",
size = 50 * Quantum.Client.ResolutionScale, size = 50 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_header_s", { surface.CreateFont( "q_header_s", {
font = "Constantia Bold Italic", font = "Constantia Bold Italic",
size = 42 * Quantum.Client.ResolutionScale, size = 42 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })

@ -6,8 +6,8 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
sound.Add( { sound.Add( {
name = "Quantum_Music_TriangeAtDawn", name = "Quantum_Music_TriangeAtDawn",
channel = CHAN_STATIC, channel = CHAN_STATIC,
volume = 0.75, volume = 0.75,
sound = "music/HL2_song23_SuitSong3.mp3" sound = "music/HL2_song23_SuitSong3.mp3"
} ) } )

@ -6,52 +6,52 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
local damagescales = { local damagescales = {
[HITGROUP_HEAD] = Quantum.Server.Settings.DamageScale[HITGROUP_HEAD], [HITGROUP_HEAD] = Quantum.Server.Settings.DamageScale[HITGROUP_HEAD],
[HITGROUP_CHEST] = Quantum.Server.Settings.DamageScale[HITGROUP_CHEST], [HITGROUP_CHEST] = Quantum.Server.Settings.DamageScale[HITGROUP_CHEST],
[HITGROUP_STOMACH] = Quantum.Server.Settings.DamageScale[HITGROUP_STOMACH], [HITGROUP_STOMACH] = Quantum.Server.Settings.DamageScale[HITGROUP_STOMACH],
[HITGROUP_LEFTARM] = Quantum.Server.Settings.DamageScale[HITGROUP_LEFTARM], [HITGROUP_LEFTARM] = Quantum.Server.Settings.DamageScale[HITGROUP_LEFTARM],
[HITGROUP_RIGHTARM] = Quantum.Server.Settings.DamageScale[HITGROUP_RIGHTARM], [HITGROUP_RIGHTARM] = Quantum.Server.Settings.DamageScale[HITGROUP_RIGHTARM],
[HITGROUP_LEFTLEG] = Quantum.Server.Settings.DamageScale[HITGROUP_LEFTLEG], [HITGROUP_LEFTLEG] = Quantum.Server.Settings.DamageScale[HITGROUP_LEFTLEG],
[HITGROUP_RIGHTLEG] = Quantum.Server.Settings.DamageScale[HITGROUP_RIGHTLEG] [HITGROUP_RIGHTLEG] = Quantum.Server.Settings.DamageScale[HITGROUP_RIGHTLEG]
} }
function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc
if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end
Quantum.Debug( tostring(pl) .. " got damaged ( " .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" ) Quantum.Debug( tostring(pl) .. " got damaged ( " .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" )
end end
function GM:GetFallDamage( pl, vel ) function GM:GetFallDamage( pl, vel )
Quantum.Debug( tostring(pl) .. " got damaged ( Fall Damage : " .. tostring( math.Round( vel / 8 ) ) .. " )" ) Quantum.Debug( tostring(pl) .. " got damaged ( Fall Damage : " .. tostring( math.Round( vel / 8 ) ) .. " )" )
return vel / 8 -- Makes the player take more "realistic" fall damage return vel / 8 -- Makes the player take more "realistic" fall damage
end end
function GM:PlayerDeathSound() return true end function GM:PlayerDeathSound() return true end
hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, dmginfo ) hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, dmginfo )
if( pl:IsPlayer() && dmginfo:GetDamage() >= 25 ) then if( pl:IsPlayer() && dmginfo:GetDamage() >= 25 ) then
local soundlist = { local soundlist = {
pain = Quantum.Server.Settings.PainSounds.Male, -- replace later with correct gender for the playermodel/character pain = Quantum.Server.Settings.PainSounds.Male, -- replace later with correct gender for the playermodel/character
idlepain = Quantum.Server.Settings.IdlePainSounds.Male -- same for this one idlepain = Quantum.Server.Settings.IdlePainSounds.Male -- same for this one
} }
pl:EmitSound( Quantum.Server.Settings.PainSounds.Male[ math.random( 1, #Quantum.Server.Settings.PainSounds.Male ) ] ) pl:EmitSound( Quantum.Server.Settings.PainSounds.Male[ math.random( 1, #Quantum.Server.Settings.PainSounds.Male ) ] )
if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end -- if it already exists remove it if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end -- if it already exists remove it
timer.Create( "Quantum_PlayerHurtSounds_" .. tostring( pl ), 4, 0, function() timer.Create( "Quantum_PlayerHurtSounds_" .. tostring( pl ), 4, 0, function()
local rannum = math.random( 0, 100 ) local rannum = math.random( 0, 100 )
if( rannum >= Quantum.Server.Settings.DamageHurtSoundRepeatChance ) then -- Make the player "moan" for a while when hurt if( rannum >= Quantum.Server.Settings.DamageHurtSoundRepeatChance ) then -- Make the player "moan" for a while when hurt
pl:EmitSound( Quantum.Server.Settings.IdlePainSounds.Male[ math.random( 1, #Quantum.Server.Settings.IdlePainSounds.Male ) ] ) pl:EmitSound( Quantum.Server.Settings.IdlePainSounds.Male[ math.random( 1, #Quantum.Server.Settings.IdlePainSounds.Male ) ] )
end end
end) end)
timer.Simple( 60, function() timer.Simple( 60, function()
timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) -- remove the timer for the player timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) -- remove the timer for the player
end) end)
end end
end) end)
hook.Add( "PlayerDeath", "Quantum_PlayerDamage_RemoveIdleSounds", function( pl ) hook.Add( "PlayerDeath", "Quantum_PlayerDamage_RemoveIdleSounds", function( pl )
if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end
end) end)

@ -10,33 +10,33 @@ Quantum.Server.Player = {}
local ply = FindMetaTable( "Player" ) local ply = FindMetaTable( "Player" )
function GM:PlayerInitialSpawn( ply ) function GM:PlayerInitialSpawn( ply )
ply.isloaded = false -- REMOVE THIS WHEN MYSQL DB IS ADDED ply.isloaded = false -- REMOVE THIS WHEN MYSQL DB IS ADDED
ply.cache = {} ply.cache = {}
-- load in all of the players characters and stuff from the MySQL DB -- load in all of the players characters and stuff from the MySQL DB
end end
local function setUpPlayer( ply ) local function setUpPlayer( ply )
if( ply:GetModel() ~= nil ) then if( ply:GetModel() ~= nil ) then
ply:SetupHands() ply:SetupHands()
else else
Quantum.Error( tostring(ply) .. " doesn't have a valid model. Unable to set up hands!" ) Quantum.Error( tostring(ply) .. " doesn't have a valid model. Unable to set up hands!" )
end end
local char = Quantum.Server.Char.GetCurrentCharacter( ply ) local char = Quantum.Server.Char.GetCurrentCharacter( ply )
local charnametxt = " spawned." local charnametxt = " spawned."
if( char ~= nil ) then if( char ~= nil ) then
charnametxt = " spawned as '" .. char.name .. "'." charnametxt = " spawned as '" .. char.name .. "'."
end end
Quantum.Debug( tostring( ply ) .. charnametxt ) Quantum.Debug( tostring( ply ) .. charnametxt )
end end
function GM:PlayerSpawn( ply ) function GM:PlayerSpawn( ply )
if( ply.isloaded ) then -- replace logic ( reversed ) if( ply.isloaded ) then -- replace logic ( reversed )
ply:Spectate( OBS_MODE_FIXED ) ply:Spectate( OBS_MODE_FIXED )
Quantum.Net.OpenMenu( ply, "character", Quantum.Server.Char.GetPlayerChars( ply ) ) Quantum.Net.OpenMenu( ply, "character", Quantum.Server.Char.GetPlayerChars( ply ) )
else else
ply:UnSpectate() ply:UnSpectate()
setUpPlayer( ply ) setUpPlayer( ply )
end end
end end

@ -6,39 +6,39 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
hook.Add( "PlayerDeath", "Quantum_Player_SaveDeathPos", function( pl ) hook.Add( "PlayerDeath", "Quantum_Player_SaveDeathPos", function( pl )
pl.deathpos = pl:GetPos() pl.deathpos = pl:GetPos()
end) end)
local function getNearestSpawn( pl ) local function getNearestSpawn( pl )
local spawnposdist = {} local spawnposdist = {}
for id, spawnpoint in pairs( Quantum.Server.Settings.SpawnLocations[ game.GetMap() ] ) do for id, spawnpoint in pairs( Quantum.Server.Settings.SpawnLocations[ game.GetMap() ] ) do
spawnposdist[id] = { dist = spawnpoint.pos:Distance( pl.deathpos ), spawnpos = spawnpoint.pos, angle = spawnpoint.ang } spawnposdist[id] = { dist = spawnpoint.pos:Distance( pl.deathpos ), spawnpos = spawnpoint.pos, angle = spawnpoint.ang }
end end
local maxdist, spawnpos, spawnangle local maxdist, spawnpos, spawnangle
for id, spawn in pairs( spawnposdist ) do -- Loop through everything and pick the nearest spawnpoint for id, spawn in pairs( spawnposdist ) do -- Loop through everything and pick the nearest spawnpoint
if( maxdist ~= nil ) then if( maxdist ~= nil ) then
if( maxdist >= spawn.dist ) then if( maxdist >= spawn.dist ) then
maxdist = spawn.dist maxdist = spawn.dist
spawnpos = spawn.spawnpos spawnpos = spawn.spawnpos
spawnangle = spawn.angle spawnangle = spawn.angle
end end
else else
maxdist = spawn.dist maxdist = spawn.dist
spawnpos = spawn.spawnpos spawnpos = spawn.spawnpos
spawnangle = spawn.angle spawnangle = spawn.angle
end end
end end
return spawnpos, spawnangle return spawnpos, spawnangle
end end
hook.Add( "PlayerSpawn", "Quantum_Player_Respawn", function( pl ) hook.Add( "PlayerSpawn", "Quantum_Player_Respawn", function( pl )
if( pl.isloaded && pl.deathpos ) then if( pl.isloaded && pl.deathpos ) then
local spawnpos, spawnangle = getNearestSpawn( pl ) local spawnpos, spawnangle = getNearestSpawn( pl )
Quantum.Debug( "Respawning player at nearest spawnpoint." ) Quantum.Debug( "Respawning player at nearest spawnpoint." )
pl:SetPos( spawnpos ) pl:SetPos( spawnpos )
pl:SetAngles( spawnangle ) pl:SetAngles( spawnangle )
end end
end) end)

@ -6,5 +6,5 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
function GM:PlayerCanHearPlayersVoice( lis, talk ) function GM:PlayerCanHearPlayersVoice( lis, talk )
if( lis:GetPos():Distance( talk:GetPos() ) > Quantum.Server.Settings.VoiceChatRange ) then return false, true end if( lis:GetPos():Distance( talk:GetPos() ) > Quantum.Server.Settings.VoiceChatRange ) then return false, true end
end end

@ -8,22 +8,19 @@
if SERVER then if SERVER then
local keyfuncs = { local keyfuncs = {
[IN_USE] = function( pl ) ["openCharMenu"] = function( pl )
Quantum.Debug( tostring( pl ) .. " pressed IN_USE" ) Quantum.Net.OpenMenu( pl, "character", Quantum.Server.Char.GetPlayerChars_cl( pl ) )
end, end,
["openCharMenu"] = function( pl ) ["mainMenu"] = function( pl )
Quantum.Net.OpenMenu( pl, "character", Quantum.Server.Char.GetPlayerChars_cl( pl ) ) Quantum.Net.OpenMenu( pl, "main", Quantum.Server.Char.GetPlayerChars_cl( pl ) )
end, end
["introTest"] = function( pl ) }
Quantum.Net.OpenMenu( pl, "intro", Quantum.Server.Char.GetPlayerChars_cl( pl ) )
end
}
function GM:KeyRelease( ply, key ) function GM:KeyRelease( ply, key )
if( keyfuncs[key] ) then keyfuncs[key]( ply ) end if( keyfuncs[key] ) then keyfuncs[key]( ply ) end
end end
function GM:ShowHelp( ply ) keyfuncs["openCharMenu"]( ply ) end function GM:ShowHelp( ply ) keyfuncs["openCharMenu"]( ply ) end
function GM:ShowTeam( ply ) keyfuncs["introTest"]( ply ) end function GM:ShowTeam( ply ) keyfuncs["mainMenu"]( ply ) end
end end

@ -7,28 +7,28 @@
Quantum.Client.Menu = {} Quantum.Client.Menu = {}
local libs = { local libs = {
["net"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_network.lua", ["net"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_network.lua",
["page"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_pages.lua", ["page"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_pages.lua",
["theme"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_theme.lua", ["theme"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_theme.lua",
["dialogue"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua" ["dialogue"] = GM.FolderName .. "/gamemode/engine/derma/lib/cl_menu_dialogueBox.lua"
} }
Quantum.Client.Menu.GetAPI = function( lib ) return include( libs[lib] ) end Quantum.Client.Menu.GetAPI = function( lib ) return include( libs[lib] ) end
net.Receive( "quantum_menu_net", function( len, pl ) net.Receive( "quantum_menu_net", function( len, pl )
local dt = net.ReadTable() local dt = net.ReadTable()
if( Quantum.Client.Cache[dt.id] ~= nil && #Quantum.Client.Cache[dt.id] >= 1 ) then if( Quantum.Client.Cache[dt.id] ~= nil && #Quantum.Client.Cache[dt.id] >= 1 ) then
table.Merge( Quantum.Client.Cache[dt.id], dt ) table.Merge( Quantum.Client.Cache[dt.id], dt )
else else
Quantum.Client.Cache[dt.id] = dt || { id = dt.id } Quantum.Client.Cache[dt.id] = dt || { id = dt.id }
end end
if( Quantum.Client.EnableDebug ) then -- debug if( Quantum.Client.EnableDebug ) then -- debug
Quantum.Debug( "Datatable size: " .. len .. "b (" .. len/8 .. "B)" ) Quantum.Debug( "Datatable size: " .. len .. "b (" .. len/8 .. "B)" )
Quantum.Debug( "--Datatable contents--") Quantum.Debug( "--Datatable contents--")
PrintTable( dt ) PrintTable( dt )
Quantum.Debug( "--End of datatable contens--" ) Quantum.Debug( "--End of datatable contens--" )
end end
local menu = include( GAMEMODE.FolderName .. "/gamemode/engine/derma/menus/menu_" .. dt.id .. ".lua" ) local menu = include( GAMEMODE.FolderName .. "/gamemode/engine/derma/menus/menu_" .. dt.id .. ".lua" )
menu.open( dt ) menu.open( dt )
end) end)

@ -13,69 +13,69 @@ local padding_s = 4 * scale
local theme = Quantum.Client.Menu.GetAPI( "theme" ) local theme = Quantum.Client.Menu.GetAPI( "theme" )
function log.createinfobox( logdata, parent ) function log.createinfobox( logdata, parent )
local fw, fh = parent:GetSize() local fw, fh = parent:GetSize()
local logtitle = logdata[1].title local logtitle = logdata[1].title
local logtext = logdata[1].text local logtext = logdata[1].text
local box = vgui.Create( "DPanel", parent ) local box = vgui.Create( "DPanel", parent )
box:SetSize( 775 * scale, 200 * scale ) box:SetSize( 775 * scale, 200 * scale )
box.Paint = function( self ) theme.sharpblurpanel( self ) end box.Paint = function( self ) theme.sharpblurpanel( self ) end
box.w, box.h = box:GetSize() box.w, box.h = box:GetSize()
box:SetPos( fw/2 - box.w/2, fh*0.8 - box.h/2 ) box:SetPos( fw/2 - box.w/2, fh*0.8 - box.h/2 )
box.x, box.y = box:GetPos() box.x, box.y = box:GetPos()
local header = vgui.Create( "DLabel", parent ) local header = vgui.Create( "DLabel", parent )
header:SetFont( "q_header_s" ) header:SetFont( "q_header_s" )
header:SetTextColor( Color( 255, 255, 255, 220 ) ) header:SetTextColor( Color( 255, 255, 255, 220 ) )
header:SizeToContents() header:SizeToContents()
header.w, header.h = header:GetSize() header.w, header.h = header:GetSize()
header:SetPos( box.x, ( box.y - header.h ) - padding/2 ) header:SetPos( box.x, ( box.y - header.h ) - padding/2 )
header.Think = function( self ) header.Think = function( self )
if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then
if( logdata[Quantum.Client.Cam.Temp.scene_index].title ~= nil ) then if( logdata[Quantum.Client.Cam.Temp.scene_index].title ~= nil ) then
self:SetVisible( true ) self:SetVisible( true )
self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].title ) self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].title )
surface.SetFont( self:GetFont() ) surface.SetFont( self:GetFont() )
local tw, th = surface.GetTextSize( self:GetText() ) local tw, th = surface.GetTextSize( self:GetText() )
self:SetSize( tw * 1.1, th * 1.1 ) self:SetSize( tw * 1.1, th * 1.1 )
end end
end end
end end
header.Paint = function( self ) header.Paint = function( self )
theme.sharpblurpanel( self ) theme.sharpblurpanel( self )
end end
header:SetContentAlignment( 5 ) header:SetContentAlignment( 5 )
local scroll = vgui.Create( "DScrollPanel", box ) local scroll = vgui.Create( "DScrollPanel", box )
scroll:SetSize( box:GetSize() ) scroll:SetSize( box:GetSize() )
scroll.Paint = function( self ) end scroll.Paint = function( self ) end
local sb = scroll:GetVBar() local sb = scroll:GetVBar()
sb.Paint = function( self ) end sb.Paint = function( self ) end
function sb.btnGrip:Paint() function sb.btnGrip:Paint()
theme.button( self, Color( 0, 0, 0, 0 ) ) theme.button( self, Color( 0, 0, 0, 0 ) )
end end
sb.btnUp:SetSize(0,0) sb.btnUp:SetSize(0,0)
sb.btnDown:SetSize(0,0) sb.btnDown:SetSize(0,0)
scroll.w, scroll.h = scroll:GetSize() scroll.w, scroll.h = scroll:GetSize()
local text = vgui.Create( "DLabel", scroll ) local text = vgui.Create( "DLabel", scroll )
text:SetText( logtext ) text:SetText( logtext )
text:SetFont( "q_info" ) text:SetFont( "q_info" )
text:SetTextColor( Color( 240, 240, 240, 255 ) ) text:SetTextColor( Color( 240, 240, 240, 255 ) )
text:SetSize( scroll.w * 0.95, scroll.h * 0.95 ) text:SetSize( scroll.w * 0.95, scroll.h * 0.95 )
text:SetWrap( true ) text:SetWrap( true )
text.w, text.h = text:GetSize() text.w, text.h = text:GetSize()
text:SetPos( scroll.w/2 - text.w/2, 0 ) text:SetPos( scroll.w/2 - text.w/2, 0 )
text.Think = function( self ) text.Think = function( self )
if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then if( logdata[Quantum.Client.Cam.Temp.scene_index] ~= nil ) then
self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].text ) self:SetText( logdata[Quantum.Client.Cam.Temp.scene_index].text )
end end
end end
return box return box
end end
return log return log

@ -14,45 +14,45 @@ local theme = Quantum.Client.Menu.GetAPI( "theme" )
function page.New( parent, args ) function page.New( parent, args )
-- check the vars -- check the vars
args.w, args.h = parent:GetSize() args.w, args.h = parent:GetSize()
args.x, args.y = 0, 0 args.x, args.y = 0, 0
args.closeW = args.closeW || 90 * scale args.closeW = args.closeW || 90 * scale
args.closeH = args.closeH || 20 * scale args.closeH = args.closeH || 20 * scale
args.closeX = args.closeX || padding args.closeX = args.closeX || padding
args.closeY = args.closeY || padding args.closeY = args.closeY || padding
-- --
local p = vgui.Create( "DPanel", parent ) local p = vgui.Create( "DPanel", parent )
p.w, p.h = args.w, args.h p.w, p.h = args.w, args.h
p.x, p.y = args.x, args.y p.x, p.y = args.x, args.y
p:SetSize( p.w, p.h ) p:SetSize( p.w, p.h )
p:SetPos( p.x, p.y ) p:SetPos( p.x, p.y )
p.Paint = args.Paint || function( self, w, h ) p.Paint = args.Paint || function( self, w, h )
-- Draw nothing, unless this function is overwritten -- Draw nothing, unless this function is overwritten
end end
p.OnClose = args.OnClose || function() end p.OnClose = args.OnClose || function() end
local close = vgui.Create( "DButton", p ) local close = vgui.Create( "DButton", p )
close:SetText( args.CloseButtonText || "Close" ) close:SetText( args.CloseButtonText || "Close" )
close:SetTextColor( args.CloseButtonTextColor || Color( 0, 0, 0, 255 ) ) close:SetTextColor( args.CloseButtonTextColor || Color( 0, 0, 0, 255 ) )
close:SetFont( args.CloseButtonFont || "q_text" ) close:SetFont( args.CloseButtonFont || "q_text" )
--close:SetSize( args.closeW, args.closeH ) --close:SetSize( args.closeW, args.closeH )
close:SizeToContents() close:SizeToContents()
local closeW, closeH = close:GetSize() local closeW, closeH = close:GetSize()
close:SetSize( closeW + padding*2, closeH ) close:SetSize( closeW + padding*2, closeH )
close:SetPos( args.closeX, args.closeY ) close:SetPos( args.closeX, args.closeY )
close.DoClick = function() close.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
p:Remove() p:Remove()
end end
close.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end close.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
close.Paint = args.CloseButtonPaint || function( self, w, h ) close.Paint = args.CloseButtonPaint || function( self, w, h )
theme.sharpbutton( self ) theme.sharpbutton( self )
end end
return p, close return p, close
end end
return page return page

@ -12,8 +12,9 @@ local padding_s = math.Round( 4 * scale )
local blur = Material("pp/blurscreen") local blur = Material("pp/blurscreen")
local function renderBlur( p, a, d )
local x, y = p:LocalToScreen( 0, 0 ) function theme.renderblur( p, a, d )
local x, y = p:LocalToScreen( 0, 0 )
surface.SetDrawColor( 255, 255, 255 ) surface.SetDrawColor( 255, 255, 255 )
surface.SetMaterial( blur ) surface.SetMaterial( blur )
@ -26,87 +27,87 @@ local function renderBlur( p, a, d )
end end
function theme.borderpanel( p, color ) function theme.borderpanel( p, color )
local w, h = p:GetSize() local w, h = p:GetSize()
local clr = color || Color( 20, 20, 20, 100 ) local clr = color || Color( 20, 20, 20, 100 )
surface.SetDrawColor( clr ) surface.SetDrawColor( clr )
surface.DrawOutlinedRect( 0, 0, w, h ) surface.DrawOutlinedRect( 0, 0, w, h )
end end
function theme.panel( p, color ) function theme.panel( p, color )
local w, h = p:GetSize() local w, h = p:GetSize()
local clr = color || Color( 0, 0, 0, 200 ) local clr = color || Color( 0, 0, 0, 200 )
local bclr = Color( 50, 50, 50, 105 ) local bclr = Color( 50, 50, 50, 105 )
draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border
draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner
end end
function theme.blurpanel( p, color ) function theme.blurpanel( p, color )
local w, h = p:GetSize() local w, h = p:GetSize()
local clr = color || Color( 0, 0, 0, 200 ) local clr = color || Color( 0, 0, 0, 200 )
local bclr = Color( 50, 50, 50, 105 ) local bclr = Color( 50, 50, 50, 105 )
renderBlur( p, 2, 7 ) theme.renderblur( p, 2, 7 )
draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border
draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner
end end
function theme.sharpblurpanel( p, color ) function theme.sharpblurpanel( p, color )
local w, h = p:GetSize() local w, h = p:GetSize()
local clr = color || Color( 0, 0, 0, 200 ) local clr = color || Color( 0, 0, 0, 200 )
surface.SetDrawColor( clr ) surface.SetDrawColor( clr )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
renderBlur( p, 2, 7 ) theme.renderblur( p, 2, 7 )
theme.borderpanel( p, Color( 255, 255, 255, 255 ) ) theme.borderpanel( p, Color( 255, 255, 255, 255 ) )
end end
function theme.button( b, color ) function theme.button( b, color )
local w, h = b:GetSize() local w, h = b:GetSize()
local clr = color || Color( 235, 64, 52, 255 ) local clr = color || Color( 235, 64, 52, 255 )
local bclr = Color( 50, 50, 50, 255 ) local bclr = Color( 50, 50, 50, 255 )
if( b:IsHovered() ) then if( b:IsHovered() ) then
bclr = Color( 205, 205, 205, 255 ) bclr = Color( 205, 205, 205, 255 )
else else
bclr = Color( 50, 50, 50, 255 ) bclr = Color( 50, 50, 50, 255 )
end end
draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border draw.RoundedBox( 6, 0, 0, w, h, bclr ) -- border
draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner draw.RoundedBox( 4, padding_s/2, padding_s/2, w - padding_s, h - padding_s, clr ) -- inner
end end
function theme.sharpbutton( b, inClr ) function theme.sharpbutton( b, inClr )
local w, h = b:GetSize() local w, h = b:GetSize()
inClr = inClr || Color( 235, 64, 52, 255 ) inClr = inClr || Color( 235, 64, 52, 255 )
if( !b:IsHovered() ) then if( !b:IsHovered() ) then
surface.SetDrawColor( 205, 205, 205, 255 ) surface.SetDrawColor( 205, 205, 205, 255 )
else else
surface.SetDrawColor( 120, 120, 120, 255 ) surface.SetDrawColor( 120, 120, 120, 255 )
end end
surface.DrawOutlinedRect( 0, 0, w, h ) surface.DrawOutlinedRect( 0, 0, w, h )
surface.SetDrawColor( inClr ) surface.SetDrawColor( inClr )
surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s ) surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s )
end end
function theme.skipbutton( b, inClr ) function theme.skipbutton( b, inClr )
local w, h = b:GetSize() local w, h = b:GetSize()
inClr = inClr || Color( 0, 0, 0, 0 ) inClr = inClr || Color( 0, 0, 0, 0 )
if( !b:IsHovered() ) then if( !b:IsHovered() ) then
surface.SetDrawColor( 205, 205, 205, 2 ) surface.SetDrawColor( 205, 205, 205, 2 )
b:SetTextColor( Color( 255, 255, 255, 2 ) ) b:SetTextColor( Color( 255, 255, 255, 2 ) )
else else
surface.SetDrawColor( 120, 120, 120, 255 ) surface.SetDrawColor( 120, 120, 120, 255 )
b:SetTextColor( Color( 255, 255, 255, 255 ) ) b:SetTextColor( Color( 255, 255, 255, 255 ) )
end end
surface.DrawOutlinedRect( 0, 0, w, h ) surface.DrawOutlinedRect( 0, 0, w, h )
surface.SetDrawColor( inClr ) surface.SetDrawColor( inClr )
surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s ) surface.DrawRect( padding_s/2, padding_s/2, w - padding_s, h - padding_s )
end end
return theme return theme

@ -8,10 +8,10 @@
local snm = {} -- Safe. Networked. Message local snm = {} -- Safe. Networked. Message
function snm.RunNetworkedFunc( func, args ) function snm.RunNetworkedFunc( func, args )
net.Start( "quantum_menu_button_net" ) -- used for menu buttons etc net.Start( "quantum_menu_button_net" ) -- used for menu buttons etc
net.WriteString( func ) -- don't worry! it's very secure :D net.WriteString( func ) -- don't worry! it's very secure :D
net.WriteTable( args ) net.WriteTable( args )
net.SendToServer() net.SendToServer()
end end
return snm return snm

@ -18,174 +18,174 @@ local padding_s = 4 * resScale
local errorMdl = "models/player.mdl" local errorMdl = "models/player.mdl"
local function getClassModels( class ) local function getClassModels( class )
if( Quantum.Classes[class] ) then if( Quantum.Classes[class] ) then
return Quantum.Classes[class].Models return Quantum.Classes[class].Models
else else
Quantum.Error( "Unable to get models from class[" .. tostring( class ) .. "]." ) Quantum.Error( "Unable to get models from class[" .. tostring( class ) .. "]." )
end end
end end
local function getMaxModel( tbl, index ) return tbl[math.Clamp( index, 1, #tbl )] end local function getMaxModel( tbl, index ) return tbl[math.Clamp( index, 1, #tbl )] end
local function renderSelectedButton( b, sel ) local function renderSelectedButton( b, sel )
if( sel ) then if( sel ) then
b:SetTextColor( Color( 255, 239, 158 ) ) b:SetTextColor( Color( 255, 239, 158 ) )
else else
b:SetTextColor( Color( 255, 255, 255 ) ) b:SetTextColor( Color( 255, 255, 255 ) )
end end
end end
local function getNextIndex( index, isNext, min, max ) local function getNextIndex( index, isNext, min, max )
if( isNext ) then if( isNext ) then
if( index + 1 > max ) then if( index + 1 > max ) then
return min -- integer overflow LUL return min -- integer overflow LUL
else else
return index + 1 return index + 1
end end
else else
if( index - 1 < min ) then -- integer underflow if( index - 1 < min ) then -- integer underflow
return max return max
else else
return index - 1 return index - 1
end end
end end
end end
local function checkNameString( name ) local function checkNameString( name )
local strTbl = string.Explode( "", name ) local strTbl = string.Explode( "", name )
for i, char in pairs( strTbl ) do for i, char in pairs( strTbl ) do
if( i == 1 || strTbl[ math.Clamp( i-1, 1, #strTbl ) ] == " " ) then -- if it is the first letter then make it a capital one if( i == 1 || strTbl[ math.Clamp( i-1, 1, #strTbl ) ] == " " ) then -- if it is the first letter then make it a capital one
strTbl[i] = string.upper( char ) -- or if it is a space inbetween make it a capital one aswell strTbl[i] = string.upper( char ) -- or if it is a space inbetween make it a capital one aswell
end end
for n, char_ in pairs( strTbl ) do for n, char_ in pairs( strTbl ) do
if( n >= #strTbl && char == " " && strTbl[n-1] ~= " " ) then strTbl[i] = " " end -- remove the spaces at the end if( n >= #strTbl && char == " " && strTbl[n-1] ~= " " ) then strTbl[i] = " " end -- remove the spaces at the end
end end
end end
return table.concat( strTbl ) -- return the "fixed" name return table.concat( strTbl ) -- return the "fixed" name
end end
local pages = { local pages = {
charCreate = function( parent ) charCreate = function( parent )
local pW, pH = parent:GetSize() local pW, pH = parent:GetSize()
local args = { local args = {
CloseButtonText = "Return", CloseButtonText = "Return",
CloseButtonFont = "q_text", CloseButtonFont = "q_text",
} }
local p, c = page.New( parent, args ) local p, c = page.New( parent, args )
p:SetVisible( true ) p:SetVisible( true )
p.w, p.h = p:GetSize() p.w, p.h = p:GetSize()
c:SetSize( 85 * resScale, 25 * resScale ) c:SetSize( 85 * resScale, 25 * resScale )
c.w, c.h = c:GetSize() c.w, c.h = c:GetSize()
c:SetPos( (p.w - c.w) - padding*4, (p.h - c.h) - padding*4 ) c:SetPos( (p.w - c.w) - padding*4, (p.h - c.h) - padding*4 )
c.DoClick = function() c.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
parent.page:SetVisible( true ) parent.page:SetVisible( true )
p:Remove() p:Remove()
end end
local scene = { local scene = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
[1] = { [1] = {
fov = 75, fov = 75,
velocity = 10, velocity = 10,
pos1 = Vector(11504.430664, 3809.523193, 72.031250), pos1 = Vector(11504.430664, 3809.523193, 72.031250),
ang1 = Angle(5, 112.406662, 0.000000) ang1 = Angle(5, 112.406662, 0.000000)
} }
} }
} }
Quantum.Client.Cam.Start( scene[game.GetMap()], true ) Quantum.Client.Cam.Start( scene[game.GetMap()], true )
local banner = vgui.Create( "DImage", p ) local banner = vgui.Create( "DImage", p )
banner:SetImage( Quantum.Client.ServerBannerPath ) banner:SetImage( Quantum.Client.ServerBannerPath )
banner:SizeToContents() banner:SizeToContents()
banner.w, banner.h = banner:GetSize() banner.w, banner.h = banner:GetSize()
banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 ) banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 )
banner.w, banner.h = banner:GetSize() banner.w, banner.h = banner:GetSize()
banner:SetPos( (p.w - banner.w) + padding*2, 0 ) banner:SetPos( (p.w - banner.w) + padding*2, 0 )
local ip = vgui.Create( "DPanel", p ) -- input panel local ip = vgui.Create( "DPanel", p ) -- input panel
ip:SetSize( 400 * resScale, p.h * 0.9 ) ip:SetSize( 400 * resScale, p.h * 0.9 )
ip.w, ip.h = ip:GetSize() ip.w, ip.h = ip:GetSize()
ip:SetPos( padding*4, p.h/2 - ip.h/2 ) ip:SetPos( padding*4, p.h/2 - ip.h/2 )
ip.Paint = function( self ) theme.blurpanel(self) end ip.Paint = function( self ) theme.blurpanel(self) end
ip.x, ip.y = ip:GetPos() ip.x, ip.y = ip:GetPos()
local header = vgui.Create( "DLabel", p ) local header = vgui.Create( "DLabel", p )
header:SetText( "Character Creation" ) header:SetText( "Character Creation" )
header:SetFont( "q_header" ) header:SetFont( "q_header" )
header:SetTextColor( Color( 255, 255, 255, 255 ) ) header:SetTextColor( Color( 255, 255, 255, 255 ) )
header:SizeToContents() header:SizeToContents()
header.w, header.h = header:GetSize() header.w, header.h = header:GetSize()
header:SetPos( (ip.x + ip.w/2) - header.w/2, header.h/2 ) header:SetPos( (ip.x + ip.w/2) - header.w/2, header.h/2 )
-- character model panel -- character model panel
local mdl = vgui.Create( "DModelPanel", p ) local mdl = vgui.Create( "DModelPanel", p )
mdl:SetSize( 600 * resScale, 1000 * resScale ) mdl:SetSize( 600 * resScale, 1000 * resScale )
mdl.w, mdl.h = mdl:GetSize() mdl.w, mdl.h = mdl:GetSize()
mdl:SetPos( p.w/2 - mdl.w/2, p.h/2 - mdl.h/2 ) mdl:SetPos( p.w/2 - mdl.w/2, p.h/2 - mdl.h/2 )
mdl.x, mdl.y = mdl:GetPos() mdl.x, mdl.y = mdl:GetPos()
mdl:SetFOV( 55 ) mdl:SetFOV( 55 )
function mdl:LayoutEntity( ent ) return end function mdl:LayoutEntity( ent ) return end
local inputs = { local inputs = {
gender = "Male", gender = "Male",
class = "Worker", class = "Worker",
modelIndex = 1, modelIndex = 1,
name = "" name = ""
} }
local name = vgui.Create( "DTextEntry", p ) local name = vgui.Create( "DTextEntry", p )
name:SetPlaceholderText( "Character Name" ) name:SetPlaceholderText( "Character Name" )
name:SetPlaceholderColor( Color( 100, 100, 100, 100 ) ) name:SetPlaceholderColor( Color( 100, 100, 100, 100 ) )
name:SetFont( "q_button2" ) name:SetFont( "q_button2" )
name:SetTextColor( Color( 255, 255, 255, 255 ) ) name:SetTextColor( Color( 255, 255, 255, 255 ) )
name:SetSize( 300 * resScale, 40 * resScale ) name:SetSize( 300 * resScale, 40 * resScale )
name.w, name.h = name:GetSize() name.w, name.h = name:GetSize()
name:SetPos( p.w/2 - name.w/2, p.h*0.85 - name.h/2 ) name:SetPos( p.w/2 - name.w/2, p.h*0.85 - name.h/2 )
name.x, name.y = name:GetPos() name.x, name.y = name:GetPos()
name.Paint = function( self ) name.Paint = function( self )
theme.blurpanel( self ) theme.blurpanel( self )
self:DrawTextEntryText( Color( 255, 255, 255, 255 ), Color( 150, 150, 150, 255 ), Color( 100, 100, 100, 255 ) ) self:DrawTextEntryText( Color( 255, 255, 255, 255 ), Color( 150, 150, 150, 255 ), Color( 100, 100, 100, 255 ) )
end end
name.OnEnter = function() name.OnEnter = function()
checkNameString( name:GetText() ) checkNameString( name:GetText() )
end end
-- input panel contens -- -- input panel contens --
local rheader = vgui.Create( "DLabel", ip ) local rheader = vgui.Create( "DLabel", ip )
rheader:SetText("Select Class") rheader:SetText("Select Class")
rheader:SetFont( "q_button2" ) rheader:SetFont( "q_button2" )
rheader:SetTextColor( Color( 255, 255, 255, 255 ) ) rheader:SetTextColor( Color( 255, 255, 255, 255 ) )
rheader:SizeToContents() rheader:SizeToContents()
rheader.w, rheader.h = rheader:GetSize() rheader.w, rheader.h = rheader:GetSize()
rheader:SetPos( ip.w/2 - rheader.w/2, rheader.h ) rheader:SetPos( ip.w/2 - rheader.w/2, rheader.h )
rheader.x, rheader.y = rheader:GetPos() rheader.x, rheader.y = rheader:GetPos()
local gbuttons = {} local gbuttons = {}
gbuttons.female = vgui.Create( "DButton", ip ) gbuttons.female = vgui.Create( "DButton", ip )
local selectedGenderButton = gbuttons.female -- select itself local selectedGenderButton = gbuttons.female -- select itself
gbuttons.female:SetText( "Female" ) gbuttons.female:SetText( "Female" )
gbuttons.female:SetTextColor( Color( 255, 255, 255, 255 ) ) gbuttons.female:SetTextColor( Color( 255, 255, 255, 255 ) )
gbuttons.female:SetFont( "q_button2" ) gbuttons.female:SetFont( "q_button2" )
gbuttons.female.Paint = function( self, w, h ) gbuttons.female.Paint = function( self, w, h )
theme.sharpbutton( self, Color( 0, 0, 0, 0 ) ) theme.sharpbutton( self, Color( 0, 0, 0, 0 ) )
renderSelectedButton( self, selectedGenderButton == self ) renderSelectedButton( self, selectedGenderButton == self )
end end
gbuttons.female:SizeToContents() gbuttons.female:SizeToContents()
gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize() gbuttons.female.w, gbuttons.female.h = gbuttons.female:GetSize()
gbuttons.female:SetPos( (ip.w - gbuttons.female.w) - padding - gbuttons.female.w/2, rheader.y + gbuttons.female.h + padding ) gbuttons.female:SetPos( (ip.w - gbuttons.female.w) - padding - gbuttons.female.w/2, rheader.y + gbuttons.female.h + padding )
gbuttons.female.x, gbuttons.female.y = gbuttons.female:GetPos() gbuttons.female.x, gbuttons.female.y = gbuttons.female:GetPos()
gbuttons.female.DoClick = function( self ) gbuttons.female.DoClick = function( self )
if( selectedGenderButton ~= self ) then if( selectedGenderButton ~= self ) then
selectedGenderButton = self selectedGenderButton = self
inputs.gender = "Female" inputs.gender = "Female"
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
end end
end end
gbuttons.male = vgui.Create( "DButton", ip ) gbuttons.male = vgui.Create( "DButton", ip )
selectedGenderButton = gbuttons.male selectedGenderButton = gbuttons.male
gbuttons.male:SetText( "Male" ) gbuttons.male:SetText( "Male" )
gbuttons.male:SetTextColor( Color( 0, 0, 0, 255 ) ) gbuttons.male:SetTextColor( Color( 0, 0, 0, 255 ) )
gbuttons.male:SetFont( "q_button2" ) gbuttons.male:SetFont( "q_button2" )
@ -194,205 +194,205 @@ local pages = {
gbuttons.male:SetPos( padding + gbuttons.male.w/2, rheader.y + gbuttons.male.h + padding ) gbuttons.male:SetPos( padding + gbuttons.male.w/2, rheader.y + gbuttons.male.h + padding )
gbuttons.male.Paint = function( self, w, h ) gbuttons.male.Paint = function( self, w, h )
theme.sharpbutton( self, Color( 0, 0, 0, 0 ) ) theme.sharpbutton( self, Color( 0, 0, 0, 0 ) )
renderSelectedButton( self, selectedGenderButton == self ) renderSelectedButton( self, selectedGenderButton == self )
end end
gbuttons.male.DoClick = function( self ) gbuttons.male.DoClick = function( self )
if( selectedGenderButton ~= self ) then if( selectedGenderButton ~= self ) then
selectedGenderButton = self selectedGenderButton = self
inputs.gender = "Male" inputs.gender = "Male"
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
end end
end end
--- Class buttons --- --- Class buttons ---
local cscroll = vgui.Create( "DScrollPanel", ip ) local cscroll = vgui.Create( "DScrollPanel", ip )
cscroll:SetSize( ip.w, ip.h/5 ) cscroll:SetSize( ip.w, ip.h/5 )
cscroll.w, cscroll.h = cscroll:GetSize() cscroll.w, cscroll.h = cscroll:GetSize()
cscroll:SetPos( 0, ip.h/6 ) cscroll:SetPos( 0, ip.h/6 )
cscroll.x, cscroll.y = cscroll:GetPos() cscroll.x, cscroll.y = cscroll:GetPos()
cscroll:GetVBar():SetSize( 0, 0 ) cscroll:GetVBar():SetSize( 0, 0 )
local classButtons = {} local classButtons = {}
local classCount = 0 local classCount = 0
for id, class in pairs( Quantum.Classes ) do for id, class in pairs( Quantum.Classes ) do
classCount = classCount + 1 -- keep count classCount = classCount + 1 -- keep count
classButtons[classCount] = vgui.Create( "DButton", cscroll ) classButtons[classCount] = vgui.Create( "DButton", cscroll )
classButtons[classCount].class = id classButtons[classCount].class = id
classButtons[classCount]:SetText( class.Name ) classButtons[classCount]:SetText( class.Name )
classButtons[classCount]:SetFont( "q_button2" ) classButtons[classCount]:SetFont( "q_button2" )
classButtons[classCount]:SetTextColor( Color( 255, 255, 255, 255 ) ) classButtons[classCount]:SetTextColor( Color( 255, 255, 255, 255 ) )
classButtons[classCount]:SizeToContents() classButtons[classCount]:SizeToContents()
classButtons[classCount].w, classButtons[classCount].h = classButtons[classCount]:GetSize() classButtons[classCount].w, classButtons[classCount].h = classButtons[classCount]:GetSize()
classButtons[classCount]:SetSize( ip.w - padding*2, classButtons[classCount].h ) classButtons[classCount]:SetSize( ip.w - padding*2, classButtons[classCount].h )
classButtons[classCount].w, classButtons[classCount].h = classButtons[classCount]:GetSize() classButtons[classCount].w, classButtons[classCount].h = classButtons[classCount]:GetSize()
classButtons[classCount]:SetPos( cscroll.w/2 - classButtons[classCount].w/2, (classCount-1) * ( padding + classButtons[classCount].h ) ) classButtons[classCount]:SetPos( cscroll.w/2 - classButtons[classCount].w/2, (classCount-1) * ( padding + classButtons[classCount].h ) )
classButtons[classCount].Paint = function( self ) classButtons[classCount].Paint = function( self )
theme.sharpbutton( self, Color( 0, 0, 0, 0 ) ) theme.sharpbutton( self, Color( 0, 0, 0, 0 ) )
renderSelectedButton( self, inputs.class == self.class ) renderSelectedButton( self, inputs.class == self.class )
end end
classButtons[classCount].DoClick = function( self ) classButtons[classCount].DoClick = function( self )
if( inputs.class ~= id ) then if( inputs.class ~= id ) then
inputs.class = id inputs.class = id
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
end end
end end
end end
--- Model selector --- --- Model selector ---
local pmodel = vgui.Create( "DButton", p ) -- previous model local pmodel = vgui.Create( "DButton", p ) -- previous model
pmodel:SetText( "< Prev. Model" ) pmodel:SetText( "< Prev. Model" )
pmodel:SetFont( "q_button_m" ) pmodel:SetFont( "q_button_m" )
pmodel:SetTextColor( Color( 255, 255, 255, 255 ) ) pmodel:SetTextColor( Color( 255, 255, 255, 255 ) )
pmodel:SizeToContents() pmodel:SizeToContents()
pmodel.w, pmodel.h = pmodel:GetSize() pmodel.w, pmodel.h = pmodel:GetSize()
pmodel:SetPos( (mdl.x - pmodel.w) + padding*10, (mdl.y + mdl.h/2) - pmodel.h/2 ) pmodel:SetPos( (mdl.x - pmodel.w) + padding*10, (mdl.y + mdl.h/2) - pmodel.h/2 )
pmodel.Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 100 ) ) end pmodel.Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 100 ) ) end
pmodel.DoClick = function( self ) pmodel.DoClick = function( self )
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
inputs.modelIndex = getNextIndex( inputs.modelIndex, false, 1, #getClassModels( inputs.class )[inputs.gender] ) inputs.modelIndex = getNextIndex( inputs.modelIndex, false, 1, #getClassModels( inputs.class )[inputs.gender] )
end end
local nmodel = vgui.Create( "DButton", p ) -- next model local nmodel = vgui.Create( "DButton", p ) -- next model
nmodel:SetText( "Next Model >" ) nmodel:SetText( "Next Model >" )
nmodel:SetFont( "q_button_m" ) nmodel:SetFont( "q_button_m" )
nmodel:SetTextColor( Color( 255, 255, 255, 255 ) ) nmodel:SetTextColor( Color( 255, 255, 255, 255 ) )
nmodel:SetSize( pmodel.w, pmodel.h ) nmodel:SetSize( pmodel.w, pmodel.h )
nmodel.w, nmodel.h = nmodel:GetSize() nmodel.w, nmodel.h = nmodel:GetSize()
nmodel:SetPos( (mdl.x + mdl.w) - padding*10, (mdl.y + mdl.h/2) - nmodel.h/2 ) nmodel:SetPos( (mdl.x + mdl.w) - padding*10, (mdl.y + mdl.h/2) - nmodel.h/2 )
nmodel.Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 100 ) ) end nmodel.Paint = function( self ) theme.sharpbutton( self, Color( 0, 0, 0, 100 ) ) end
nmodel.DoClick = function( self ) nmodel.DoClick = function( self )
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
inputs.modelIndex = getNextIndex( inputs.modelIndex, true, 1, #getClassModels( inputs.class )[inputs.gender] ) inputs.modelIndex = getNextIndex( inputs.modelIndex, true, 1, #getClassModels( inputs.class )[inputs.gender] )
end end
-- Class info -- -- Class info --
local mscroll = vgui.Create( "DScrollPanel", ip ) local mscroll = vgui.Create( "DScrollPanel", ip )
mscroll:SetSize( ip.w, ip.h/1.6 ) mscroll:SetSize( ip.w, ip.h/1.6 )
mscroll.w, mscroll.h = mscroll:GetSize() mscroll.w, mscroll.h = mscroll:GetSize()
mscroll:SetPos( 0, ip.h - mscroll.h ) mscroll:SetPos( 0, ip.h - mscroll.h )
mscroll:GetVBar():SetSize( 0, 0 ) mscroll:GetVBar():SetSize( 0, 0 )
mscroll.Paint = function( self ) mscroll.Paint = function( self )
theme.borderpanel( self ) theme.borderpanel( self )
end end
--- Model viewer --- Model viewer
mdl:SetModel( Quantum.Models.Player.Citizen.Male[math.random(1, #Quantum.Models.Player.Citizen.Male)] ) -- set the char model mdl:SetModel( Quantum.Models.Player.Citizen.Male[math.random(1, #Quantum.Models.Player.Citizen.Male)] ) -- set the char model
local minv, maxv = mdl.Entity:GetRenderBounds() local minv, maxv = mdl.Entity:GetRenderBounds()
local ent = mdl.Entity local ent = mdl.Entity
local eyepos = ent:GetBonePosition( ent:LookupBone( "ValveBiped.Bip01_Head1" ) ) local eyepos = ent:GetBonePosition( ent:LookupBone( "ValveBiped.Bip01_Head1" ) )
eyepos:Add( Vector( 40, 0, -15 ) ) eyepos:Add( Vector( 40, 0, -15 ) )
mdl:SetCamPos( eyepos - Vector( -10, 0, -2 ) ) mdl:SetCamPos( eyepos - Vector( -10, 0, -2 ) )
mdl:SetLookAt( eyepos ) mdl:SetLookAt( eyepos )
mdl.Think = function( self ) mdl.Think = function( self )
--getClassModels(inputs.class) --getClassModels(inputs.class)
if( self:GetModel() ~= getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) then if( self:GetModel() ~= getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) then
self:SetModel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) self:SetModel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) )
end end
end end
-- create char button -- -- create char button --
local cr = vgui.Create( "DButton", p ) local cr = vgui.Create( "DButton", p )
cr:SetText( "Create Character" ) cr:SetText( "Create Character" )
cr:SetFont( "q_button2" ) cr:SetFont( "q_button2" )
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) cr:SetTextColor( Color( 0, 0, 0, 255 ) )
cr:SizeToContents() cr:SizeToContents()
cr.w, cr.h = cr:GetSize() cr.w, cr.h = cr:GetSize()
cr:SetPos( name.x + name.w/2 - cr.w/2, name.y + cr.h + padding ) cr:SetPos( name.x + name.w/2 - cr.w/2, name.y + cr.h + padding )
cr.Paint = function( self ) theme.sharpbutton( self ) end cr.Paint = function( self ) theme.sharpbutton( self ) end
cr.DoClick = function( self ) cr.DoClick = function( self )
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
-- create char -- create char
inputs.name = checkNameString( name:GetText() ) inputs.name = checkNameString( name:GetText() )
snm.RunNetworkedFunc( "createChar", inputs ) snm.RunNetworkedFunc( "createChar", inputs )
end end
return p, c return p, c
end end
} }
function menu.open( dt ) function menu.open( dt )
Quantum.Client.IsInMenu = true -- hide the hud Quantum.Client.IsInMenu = true -- hide the hud
if( !f ) then if( !f ) then
local f = vgui.Create( "DFrame" ) local f = vgui.Create( "DFrame" )
f:SetTitle( "" ) f:SetTitle( "" )
f:SetSize( sw, sh ) f:SetSize( sw, sh )
f.Paint = function( self, w, h ) f.Paint = function( self, w, h )
surface.SetDrawColor( 0, 0, 0, 120 ) surface.SetDrawColor( 0, 0, 0, 120 )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
end end
f:SetDraggable( false ) f:SetDraggable( false )
f:ShowCloseButton( false ) f:ShowCloseButton( false )
f:MakePopup() f:MakePopup()
function f:OnClose() function f:OnClose()
Quantum.Client.IsInMenu = false -- show the hud when closed Quantum.Client.IsInMenu = false -- show the hud when closed
Quantum.Client.Cam.Stop() Quantum.Client.Cam.Stop()
end end
local scene = { local scene = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
[1] = { [1] = {
fov = 70, fov = 70,
velocity = 10, velocity = 10,
pos1 = Vector(9807.226563, -9093.957031, 5560.153809), pos1 = Vector(9807.226563, -9093.957031, 5560.153809),
ang1 = Angle(5.702401, -42.888149, 0.000000) ang1 = Angle(5.702401, -42.888149, 0.000000)
} }
} }
} }
Quantum.Client.Cam.Start( scene[game.GetMap()], true ) Quantum.Client.Cam.Start( scene[game.GetMap()], true )
local args = { local args = {
CloseButtonText = "Quit", CloseButtonText = "Quit",
CloseButtonFont = "q_text" CloseButtonFont = "q_text"
} }
local p, c = page.New( f, args ) local p, c = page.New( f, args )
f.page = p f.page = p
f.page:SetVisible( true ) f.page:SetVisible( true )
local clist = vgui.Create( "DScrollPanel", p ) local clist = vgui.Create( "DScrollPanel", p )
clist:SetSize( 380 * resScale, sh - padding*15 ) clist:SetSize( 380 * resScale, sh - padding*15 )
clist.w, clist.h = clist:GetSize() clist.w, clist.h = clist:GetSize()
clist:SetPos( (sw - clist.w) - padding*2, padding*6 ) clist:SetPos( (sw - clist.w) - padding*2, padding*6 )
clist.x, clist.y = clist:GetPos() clist.x, clist.y = clist:GetPos()
clist.Paint = function( self, w, h ) clist.Paint = function( self, w, h )
theme.blurpanel( self ) theme.blurpanel( self )
end end
local sbar = clist:GetVBar() local sbar = clist:GetVBar()
sbar:SetSize( 0, 0 ) -- Remove the scroll bar sbar:SetSize( 0, 0 ) -- Remove the scroll bar
--- Close/quit button stuff --- --- Close/quit button stuff ---
local cW, cH = c:GetSize() local cW, cH = c:GetSize()
c:SetPos( (clist.x + clist.w) - cW, clist.y + clist.h + cH ) c:SetPos( (clist.x + clist.w) - cW, clist.y + clist.h + cH )
c.Paint = function( self ) theme.button( self ) end c.Paint = function( self ) theme.button( self ) end
c.DoClick = function() c.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
f:Close() f:Close()
end end
--- ---
local banner = vgui.Create( "DImage", p ) local banner = vgui.Create( "DImage", p )
banner:SetImage( Quantum.Client.ServerBannerPath ) banner:SetImage( Quantum.Client.ServerBannerPath )
banner:SizeToContents() banner:SizeToContents()
banner.w, banner.h = banner:GetSize() banner.w, banner.h = banner:GetSize()
banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 ) banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 )
banner:SetPos( padding, padding ) banner:SetPos( padding, padding )
local header = vgui.Create( "DLabel", p ) local header = vgui.Create( "DLabel", p )
header:SetText( "Characters" ) header:SetText( "Characters" )
header:SetFont( "q_header" ) header:SetFont( "q_header" )
header:SizeToContents() header:SizeToContents()
local headerW, headerH = header:GetSize() local headerW, headerH = header:GetSize()
header:SetPos( clist.x + ( clist.w/2 - headerW/2 ), (clist.y - headerH) + padding/2 ) header:SetPos( clist.x + ( clist.w/2 - headerW/2 ), (clist.y - headerH) + padding/2 )
header:SetTextColor( Color( 255, 255, 255, 255 ) ) header:SetTextColor( Color( 255, 255, 255, 255 ) )
header.Paint = function( self, w, h ) end header.Paint = function( self, w, h ) end
local chars = dt.cont -- set the char table local chars = dt.cont -- set the char table
local cpanels = {} local cpanels = {}
local selectedChar local selectedChar
if( table.Count( chars ) >= 1 ) then if( table.Count( chars ) >= 1 ) then
-- Char model -- Char model
@ -421,66 +421,66 @@ function menu.open( dt )
end end
local count = 0 local count = 0
for k, v in pairs( chars ) do for k, v in pairs( chars ) do
count = count + 1 count = count + 1
cpanels[count] = vgui.Create( "DButton", clist ) cpanels[count] = vgui.Create( "DButton", clist )
cpanels[count].index = count cpanels[count].index = count
cpanels[count].char = v -- give the panel it's character cpanels[count].char = v -- give the panel it's character
if( !selectedChar ) then selectedChar = cpanels[1] end -- select the first one if( !selectedChar ) then selectedChar = cpanels[1] end -- select the first one
cpanels[count]:SetText( "" ) cpanels[count]:SetText( "" )
cpanels[count]:SetSize( clist.w - padding, 100 * resScale ) cpanels[count]:SetSize( clist.w - padding, 100 * resScale )
cpanels[count].w, cpanels[count].h = cpanels[count]:GetSize() cpanels[count].w, cpanels[count].h = cpanels[count]:GetSize()
cpanels[count]:SetPos( padding/2, (padding)*count + (cpanels[count].h * (count-1)) ) cpanels[count]:SetPos( padding/2, (padding)*count + (cpanels[count].h * (count-1)) )
cpanels[count].Paint = function( self, w, h ) cpanels[count].Paint = function( self, w, h )
surface.SetDrawColor( 0, 0, 0, 0 ) surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
if( self == selectedChar ) then if( self == selectedChar ) then
surface.SetDrawColor( 252, 186, 3, 100 ) surface.SetDrawColor( 252, 186, 3, 100 )
surface.DrawOutlinedRect( 0, 0, w, h ) surface.DrawOutlinedRect( 0, 0, w, h )
end end
end end
cpanels[count].DoClick = function( self ) -- if you press the char, then select it cpanels[count].DoClick = function( self ) -- if you press the char, then select it
selectedChar = self selectedChar = self
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
p.mdl:SetModel( self.char.model || errorMdl ) p.mdl:SetModel( self.char.model || errorMdl )
end end
local txt = vgui.Create( "DLabel", cpanels[count] ) local txt = vgui.Create( "DLabel", cpanels[count] )
txt:SetText( v.name || "[ERROR] NAME=nil" ) txt:SetText( v.name || "[ERROR] NAME=nil" )
txt:SetFont( "q_charNameText" ) txt:SetFont( "q_charNameText" )
txt:SetTextColor( Color( 200, 200, 200, 220 ) ) txt:SetTextColor( Color( 200, 200, 200, 220 ) )
txt:SizeToContents() txt:SizeToContents()
local txtW, txtH = txt:GetSize() local txtW, txtH = txt:GetSize()
txt:SetPos( padding, cpanels[count].h/4 - txtH/2 ) txt:SetPos( padding, cpanels[count].h/4 - txtH/2 )
local txtX, txtY = txt:GetPos() local txtX, txtY = txt:GetPos()
local lvlTxt local lvlTxt
if( v.job.level >= 0 ) then if( v.job.level >= 0 ) then
lvlTxt = "Level " .. v.job.level .. " " lvlTxt = "Level " .. v.job.level .. " "
else else
lvlTxt = "" lvlTxt = ""
end end
local lvl = vgui.Create( "DLabel", cpanels[count] ) local lvl = vgui.Create( "DLabel", cpanels[count] )
lvl:SetText( lvlTxt .. v.job.title ) lvl:SetText( lvlTxt .. v.job.title )
lvl:SetFont( "q_text2" ) lvl:SetFont( "q_text2" )
lvl:SetTextColor( Color( 180, 180, 180, 225 ) ) lvl:SetTextColor( Color( 180, 180, 180, 225 ) )
lvl:SizeToContents() lvl:SizeToContents()
local lvlW, lvlH = lvl:GetSize() local lvlW, lvlH = lvl:GetSize()
lvl:SetPos( txtX, txtY + lvlH ) lvl:SetPos( txtX, txtY + lvlH )
local lvlX, lvlY = lvl:GetPos() local lvlX, lvlY = lvl:GetPos()
local class = vgui.Create( "DLabel", cpanels[count] ) local class = vgui.Create( "DLabel", cpanels[count] )
class:SetText( v.class ) class:SetText( v.class )
class:SetFont( "q_text2" ) class:SetFont( "q_text2" )
class:SetTextColor( Color( 252, 186, 3, 180 ) ) class:SetTextColor( Color( 252, 186, 3, 180 ) )
class:SizeToContents() class:SizeToContents()
local classW, classH = class:GetSize() local classW, classH = class:GetSize()
class:SetPos( txtX, lvlY + classH ) class:SetPos( txtX, lvlY + classH )
end end
if( selectedChar && p.mdl ~= nil ) then if( selectedChar && p.mdl ~= nil ) then
p.mdl:SetModel( selectedChar.char.model ) -- set the char model p.mdl:SetModel( selectedChar.char.model ) -- set the char model
@ -491,26 +491,26 @@ function menu.open( dt )
p.mdl:SetLookAt( eyepos ) p.mdl:SetLookAt( eyepos )
end end
if( table.Count( dt.cont ) < Quantum.CharacterLimit ) then if( table.Count( dt.cont ) < Quantum.CharacterLimit ) then
-- create char button -- create char button
local cr = vgui.Create( "DButton", p ) local cr = vgui.Create( "DButton", p )
cr:SetText("Create New Character") cr:SetText("Create New Character")
cr:SetFont( "q_button" ) cr:SetFont( "q_button" )
cr:SetTextColor( Color( 0, 0, 0, 255 ) ) cr:SetTextColor( Color( 0, 0, 0, 255 ) )
cr:SizeToContents() cr:SizeToContents()
cr.w, cr.h = cr:GetSize() cr.w, cr.h = cr:GetSize()
cr:SetPos( clist.x + ( clist.w/2 - cr.w/2 ), clist.y + ( ( clist.h - cr.h ) - padding*2 ) ) cr:SetPos( clist.x + ( clist.w/2 - cr.w/2 ), clist.y + ( ( clist.h - cr.h ) - padding*2 ) )
cr.Paint = function( self ) cr.Paint = function( self )
theme.sharpbutton( self ) theme.sharpbutton( self )
end end
cr.DoClick = function() cr.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
p:SetVisible( false ) p:SetVisible( false )
local crPage = pages.charCreate( f ) local crPage = pages.charCreate( f )
end end
cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end cr.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
end end
if( selectedChar ) then if( selectedChar ) then
-- Delete char button -- Delete char button
@ -531,25 +531,25 @@ function menu.open( dt )
dl.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end dl.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
-- Enter world button -- -- Enter world button --
p.enter = vgui.Create( "DButton", p ) p.enter = vgui.Create( "DButton", p )
p.enter:SetText( "Enter World" ) p.enter:SetText( "Enter World" )
p.enter:SetFont( "q_button2" ) p.enter:SetFont( "q_button2" )
p.enter:SetTextColor( Color( 0, 0, 0, 255 ) ) p.enter:SetTextColor( Color( 0, 0, 0, 255 ) )
p.enter:SizeToContents() p.enter:SizeToContents()
p.enter.w, p.enter.h = p.enter:GetSize() p.enter.w, p.enter.h = p.enter:GetSize()
p.enter:SetPos( p.w/2 - p.enter.w/2, p.h*0.925 - p.enter.h/2 ) p.enter:SetPos( p.w/2 - p.enter.w/2, p.h*0.925 - p.enter.h/2 )
p.enter.Paint = function( self ) theme.sharpbutton( self ) end p.enter.Paint = function( self ) theme.sharpbutton( self ) end
p.enter.DoClick = function() p.enter.DoClick = function()
surface.PlaySound( "UI/buttonclick.wav" ) surface.PlaySound( "UI/buttonclick.wav" )
-- enter world -- -- enter world --
local dt = { index = selectedChar.index } local dt = { index = selectedChar.index }
snm.RunNetworkedFunc( "enterWorldChar", dt ) -- FIX CRASH ISSUE ( 0xC00000FD ) snm.RunNetworkedFunc( "enterWorldChar", dt ) -- FIX CRASH ISSUE ( 0xC00000FD )
f:Close() -- close the frame f:Close() -- close the frame
end end
p.enter.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end p.enter.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
end end
end end
end end
return menu return menu

@ -11,133 +11,153 @@ local log = Quantum.Client.Menu.GetAPI( "dialogue" )
local theme = Quantum.Client.Menu.GetAPI( "theme" ) local theme = Quantum.Client.Menu.GetAPI( "theme" )
local scenes = { -- 5031.821777 3866.334961 120.090790;setang 0.898059 56.421352 0.000000 local scenes = { -- 5031.821777 3866.334961 120.090790;setang 0.898059 56.421352 0.000000
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
[1] = { [1] = {
fov = 70, fov = 70,
velocity = 12, velocity = 12,
pos1 = Vector(5062.544434, 3264.783447, 136.604355), pos1 = Vector(5062.544434, 3264.783447, 136.604355),
pos2 = Vector(5031.821777, 3866.334961, 120.090790), pos2 = Vector(5031.821777, 3866.334961, 120.090790),
ang1 = Angle(0.370070, 90.952415, 0.000000), ang1 = Angle(0.370070, 90.952415, 0.000000),
ang2 = Angle(0.898059, 56.421352, 0.000000) ang2 = Angle(0.898059, 56.421352, 0.000000)
}, },
[2] = { [2] = {
fov = 80, fov = 80,
velocity = 16, velocity = 12,
pos1 = Vector(6879, 4135, 72), pos1 = Vector(6879, 4135, 72),
pos2 = Vector(8760, 2740, 86), pos2 = Vector(8760, 2740, 86),
ang1 = Angle(0.686861, -43.159401, 0.000000), ang1 = Angle(0.686861, -43.159401, 0.000000),
ang2 = Angle(1, -104, 0) ang2 = Angle(1, -104, 0)
}, },
[3] = { [3] = {
fov = 70, fov = 70,
velocity = 12, velocity = 12,
pos1 = Vector( 8917, 2194, 83 ), pos1 = Vector( 8917, 2194, 83 ),
pos2 = Vector( 8312, 2265, 83 ), pos2 = Vector( 8312, 2265, 83 ),
ang1 = Angle( 2, -123, 0 ), ang1 = Angle( 2, -123, 0 ),
ang2 = Angle( 3, -41, 0 ) ang2 = Angle( 3, -41, 0 )
}, },
[4] = { [4] = {
fov = 70, fov = 70,
velocity = 12, velocity = 12,
pos1 = Vector( 10860.154297, 3337.662109, 141.101013 ), pos1 = Vector( 10860.154297, 3337.662109, 141.101013 ),
pos2 = Vector( 10881.356445, 5483.074219, 132.792114 ), pos2 = Vector( 10881.356445, 5483.074219, 132.792114 ),
ang1 = Angle( 0.052806, 85.319626, 0.000000 ), ang1 = Angle( 0.052806, 85.319626, 0.000000 ),
ang2 = Angle( -0.105593, 90.978638, 0.000000 ) ang2 = Angle( -0.105593, 90.978638, 0.000000 )
}, },
[5] = { [5] = {
fov = 60, fov = 60,
velocity = 12, velocity = 16,
pos1 = Vector( 3114.608887, -13817.962891, 82.778885 ), pos1 = Vector( 6830.229004, 9614.283203, 105.920792 ),
pos2 = Vector( 5247.718262, -14413.496094, 74.946350 ), pos2 = Vector( 6675.346191, 9711.740234, 102.549484 ),
ang1 = Angle( 0.844603, -15.770578, 0.000000 ), ang1 = Angle( 1.055771, 147.803604, 0.000000 ),
ang2 = Angle( 2.006202, 37.927032, 0.000000 ) ang2 = Angle( 1.055771, 149.803604, 0.000000 )
}, },
[6] = { [6] = {
fov = 60, fov = 60,
velocity = 12, velocity = 15,
pos1 = Vector( 6830.229004, 9614.283203, 105.920792 ), pos1 = Vector( 3114.608887, -13817.962891, 82.778885 ),
pos2 = Vector( 6675.346191, 9711.740234, 102.549484 ), pos2 = Vector( 5247.718262, -14413.496094, 74.946350 ),
ang1 = Angle( 1.055771, 147.803604, 0.000000 ), ang1 = Angle( 0.844603, -15.770578, 0.000000 ),
ang2 = Angle( 1.055771, 149.803604, 0.000000 ) ang2 = Angle( 2.006202, 37.927032, 0.000000 )
} },
} [7] = {
fov = 60,
velocity = 14,
pos1 = Vector( 4964.591797, 4514.272461, 213.532272 ),
pos2 = Vector( 5047.838379, 3216.407959, 128.219254 ),
ang1 = Angle( 8.131199, -77.082695, 0.000000 ),
ang2 = Angle( 0.422407, -89.520081, 0.000000 )
}
}
} }
function intro.open( dt ) function intro.open( dt )
local chars = dt.cont local chars = dt.cont
local resScale = Quantum.Client.ResolutionScale local resScale = Quantum.Client.ResolutionScale
local sw, sh = ScrW(), ScrH() local sw, sh = ScrW(), ScrH()
local padding = 10 * resScale local padding = 10 * resScale
local padding_s = 4 * resScale local padding_s = 4 * resScale
if( !f ) then if( !f ) then
Quantum.Client.IsInMenu = true -- hide the hud Quantum.Client.IsInMenu = true -- hide the hud
local f = vgui.Create( "DFrame" ) local f = vgui.Create( "DFrame" )
f:SetSize( sw, sh ) f:SetSize( sw, sh )
f:SetTitle( "" ) f:SetTitle( "" )
f:ShowCloseButton( false ) f:ShowCloseButton( false )
f.Paint = function( self, w, h ) f.Paint = function( self, w, h )
surface.SetDrawColor( Color( 20, 20, 20, 255 ) ) surface.SetDrawColor( Color( 20, 20, 20, 255 ) )
local height = 90 * resScale local height = 90 * resScale
surface.DrawRect( 0, 0, w, 90 * resScale ) surface.DrawRect( 0, 0, w, 90 * resScale )
surface.DrawRect( 0, h - height, w, height ) surface.DrawRect( 0, h - height, w, height )
end end
f:SetDraggable( false ) f:SetDraggable( false )
f:MakePopup() f:MakePopup()
function f:OnClose() function f:OnClose()
Quantum.Client.IsInMenu = false Quantum.Client.IsInMenu = false
Quantum.Client.Cam.Stop() -- stop the cinematic Quantum.Client.Cam.Stop() -- stop the cinematic
end end
f.w, f.h = f:GetSize() f.w, f.h = f:GetSize()
--- MUSIC --- f.Think = function( self )
--surface.PlaySound( "music/HL1_song10.mp3" ) -- too short if( Quantum.Client.Cam.Temp.Finished == true ) then self:Close() end -- if the scene is finished then close the menu and exit the cinematic
--surface.PlaySound( "music/HL2_song23_SuitSong3.mp3" ) end
--LocalPlayer():EmitSound("Quantum_Music_TriangeAtDawn")
local skip = vgui.Create( "DButton", f ) --- MUSIC ---
skip:SetText( "Skip Intro" ) --surface.PlaySound( "music/HL1_song10.mp3" ) -- too short
skip:SetFont( "q_button_m" ) --surface.PlaySound( "music/HL2_song23_SuitSong3.mp3" )
skip:SetTextColor( Color( 255, 255, 255, 255 ) ) --LocalPlayer():EmitSound("Quantum_Music_TriangeAtDawn")
skip:SizeToContents()
skip.Paint = function( self ) theme.skipbutton( self, Color( 0, 0, 0, 0 ) ) end
skip.w, skip.h = skip:GetSize()
skip:SetPos( f.w - skip.w - padding, f.h - skip.h - padding )
skip.DoClick = function( self )
f:Close()
end
skip.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
Quantum.Client.Cam.Start( scenes[game.GetMap()], false ) -- start the cinematic local skip = vgui.Create( "DButton", f )
skip:SetText( "Skip Intro" )
skip:SetFont( "q_button_m" )
skip:SetTextColor( Color( 255, 255, 255, 255 ) )
skip:SizeToContents()
skip.Paint = function( self ) theme.skipbutton( self, Color( 0, 0, 0, 0 ) ) end
skip.w, skip.h = skip:GetSize()
skip:SetPos( f.w - skip.w - padding, f.h - skip.h - padding )
skip.DoClick = function( self )
f:Close()
end
skip.OnCursorEntered = function() surface.PlaySound( "UI/buttonrollover.wav" ) end
local logdata = { Quantum.Client.Cam.Start( scenes[game.GetMap()], false ) -- start the cinematic
[1] = {
title = "Welcome!",
text = "Welcome to the server! This server is running the Quantum framework which was developed by AlmTech.\n\nDuring this awesome cinematic you will be shown what you can do on the server. Starting with the basics."
},
[2] = {
title = "Classes & Professions",
text = "Professions are the core gameplay where they can unlock certian abilities to craft, cook and gather certain resources. You can learn a profession at any teacher NPC.\n\nYou can have the maximum of 2 professions and if you are skilled enough then some players might hire you."
},
[3] = {
title = "Classes & Professions",
text = "Professions are important where they could lead you to many opportunities.\nThe items produced by certain professions could be sold or traded to NPCs and other players. But keep in mind that everyone might not be as trustworthy as you would have thought."
},
[4] = {
title = "Classes & Professions",
text = "Character classes are also one of many key element to the core gameplay. Some character classes are better at certain things but worse at other things, but your class does not define your journey and you have the freedom to choose whatever you want to do."
},
[5] = {
title = "Different Professions",
text = "There are different kinds of professions. These professions range from gathering resources, crafting items and even combat. But choose wisely becuase " -- insert more text later
}
}
local box = log.createinfobox( logdata, f ) local logdata = {
end [1] = {
title = "Welcome!",
text = "Welcome to the server! This server is running the Quantum framework which was developed by AlmTech.\n\nDuring this awesome cinematic you will be shown what you can do on the server. Starting with the basics."
},
[2] = {
title = "Classes & Professions",
text = "Professions are the core gameplay where they can unlock certian abilities to craft, cook and gather certain resources. You can learn a profession at any teacher NPC.\n\nYou can have the maximum of 2 professions and if you are skilled enough then some players might hire you."
},
[3] = {
title = "Classes & Professions",
text = "Professions are important where they could lead you to many opportunities.\nThe items produced by certain professions could be sold or traded to NPCs and other players. But keep in mind that everyone might not be as trustworthy as you would have thought."
},
[4] = {
title = "Classes & Professions",
text = "Character classes are also one of many key element to the core gameplay. Some character classes are better at certain things but worse at other things, but your class does not define your journey and you have the freedom to choose whatever you want to do."
},
[5] = {
title = "Factions & Zones",
text = "As a citizen on the server you can join or create your own faction. Factions are considered as an organization where players can band together to achieve goals and dominate a certain area on the map. But be aware that there exists more than one faction."
},
[6] = {
title = "Factions & Zones",
text = "All factions can controll zones if they have enough resources. Some zones/areas of the map contain different resources than others, therefore they might be more valuable to the other factions.\nA zone can be taken over by any faction but there might be competition which might conclude in a war."
},
[7] = {
title = "Questions & Help",
text = "If you have any questions about the server just join our discord server and we will be more than happy to give you a answer. If you need help with something in-game then you might consider contacting a 'Server-Master' which are the moderators of the server. Good luck!"
}
}
local box = log.createinfobox( logdata, f )
end
end end
return intro return intro

@ -0,0 +1,77 @@
-- __ _ _______ _ __
-- / / /\ | | |__ __| | | \ \
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
local main = {}
local theme = Quantum.Client.Menu.GetAPI( "theme" )
local scenes = {
["rp_truenorth_v1a_livin"] = {
[1] = {
[1] = {
fov = 60,
velocity = 1,
pos1 = Vector( 3473.962158, -5456.522949, 4205.845703 ),
ang1 = Angle( 6.283165, -108.298935, 0.000000 )
}
},
[2] = {
[1] = {
fov = 70,
velocity = 1,
pos1 = Vector( 10481.976562, -6193.810059, 5464.451172 ),
ang1 = Angle( 3.220725, 103.288849, 0.000000 )
}
},
[3] = {
[1] = {
fov = 85,
velocity = 1,
pos1 = Vector( 6285.742676, -14192.770508, 53.289391 ),
ang1 = Angle( -0.052740, 158.862747, 0.000000 )
}
},
[4] = {
[1] = {
fov = 85,
velocity = 1,
pos1 = Vector( -11803.785156, -13864.571289, -39.331917 ),
ang1 = Angle( 7.180876, 118.805817, 0.000000 )
}
}
}
}
function main.open(dt)
if( !f ) then
Quantum.Client.IsInMenu = true -- hide the hud
local resScale = Quantum.Client.ResolutionScale
local sw, sh = ScrW(), ScrH()
local padding = 10 * resScale
local padding_s = 4 * resScale
local f = vgui.Create( "DFrame" )
f:SetSize( sw, sh )
f:SetTitle( "" )
f:IsDraggable( false )
f:MakePopup()
f.Paint = function( self )
theme.renderblur( self, 2, 7 )
end
f.OnClose = function( self )
Quantum.Client.IsInMenu = false
Quantum.Client.Cam.Stop()
end
Quantum.Client.Cam.Start( scenes[ game.GetMap() ][math.random( 1, table.Count(scenes[ game.GetMap() ])) ], false )
end
end
return main

@ -5,53 +5,56 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / -- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Client.Cam = {} Quantum.Client.Cam = {}
function Quantum.Client.Cam.InvertAngle( ang ) return Angle( -ang.x, ang.y, -ang.z ) end -- Flip the camera 180* relative to target function Quantum.Client.Cam.InvertAngle( ang ) return Angle( -ang.x, ang.y, -ang.z ) end -- Flip the camera 180* relative to target
function Quantum.Client.Cam.Stop() function Quantum.Client.Cam.Stop()
hook.Remove( "CalcView", "Quantum_Cinematic" ) hook.Remove( "CalcView", "Quantum_Cinematic" )
Quantum.Client.Cam.Temp.scene_index = nil -- remove the var becuase it is unneeded Quantum.Client.Cam.Temp.scene_index = nil -- remove the var becuase it is unneeded
Quantum.Debug( "Stopped cinematic." ) Quantum.Debug( "Stopped cinematic." )
end end
function Quantum.Client.Cam.Start( scene, loop ) function Quantum.Client.Cam.Start( scene, loop )
local frac = 0 local frac = 0
local time -- speed of the camera ( how long till it reaches its finish point ) local time -- speed of the camera ( how long till it reaches its finish point )
local fov local fov
Quantum.Client.Cam.Temp = {} Quantum.Client.Cam.Temp = {}
Quantum.Client.Cam.Temp.scene_index = 1 Quantum.Client.Cam.Temp.Finished = false
Quantum.Client.Cam.Temp.scene_index = 1
local view = {} -- calcview vector data
local view = {} -- calcview vector data
hook.Remove( "CalcView", "Quantum_Cinematic" ) -- if a cinematic is already running; cancel it
hook.Remove( "CalcView", "Quantum_Cinematic" ) -- if a cinematic is already running; cancel it
hook.Add( "CalcView", "Quantum_Cinematic", function( ply, pos, ang, fov )
time = scene[Quantum.Client.Cam.Temp.scene_index].velocity || 5 hook.Add( "CalcView", "Quantum_Cinematic", function( ply, pos, ang, fov )
fov = scene[Quantum.Client.Cam.Temp.scene_index].fov || 20 time = scene[Quantum.Client.Cam.Temp.scene_index].velocity || 5
frac = math.Clamp( frac + FrameTime()/time, 0, 1 ) fov = scene[Quantum.Client.Cam.Temp.scene_index].fov || 20
if( frac <= 0 ) then return end frac = math.Clamp( frac + FrameTime()/time, 0, 1 )
if( frac <= 0 ) then return end
scene[Quantum.Client.Cam.Temp.scene_index].pos2 = scene[Quantum.Client.Cam.Temp.scene_index].pos2 || scene[Quantum.Client.Cam.Temp.scene_index].pos1 -- if there is no finish pos then make it stay still at starting pos
scene[Quantum.Client.Cam.Temp.scene_index].ang2 = scene[Quantum.Client.Cam.Temp.scene_index].ang2 || scene[Quantum.Client.Cam.Temp.scene_index].ang1 scene[Quantum.Client.Cam.Temp.scene_index].pos2 = scene[Quantum.Client.Cam.Temp.scene_index].pos2 || scene[Quantum.Client.Cam.Temp.scene_index].pos1 -- if there is no finish pos then make it stay still at starting pos
scene[Quantum.Client.Cam.Temp.scene_index].ang2 = scene[Quantum.Client.Cam.Temp.scene_index].ang2 || scene[Quantum.Client.Cam.Temp.scene_index].ang1
view.origin = LerpVector( frac, scene[Quantum.Client.Cam.Temp.scene_index].pos1, scene[Quantum.Client.Cam.Temp.scene_index].pos2 )
view.angles = LerpAngle( frac, scene[Quantum.Client.Cam.Temp.scene_index].ang1, scene[Quantum.Client.Cam.Temp.scene_index].ang2 ) view.origin = LerpVector( frac, scene[Quantum.Client.Cam.Temp.scene_index].pos1, scene[Quantum.Client.Cam.Temp.scene_index].pos2 )
view.fov = fov view.angles = LerpAngle( frac, scene[Quantum.Client.Cam.Temp.scene_index].ang1, scene[Quantum.Client.Cam.Temp.scene_index].ang2 )
view.drawviewer = true view.fov = fov
view.drawviewer = true
if( view.origin:IsEqualTol( scene[Quantum.Client.Cam.Temp.scene_index].pos2, 1 ) ) then
if( Quantum.Client.Cam.Temp.scene_index + 1 <= #scene ) then if( view.origin:IsEqualTol( scene[Quantum.Client.Cam.Temp.scene_index].pos2, 1 ) ) then
frac = 0 if( Quantum.Client.Cam.Temp.scene_index + 1 <= #scene ) then
Quantum.Client.Cam.Temp.scene_index = Quantum.Client.Cam.Temp.scene_index + 1 frac = 0
end Quantum.Client.Cam.Temp.scene_index = Quantum.Client.Cam.Temp.scene_index + 1
if( Quantum.Client.Cam.Temp.scene_index > #scene ) then -- if all scenes are finished, loop them if loop is enabled else
Quantum.Client.Cam.Temp.scene_index = 1 Quantum.Client.Cam.Temp.Finished = true -- tell the menu that the scene is finished
end end
-- otherwise it will just stop at the end. if( Quantum.Client.Cam.Temp.scene_index > #scene ) then -- if all scenes are finished, loop them if loop is enabled
end Quantum.Client.Cam.Temp.scene_index = 1
end
return view -- otherwise it will just stop at the end.
end) end
return view
end)
end end

@ -9,102 +9,102 @@ Quantum.Server.Char = {}
Quantum.Server.Char.Players = {} Quantum.Server.Char.Players = {}
local function CreateCharTable( args ) local function CreateCharTable( args )
return { return {
name = args.name || "UNKNOWN", name = args.name || "UNKNOWN",
class = Quantum.Classes[args.class] || Quantum.Classes[1], class = Quantum.Classes[args.class] || Quantum.Classes[1],
maxhealth = Quantum.Server.Settings.MaxHealth, maxhealth = Quantum.Server.Settings.MaxHealth,
health = args.health || Quantum.Server.Settings.MaxHealth, health = args.health || Quantum.Server.Settings.MaxHealth,
model = Quantum.Classes[args.class].Models[args.gender][args.modelIndex] || "models/player.mdl", model = Quantum.Classes[args.class].Models[args.gender][args.modelIndex] || "models/player.mdl",
money = args.money || Quantum.Server.Settings.StarterMoney, money = args.money || Quantum.Server.Settings.StarterMoney,
inventory = args.inventory || {}, -- create new inventory later inventory = args.inventory || {}, -- create new inventory later
jobs = args.jobs || { jobs = args.jobs || {
[1] = { title = "Unemployed", level = -1 }, [1] = { title = "Unemployed", level = -1 },
}, },
skills = args.skills || { skills = args.skills || {
crafting = 0, crafting = 0,
cooking = 0, cooking = 0,
combat = 0, combat = 0,
science = 0 science = 0
}, },
training = args.training || {}, training = args.training || {},
licenses = args.licenses || {}, licenses = args.licenses || {},
titles = args.titles || {} titles = args.titles || {}
} }
end end
function Quantum.Server.Char.Load( pl, index, tbl ) function Quantum.Server.Char.Load( pl, index, tbl )
local id = pl:SteamID() .. ";" .. index local id = pl:SteamID() .. ";" .. index
if( Quantum.Server.Char.Players[ id ] == nil ) then if( Quantum.Server.Char.Players[ id ] == nil ) then
Quantum.Server.Char.Players[ id ] = CreateCharTable( tbl ) -- create the character Quantum.Server.Char.Players[ id ] = CreateCharTable( tbl ) -- create the character
Quantum.Server.Char.Players[ id ].inventory = tbl.inventory || Quantum.Server.Inventory.Create( Quantum.Server.Char.Players[ id ] ) -- give the character an inventory Quantum.Server.Char.Players[ id ].inventory = tbl.inventory || Quantum.Server.Inventory.Create( Quantum.Server.Char.Players[ id ] ) -- give the character an inventory
Quantum.Debug( "Created character (" .. id .. ")" ) Quantum.Debug( "Created character (" .. id .. ")" )
return Quantum.Server.Char.Players[ id ] return Quantum.Server.Char.Players[ id ]
else else
Quantum.Error( "Tried to duplicate character! Index already used. (" .. id .. ")" ) Quantum.Error( "Tried to duplicate character! Index already used. (" .. id .. ")" )
end end
end end
function Quantum.Server.Char.Remove( pl, index ) function Quantum.Server.Char.Remove( pl, index )
local id = pl:SteamID() .. ":" .. index local id = pl:SteamID() .. ":" .. index
if( Quantum.Server.Char.Players[ id ] ~= nil ) then if( Quantum.Server.Char.Players[ id ] ~= nil ) then
Quantum.Server.Char.Players[ id ] = nil Quantum.Server.Char.Players[ id ] = nil
Quantum.Debug( "Removed character (" .. id .. ")" ) Quantum.Debug( "Removed character (" .. id .. ")" )
end end
end end
function Quantum.Server.Char.GetCurrentCharacter( pl ) function Quantum.Server.Char.GetCurrentCharacter( pl )
if( pl.character == nil ) then Quantum.Error( tostring( pl ) .. " doesn't have a character! Unable to get current character table." ) end if( pl.character == nil ) then Quantum.Error( tostring( pl ) .. " doesn't have a character! Unable to get current character table." ) end
return pl.character return pl.character
end end
local function setupCharacter( pl, char ) local function setupCharacter( pl, char )
pl:Spawn() pl:Spawn()
pl:SetMaxHealth( char.maxhealth ) pl:SetMaxHealth( char.maxhealth )
pl:SetHealth( char.health ) pl:SetHealth( char.health )
pl:SetModel( char.model ) pl:SetModel( char.model )
end end
function Quantum.Server.Char.SetCurrentCharacter( pl, index ) function Quantum.Server.Char.SetCurrentCharacter( pl, index )
local id = pl:SteamID() .. ";" .. index local id = pl:SteamID() .. ";" .. index
if( Quantum.Server.Char.Players[ id ] ) then if( Quantum.Server.Char.Players[ id ] ) then
pl.character = Quantum.Server.Char.Players[ id ] pl.character = Quantum.Server.Char.Players[ id ]
pl.charindex = index pl.charindex = index
setupCharacter( pl, pl.character ) setupCharacter( pl, pl.character )
return pl.character return pl.character
else else
Quantum.Error( "Unable to set " .. tostring(pl) .. " character (" .. id .. "). Character not found!" ) Quantum.Error( "Unable to set " .. tostring(pl) .. " character (" .. id .. "). Character not found!" )
return nil return nil
end end
end end
function Quantum.Server.Char.GetPlayerChars( pl ) function Quantum.Server.Char.GetPlayerChars( pl )
local chars = {} local chars = {}
local strtbl = {} local strtbl = {}
for id, char in pairs( Quantum.Server.Char.Players ) do for id, char in pairs( Quantum.Server.Char.Players ) do
strtbl = string.Split( id, ";" ) strtbl = string.Split( id, ";" )
if( strtbl[1] == pl:SteamID() ) then chars[id] = char end if( strtbl[1] == pl:SteamID() ) then chars[id] = char end
end end
return chars return chars
end end
function Quantum.Server.Char.GetCharCount( pl ) function Quantum.Server.Char.GetCharCount( pl )
return table.Count( Quantum.Server.Char.GetPlayerChars( pl ) ) || 0 return table.Count( Quantum.Server.Char.GetPlayerChars( pl ) ) || 0
end end
local function getBasicCharInfo( char ) local function getBasicCharInfo( char )
return { return {
name = char.name, name = char.name,
model = char.model, model = char.model,
class = char.class.Name, class = char.class.Name,
job = char.jobs[1] job = char.jobs[1]
} }
end end
function Quantum.Server.Char.GetPlayerChars_cl( pl ) function Quantum.Server.Char.GetPlayerChars_cl( pl )
local chars = {} local chars = {}
for id, char in pairs( Quantum.Server.Char.GetPlayerChars( pl ) ) do for id, char in pairs( Quantum.Server.Char.GetPlayerChars( pl ) ) do
chars[id] = getBasicCharInfo( char ) chars[id] = getBasicCharInfo( char )
end end
return chars return chars
end end

@ -8,35 +8,35 @@
Quantum.Server.Inventory = {} Quantum.Server.Inventory = {}
function Quantum.Server.Inventory.Create( char ) function Quantum.Server.Inventory.Create( char )
char.inventory = {} char.inventory = {}
for i = 1, Quantum.Server.Settings.Inventory.Width do for i = 1, Quantum.Server.Settings.Inventory.Width do
char.inventory[i] = {} char.inventory[i] = {}
end end
for h, v in pairs( char.inventory ) do for h, v in pairs( char.inventory ) do
for w = 1, Quantum.Server.Settings.Inventory.Height do for w = 1, Quantum.Server.Settings.Inventory.Height do
char.inventory[h][w] = 0 char.inventory[h][w] = 0
end end
end end
return char.inventory return char.inventory
end end
local function isEquippable( item ) local function isEquippable( item )
return item.equipable || false return item.equipable || false
end end
function Quantum.Server.Inventory.SetSlotItem( char, x, y, item, amount ) function Quantum.Server.Inventory.SetSlotItem( char, x, y, item, amount )
if( isEquippable( item ) ) then if( isEquippable( item ) ) then
amount = 1 amount = 1
char.inventory[x][y] = { item } char.inventory[x][y] = { item }
else else
amount = amount || 1 amount = amount || 1
char.inventory[x][y] = { item, amount } char.inventory[x][y] = { item, amount }
end end
Quantum.Debug( "Gave " .. char.name .. " " .. amount .. " [" .. item.name .. "]" ) Quantum.Debug( "Gave " .. char.name .. " " .. amount .. " [" .. item.name .. "]" )
return return
end end
function Quantum.Server.Inventory.GetSlotItem( char, x, y ) return char.inventory[x][y] end function Quantum.Server.Inventory.GetSlotItem( char, x, y ) return char.inventory[x][y] end

@ -110,7 +110,7 @@ local function runNetFunc( pl, func, args )
end end
net.Receive( "quantum_menu_button_net", function( len, pl ) net.Receive( "quantum_menu_button_net", function( len, pl )
local funcid = net.ReadString() local funcid = net.ReadString()
local args = net.ReadTable() local args = net.ReadTable()
runNetFunc( pl, funcid, args ) runNetFunc( pl, funcid, args )
end) end)

@ -7,15 +7,15 @@
local menus = { local menus = {
character = function( pl ) character = function( pl )
Quantum.Net.OpenMenu( pl, "character", Quantum.Server.Char.GetPlayerChars( pl ) ) Quantum.Net.OpenMenu( pl, "character", Quantum.Server.Char.GetPlayerChars( pl ) )
end end
} }
function Quantum.Server.OpenMenu( pl, menu ) function Quantum.Server.OpenMenu( pl, menu )
if( menus[menu] ) then if( menus[menu] ) then
menus[menu]( pl ) menus[menu]( pl )
else else
Quantum.Error( "Tried to open a non-exsistent menu for " .. tostring(pl) .. "." ) Quantum.Error( "Tried to open a non-exsistent menu for " .. tostring(pl) .. "." )
end end
end end

@ -9,15 +9,15 @@ Quantum.Item = {}
Quantum.Items = {} Quantum.Items = {}
function Quantum.Item.Create( id, args ) function Quantum.Item.Create( id, args )
local item = { local item = {
name = args.name, -- items name name = args.name, -- items name
desc = args.desc, -- items description desc = args.desc, -- items description
icon = args.icon, -- items icon icon = args.icon, -- items icon
stack = args.stack, -- items max stack size stack = args.stack, -- items max stack size
soulbound = args.soulbound, -- if item could be dropped/traded to other players soulbound = args.soulbound, -- if item could be dropped/traded to other players
rarity = args.rarity, -- rarity of the item rarity = args.rarity, -- rarity of the item
usefunction = args.usefunction, -- use function usefunction = args.usefunction, -- use function
consumefunction = args.consumefunction, --consume function consumefunction = args.consumefunction, --consume function
equipfunction = args.equipfunction -- equip function equipfunction = args.equipfunction -- equip function
} }
end end

@ -9,17 +9,17 @@ local prefix
if CLIENT then prefix = "[Quantum] : " else prefix = "" end -- A little advertisement for the players if CLIENT then prefix = "[Quantum] : " else prefix = "" end -- A little advertisement for the players
function Quantum.Debug( txt ) -- Very usefull for debugging function Quantum.Debug( txt ) -- Very usefull for debugging
if( txt ) then if( txt ) then
MsgC( Color( 200, 200, 200 ), prefix .. "[Debug] " .. txt .. "\n" ) MsgC( Color( 200, 200, 200 ), prefix .. "[Debug] " .. txt .. "\n" )
else else
MsgC( Color( 200, 200, 200 ), prefix .. "[Debug]\n" ) MsgC( Color( 200, 200, 200 ), prefix .. "[Debug]\n" )
end end
end end
function Quantum.Error( txt ) function Quantum.Error( txt )
if( txt ) then if( txt ) then
MsgC( Color( 255, 10, 10 ), prefix .. "[ERROR] " .. txt .. "\n" ) MsgC( Color( 255, 10, 10 ), prefix .. "[ERROR] " .. txt .. "\n" )
else else
return return
end end
end end

@ -6,106 +6,106 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
if SERVER then if SERVER then
AddCSLuaFile( "engine/sh_debug.lua" ) AddCSLuaFile( "engine/sh_debug.lua" )
AddCSLuaFile( "settings/sh_settings.lua" ) AddCSLuaFile( "settings/sh_settings.lua" )
AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" ) AddCSLuaFile( "shared.lua" )
-- Content -- -- Content --
local path = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png" local path = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png"
resource.AddSingleFile( path ) resource.AddSingleFile( path )
include( "shared.lua" ) -- include( "shared.lua" ) --
Quantum.Server = {} Quantum.Server = {}
include( "settings/sv_settings.lua" ) -- include the settings include( "settings/sv_settings.lua" ) -- include the settings
local function loadCoreFiles() local function loadCoreFiles()
local fol = GM.FolderName .. "/gamemode/engine/core/" local fol = GM.FolderName .. "/gamemode/engine/core/"
MsgC( "\n" ) MsgC( "\n" )
Quantum.Debug( "Loading core files..." ) Quantum.Debug( "Loading core files..." )
-- Shared files -- Shared files
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do for _, file in pairs( shFiles ) do
AddCSLuaFile( fol .. file ) AddCSLuaFile( fol .. file )
include( fol .. file ) include( fol .. file )
Quantum.Debug( "(CORE) Loaded: " .. fol .. file ) Quantum.Debug( "(CORE) Loaded: " .. fol .. file )
end end
-- CLient files -- CLient files
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do for _, file in pairs( clFiles ) do
AddCSLuaFile( fol .. "client/" .. file ) AddCSLuaFile( fol .. "client/" .. file )
Quantum.Debug( "(CORE) Loaded: " .. fol .. "client/" .. file ) Quantum.Debug( "(CORE) Loaded: " .. fol .. "client/" .. file )
end end
-- Server files -- Server files
local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" )
for _, file in pairs( cFiles ) do for _, file in pairs( cFiles ) do
include( fol .. "server/" .. file ) include( fol .. "server/" .. file )
Quantum.Debug( "(CORE) Loaded: " .. fol .. "server/" .. file ) Quantum.Debug( "(CORE) Loaded: " .. fol .. "server/" .. file )
end end
end end
local function loadLibFiles() local function loadLibFiles()
local fol = GM.FolderName .. "/gamemode/engine/lib/" local fol = GM.FolderName .. "/gamemode/engine/lib/"
MsgC( "\n" ) MsgC( "\n" )
Quantum.Debug( "Loading libraries..." ) Quantum.Debug( "Loading libraries..." )
-- Shared files -- Shared files
local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" )
for _, file in pairs( shFiles ) do for _, file in pairs( shFiles ) do
AddCSLuaFile( fol .. file ) AddCSLuaFile( fol .. file )
include( fol .. file ) include( fol .. file )
Quantum.Debug( "Added library: " .. fol .. file ) Quantum.Debug( "Added library: " .. fol .. file )
end end
-- CLient files -- CLient files
local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" )
for _, file in pairs( clFiles ) do for _, file in pairs( clFiles ) do
AddCSLuaFile( fol .. "client/" .. file ) AddCSLuaFile( fol .. "client/" .. file )
Quantum.Debug( "Added library: " .. fol .. "client/" .. file ) Quantum.Debug( "Added library: " .. fol .. "client/" .. file )
end end
-- Server files -- Server files
local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" )
for _, file in pairs( cFiles ) do for _, file in pairs( cFiles ) do
include( fol .. "server/" .. file ) include( fol .. "server/" .. file )
Quantum.Debug( "Added library: " .. fol .. "server/" .. file ) Quantum.Debug( "Added library: " .. fol .. "server/" .. file )
end end
end end
local function addAllDermaMenus() local function addAllDermaMenus()
local fol = GM.FolderName .. "/gamemode/engine/derma/" local fol = GM.FolderName .. "/gamemode/engine/derma/"
MsgC( "\n" ) MsgC( "\n" )
Quantum.Debug( "Loading menus...") Quantum.Debug( "Loading menus...")
AddCSLuaFile( fol .. "cl_menu.lua" ) AddCSLuaFile( fol .. "cl_menu.lua" )
-- add all the menu libs -- add all the menu libs
local libfol = fol .. "lib/" local libfol = fol .. "lib/"
local libFiles = file.Find( libfol .. "cl_*.lua", "LUA" ) local libFiles = file.Find( libfol .. "cl_*.lua", "LUA" )
for _, file in pairs( libFiles ) do for _, file in pairs( libFiles ) do
AddCSLuaFile( libfol .. file ) AddCSLuaFile( libfol .. file )
Quantum.Debug( "Added library: " .. libfol .. file ) Quantum.Debug( "Added library: " .. libfol .. file )
end end
-- add the menu's -- add the menu's
local menufol = GM.FolderName .. "/gamemode/engine/derma/menus/" local menufol = GM.FolderName .. "/gamemode/engine/derma/menus/"
local menuFiles = file.Find( menufol .. "menu_*.lua", "LUA" ) local menuFiles = file.Find( menufol .. "menu_*.lua", "LUA" )
for _, file in pairs( menuFiles ) do for _, file in pairs( menuFiles ) do
AddCSLuaFile( menufol .. file ) AddCSLuaFile( menufol .. file )
Quantum.Debug( "Added menu: " .. menufol .. file ) Quantum.Debug( "Added menu: " .. menufol .. file )
end end
end end
function Quantum.Server.Load() function Quantum.Server.Load()
-- Add all of the base files -- Add all of the base files
loadCoreFiles() loadCoreFiles()
loadLibFiles() loadLibFiles()
addAllDermaMenus() addAllDermaMenus()
end end
Quantum.Server.Load() Quantum.Server.Load()
end end

@ -8,51 +8,51 @@
Quantum.CharacterLimit = 5 Quantum.CharacterLimit = 5
Quantum.Models = { Quantum.Models = {
NPC = {}, NPC = {},
Player = { Player = {
Citizen = { Citizen = {
Male = { Male = {
"models/player/Group01/male_01.mdl", "models/player/Group01/male_01.mdl",
"models/player/Group01/male_02.mdl", "models/player/Group01/male_02.mdl",
"models/player/Group01/male_03.mdl", "models/player/Group01/male_03.mdl",
"models/player/Group01/male_04.mdl", "models/player/Group01/male_04.mdl",
"models/player/Group01/male_05.mdl", "models/player/Group01/male_05.mdl",
"models/player/Group01/male_06.mdl", "models/player/Group01/male_06.mdl",
"models/player/Group01/male_07.mdl", "models/player/Group01/male_07.mdl",
"models/player/Group01/male_08.mdl", "models/player/Group01/male_08.mdl",
"models/player/Group01/male_09.mdl" "models/player/Group01/male_09.mdl"
}, },
Female = { Female = {
"models/player/group01/female_01.mdl", "models/player/group01/female_01.mdl",
"models/player/group01/female_02.mdl", "models/player/group01/female_02.mdl",
"models/player/group01/female_03.mdl", "models/player/group01/female_03.mdl",
"models/player/group01/female_04.mdl", "models/player/group01/female_04.mdl",
"models/player/group01/female_05.mdl", "models/player/group01/female_05.mdl",
"models/player/group01/female_06.mdl" "models/player/group01/female_06.mdl"
} }
}, },
Nobleman = { Nobleman = {
Male = { "models/player/breen.mdl" }, Male = { "models/player/breen.mdl" },
Female = { "models/player/alyx.mdl" } Female = { "models/player/alyx.mdl" }
} }
} }
} }
Quantum.Classes = { Quantum.Classes = {
Commoner = { -- id Commoner = { -- id
Name = "Commoner", Name = "Commoner",
Desc = "Someone who lives in a city.", Desc = "Someone who lives in a city.",
Models = Quantum.Models.Player.Citizen Models = Quantum.Models.Player.Citizen
}, },
Nobleman = { Nobleman = {
Name = "Nobleman", Name = "Nobleman",
Desc = "A nobleman is someone who originates from a family of wealth and power and tend to look down upon those who are not 'fit' in their eyes. They often expects everyone to do their bidding without question.", Desc = "A nobleman is someone who originates from a family of wealth and power and tend to look down upon those who are not 'fit' in their eyes. They often expects everyone to do their bidding without question.",
Models = Quantum.Models.Player.Nobleman -- change this to better models Models = Quantum.Models.Player.Nobleman -- change this to better models
}, },
Worker = { Worker = {
Name = "Worker", Name = "Worker",
Desc = "A worker is someone who is in the working-class and come from a poor family but has learned the secret of life; how to work hard and earn what you want.", Desc = "A worker is someone who is in the working-class and come from a poor family but has learned the secret of life; how to work hard and earn what you want.",
Models = Quantum.Models.Player.Citizen -- change this to better models Models = Quantum.Models.Player.Citizen -- change this to better models
} }
} }

@ -5,7 +5,7 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / -- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Server.Settings = {} Quantum.Server.Settings = {}
Quantum.Server.Settings.VoiceChatRange = 400 Quantum.Server.Settings.VoiceChatRange = 400
@ -14,8 +14,8 @@ Quantum.Server.Settings.MaxHealth = 100
Quantum.Server.Settings.StarterMoney = 0 Quantum.Server.Settings.StarterMoney = 0
Quantum.Server.Settings.Inventory = { Quantum.Server.Settings.Inventory = {
Height = 5, Height = 5,
Width = 5 Width = 5
} }
--- Features to be added --- --- Features to be added ---
@ -25,53 +25,53 @@ Quantum.Server.Settings.MaxSkillLevel = 100
Quantum.Server.Settings.SpawnLocations = { Quantum.Server.Settings.SpawnLocations = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {
["Hospital"] = { pos = Vector( 13583, 13189, 128 ), ang = Angle( 1, 115, 0 ) }, ["Hospital"] = { pos = Vector( 13583, 13189, 128 ), ang = Angle( 1, 115, 0 ) },
["Lake"] = { pos = Vector( 10812, -8319, 5388 ), ang = Angle( 5, -40, 0 ) } ["Lake"] = { pos = Vector( 10812, -8319, 5388 ), ang = Angle( 5, -40, 0 ) }
} }
} }
Quantum.Server.Settings.Licenses = { Quantum.Server.Settings.Licenses = {
Driving = { title = "Driving License", desc = "This permits you to operate and pilot any motorized vehicle in a public area.", cost = 1000 } Driving = { title = "Driving License", desc = "This permits you to operate and pilot any motorized vehicle in a public area.", cost = 1000 }
} }
Quantum.Server.Settings.Titles = { Quantum.Server.Settings.Titles = {
dev = "Developer," dev = "Developer,"
} }
Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitgroup Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitgroup
[HITGROUP_HEAD] = 10, [HITGROUP_HEAD] = 10,
[HITGROUP_CHEST] = 4, [HITGROUP_CHEST] = 4,
[HITGROUP_STOMACH] = 2, [HITGROUP_STOMACH] = 2,
[HITGROUP_LEFTARM] = 1, [HITGROUP_LEFTARM] = 1,
[HITGROUP_RIGHTARM] = 1, [HITGROUP_RIGHTARM] = 1,
[HITGROUP_LEFTLEG] = 1, [HITGROUP_LEFTLEG] = 1,
[HITGROUP_RIGHTLEG] = 1 [HITGROUP_RIGHTLEG] = 1
} }
Quantum.Server.Settings.PainSounds = {} Quantum.Server.Settings.PainSounds = {}
Quantum.Server.Settings.PainSounds.Male = { Quantum.Server.Settings.PainSounds.Male = {
"vo/npc/male01/pain01.wav", "vo/npc/male01/pain01.wav",
"vo/npc/male01/pain02.wav", "vo/npc/male01/pain02.wav",
"vo/npc/male01/pain03.wav", "vo/npc/male01/pain03.wav",
"vo/npc/male01/pain04.wav", "vo/npc/male01/pain04.wav",
"vo/npc/male01/pain05.wav", "vo/npc/male01/pain05.wav",
"vo/npc/male01/pain06.wav", "vo/npc/male01/pain06.wav",
"vo/npc/male01/pain07.wav", "vo/npc/male01/pain07.wav",
"vo/npc/male01/pain08.wav", "vo/npc/male01/pain08.wav",
"vo/npc/male01/pain09.wav" "vo/npc/male01/pain09.wav"
} }
Quantum.Server.Settings.DamageHurtSoundRepeatChance = 90 -- % Quantum.Server.Settings.DamageHurtSoundRepeatChance = 90 -- %
Quantum.Server.Settings.IdlePainSounds = {} Quantum.Server.Settings.IdlePainSounds = {}
Quantum.Server.Settings.IdlePainSounds.Male = { Quantum.Server.Settings.IdlePainSounds.Male = {
"vo/npc/male01/moan01.wav", "vo/npc/male01/moan01.wav",
"vo/npc/male01/moan02.wav", "vo/npc/male01/moan02.wav",
"vo/npc/male01/moan03.wav", "vo/npc/male01/moan03.wav",
"vo/npc/male01/moan04.wav", "vo/npc/male01/moan04.wav",
"vo/npc/male01/moan05.wav" "vo/npc/male01/moan05.wav"
} }

Loading…
Cancel
Save