Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions lua/entities/gmod_wire_expression2/core/cl_console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ local convars = {
wire_expression2_convar_whitelist = ""
}

local function CreateCVars()
for name,default in pairs(convars) do
local current_cvar = CreateClientConVar(name, default, true, true)
local value = current_cvar:GetString() or default
RunConsoleCommand(name, value)
end
end

if CanRunConsoleCommand() then
CreateCVars()
else
hook.Add("Initialize", "wire_expression2_console", function()
CreateCVars()
end)
for name, default in pairs(convars) do
CreateClientConVar(name, default, true, true)
end
27 changes: 9 additions & 18 deletions lua/entities/gmod_wire_expression2/core/cl_player.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
local function SendFriendStatus()
local friends = {}
hook.Add("OnEntityCreated", "wire_expression2_extension_player", function(ent)
if ent:IsPlayer() then
local friends = {}

for _, ply in ipairs(player.GetHumans()) do
if ply:GetFriendStatus() == "friend" then
table.insert(friends, ply:EntIndex())
for _, ply in ipairs(player.GetHumans()) do
if ply:GetFriendStatus() == "friend" then
table.insert(friends, ply:EntIndex())
end
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()
RunConsoleCommand("wire_expression2_friend_status", table.concat(friends, ","))
end
end)
7 changes: 0 additions & 7 deletions lua/wire/client/cl_wirelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,6 @@ hook.Add("InitPostEntity", "language_strings", function()
end
end)

if not CanRunConsoleCommand then
function CanRunConsoleCommand() return false end
hook.Add("Initialize", "CanRunConsoleCommand", function()
function CanRunConsoleCommand() return true end
end)
end

function Derma_StringRequestNoBlur(...)
local panel = Derma_StringRequest(...)
panel:SetBackgroundBlur(false)
Expand Down
8 changes: 3 additions & 5 deletions lua/wire/client/text_editor/wire_expression2_editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1786,11 +1786,9 @@ function Editor:SetV(bool)
self:SetVisible(bool)
self:SetKeyboardInputEnabled(bool)
self:GetParent():SetWorldClicker(wire_expression2_editor_worldclicker:GetBool() and bool) -- Enable this on the background so we can update E2's without closing the editor
if CanRunConsoleCommand() then
RunConsoleCommand("wire_expression2_event", bool and "editor_open" or "editor_close")
if not e2_function_data_received and bool then -- Request the E2 functions
RunConsoleCommand("wire_expression2_sendfunctions")
end
RunConsoleCommand("wire_expression2_event", bool and "editor_open" or "editor_close")
if not e2_function_data_received and bool then -- Request the E2 functions
RunConsoleCommand("wire_expression2_sendfunctions")
end
end

Expand Down
Loading