diff --git a/enhanced_playermodel_selector.psd b/enhanced_playermodel_selector.psd
new file mode 100644
index 0000000..01c9fff
Binary files /dev/null and b/enhanced_playermodel_selector.psd differ
diff --git a/enhanced_playermodel_selector_localization.jpg b/enhanced_playermodel_selector_localization.jpg
new file mode 100644
index 0000000..ef87836
Binary files /dev/null and b/enhanced_playermodel_selector_localization.jpg differ
diff --git a/lua/autorun/enhanced_playermodel_selector/default_playermodels.lua b/lua/autorun/enhanced_playermodel_selector/default_playermodels.lua
new file mode 100644
index 0000000..91ca8ed
--- /dev/null
+++ b/lua/autorun/enhanced_playermodel_selector/default_playermodels.lua
@@ -0,0 +1,101 @@
+
+AddCSLuaFile()
+
+DefaultPlayerModels = {
+ ["models/player/alyx.mdl"] = true,
+ ["models/player/barney.mdl"] = true,
+ ["models/player/breen.mdl"] = true,
+ ["models/player/charple.mdl"] = true,
+ ["models/player/p2_chell.mdl"] = true,
+ ["models/player/corpse1.mdl"] = true,
+ ["models/player/combine_soldier.mdl"] = true,
+ ["models/player/combine_soldier_prisonguard.mdl"] = true,
+ ["models/player/combine_super_soldier.mdl"] = true,
+ ["models/player/eli.mdl"] = true,
+ ["models/player/gman_high.mdl"] = true,
+ ["models/player/kleiner.mdl"] = true,
+ ["models/player/monk.mdl"] = true,
+ ["models/player/mossman.mdl"] = true,
+ ["models/player/mossman_arctic.mdl"] = true,
+ ["models/player/odessa.mdl"] = true,
+ ["models/player/police.mdl"] = true,
+ ["models/player/police_fem.mdl"] = true,
+ ["models/player/magnusson.mdl"] = true,
+ ["models/player/soldier_stripped.mdl"] = true,
+ ["models/player/zombie_classic.mdl"] = true,
+ ["models/player/zombie_fast.mdl"] = true,
+
+ -- Citizens
+ ["models/player/Group01/male_01.mdl"] = true,
+ ["models/player/Group01/male_02.mdl"] = true,
+ ["models/player/Group01/male_03.mdl"] = true,
+ ["models/player/Group01/male_04.mdl"] = true,
+ ["models/player/Group01/male_05.mdl"] = true,
+ ["models/player/Group01/male_06.mdl"] = true,
+ ["models/player/Group01/male_07.mdl"] = true,
+ ["models/player/Group01/male_08.mdl"] = true,
+ ["models/player/Group01/male_09.mdl"] = true,
+ ["models/player/Group01/female_01.mdl"] = true,
+ ["models/player/Group01/female_02.mdl"] = true,
+ ["models/player/Group01/female_03.mdl"] = true,
+ ["models/player/Group01/female_04.mdl"] = true,
+ ["models/player/Group01/female_05.mdl"] = true,
+ ["models/player/Group01/female_06.mdl"] = true,
+
+ -- Refugees
+ ["models/player/Group03/male_01.mdl"] = true,
+ ["models/player/Group03/male_02.mdl"] = true,
+ ["models/player/Group03/male_03.mdl"] = true,
+ ["models/player/Group03/male_04.mdl"] = true,
+ ["models/player/Group03/male_05.mdl"] = true,
+ ["models/player/Group03/male_06.mdl"] = true,
+ ["models/player/Group03/male_07.mdl"] = true,
+ ["models/player/Group03/male_08.mdl"] = true,
+ ["models/player/Group03/male_09.mdl"] = true,
+ ["models/player/Group03/female_01.mdl"] = true,
+ ["models/player/Group03/female_02.mdl"] = true,
+ ["models/player/Group03/female_03.mdl"] = true,
+ ["models/player/Group03/female_04.mdl"] = true,
+ ["models/player/Group03/female_05.mdl"] = true,
+ ["models/player/Group03/female_06.mdl"] = true,
+
+ ["models/player/Group02/male_02.mdl"] = true,
+ ["models/player/Group02/male_04.mdl"] = true,
+ ["models/player/Group02/male_06.mdl"] = true,
+ ["models/player/Group02/male_08.mdl"] = true,
+
+ -- Medics
+ ["models/player/Group03m/male_01.mdl"] = true,
+ ["models/player/Group03m/male_02.mdl"] = true,
+ ["models/player/Group03m/male_03.mdl"] = true,
+ ["models/player/Group03m/male_04.mdl"] = true,
+ ["models/player/Group03m/male_05.mdl"] = true,
+ ["models/player/Group03m/male_06.mdl"] = true,
+ ["models/player/Group03m/male_07.mdl"] = true,
+ ["models/player/Group03m/male_08.mdl"] = true,
+ ["models/player/Group03m/male_09.mdl"] = true,
+ ["models/player/Group03m/female_01.mdl"] = true,
+ ["models/player/Group03m/female_02.mdl"] = true,
+ ["models/player/Group03m/female_03.mdl"] = true,
+ ["models/player/Group03m/female_04.mdl"] = true,
+ ["models/player/Group03m/female_05.mdl"] = true,
+ ["models/player/Group03m/female_06.mdl"] = true,
+
+ ["models/player/skeleton.mdl"] = true,
+ ["models/player/zombie_soldier.mdl"] = true,
+ ["models/player/hostage/hostage_01.mdl"] = true,
+ ["models/player/hostage/hostage_02.mdl"] = true,
+ ["models/player/hostage/hostage_03.mdl"] = true,
+ ["models/player/hostage/hostage_04.mdl"] = true,
+ ["models/player/arctic.mdl"] = true,
+ ["models/player/gasmask.mdl"] = true,
+ ["models/player/guerilla.mdl"] = true,
+ ["models/player/leet.mdl"] = true,
+ ["models/player/phoenix.mdl"] = true,
+ ["models/player/riot.mdl"] = true,
+ ["models/player/swat.mdl"] = true,
+ ["models/player/urban.mdl"] = true,
+ ["models/player/dod_german.mdl"] = true,
+ ["models/player/dod_american.mdl"] = true
+
+}
\ No newline at end of file
diff --git a/lua/autorun/lf_playermodel_selector.lua b/lua/autorun/lf_playermodel_selector.lua
index 2651033..ab700b1 100644
--- a/lua/autorun/lf_playermodel_selector.lua
+++ b/lua/autorun/lf_playermodel_selector.lua
@@ -1,7 +1,8 @@
-- Enhanced PlayerModel Selector
--- Upgraded code by LibertyForce http://steamcommunity.com/id/libertyforce
+-- Upgraded code by LibertyForce https://steamcommunity.com/id/libertyforce
-- Based on: https://github.com/garrynewman/garrysmod/blob/1a2c317eeeef691e923453018236cf9f66ee74b4/garrysmod/gamemodes/sandbox/gamemode/editor_player.lua
+include("enhanced_playermodel_selector/default_playermodels.lua")
local flag = { FCVAR_REPLICATED }
if SERVER then flag = { FCVAR_ARCHIVE, FCVAR_REPLICATED } end
@@ -17,10 +18,8 @@ for cvar, def in pairs( convars ) do
end
flag = nil
-
if SERVER then
-
AddCSLuaFile()
--util.AddNetworkString("lf_playermodel_client_sync")
@@ -211,42 +210,42 @@ local function UpdatePlayerModel( ply )
timer.Simple( 0.1, function() if ply.SetupHands and isfunction( ply.SetupHands ) then ply:SetupHands() end end )
timer.Simple( 0.2, function()
if ply:GetInfo( "cl_playerhands" ) != "" then mdlname = ply:GetInfo( "cl_playerhands" ) end
- local mdlhands = player_manager.TranslatePlayerHands( mdlname )
+ local HandsModel = player_manager.TranslatePlayerHands( mdlname )
- local hands_ent = ply:GetHands()
- if hands_ent and mdlhands and istable( mdlhands ) then
- if hands_ent:GetModel() != mdlhands.model then
+ local HandsEntity = ply:GetHands()
+ if HandsEntity and HandsModel and istable( HandsModel ) then
+ if HandsEntity:GetModel() != HandsModel.model then
if debugmode then print( "LF_PMS: SetupHands failed. Gamemode doesn't implement this function correctly. Trying workaround..." ) end
- if ( IsValid( hands_ent ) ) then
- hands_ent:SetModel( mdlhands.model )
- hands_ent:SetSkin( mdlhands.skin )
- hands_ent:SetBodyGroups( mdlhands.body )
+ if ( IsValid( HandsEntity ) ) then
+ HandsEntity:SetModel( HandsModel.model )
+ HandsEntity:SetSkin( HandsModel.skin )
+ HandsEntity:SetBodyGroups( HandsModel.body )
local skin = ply:GetInfoNum( "cl_playerhandsskin", 0 )
- hands_ent:SetSkin( skin )
+ HandsEntity:SetSkin( skin )
if debugmode then print( "LF_PMS: Set hands model skin to no.: "..tostring( skin ) ) end
local groups = ply:GetInfo( "cl_playerhandsbodygroups" )
if ( groups == nil ) then groups = "" end
local groups = string.Explode( " ", groups )
- for k = 0, hands_ent:GetNumBodyGroups() - 1 do
+ for k = 0, HandsEntity:GetNumBodyGroups() - 1 do
local v = tonumber( groups[ k + 1 ] ) or 0
- hands_ent:SetBodygroup( k, v )
+ HandsEntity:SetBodygroup( k, v )
if debugmode then print( "LF_PMS: Set hands bodygroup no. "..tostring( k ).." to: "..tostring( v ) ) end
end
if debugmode then
timer.Simple( 0.2, function()
- if hands_ent:GetModel() != mdlhands.model then
+ if HandsEntity:GetModel() != HandsModel.model then
print( "LF_PMS: Workaround failed. Unable to setup viewmodel hands. Please check for incompatible addons." )
else
- print( "LF_PMS: Workaround successful. Hands set to: "..mdlhands.model )
+ print( "LF_PMS: Workaround successful. Hands set to: "..HandsModel.model )
end
end )
end
end
else
- if debugmode then print( "LF_PMS: SetupHands successful. Hands set to: "..tostring( mdlhands.model ) ) end
+ if debugmode then print( "LF_PMS: SetupHands successful. Hands set to: "..tostring( HandsModel.model ) ) end
end
else
if debugmode then print( "LF_PMS: ERROR - SetupHands failed. player_manager.TranslatePlayerHands didn't return valid data. Please check for incompatible addons." ) end
@@ -380,10 +379,11 @@ end
if CLIENT then
-local Version = "3.3, Fesiug's Edit"
+local Version = "4.1"
local Menu = { }
-local Frame
-local default_animations = { "idle_all_01", "menu_walk", "pose_standing_02", "pose_standing_03", "idle_fist" }
+local MainWindow
+local default_animations = { "idle_all_01", "menu_walk", "menu_combine", "pose_standing_02", "pose_standing_03", "idle_fist", "menu_gman", "idle_all_scared", "menu_zombie_01", "idle_magic", "walk_ar2" }
+local currentanim = 0
local Favorites = { }
--local addon_vox = false
@@ -406,17 +406,29 @@ if file.Exists( "lf_playermodel_selector/cl_favorites.txt", "DATA" ) then
end
end
+local function RRRotateAroundPoint(pos, ang, point, offset_ang)
+ local mat = Matrix()
+ mat:SetTranslation(pos)
+ mat:SetAngles(ang)
+ mat:Translate(point)
+
+ local rot_mat = Matrix()
+ rot_mat:SetAngles(offset_ang)
+ rot_mat:Invert()
+
+ mat:Mul(rot_mat)
+
+ mat:Translate(-point)
+
+ return mat:GetTranslation(), mat:GetAngles()
+end
CreateClientConVar( "cl_playermodel_selector_force", "1", true, true )
+CreateClientConVar( "cl_playermodel_selector_hide_defaults", "0", true, true )
CreateClientConVar( "cl_playermodel_selector_unlockflexes", "0", false, true )
CreateClientConVar( "cl_playermodel_selector_bgcolor_custom", "1", true, true )
CreateClientConVar( "cl_playermodel_selector_bgcolor_trans", "1", true, true )
-
---net.Start("lf_playermodel_client_sync")
---net.SendToServer()
---net.Receive("lf_playermodel_client_sync", function()
--- addon_vox = net.ReadBool()
---end )
+CreateClientConVar( "cl_playermodel_selector_ignorehands", "1", true, true )
hook.Add( "PostGamemodeLoaded", "lf_playermodel_sboxcvars", function()
CreateConVar( "cl_playercolor", "0.24 0.34 0.41", { FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD }, "The value is a Vector - so between 0-1 - not between 0-255" )
@@ -431,14 +443,14 @@ end )
local function KeyboardOn( pnl )
- if ( IsValid( Frame ) and IsValid( pnl ) and pnl:HasParent( Frame ) ) then
- Frame:SetKeyboardInputEnabled( true )
+ if ( IsValid( MainWindow ) and IsValid( pnl ) and pnl:HasParent( MainWindow ) ) then
+ MainWindow:SetKeyboardInputEnabled( true )
end
end
hook.Add( "OnTextEntryGetFocus", "lf_playermodel_keyboard_on", KeyboardOn )
local function KeyboardOff( pnl )
- if ( IsValid( Frame ) and IsValid( pnl ) and pnl:HasParent( Frame ) ) then
- Frame:SetKeyboardInputEnabled( false )
+ if ( IsValid( MainWindow ) and IsValid( pnl ) and pnl:HasParent( MainWindow ) ) then
+ MainWindow:SetKeyboardInputEnabled( false )
end
end
hook.Add( "OnTextEntryLoseFocus", "lf_playermodel_keyboard_off", KeyboardOff )
@@ -466,19 +478,34 @@ end
concommand.Add( "playermodel_loadfav", LoadFavorite )
+-- Horrible. I hate Garry's Mod
+local HandIconGenerator = GetRenderTarget("HandIconGenerator", 512, 512)
+local myMat2 = CreateMaterial( "HandIconGenerator_RTMat", "UnlitGeneric", {
+ ["$basetexture"] = HandIconGenerator:GetName(), -- Make the material use our render target texture
+ ["$translucent"] = 1,
+ ["$vertexcolor"] = 1,
+ ["$vertexalpha"] = 1,
+} )
+local matshiny = Material("models/shiny")
+local hasbgs = Material("eps/hasbgs4.png", "mips smooth") -- or hasbgs3 idk which better
+
+
+function Menu.UpdateFromConvars()
+ -- wah wah dont error ples
+end
function Menu.Setup()
- Frame = vgui.Create( "DFrame" )
+ MainWindow = vgui.Create( "DFrame" )
local fw, fh = math.min( ScrW() - 16, 960 ), math.min( ScrH() - 16, 700 )
- Frame:SetSize( fw, fh )
- Frame:SetTitle( "Enhanced PlayerModel Selector "..Version )
- Frame:SetVisible( true )
- Frame:SetDraggable( true )
- Frame:SetScreenLock( false )
- Frame:ShowCloseButton( true )
- Frame:Center()
- Frame:MakePopup()
- Frame:SetKeyboardInputEnabled( false )
+ MainWindow:SetSize( fw, fh )
+ MainWindow:SetTitle( string.format(language.GetPhrase("EPS.Title"),Version) )
+ MainWindow:SetVisible( true )
+ MainWindow:SetDraggable( true )
+ MainWindow:SetScreenLock( false )
+ MainWindow:ShowCloseButton( true )
+ MainWindow:Center()
+ MainWindow:MakePopup()
+ MainWindow:SetKeyboardInputEnabled( false )
local r, g, b = 97, 100, 102
if GetConVar( "cl_playermodel_selector_bgcolor_custom" ):GetBool() then
local bgcolor = string.Explode( " ", GetConVar( "cl_playercolor" ):GetString() )
@@ -492,74 +519,84 @@ function Menu.Setup()
end
end
local a = GetConVar( "cl_playermodel_selector_bgcolor_trans" ):GetBool() == true and 127 or 255
- Frame.Paint = function( self, w, h )
+ MainWindow.Paint = function( self, w, h )
draw.RoundedBox( 10, 0, 0, w, h, Color( r, g, b, a ) ) return true
end
- Frame.lblTitle:SetTextColor( Color( 0, 0, 0, 255 ) )
- Frame.lblTitle.Paint = function ( self, w, h )
- draw.SimpleTextOutlined( Frame.lblTitle:GetText(), "DermaDefaultBold", 1, 2, Color( 255, 255, 255, 255), 0, 0, 1, Color( 0, 0, 0, 255) ) return true
+ MainWindow.lblTitle:SetTextColor( Color( 0, 0, 0, 255 ) )
+ MainWindow.lblTitle.Paint = function ( self, w, h )
+ draw.SimpleTextOutlined( MainWindow.lblTitle:GetText(), "DermaDefaultBold", 1, 2, Color( 255, 255, 255, 255), 0, 0, 1, Color( 0, 0, 0, 255) ) return true
end
- Frame.btnMinim:SetEnabled( true )
- Frame.btnMinim.DoClick = function()
- Frame:SetVisible( false )
+ MainWindow.btnMinim:SetEnabled( true )
+ MainWindow.btnMinim.DoClick = function()
+ MainWindow:SetVisible( false )
end
- --Frame.btnMaxim.Paint = function( panel, w, h ) derma.SkinHook( "Paint", "WindowMinimizeButton", panel, w, h ) end
+ --MainWindow.btnMaxim.Paint = function( panel, w, h ) derma.SkinHook( "Paint", "WindowMinimizeButton", panel, w, h ) end
local maxi_allowed = false
local maxi_mode = 0
if ScrW() > fw and ScrH() > fh then maxi_allowed = true end
- Frame.btnMaxim:SetEnabled( maxi_allowed )
- Frame.btnMaxim.DoClick = function()
+ MainWindow.btnMaxim:SetEnabled( maxi_allowed )
+ MainWindow.btnMaxim.DoClick = function()
+ local WorkshopButtonWidth, WorkshopButtonHeight = Menu.WorkshopButton:GetTextSize()
+ local ApplyButtonWidth, ApplyButtonHeight = Menu.ApplyButton:GetTextSize()
+ local ResetButtonWidth, ResetButtonHeight = Menu.ResetButton:GetTextSize()
+ local AnimButtonWidth, AnimButtonHeight = Menu.AnimButton:GetTextSize()
if maxi_allowed and maxi_mode == 0 then
- Frame:SetSize( ScrW(), ScrH() )
- Frame:Center()
- Frame:SetDraggable( false )
- Menu.ApplyButton:SetPos( ScrW() - 560, 30 )
- Menu.ResetButton:SetPos( 5, ScrH() - 25 )
- Menu.AdvButton:SetPos( ScrW() - 200, 3 )
+ MainWindow:SetSize( ScrW(), ScrH() )
+ MainWindow:Center()
+ MainWindow:SetDraggable( false )
+ Menu.ApplyButton:SetPos( ScrW() - (ApplyButtonWidth + 480), 0 )
+ Menu.WorkshopButton:SetPos( ScrW() - (WorkshopButtonWidth + 110), 6 )
+
+ Menu.ResetButton:SetPos( 5, ScrH() - 60 )
+ Menu.AnimButton:SetPos( 20 + ResetButtonWidth, ScrH() - 60 )
maxi_mode = 1
elseif maxi_allowed and maxi_mode == 1 then
Menu.ApplyButton:SetVisible( false )
Menu.ResetButton:SetVisible( false )
- Menu.AdvButton:SetVisible( false )
+ Menu.AnimButton:SetVisible( false )
+ Menu.WorkshopButton:SetVisible( false )
Menu.Right:SetVisible( false )
- Frame:InvalidateLayout( false )
+ MainWindow:InvalidateLayout( false )
maxi_mode = 2
else
- Frame:SetSize( fw, fh )
- Frame:Center()
- Frame:SetDraggable( true )
- Menu.ApplyButton:SetPos( fw - 560, 30 )
+ MainWindow:SetSize( fw, fh )
+ MainWindow:Center()
+ MainWindow:SetDraggable( true )
+
+ Menu.ApplyButton:SetPos( fw - (ApplyButtonWidth + 480), 0 )
Menu.ApplyButton:SetVisible( true )
- Menu.ResetButton:SetPos( 5, fh - 25 )
+ Menu.ResetButton:SetPos( 5, fh - 60 )
+ Menu.AnimButton:SetPos( 20 + ResetButtonWidth, fh - 60 )
Menu.ResetButton:SetVisible( true )
- Menu.AdvButton:SetPos( fw - 200, 3 )
- Menu.AdvButton:SetVisible( true )
+ Menu.AnimButton:SetVisible( true )
+ Menu.WorkshopButton:SetPos( fw - (WorkshopButtonWidth + 110), 6 )
+ Menu.WorkshopButton:SetVisible( true )
Menu.Right:SetVisible( true )
maxi_mode = 0
end
end
- local mdl = Frame:Add( "DModelPanel" )
- mdl:Dock( FILL )
- --mdl:SetSize( 520, 0 )
- mdl:SetFOV( 36 )
- mdl:SetCamPos( Vector( 0, 0, 0 ) )
- mdl:SetDirectionalLight( BOX_RIGHT, Color( 255, 160, 80, 255 ) )
- mdl:SetDirectionalLight( BOX_LEFT, Color( 80, 160, 255, 255 ) )
- mdl:SetAmbientLight( Vector( -64, -64, -64 ) )
- mdl:SetAnimated( true )
- mdl:SetLookAt( Vector( -100, 0, -22 ) )
- function mdl.DefaultPos()
+ local ModelPreview = MainWindow:Add( "DModelPanel" )
+ ModelPreview:Dock( FILL )
+ ModelPreview:SetFOV( 36 ) -- PM FOV
+ ModelPreview:SetCamPos( Vector( 0, 0, 0 ) )
+ ModelPreview:SetDirectionalLight( BOX_RIGHT, Color( 255, 160, 80, 255 ) )
+ ModelPreview:SetDirectionalLight( BOX_LEFT, Color( 80, 160, 255, 255 ) )
+ ModelPreview:SetAmbientLight( Vector( -64, -64, -64 ) )
+ ModelPreview:SetAnimated( true )
+ ModelPreview:SetLookAt( Vector( -100, 0, -22 ) )
+ function ModelPreview.DefaultPos()
if ( Menu.IsHandsTabActive() ) then return end
- mdl.Angles = Angle( 0, 0, 0 )
- mdl.Pos = Vector( -100, 0, -61 )
+ ModelPreview.Angles = Angle( 0, 0, 0 )
+ ModelPreview.Pos = Vector( -100, 0, -61 )
+ ModelPreview.AngleOffset = Angle( 0, 0, 0 )
end
- mdl.DefaultPos()
+ ModelPreview.DefaultPos()
- function mdl:PreDrawModel( mdlEnt )
+ function ModelPreview:PreDrawModel( mdlEnt )
if ( IsValid( self.EntityHands ) and Menu.IsHandsTabActive() ) then
if ( not self.EntityHands:IsEffectActive( EF_BONEMERGE ) ) then
self.EntityHands:AddEffects( EF_BONEMERGE )
@@ -572,53 +609,62 @@ function Menu.Setup()
end
end
- Menu.AdvButton = Frame:Add( "DButton" )
- Menu.AdvButton:SetSize( 100, 18 )
- Menu.AdvButton:SetPos( fw - 200, 3 )
- Menu.AdvButton:SetText( "Visit Addon Page" )
- Menu.AdvButton.DoClick = function()
- gui.OpenURL( "http://steamcommunity.com/sharedfiles/filedetails/?id=2257795841" )
- SetClipboardText( "http://steamcommunity.com/sharedfiles/filedetails/?id=2257795841" )
+ Menu.WorkshopButton = MainWindow:Add( "DButton" )
+ Menu.WorkshopButton:SetText( "#EPS.VisitAddonPage" )
+ local Width, Height = Menu.WorkshopButton:GetTextSize()
+ Menu.WorkshopButton:SetSize( Width + 8, 18 )
+ Menu.WorkshopButton:SetPos( fw - (Width + 110), 6 )
+ Menu.WorkshopButton.DoClick = function()
+ gui.OpenURL( "https://steamcommunity.com/sharedfiles/filedetails/?id=2247755443" )
+ SetClipboardText( "https://steamcommunity.com/sharedfiles/filedetails/?id=2247755443" )
end
- Menu.ApplyButton = Frame:Add( "DButton" )
- Menu.ApplyButton:SetSize( 120, 30 )
- Menu.ApplyButton:SetPos( fw - 560, 30 )
- Menu.ApplyButton:SetText( "Apply playermodel" )
+ Menu.ApplyButton = ModelPreview:Add( "DButton" )
+ Menu.ApplyButton:SetText( "#EPS.ApplyPM" )
+ local ApplyButtonWidth, ApplyButtonHeight = Menu.ApplyButton:GetTextSize()
+ Menu.ApplyButton:SetPos( fw - (ApplyButtonWidth + 480), 0 )
+ Menu.ApplyButton:SetSize( ApplyButtonWidth + 30, 30 )
Menu.ApplyButton:SetEnabled( LocalPlayer():IsAdmin() or GetConVar( "sv_playermodel_selector_instantly" ):GetBool() )
Menu.ApplyButton.DoClick = LoadPlayerModel
- Menu.ResetButton = Frame:Add( "DButton" )
- Menu.ResetButton:SetSize( 40, 20 )
- Menu.ResetButton:SetPos( 5, fh - 25 )
- Menu.ResetButton:SetText( "Reset" )
- Menu.ResetButton.DoClick = mdl.DefaultPos
+ Menu.ResetButton = ModelPreview:Add( "DButton" )
+ Menu.ResetButton:SetText( "#EPS.Reset" )
+ local ResetButtonWidth, ResetButtonHeight = Menu.ResetButton:GetTextSize()
+ Menu.ResetButton:SetSize( ResetButtonWidth + 8, 20 )
+ Menu.ResetButton:SetPos( 5, fh - 60 )
+ Menu.ResetButton.DoClick = ModelPreview.DefaultPos
+ Menu.AnimButton = ModelPreview:Add( "DButton" )
+ Menu.AnimButton:SetText( "#EPS.NextAnim" )
+ local AnimButtonWidth, AnimButtonHeight = Menu.AnimButton:GetTextSize()
+ Menu.AnimButton:SetSize( AnimButtonWidth + 8, 20 )
+ Menu.AnimButton:SetPos( 20 + ResetButtonWidth, fh - 60 )
+ Menu.AnimButton.DoClick = function()
+ currentanim = (currentanim + 1) % (#default_animations)
+ Menu.PlayPreviewAnimation( ModelPreview, LocalPlayer():GetInfo( "cl_playermodel" ) )
+ end
- Menu.Right = Frame:Add( "DPropertySheet" )
+ Menu.Right = MainWindow:Add( "DPropertySheet" )
Menu.Right:Dock( RIGHT )
Menu.Right:SetSize( 430, 0 )
Menu.Right.OnActiveTabChanged = function( self, oldTab, newTab )
- timer.Simple( 0, function() Menu.UpdateFromConvars() end )
+ timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
end
local modeltab = Menu.Right:Add( "DPropertySheet" )
- Menu.Right:AddSheet( "Model", modeltab, "icon16/user.png" )
+ Menu.Right:AddSheet( "#EPS.Model", modeltab, "icon16/user.png" )
- local t = modeltab:Add( "DLabel" )
- t:SetPos( 129, 1 )
- --t:SetSize( 100, 20 )
- t:SetText( "Search:" )
-
- Menu.ModelFilter = modeltab:Add( "DTextEntry" )
- Menu.ModelFilter:SetPos( 168, 1 )
- Menu.ModelFilter:SetSize( 246, 20 )
- Menu.ModelFilter:SetUpdateOnType( true )
- Menu.ModelFilter.OnValueChange = function() Menu.ModelPopulate() end
+ Menu.ModelFilter = modeltab:Add( "DTextEntry" )
+ Menu.ModelFilter:SetPlaceholderText( "#EPS.Search" )
+ Menu.ModelFilter:DockMargin( 8, 0, 8, 8 )
+ Menu.ModelFilter:Dock( TOP )
+
+ Menu.ModelFilter:SetUpdateOnType( true )
+ Menu.ModelFilter.OnValueChange = function() Menu.ModelPopulate() end
local ModelScroll = modeltab:Add( "DScrollPanel" )
- modeltab:AddSheet( "Icons", ModelScroll, "icon16/application_view_tile.png" )
+ modeltab:AddSheet( "#EPS.Model.Icons", ModelScroll, "icon16/application_view_tile.png" )
ModelScroll:DockMargin( 2, 0, 2, 2 )
ModelScroll:Dock( FILL )
@@ -631,12 +677,12 @@ function Menu.Setup()
local ModelList = modeltab:Add( "DListView" )
- modeltab:AddSheet( "Table", ModelList, "icon16/application_view_list.png" )
+ modeltab:AddSheet( "#EPS.Model.Table", ModelList, "icon16/application_view_list.png" )
ModelList:DockMargin( 5, 0, 5, 5 )
ModelList:Dock( FILL )
ModelList:SetMultiSelect( false )
- ModelList:AddColumn( "Model" )
- ModelList:AddColumn( "Path" )
+ ModelList:AddColumn( "#EPS.Model.Table.Model" )
+ ModelList:AddColumn( "#EPS.Model.Table.Path" )
ModelList.OnRowSelected = function()
local sel = ModelList:GetSelected()
if !sel[1] then return end
@@ -648,7 +694,7 @@ function Menu.Setup()
-- RunConsoleCommand( "cl_playerhands", "" )
RunConsoleCommand( "cl_playerhandsbodygroups", "0" )
RunConsoleCommand( "cl_playerhandsskin", "0" )
- timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
+ timer.Simple( 0.3, function() Menu.UpdateFromConvars() end )
end
local AllModels = player_manager.AllValidModels()
@@ -675,9 +721,10 @@ function Menu.Setup()
end
for name, model in SortedPairs( AllModels ) do
-
+
if IsInFilter( name ) then
-
+ if GetConVar( "cl_playermodel_selector_hide_defaults" ):GetBool() and DefaultPlayerModels[model] then continue end -- Testing, may have bugs.
+ if GetConVar( "cl_playermodel_selector_ignorehands" ):GetBool() and player_manager.TranslatePlayerHands(name).model == model then continue end -- No
local icon = ModelIconLayout:Add( "SpawnIcon" )
icon:SetSize( 64, 64 )
--icon:InvalidateLayout( true )
@@ -692,11 +739,11 @@ function Menu.Setup()
-- RunConsoleCommand( "cl_playerhands", "" )
RunConsoleCommand( "cl_playerhandsbodygroups", "0" )
RunConsoleCommand( "cl_playerhandsskin", "0" )
- timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
+ timer.Simple( 0.3, function() Menu.UpdateFromConvars() end )
end
-
+
ModelList:AddLine( name, model )
-
+
end
end
@@ -707,23 +754,19 @@ function Menu.Setup()
-------------------------------------------------------------
local handtab = Menu.Right:Add( "DPropertySheet" )
- local htb = Menu.Right:AddSheet( "Hands", handtab, "icon16/attach.png" )
+ local htb = Menu.Right:AddSheet( "#EPS.Hands", handtab, "icon16/attach.png" )
htb.Tab.IsHandsTab = true
- local t = handtab:Add( "DLabel" )
- t:SetPos( 129, 1 )
- --t:SetSize( 100, 20 )
- t:SetText( "Search:" )
-
Menu.HandsFilter = handtab:Add( "DTextEntry" )
- Menu.HandsFilter:SetPos( 168, 1 )
- Menu.HandsFilter:SetSize( 246, 20 )
+ Menu.HandsFilter:SetPlaceholderText( "#EPS.Search" )
+ Menu.HandsFilter:DockMargin( 8, 0, 8, 4 )
+ Menu.HandsFilter:Dock( TOP )
Menu.HandsFilter:SetUpdateOnType( true )
Menu.HandsFilter.OnValueChange = function() Menu.HandsPopulate() end
local ModelScroll = handtab:Add( "DScrollPanel" )
- handtab:AddSheet( "Icons", ModelScroll, "icon16/application_view_tile.png" )
+ handtab:AddSheet( "#EPS.Hands.Icons", ModelScroll, "icon16/application_view_tile.png" )
ModelScroll:DockMargin( 2, 0, 2, 2 )
ModelScroll:Dock( FILL )
@@ -732,16 +775,16 @@ function Menu.Setup()
ModelIconLayout:SetSpaceY( 2 )
ModelIconLayout:Dock( FILL )
- local modelicons = { }
+ local modelicons_forhands = { }
local ModelList = handtab:Add( "DListView" )
- handtab:AddSheet( "Table", ModelList, "icon16/application_view_list.png" )
+ handtab:AddSheet( "#EPS.Hands.Table", ModelList, "icon16/application_view_list.png" )
ModelList:DockMargin( 5, 0, 5, 5 )
ModelList:Dock( FILL )
ModelList:SetMultiSelect( false )
- ModelList:AddColumn( "Model" )
- ModelList:AddColumn( "Path" )
+ ModelList:AddColumn( "#EPS.Hands.Table.Model" )
+ ModelList:AddColumn( "#EPS.Hands.Table.Path" )
ModelList.OnRowSelected = function()
local sel = ModelList:GetSelected()
if !sel[1] then return end
@@ -777,60 +820,213 @@ function Menu.Setup()
end
end
- local icon = ModelIconLayout:Add( "SpawnIcon" )
- icon:SetSize( 64, 64 )
- icon:SetSpawnIcon( "icon64/playermodel.png" )
- --icon:SetModel( model )
- icon:SetTooltip( "Use playermodel" )
- table.insert( modelicons, icon )
- icon.DoClick = function()
- RunConsoleCommand( "cl_playerhands", "" )
- RunConsoleCommand( "cl_playerhandsbodygroups", "0" )
- RunConsoleCommand( "cl_playerhandsskin", "0" )
- timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
- end
+ local icon = ModelIconLayout:Add( "SpawnIcon" )
+ icon:SetSize( 64, 64 )
+ icon:SetSpawnIcon( "icon64/playermodel.png" )
+ icon:SetTooltip( "#EPS.Hands.UsePM" )
+ icon.DoClick = function()
+ RunConsoleCommand( "cl_playerhands", "" )
+ RunConsoleCommand( "cl_playerhandsbodygroups", "0" )
+ RunConsoleCommand( "cl_playerhandsskin", "0" )
+ timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
+ end
- ModelList:AddLine( name, model )
+ local exister = {}
for name, model in SortedPairs( AllModels ) do
if IsInFilter( name ) then
-
+ local result = player_manager.TranslatePlayerHands( name )
+ if exister[result.model:lower()] then
+ continue
+ else
+ exister[result.model:lower()] = true
+ end
local icon = ModelIconLayout:Add( "SpawnIcon" )
icon:SetSize( 64, 64 )
--icon:InvalidateLayout( true )
- icon:SetModel( model )
- icon:SetTooltip( name )
- table.insert( modelicons, icon )
+ icon:SetModel( "models/kleiner_animations.mdl" )
+ icon:SetTooltip( name .. "\n" .. result.model )
+ icon.ResultList = result
+
+ function icon:Paint( w, h )
+ return true
+ end
+ table.insert( modelicons_forhands, icon )
+
+ function icon:MakeHandIcon()
+ if !self.ResultList then print("EPS Hands: Result list missing.") return end
+
+ local CL_FISTS = ClientsideModel("models/weapons/c_arms.mdl")
+ local CL_REALHANDS = ClientsideModel( self.ResultList.model, RENDERGROUP_BOTH )
+
+ CL_FISTS:SetNoDraw( true )
+ CL_FISTS:SetPos( vector_origin )
+ CL_FISTS:SetAngles( angle_zero )
+ CL_REALHANDS:SetNoDraw( true )
+
+ CL_FISTS:ResetSequence( CL_FISTS:LookupSequence( "fists_idle_01" ) )
+
+ CL_REALHANDS:AddEffects( EF_BONEMERGE )
+ CL_REALHANDS:SetBodyGroups(result.body)
+ CL_REALHANDS:SetSkin(isnumber(result.skin) and result.skin or 0)
+
+ CL_REALHANDS:SetParent( CL_FISTS )
+
+ local cam_pos = Vector( 0, 0, 0 )
+ local cam_ang = Angle( 6, -16.9, 0 )
+ local cam_fov = 17
+
+ render.PushRenderTarget( HandIconGenerator )
+ render.OverrideDepthEnable( true, true )
+ render.SetWriteDepthToDestAlpha( false )
+ render.SuppressEngineLighting( true )
+
+ local CL_SHIRT = {
+ {
+ type = MATERIAL_LIGHT_POINT,
+ color = Vector( 1, 1, 1 )*1,
+ pos = Vector( 0, -48, 32 ),
+ },
+ {
+ type = MATERIAL_LIGHT_POINT,
+ color = Vector( -1, -1, -1 )*1,
+ pos = Vector( 0, 32, -64 ),
+ },
+ }
+
+ render.SetLocalModelLights(CL_SHIRT)
+ -- render.Clear(0, 0, 0, 0, true, true)
+ render.Clear(0, 0, 0, 0)
+ render.ClearDepth( true )
+ render.OverrideAlphaWriteEnable( true, true )
+
+
+ -- rendering twice to get good alpha
+ render.SetBlend(1)
+ render.SetColorModulation(1, 1, 1)
+ render.MaterialOverride(matshiny)
+ render.OverrideColorWriteEnable(true, false)
+
+ cam.Start3D( cam_pos, cam_ang, cam_fov, 0, 0, 64, 64, 0.1, 1000 )
+ CL_FISTS:SetupBones()
+ CL_REALHANDS:SetupBones()
+ CL_REALHANDS:DrawModel( STUDIO_TWOPASS )
+ cam.End3D()
+
+ render.OverrideColorWriteEnable(false, false)
+ render.MaterialOverride()
+
+
+ render.SetWriteDepthToDestAlpha( true )
+ render.OverrideBlend( true, BLEND_ONE, BLEND_ZERO, BLENDFUNC_ADD, BLEND_ZERO, BLEND_ONE, BLENDFUNC_ADD )
+ cam.Start3D( cam_pos, cam_ang, cam_fov, 0, 0, 64, 64, 0.1, 1000 )
+ CL_FISTS:SetupBones()
+ CL_REALHANDS:SetupBones()
+ CL_REALHANDS:DrawModel( STUDIO_TWOPASS )
+ cam.End3D()
+
+ render.MaterialOverride()
+ render.SetWriteDepthToDestAlpha( false )
+
+ render.OverrideBlend( false )
+ render.SuppressEngineLighting(false)
+
+ local HandBodygroups = CL_REALHANDS:GetBodyGroups()
+ for i = 0, #HandBodygroups - 1 do
+ if CL_REALHANDS:GetBodygroupCount(i) < 2 then continue end
+ cam.Start2D()
+ surface.SetDrawColor( 255, 255, 255, 255 )
+ surface.SetMaterial(hasbgs)
+ surface.DrawTexturedRect(0, 0, 64, 64)
+ cam.End2D()
+ break
+ end
+ print( "Generating " .. result.model:StripExtension() )
+ local data = render.Capture( {
+ format = "png",
+ x = 0,
+ y = 0,
+ w = 64,
+ h = 64
+ } )
+
+ if !file.Exists("eps_hands", "DATA") then
+ file.CreateDir("eps_hands")
+ end
+
+ local EXPLOSION = string.Explode( "/", result.model:StripExtension(), false )
+ EXPLOSION[#EXPLOSION] = nil
+ EXPLOSION = table.concat( EXPLOSION, "/" )
+ file.CreateDir( "eps_hands/" .. EXPLOSION )
+ local fullpath = "eps_hands/" .. result.model:StripExtension() .. ".png"
+ file.Write( fullpath, data )
+
+ render.OverrideAlphaWriteEnable( false )
+ render.SuppressEngineLighting( false )
+ render.OverrideDepthEnable( false )
+ render.PopRenderTarget()
+ --icon:SetModel("models/kleiner_animations.mdl")
+ icon:SetIcon( "data/eps_hands/" .. result.model:StripExtension() .. ".png" )
+ --icon:SetTooltip( name .. "\n" .. result.model )
+
+ --local tab = {}
+ --tab.ent = CL_REALHANDS
+ --tab.cam_pos = Vector( 0, 0, 0 )
+ --tab.cam_ang = Angle( 4, -18, 0 )
+ --tab.cam_fov = 20
+
+ --self:RebuildSpawnIconEx( tab )
+
+ CL_FISTS:Remove()
+ CL_REALHANDS:Remove()
+ end
+
+ -- Make a pretty ass icon
+ if !file.Exists( "eps_hands/" .. result.model:StripExtension() .. ".png", "DATA" ) then
+ print("IT DOESN'T EXIST", "eps_hands/" .. result.model:StripExtension() .. ".png")
+ if IsValid(icon) then
+ icon:MakeHandIcon()
+ end
+ else
+ --icon:SetModel("models/kleiner_animations.mdl")
+ icon:SetIcon( "data/eps_hands/" .. result.model:StripExtension() .. ".png" )
+ --icon:SetTooltip( name .. "\n" .. result.model )
+ end
icon.DoClick = function()
RunConsoleCommand( "cl_playerhands", name )
RunConsoleCommand( "cl_playerhandsbodygroups", "0" )
RunConsoleCommand( "cl_playerhandsskin", "0" )
timer.Simple( 0.1, function() Menu.UpdateFromConvars() end )
end
-
+ icon.DoRightClick = function()
+ if IsValid(icon) then
+ icon:MakeHandIcon()
+ end
+ end
+
ModelList:AddLine( name, model )
end
end
-
+
end
Menu.HandsPopulate()
--------------------------------------------------------
local favorites = Menu.Right:Add( "DPanel" )
- Menu.Right:AddSheet( "Favorites", favorites, "icon16/star.png" )
+ Menu.Right:AddSheet( "#EPS.Favorites", favorites, "icon16/star.png" )
favorites:DockPadding( 8, 8, 8, 8 )
local FavList = favorites:Add( "DListView" )
FavList:Dock( FILL )
FavList:SetMultiSelect( true )
- FavList:AddColumn( "Favorites" )
- FavList:AddColumn( "Model" )
- FavList:AddColumn( "Skin" ):SetFixedWidth( 25 )
- FavList:AddColumn( "Bodygroups" )
+ FavList:AddColumn( "#EPS.Favorites" )
+ FavList:AddColumn( "#EPS.Favorites.Model" )
+ FavList:AddColumn( "#EPS.Favorites.Skin" ):SetFixedWidth( 40 )
+ FavList:AddColumn( "#EPS.Favorites.Bodygroups" )
FavList.DoDoubleClick = function( id, sel )
local name = tostring( FavList:GetLine( sel ):GetValue( 1 ) )
if istable( Favorites[name] ) then
@@ -856,7 +1052,7 @@ function Menu.Setup()
b:Dock( TOP )
b:SetHeight( 25 )
b:DockMargin( 0, 0, 200, 10 )
- b:SetText( "Load selected Favorite" )
+ b:SetText( "#EPS.Favorites.LoadFavorite" )
b.DoClick = function()
local sel = FavList:GetSelected()
if !sel[1] then return end
@@ -865,7 +1061,7 @@ function Menu.Setup()
RunConsoleCommand( "cl_playermodel", Favorites[name].model )
RunConsoleCommand( "cl_playerbodygroups", Favorites[name].bodygroups )
RunConsoleCommand( "cl_playerskin", Favorites[name].skin )
- timer.Simple( 0.1, function()
+ timer.Simple( 0.3, function()
Menu.UpdateFromConvars()
end )
end
@@ -874,7 +1070,7 @@ function Menu.Setup()
local t = favorites:Add( "DLabel" )
t:Dock( BOTTOM )
t:SetAutoStretchVertical( true )
- t:SetText( "Here you can save your favorite playermodel combinations. To do this:\n1. Select a model and setup the skin and bodygroups as you wish.\n2. Enter a unique name into the textfield and click \"Add new favorite\".\n3. Load your favorite by selecting it in the list below and clicking \"Load selected\".\nYou can also apply existing favorites by console command:\nplayermodel_loadfav \"the favorite's name\"" )
+ t:SetText( "#EPS.Favorites.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -900,7 +1096,7 @@ function Menu.Setup()
local b = control:Add( "DButton" )
b:SetPos( 0, 30 )
b:SetSize( 125, 20 )
- b:SetText( "Add new favorite" )
+ b:SetText( "#EPS.Favorites.AddNewFavorite" )
b.DoClick = function()
local name = FavEntry:GetValue()
if name == "" then return end
@@ -910,7 +1106,7 @@ function Menu.Setup()
local b = control:Add( "DButton" )
b:SetPos( 135, 30 )
b:SetSize( 125, 20 )
- b:SetText( "Replace selected" )
+ b:SetText( "#EPS.Favorites.ReplaceSelected" )
b.DoClick = function()
local sel = FavList:GetSelected()
if sel[2] then return end
@@ -922,7 +1118,7 @@ function Menu.Setup()
local b = control:Add( "DButton" )
b:SetPos( 270, 30 )
b:SetSize( 125, 20 )
- b:SetText( "Delete all selected" )
+ b:SetText( "#EPS.Favorites.DeleteAllSelected" )
b.DoClick = function()
local sel = FavList:GetSelected()
for k, v in pairs( sel ) do
@@ -935,7 +1131,7 @@ function Menu.Setup()
local bdcontrols = Menu.Right:Add( "DPanel" )
- local bgtab = Menu.Right:AddSheet( "Bodygroups", bdcontrols, "icon16/group.png" )
+ local bgtab = Menu.Right:AddSheet( "#EPS.Bodygroups", bdcontrols, "icon16/group.png" )
bdcontrols:DockPadding( 8, 8, 8, 8 )
local bdcontrolspanel = bdcontrols:Add( "DPanelList" )
@@ -944,7 +1140,7 @@ function Menu.Setup()
-- Hands
local h__bdcontrols = Menu.Right:Add( "DPanel" )
- local h__bgtab = Menu.Right:AddSheet( "Handgroups", h__bdcontrols, "icon16/group_link.png" )
+ local h__bgtab = Menu.Right:AddSheet( "#EPS.Handgroups", h__bdcontrols, "icon16/group_link.png" )
h__bdcontrols:DockPadding( 8, 8, 8, 8 )
h__bgtab.Tab.IsHandsTab = true
@@ -955,7 +1151,7 @@ function Menu.Setup()
local flexcontrols = Menu.Right:Add( "DPanel" )
- local flextab = Menu.Right:AddSheet( "Flexes", flexcontrols, "icon16/emoticon_wink.png" )
+ local flextab = Menu.Right:AddSheet( "#EPS.Flexes", flexcontrols, "icon16/emoticon_wink.png" )
flexcontrols:DockPadding( 8, 8, 8, 8 )
local flexcontrolspanel = flexcontrols:Add( "DPanelList" )
@@ -964,11 +1160,11 @@ function Menu.Setup()
local controls = Menu.Right:Add( "DPanel" )
- Menu.Right:AddSheet( "Colors", controls, "icon16/color_wheel.png" )
+ Menu.Right:AddSheet( "#EPS.Colors", controls, "icon16/color_wheel.png" )
controls:DockPadding( 8, 8, 8, 8 )
local lbl = controls:Add( "DLabel" )
- lbl:SetText( "Player color" )
+ lbl:SetText( "#EPS.Colors.PlayerColor" )
lbl:SetTextColor( Color( 0, 0, 0, 255 ) )
lbl:Dock( TOP )
@@ -979,7 +1175,7 @@ function Menu.Setup()
plycol:SetSize( 200, ( fh - 160) / 2 )
local lbl = controls:Add( "DLabel" )
- lbl:SetText( "Physgun color" )
+ lbl:SetText( "#EPS.Colors.PhysgunColor" )
lbl:SetTextColor( Color( 0, 0, 0, 255 ) )
lbl:DockMargin( 0, 8, 0, 0 )
lbl:Dock( TOP )
@@ -995,7 +1191,7 @@ function Menu.Setup()
b:DockMargin( 0, 8, 0, 0 )
b:Dock( TOP )
b:SetSize( 150, 20 )
- b:SetText( "Reset to default values" )
+ b:SetText( "#EPS.Colors.ResetToDefault" )
b.DoClick = function()
plycol:SetVector( Vector( 0.24, 0.34, 0.41 ) )
wepcol:SetVector( Vector( 0.30, 1.80, 2.10 ) )
@@ -1005,11 +1201,11 @@ function Menu.Setup()
local moretab = Menu.Right:Add( "DPropertySheet" )
- Menu.Right:AddSheet( "Settings", moretab, "icon16/key.png" )
+ Menu.Right:AddSheet( "#EPS.Settings", moretab, "icon16/key.png" )
local panel = moretab:Add( "DPanel" )
- moretab:AddSheet( "Client", panel, "icon16/status_online.png" )
+ moretab:AddSheet( "#EPS.Settings.Client", panel, "icon16/status_online.png" )
panel:DockPadding( 10, 10, 10, 10 )
local panel = panel:Add( "DScrollPanel" )
@@ -1020,7 +1216,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Enforce your playermodel" )
+ c:SetText( "#EPS.Settings.Client.EnforcePM" )
c:SetDark( true )
c.OnChange = function( p, v )
RunConsoleCommand( c.cvar, v == true and "1" or "0" )
@@ -1030,7 +1226,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, your selected playermodel will be protected. No other function will be able to change your playermodel anymore." )
+ t:SetText( "#EPS.Settings.Client.EnforcePM.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1039,7 +1235,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Use Player color as background" )
+ c:SetText( "#EPS.Settings.Client.PlayerColorBG" )
c:SetDark( true )
c:SizeToContents()
c.OnChange = function( p, v )
@@ -1050,7 +1246,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, your selected player color will be used as the menu background. If disabled, the background will be grey." )
+ t:SetText( "#EPS.Settings.Client.PlayerColorBG.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1059,7 +1255,27 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Transparent background" )
+ c:SetText( "#EPS.Settings.Client.TransparentBG" )
+ c:SetDark( true )
+ c:SizeToContents()
+ c.OnChange = function( p, v )
+ RunConsoleCommand( c.cvar, v == true and "1" or "0" )
+ end
+
+ local t = panel:Add( "DLabel" )
+ t:Dock( TOP )
+ t:DockMargin( 0, 0, 0, 20 )
+ t:SetAutoStretchVertical( true )
+ t:SetText( "#EPS.Settings.Client.TransparentBG.Desc" )
+ t:SetDark( true )
+ t:SetWrap( true )
+
+ local c = panel:Add( "DCheckBoxLabel" )
+ c.cvar = "cl_playermodel_selector_hide_defaults"
+ c:Dock( TOP )
+ c:DockMargin( 0, 0, 0, 5 )
+ c:SetValue( GetConVar(c.cvar):GetBool() )
+ c:SetText( "#EPS.Settings.Client.HideDefaultPMs" )
c:SetDark( true )
c:SizeToContents()
c.OnChange = function( p, v )
@@ -1070,7 +1286,28 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, the menu backgroup will be transparent. If disabled, the background will be opaque." )
+ t:SetText( "#EPS.Settings.Client.HideDefaultPMs.Desc" )
+ t:SetDark( true )
+ t:SetWrap( true )
+
+ local c = panel:Add( "DCheckBoxLabel" )
+ c.cvar = "cl_playermodel_selector_ignorehands"
+ c:Dock( TOP )
+ c:DockMargin( 0, 0, 0, 5 )
+ c:SetValue( GetConVar(c.cvar):GetBool() )
+ c:SetText( "#EPS.Settings.Client.IgnoreC_ArmsOnlyPMs" )
+ c:SetDark( true )
+ c:SizeToContents()
+ c.OnChange = function( p, v )
+ RunConsoleCommand( c.cvar, v == true and "1" or "0" )
+ Menu.ModelPopulate()
+ end
+
+ local t = panel:Add( "DLabel" )
+ t:Dock( TOP )
+ t:DockMargin( 0, 0, 0, 20 )
+ t:SetAutoStretchVertical( true )
+ t:SetText( "#EPS.Settings.Client.IgnoreC_ArmsOnlyPMs.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1079,7 +1316,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Show flexes tab" )
+ c:SetText( "#EPS.Settings.Client.ShowFlexes" )
c:SetDark( true )
c:SizeToContents()
c.OnChange = function( p, v )
@@ -1091,7 +1328,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "This allows you to manipulate flexes on your playermodel. However, flex manipulation is not really made for playermodels and will cause issues. This includes the following:\n- Eye blinking no longer working.\n- Faces might be distorted unless the flexes are corrected manually.\n- Might break the faces of incompatible playermodels completely.\n- Even if you put all flexes to default value, the engine still considers them as manipulated. Models with problems won't be fixed.\nYou must switch your model once, for the tab to appear!" )
+ t:SetText( "#EPS.Settings.Client.ShowFlexes.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1099,18 +1336,25 @@ function Menu.Setup()
b:Dock( TOP )
b:DockMargin( 0, 0, 270, 5 )
b:SetHeight( 15 )
- b:SetText( "Rebuild spawn icons" )
+ b:SetText( "#EPS.Settings.Client.RebuildIcon" )
b.DoClick = function()
for _, icon in pairs( modelicons ) do
icon:RebuildSpawnIcon()
end
+
+ -- local thecount = 0
+ for _, icon in pairs( modelicons_forhands ) do
+ if IsValid(icon) then
+ icon:MakeHandIcon()
+ end
+ end
end
local t = panel:Add( "DLabel" )
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "Forces all playermodel icons to be re-rendered. Useful if the icons are outdated after custom models changed their appearance. This may take a while, depending on the number of models and your PC's speed." )
+ t:SetText( "#EPS.Settings.Client.RebuildIcon.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1118,7 +1362,7 @@ function Menu.Setup()
if LocalPlayer():IsAdmin() then
local panel = moretab:Add( "DPanel" )
- moretab:AddSheet( "Server", panel, "icon16/world.png" )
+ moretab:AddSheet( "#EPS.Settings.Server", panel, "icon16/world.png" )
panel:DockPadding( 10, 10, 10, 10 )
local panel = panel:Add( "DScrollPanel" )
@@ -1136,7 +1380,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Enable playermodel enforcement" )
+ c:SetText( "#EPS.Settings.Server.EnablePMEnforcement" )
c:SetDark( true )
c.OnChange = ChangeCVar
@@ -1144,7 +1388,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, selected playermodels will be enforced and protected. No gamemodes, maps or addons can overwrite them anymore. Players can toggle this function individually, using the checkbox on top of the menu.\nIf disabled, only the manual button works outside of Sandbox." )
+ t:SetText( "#EPS.Settings.Server.EnablePMEnforcement.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1153,7 +1397,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Allow instant changes" )
+ c:SetText( "#EPS.Settings.Server.AllowInstantChanges" )
c:SetDark( true )
c.OnChange = ChangeCVar
@@ -1161,7 +1405,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, players can apply their changes instantly instead of having to respawn." )
+ t:SetText( "#EPS.Settings.Server.AllowInstantChanges.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1170,7 +1414,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Allow players to change flexes" )
+ c:SetText( "#EPS.Settings.Server.AllowFlexes" )
c:SetDark( true )
c.OnChange = ChangeCVar
@@ -1178,7 +1422,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, players can change the flexes for their playermodels. This will break player blinking and may cause other issues. Enable at own risk. Players can only reset their flexes by disconnecting." )
+ t:SetText( "#EPS.Settings.Server.AllowFlexes.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1187,7 +1431,7 @@ function Menu.Setup()
c:Dock( TOP )
c:DockMargin( 0, 0, 0, 5 )
c:SetValue( GetConVar(c.cvar):GetBool() )
- c:SetText( "Enable in all gamemodes" )
+ c:SetText( "#EPS.Settings.Server.EnableInAllGM" )
c:SetDark( true )
c.OnChange = ChangeCVar
@@ -1195,7 +1439,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "If enabled, the PlayerModel Selector will be available for all players in every gamemode. If disabled, only Admins can use it outside of Sandbox." )
+ t:SetText( "#EPS.Settings.Server.EnableInAllGM.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1203,7 +1447,7 @@ function Menu.Setup()
s.cvar = "sv_playermodel_selector_limit"
s:Dock( TOP )
s:DockMargin( 0, 0, 0, 5 )
- s:SetText( "Request limit" )
+ s:SetText( "#EPS.Settings.Server.RequestLimit" )
s:SetDark( true )
s:SetDecimals( 0 )
s:SetMax( 900 )
@@ -1219,13 +1463,13 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "Timelimit in seconds that players have to wait, before they can use the instant change function again. Set to 0 to disable." )
+ t:SetText( "#EPS.Settings.Server.RequestLimit.Desc" )
t:SetDark( true )
t:SetWrap( true )
local panel = moretab:Add( "DPanel" )
- moretab:AddSheet( "GM Blacklist", panel, "icon16/delete.png" )
+ moretab:AddSheet( "#EPS.Settings.GM_Blacklist", panel, "icon16/delete.png" )
panel:DockPadding( 10, 10, 10, 10 )
local Blacklist = panel:Add( "DListView" )
@@ -1233,7 +1477,7 @@ function Menu.Setup()
Blacklist:DockMargin( 0, 0, 20, 0 )
Blacklist:SetWidth( 150 )
Blacklist:SetMultiSelect( true )
- Blacklist:AddColumn( "Blacklisted gamemodes" )
+ Blacklist:AddColumn( "#EPS.Settings.GM_Blacklist.ExistedGM" )
net.Receive("lf_playermodel_blacklist", function()
local tbl = net.ReadTable()
@@ -1255,7 +1499,7 @@ function Menu.Setup()
t:Dock( TOP )
t:DockMargin( 0, 0, 0, 20 )
t:SetAutoStretchVertical( true )
- t:SetText( "Here you can blacklist incompatible gamemodes.\n\nPlayers (including Admins) can't change their playermodels in those gamemodes, regardless of other settings." )
+ t:SetText( "#EPS.Settings.GM_Blacklist.Desc" )
t:SetDark( true )
t:SetWrap( true )
@@ -1263,7 +1507,7 @@ function Menu.Setup()
b:Dock( TOP )
b:DockMargin( 0, 0, 0, 20 )
b:SetHeight( 25 )
- b:SetText( "Add current gamemode to Blacklist" )
+ b:SetText( "#EPS.Settings.GM_Blacklist.AddCurrent" )
b.DoClick = function()
if GAMEMODE_NAME == "sandbox" then return end
net.Start( "lf_playermodel_blacklist" )
@@ -1281,7 +1525,7 @@ function Menu.Setup()
b:Dock( TOP )
b:DockMargin( 0, 0, 0, 20 )
b:SetHeight( 20 )
- b:SetText( "Manually add gamemode" )
+ b:SetText( "#EPS.Settings.GM_Blacklist.ManuallyAddGM" )
b.DoClick = function()
local name = TextEntry:GetValue()
if name == "" or name == "sandbox" then return end
@@ -1295,7 +1539,7 @@ function Menu.Setup()
b:Dock( TOP )
b:DockMargin( 0, 0, 0, 0 )
b:SetHeight( 25 )
- b:SetText( "Remove selected gamemodes" )
+ b:SetText( "#EPS.Settings.GM_Blacklist.RemoveSelected" )
b.DoClick = function()
local tbl = { }
local sel = Blacklist:GetSelected()
@@ -1313,7 +1557,7 @@ function Menu.Setup()
if TFAVOX_Models then
local panel = moretab:Add( "DPanel" )
- moretab:AddSheet( "VOX", panel, "icon16/sound.png" )
+ moretab:AddSheet( "#EPS.Settings.VOX", panel, "icon16/sound.png" )
panel:DockPadding( 10, 10, 10, 10 )
local VOXlist = panel:Add( "DListView" )
@@ -1321,8 +1565,8 @@ function Menu.Setup()
VOXlist:DockMargin( 0, 0, 0, 10 )
VOXlist:SetHeight( ( fh - 126 - 44 ) / 2 ) -- 260
VOXlist:SetMultiSelect( true )
- VOXlist:AddColumn( "PlayerModel" )
- VOXlist:AddColumn( "assigned VOX pack" )
+ VOXlist:AddColumn( "#EPS.Settings.VOX.PlayerModel" )
+ VOXlist:AddColumn( "#EPS.Settings.VOX.Assigned" )
net.Receive("lf_playermodel_voxlist", function()
local tbl = net.ReadTable()
@@ -1351,7 +1595,7 @@ function Menu.Setup()
VOXinstalled:DockMargin( 0, 10, 0, 0 )
VOXinstalled:SetHeight( ( fh - 126 - 44 ) / 2 )
VOXinstalled:SetMultiSelect( false )
- VOXinstalled:AddColumn( "Available VOX packs" )
+ VOXinstalled:AddColumn( "#EPS.Settings.VOX.AvailableVOX" )
if istable( TFAVOX_Models ) then
for k, v in pairs( TFAVOX_Models ) do
@@ -1364,7 +1608,7 @@ function Menu.Setup()
b:Dock( LEFT )
--b:DockPadding( 100, 0, 100, 0 )
b:SetWidth( 200 )
- b:SetText( "Assign VOX pack to current PlayerModel" )
+ b:SetText( "#EPS.Settings.VOX.AssignToCurrent" )
b.DoClick = function()
local sel = VOXinstalled:GetSelected()
if !sel[1] then return end
@@ -1381,7 +1625,7 @@ function Menu.Setup()
b:Dock( RIGHT )
--b:DockPadding( 100, 0, 100, 0 )
b:SetWidth( 170 )
- b:SetText( "Remove selected assignment" )
+ b:SetText( "#EPS.Settings.VOX.RemoveSelected" )
b.DoClick = function()
local tbl = { }
local sel = VOXlist:GetSelected()
@@ -1401,7 +1645,7 @@ function Menu.Setup()
local panel = moretab:Add( "DPanel" )
- moretab:AddSheet( "Info", panel, "icon16/information.png" )
+ moretab:AddSheet( "#EPS.Settings.Info", panel, "icon16/information.png" )
panel:DockPadding( 0, 0, 0, 0 )
local t = panel:Add( "DHTML" )
@@ -1412,9 +1656,12 @@ function Menu.Setup()
t:AddFunction( "url", "open", function( str ) gui.OpenURL( str ) end )
t:AddFunction( "url", "copy", function( str ) SetClipboardText( str ) end )
+ local title = string.format(language.GetPhrase("EPS.Title"),Version)
+
local intro = [[Created by LibertyForce.
Thank you for installing this addon! Enjoying it?
Modified by Fesiug. You can now customize your hands!
Modified by YuRaNnNzZZ. You can see your selected hands!
+ Modified by Insane Black Rock Shooter. Localization Support!
Please leave a LIKE on the workshop page.]]
if !game.SinglePlayer() and !LocalPlayer():IsSuperAdmin() then
intro = [[This server is running Enhanced PlayerModel Selector by LibertyForce. Enjoying it?
@@ -1435,6 +1682,12 @@ function Menu.Setup()
font-size: 15px;
color: #5aa9d6;
font-weight: bold;
+ margin: 0;
+ padding: 0px 0px 4px 0px;
+ }
+ h3, h4, h5, h6 {
+ margin: 0;
+ padding: 2px 0px 6px 0px;
}
h1 {
font-size: 20px;
@@ -1464,24 +1717,47 @@ function Menu.Setup()
]]..intro..[[
+Enhanced Playermodel Selector provides additional functionality with those addons installed:
Translators: | Language: |
+
---|---|
Insane Black Rock Shooter | Simplified Chinese | +
Berry | Russian | +
Stann | Polish | +
憨憨羊の宇航鸽鸽 | Traditional Chinese | +
Tora | Turkish | +
GermanMaKo | German | +