This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 8064ba84d8
commit 6a58f406b1
7522 changed files with 4011896 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
net.Receive("ixGestureAnimation", function()
local client = net.ReadEntity()
if (!IsValid(client)) then return end
local sequence = net.ReadString()
client:AddVCDSequenceToGestureSlot(GESTURE_SLOT_VCD, sequence, 0, true)
end)
net.Receive("ixOpenHandSignalMenu", function()
if IsValid(ix.gui.handsignalMenu) then ix.gui.handsignalMenu:Remove() end
vgui.Create("ixGestureWheel")
end)

View File

@@ -0,0 +1,89 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local PANEL = {}
local function FramePaint( s, w, h )
surface.SetDrawColor(Color(0, 0, 0, 50))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(100, 100, 100, 150))
surface.DrawOutlinedRect(0, 0, w, h)
end
local function PointOnCircle( ang, radius, offX, offY )
ang = math.rad( ang )
local x = math.cos( ang ) * radius + offX
local y = math.sin( ang ) * radius + offY
return x, y
end
function PANEL:Init()
ix.gui.handsignalMenu = self
self:SetSize(ScrW(), ScrH())
self.gestButtons = {}
local gestures = ix.handsignal:GetAnimClassGestures(ix.anim.GetModelClass(LocalPlayer():GetModel()))
local numSquares = #gestures
local interval = 360 / numSquares
local centerX, centerY = self:GetWide()*0.485, self:GetTall()*0.45
local radius = 240
for degrees = 1, 360, interval do --Start at 1, go to 360, and skip forward at even intervals.
local x, y = PointOnCircle( degrees, radius, centerX, centerY )
local gestButton = self:Add("DButton")
gestButton:SetFont("MenuFontNoClamp")
gestButton:SetText( "..." )
gestButton:SetPos(x, y)
self.gestButtons[#self.gestButtons + 1] = gestButton
gestButton.Paint = function( s, w, h ) FramePaint(s, w, h) end
gestButton.DoClick = function ( btn )
self:Remove()
end
end
for k, v in ipairs(gestures) do
local btn = self.gestButtons[k]
btn:SetText(v.name)
btn.DoClick = function()
net.Start("ixAskForGestureAnimation")
net.WriteString(v.gesturePath)
net.SendToServer()
surface.PlaySound("helix/ui/press.wav")
self:Remove()
end
btn:SetWide(ScreenScale(128 / 3))
btn:SetHeight(ScreenScale(64 / 3))
end
self.closeButton = self:Add("DButton")
self.closeButton:Dock(BOTTOM)
self.closeButton:SetFont("MenuFontNoClamp")
self.closeButton:SetText( "Close" )
self.closeButton:SetHeight(ScreenScale(64 / 3))
self.closeButton.Paint = function( s, w, h ) FramePaint(s, w, h) end
self.closeButton.DoClick = function ( btn )
surface.PlaySound("helix/ui/press.wav")
self:Remove()
end
self:MakePopup()
self:SetKeyboardInputEnabled(false)
end
function PANEL:Paint(width, height)
surface.SetDrawColor(Color(63, 58, 115, 100))
surface.DrawRect(0, 0, width, height)
Derma_DrawBackgroundBlur( self, 0 )
end
vgui.Register("ixGestureWheel", PANEL)

View File

@@ -0,0 +1,15 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
LANGUAGE = {
optEnableGestureAnims = "Enable Gesture Animations",
optdEnableGestureAnims = "Whether your character should make a random gesture when speaking."
}

View File

@@ -0,0 +1,173 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ix.handsignal = ix.handsignal or {}
ix.handsignal.stored = ix.handsignal.stored or {}
function ix.handsignal:Register(data)
if ix.handsignal.stored[data.id] then return "already exists" end
ix.handsignal.stored[data.id] = data
end
function ix.handsignal:GetAnimClassGestures(animClass)
local tbl = {}
for k, v in pairs(ix.handsignal.stored) do
if v.animClass == animClass then tbl[#tbl + 1] = v end
end
return tbl
end
-- female
ix.handsignal:Register({
id = "wave",
name = "Wave",
animClass = "citizen_female",
gesturePath = "g_wave"
})
ix.handsignal:Register({
id = "display_r",
name = "Display (Right)",
animClass = "citizen_female",
gesturePath = "g_right_openhand"
})
ix.handsignal:Register({
id = "headshake",
name = "Headshake",
animClass = "citizen_female",
gesturePath = "hg_headshake"
})
ix.handsignal:Register({
id = "display_l",
name = "Display (Left)",
animClass = "citizen_female",
gesturePath = "g_display_left"
})
-- male
ix.handsignal:Register({
id = "clap",
name = "Clap",
animClass = "citizen_male",
gesturePath = "g_clap"
})
ix.handsignal:Register({
id = "clap_m",
name = "Clap",
animClass = "metrocop",
gesturePath = "g_clap"
})
ix.handsignal:Register({
id = "point",
name = "Point",
animClass = "citizen_male",
gesturePath = "g_point_l"
})
ix.handsignal:Register({
id = "point_m",
name = "Point",
animClass = "metrocop",
gesturePath = "g_point_l"
})
ix.handsignal:Register({
id = "point_left",
name = "Point (Left)",
animClass = "citizen_male",
gesturePath = "g_pointleft_l"
})
ix.handsignal:Register({
id = "point_left_m",
name = "Point (Left)",
animClass = "metrocop",
gesturePath = "g_pointleft_l"
})
ix.handsignal:Register({
id = "point_right",
name = "Point (Right)",
animClass = "citizen_male",
gesturePath = "g_pointright_l"
})
ix.handsignal:Register({
id = "point_right_m",
name = "Point (Right)",
animClass = "metrocop",
gesturePath = "g_pointright_l"
})
ix.handsignal:Register({
id = "wave_male",
name = "Wave",
animClass = "citizen_male",
gesturePath = "g_wave"
})
ix.handsignal:Register({
id = "wave_metro",
name = "Wave",
animClass = "metrocop",
gesturePath = "g_wave"
})
ix.handsignal:Register({
id = "wave_low",
name = "Wave (Low)",
animClass = "citizen_male",
gesturePath = "g_lookatthis"
})
ix.handsignal:Register({
id = "wave_low_m",
name = "Wave (Low)",
animClass = "metrocop",
gesturePath = "g_lookatthis"
})
-- OTA
ix.handsignal:Register({
id = "advance",
name = "Advance",
animClass = "overwatch",
gesturePath = "signal_advance"
})
ix.handsignal:Register({
id = "forward",
name = "Point",
animClass = "overwatch",
gesturePath = "signal_forward"
})
ix.handsignal:Register({
id = "group",
name = "Group",
animClass = "overwatch",
gesturePath = "signal_group"
})
ix.handsignal:Register({
id = "halt",
name = "Halt",
animClass = "overwatch",
gesturePath = "signal_halt"
})
ix.handsignal:Register({
id = "ota_point_r",
name = "Point (Right)",
animClass = "overwatch",
gesturePath = "signal_right"
})
ix.handsignal:Register({
id = "ota_point_l",
name = "Point (Left)",
animClass = "overwatch",
gesturePath = "signal_left"
})
ix.handsignal:Register({
id = "takecover",
name = "Take Cover",
animClass = "overwatch",
gesturePath = "signal_takecover"
})

View File

@@ -0,0 +1,27 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local playerMeta = FindMetaTable("Player")
function playerMeta:PlayGestureAnimation(animation)
net.Start("ixGestureAnimation")
net.WriteEntity(self)
net.WriteString(animation)
net.SendPVS( self:GetPos() )
end
net.Receive("ixAskForGestureAnimation", function(len, client)
local gest = net.ReadString()
if not client:IsPlayer() or (client.ixGestDelay and client.ixGestDelay > CurTime()) then return end
client:PlayGestureAnimation(client:LookupSequence(gest))
client.ixGestDelay = CurTime() + 1
end)

View File

@@ -0,0 +1,15 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ix.option.Add("enableGestureAnims", ix.type.bool, true, {
category = "appearance",
bNetworked = true
})

View File

@@ -0,0 +1,36 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local PLUGIN = PLUGIN
PLUGIN.name = "Dialogue Gestures & Hand Signals"
PLUGIN.author = "Naast & Aspect™"
PLUGIN.description = "Adds dialogue gestures & hand signals."
ix.util.Include("meta/sv_player.lua")
ix.util.Include("cl_plugin.lua")
ix.util.Include("sh_options.lua")
ix.util.Include("sv_hooks.lua")
PLUGIN.availableAnimClasses = {
["metrocop"] = true,
["citizen_male"] = true,
["citizen_female"] = true,
["overwatch"] = true
}
ix.command.Add("Handsignals", {
description = "Open the handsignals menu!",
OnRun = function(self, client)
if not PLUGIN.availableAnimClasses[ix.anim.GetModelClass(client:GetModel())] then return client:NotifyLocalized("Your model is not supported") end
net.Start("ixOpenHandSignalMenu")
net.Send(client)
end
})

View File

@@ -0,0 +1,98 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
util.AddNetworkString("ixOpenHandSignalMenu")
util.AddNetworkString("ixGestureAnimation")
util.AddNetworkString("ixAskForGestureAnimation")
local animationLookup = {
male = {
"bg_accent_left",
"bg_accentfwd",
"bg_accentup",
"bg_down",
"bg_left",
"bg_right",
"bg_up_l",
"bg_up_r",
"g_antman_punctuate",
"g_armsout",
"g_chestup",
"g_fist_l",
"g_fist_r",
"g_first_swing_accross",
"g_lefthandmotion",
"g_lhandease",
"g_look",
"g_look_small",
"g_medpuct_mid",
"g_noway_small",
"g_openarms",
"g_openarms_right",
"g_palm_out_high_l",
"g_palm_out_high_r",
"g_palm_out_r",
"g_palm_out_l",
"g_palm_up_high_l",
"g_palm_up_l",
"g_puncuate",
"g_righthandheavy",
"g_righthandroll",
"g_shrug",
"g_what",
"hg_chest_twistl",
"hg_headshake",
"hg_nod_yes",
"hg_puncuate_down",
"hg_turn_l",
"hg_turn_r",
"hg_turnl",
"hg_turnr"
},
female = {
"hg_headshake",
"hg_nodleft",
"hg_nodright",
"hg_puncuate_down",
"g_display_left",
"g_left_openhand",
"g_puncuate",
"g_right_openhand",
"b_accent_back",
"b_accent_fwd",
"b_head_back",
"b_head_forward",
"b_overhere_left",
"b_overhere_right",
}
}
local allowedChatTypes = {
["ic"] = true,
["w"] = true,
["wd"] = true,
["y"] = true,
["sv"] = true
}
function PLUGIN:PostPlayerSay(client, chatType)
if (!ix.option.Get(client, "enableGestureAnims", true)) then return end
if (!allowedChatTypes[chatType] or !client:Alive()) then return end
if (!client:Alive()) then return end
--local modelClass = ix.anim.GetModelClass(client:GetModel())
--if (modelClass != "citizen_male" and modelClass != "citizen_female") then return end
local activeWeapon = client:GetActiveWeapon()
if (!IsValid(activeWeapon)) then return end
if (activeWeapon and activeWeapon:GetClass() != "ix_hands") then return end
if (math.random(1, 2) == 2) then return end -- Don't want it to always gesture
client:PlayGestureAnimation(client:LookupSequence(client:IsFemale() and animationLookup.female[math.random(#animationLookup.female)] or animationLookup.male[math.random(#animationLookup.male)]))
end