Permalink
Browse files

Player model selector will always fit game window

  • Loading branch information...
robotboy655 committed Nov 10, 2016
1 parent 5c3c9e4 commit 30951120c759d0362a48b6d1dcde19724c05b4ce
@@ -11,6 +11,9 @@ list.Set( "DesktopWindows", "PlayerEditor", {
height = 700,
onewindow = true,
init = function( icon, window )
window:SetSize( math.min( ScrW() - 16, window:GetWide() ), math.min( ScrH() - 16, window:GetTall() ) )
window:Center()
local mdl = window:Add( "DModelPanel" )
mdl:Dock( FILL )
@@ -55,7 +58,7 @@ list.Set( "DesktopWindows", "PlayerEditor", {
plycol:SetAlphaBar( false )
plycol:SetPalette( false )
plycol:Dock( TOP )
plycol:SetSize( 200, 260 )
plycol:SetSize( 200, math.min( window:GetTall() / 3, 260 ) )
local lbl = controls:Add( "DLabel" )
lbl:SetText( "Physgun color" )
@@ -67,7 +70,7 @@ list.Set( "DesktopWindows", "PlayerEditor", {
wepcol:SetAlphaBar( false )
wepcol:SetPalette( false )
wepcol:Dock( TOP )
wepcol:SetSize( 200, 260 )
wepcol:SetSize( 200, math.min( window:GetTall() / 3, 260 ) )
wepcol:SetVector( Vector( GetConVarString( "cl_weaponcolor" ) ) );
sheet:AddSheet( "Colors", controls, "icon16/color_wheel.png" )
@@ -112,7 +115,6 @@ list.Set( "DesktopWindows", "PlayerEditor", {
end
-- Updating
local function UpdateBodyGroups( pnl, val )
if ( pnl.type == "bgroup" ) then
@@ -229,7 +231,7 @@ list.Set( "DesktopWindows", "PlayerEditor", {
function mdl:DragMouseRelease() self.Pressed = false end
function mdl:LayoutEntity( Entity )
function mdl:LayoutEntity( ent )
if ( self.bAnimated ) then self:RunAnimation() end
if ( self.Pressed ) then
@@ -239,7 +241,7 @@ list.Set( "DesktopWindows", "PlayerEditor", {
self.PressX, self.PressY = gui.MousePos()
end
Entity:SetAngles( self.Angles )
ent:SetAngles( self.Angles )
end
end
@@ -39,9 +39,12 @@ properties.Add( "keepupright", {
local constraint = constraint.Keepupright( ent, Phys:GetAngles(), 0, 999999 )
--I feel like this is not stable enough
-- I feel like this is not stable enough
-- This cannot be implemented without a custom constraint.Keepupright function or modification for proper duplicator support.
--print( constraint:GetSaveTable().m_worldGoalAxis )
--constraint:SetSaveValue( "m_localTestAxis", constraint:GetSaveTable().m_worldGoalAxis ) --ent:GetAngles():Up() )
--constraint:SetSaveValue( "m_worldGoalAxis", Vector( 0, 0, 1 ) )
--constraint:SetSaveValue( "m_bDampAllRotation", true )
if ( constraint ) then

0 comments on commit 3095112

Please sign in to comment.