From 613829e834445cb1b21db7905a41b70ccfee726d Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:46:25 +0300 Subject: [PATCH 1/3] Remove istyping hack This may have been created before IsTyping was added to GMOD, but we have it by default now, so this hack is no longer needed --- .../gmod_wire_expression2/core/cl_player.lua | 12 ++++-------- lua/entities/gmod_wire_expression2/core/player.lua | 11 +++-------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/core/cl_player.lua b/lua/entities/gmod_wire_expression2/core/cl_player.lua index 922b1efa5f..0ceb19da58 100644 --- a/lua/entities/gmod_wire_expression2/core/cl_player.lua +++ b/lua/entities/gmod_wire_expression2/core/cl_player.lua @@ -1,26 +1,22 @@ local function SendFriendStatus() local friends = {} - for _,ply in ipairs(player.GetHumans()) do + + for _, ply in ipairs(player.GetHumans()) do if ply:GetFriendStatus() == "friend" then table.insert(friends, ply:EntIndex()) end end + RunConsoleCommand("wire_expression2_friend_status", table.concat(friends, ",")) end if CanRunConsoleCommand() then SendFriendStatus() end + hook.Add("OnEntityCreated", "wire_expression2_extension_player", function(ent) if not IsValid(ent) then return end if not ent:IsPlayer() then return end SendFriendStatus() end) - --- isTyping -hook.Add("StartChat","E2_IsTyping_Start",function() RunConsoleCommand("E2_StartChat") end) -hook.Add("FinishChat","E2_IsTyping_Finish",function() RunConsoleCommand("E2_FinishChat") end) -hook.Add("ShutDown", "E2_FinishChat_Remove", function() - hook.Remove("FinishChat", "E2_IsTyping_Finish") -end) diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index 2b711b6475..aec52049fc 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -500,15 +500,10 @@ end, function(self) self.entity.Use = nil end) - --- isTyping -local plys = {} -concommand.Add("E2_StartChat",function(ply,cmd,args) plys[ply] = true end) -concommand.Add("E2_FinishChat",function(ply,cmd,args) plys[ply] = nil end) -hook.Add("PlayerDisconnected","E2_istyping",function(ply) plys[ply] = nil end) - e2function number entity:isTyping() - return plys[this] and 1 or 0 + if not IsValid(this) then return self:throw("Invalid entity!", 0) end + if not this:IsPlayer() then return self:throw("Expected a Player but got Entity", 0) end + return self:IsTyping() end -------------------------------------------------------------------------------- From 28578b3128fdd0cf6305eb6c8512fc9d20c80fdb Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:48:00 +0300 Subject: [PATCH 2/3] Return number --- lua/entities/gmod_wire_expression2/core/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index aec52049fc..1b734a7875 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -503,7 +503,7 @@ end) e2function number entity:isTyping() if not IsValid(this) then return self:throw("Invalid entity!", 0) end if not this:IsPlayer() then return self:throw("Expected a Player but got Entity", 0) end - return self:IsTyping() + return self:IsTyping() and 1 or 0 end -------------------------------------------------------------------------------- From 8e3dab09a1b076079b558e5b7c2c271c8024c337 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:48:19 +0300 Subject: [PATCH 3/3] Use this --- lua/entities/gmod_wire_expression2/core/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index 1b734a7875..def8d1af31 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -503,7 +503,7 @@ end) e2function number entity:isTyping() if not IsValid(this) then return self:throw("Invalid entity!", 0) end if not this:IsPlayer() then return self:throw("Expected a Player but got Entity", 0) end - return self:IsTyping() and 1 or 0 + return this:IsTyping() and 1 or 0 end --------------------------------------------------------------------------------