Skip to content

Commit

Permalink
Add warning to install CFW if not found
Browse files Browse the repository at this point in the history
thecraftianman committed Aug 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 445fac4 commit 4acfdbc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lua/acf/compatibility/conflict_checker.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local Messages = ACF.Utilities.Messages

-- Older versions of ACF will conflict due to the new file loading system we implemented.
-- If the server has an older version installed simultaneously, we'll let the players know.
@@ -14,11 +15,26 @@ if ACF.Version then
net.Receive("ACF_VersionConflict", function()
hook.Add("CreateMove", "ACF Version Conflict", function(Move)
if Move:GetButtons() ~= 0 then
ACF.PrintToChat("Warning", "An unsupported or multiple versions of ACF detected. Check server's ACF installation.")
Messages.PrintChat("Warning", "An unsupported or multiple versions of ACF detected. Check server's ACF installation.")

hook.Remove("CreateMove", "ACF Version Conflict")
end
end)
end)
end
end

-- Make sure that players also know they need to install CFW if they haven't already

timer.Simple(1, function()
if not CFW then
hook.Add("CreateMove", "ACF CFW Requirement", function(Move)
if Move:GetButtons() ~= 0 then
local PrintFunc = CLIENT and Messages.PrintChat or Messages.PrintLog
PrintFunc("Warning", "Contraption Framework is not installed! ACF will not work correctly! Install it at https://steamcommunity.com/sharedfiles/filedetails/?id=3154971187")

hook.Remove("CreateMove", "ACF Version Conflict")
end
end)
end
end)

0 comments on commit 4acfdbc

Please sign in to comment.