-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from GMLambda/bad-bad-addons
Add a warning for when bad addons are mounted
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
AddCSLuaFile() | ||
|
||
local badAddonIds = { | ||
-- "Episode animation fixes" | ||
["3022183926"] = true, | ||
["1879556056"] = true, | ||
["2576796480"] = true, | ||
["3263204957"] = true, | ||
["1881393042"] = true, | ||
["1095903501"] = true, | ||
["1890049841"] = true, | ||
-- Reserved. | ||
} | ||
|
||
local function IsBadAddon(id) | ||
return badAddonIds[id] ~= nil | ||
end | ||
|
||
local function CheckAddonCompatibility() | ||
local addons = engine.GetAddons() | ||
local badAddons = {} | ||
for _, addon in pairs(addons) do | ||
if addon.mounted and IsBadAddon(addon.wsid) then | ||
table.insert(badAddons, addon) | ||
end | ||
end | ||
if #badAddons == 0 then | ||
return | ||
end | ||
local errorInfo = "WARNING: Following addons are obsolete or cause issues:\n" | ||
for _, addon in pairs(badAddons) do | ||
errorInfo = errorInfo .. " - " .. addon.title .. " (" .. addon.wsid .. ")\n" | ||
end | ||
errorInfo = errorInfo .. "Disable them and restart the game for the best experience.\n" | ||
ErrorNoHalt(errorInfo) | ||
end | ||
|
||
CheckAddonCompatibility() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters