Improvments

master
AlmTech Software 5 years ago
parent 7af11c9d2c
commit 64e2adc7b3
  1. 29
      gamemode/engine/derma/lib/cl_render.lua
  2. 33
      gamemode/engine/derma/menus/menu_character.lua

@ -7,14 +7,31 @@
local qrender = {} local qrender = {}
function qrender.vmodel( mdl, vec, ang ) function qrender.CreateMdl( mdl, vec, ang )
render.Model( { Quantum.Debug( "CSEnt created." )
model = mdl,
pos = vec,
angle = ang
} )
local ent = ClientsideModel( mdl )
ent:SetPos( vec )
ent:SetAngles( ang )
return ent
end
function qrender.SetModel( ent, model )
if( ent:GetModel() != model ) then
ent:SetModel( model )
else
return
end
end
function qrender.delCSent( ent )
if( IsValid(ent) ) then
Quantum.Debug( "CSEnt removed." )
ent:Remove()
end
end end
return qrender return qrender

@ -79,16 +79,16 @@ local function runIntroCinematic( parent, char )
end end
local modelLocations = { local modelLocations = {
["rp_dunwood_eu"] = { -- ["rp_dunwood_eu"] = {
["charselect"] = { -- ["charselect"] = {
pos = Vector( -7553.9194335938, 13563.834960938, 256.03125 ), -- pos = Vector( -7553.9194335938, 13563.834960938, 256.03125 ),
ang = Angle( 46.707160949707, -47.234722137451, 0 ) -- ang = Angle( 0, -47.234722137451, 0 )
}, -- },
["charcreate"] = { -- ["charcreate"] = {
pos = Vector( -7553.9194335938, 13563.834960938, 256.03125 ), -- pos = Vector( -7553.9194335938, 13563.834960938, 256.03125 ),
ang = Angle( 46.707160949707, -47.234722137451, 0 ) -- ang = Angle( 0, -47.234722137451, 0 )
} -- }
} -- }
} }
local pages = { local pages = {
@ -122,9 +122,9 @@ local pages = {
}, },
["rp_dunwood_eu"] = { ["rp_dunwood_eu"] = {
[1] = { [1] = {
fov = 75, fov = 50,
velocity = 10, velocity = 10,
pos1 = Vector( -7419.0327148438, 13390.305664063, 256.03125 ), pos1 = Vector( -7419.0327148438, 13390.305664063, 326.03125 ),
ang1 = Angle( 3.4110288619995, 126.79418945313, 0 ) ang1 = Angle( 3.4110288619995, 126.79418945313, 0 )
} }
} }
@ -337,12 +337,17 @@ local pages = {
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 )
else
mdl.csent = qrender.CreateMdl( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ), modelLocations[ game.GetMap() ]["charselect"].pos, modelLocations[ game.GetMap() ]["charselect"].ang )
end
mdl.OnRemove = function()
qrender.delCSent( mdl.csent )
end end
mdl.Think = function( self ) mdl.Think = function( self )
if( self:GetModel() ~= getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) then if( self:GetModel() ~= getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) then
if( ( modelLocations[ game.GetMap() ] != nil ) ) then if( ( modelLocations[ game.GetMap() ] != nil && self.csent != nil ) ) then
qrender.vmodel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ), modelLocations[ game.GetMap() ]["charselect"].pos, modelLocations[ game.GetMap() ]["charselect"].ang ) qrender.SetModel( self.csent, getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) )
else else
self:SetModel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) ) self:SetModel( getMaxModel( getClassModels(inputs.class)[inputs.gender], inputs.modelIndex ) )
end end

Loading…
Cancel
Save