-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.lua
More file actions
executable file
·70 lines (65 loc) · 2.83 KB
/
Copy pathConfig.lua
File metadata and controls
executable file
·70 lines (65 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
local addonName, Ironman = ...
-- Config.lua
SLASH_IRONMAN1 = "/ironman"
SLASH_IRONMAN2 = "/im"
SlashCmdList["IRONMAN"] = function(msg)
msg = msg or ""
local cmd = string.lower(msg)
if cmd == "rules" then
print("|cff00ff00Ironman Rules:|r")
for ruleKey, rule in pairs(IronmanModeDB.rules) do
if type(rule) == "table" then
print(" - " .. (rule.name or ruleKey) .. ": " .. (rule.enabled and "ON" or "OFF") .. " (weight: " .. (rule.weight or 10) .. ")")
else
print(" - " .. ruleKey .. ": " .. (rule and "ON" or "OFF") .. " (BOOLEAN - NEEDS CONVERSION)")
end
end
elseif cmd == "convert" then
print("|cffff0000[Ironman]|r Manually triggering rule conversion...")
if IronmanModeDB and IronmanModeDB.rules then
Ironman:ConvertRulesToObjects()
print("|cffff0000[Ironman]|r Conversion attempt complete. Check above for details.")
else
print("|cffff0000[Ironman]|r No rules to convert!")
end
elseif cmd == "debug" then
print("|cffff0000[Ironman]|r === Debug Info ===")
print("Enabled: " .. tostring(IronmanModeDB.enabled))
print("Validity: " .. tostring(IronmanModeDB.validity))
print("Hardcore: " .. tostring(IronmanModeDB.doHardcore))
print("Normal Score: " .. tostring(IronmanModeDB.normalScore))
print("Hardcore Score: " .. tostring(IronmanModeDB.hardcoreScore))
print("Violations: " .. tostring(#(IronmanModeDB.violations or {})))
print("Rules:")
for ruleKey, rule in pairs(IronmanModeDB.rules or {}) do
if type(rule) == "table" then
print(" " .. ruleKey .. ": enabled=" .. tostring(rule.enabled) .. ", weight=" .. tostring(rule.weight) .. ", name=" .. tostring(rule.name))
else
print(" " .. ruleKey .. ": " .. tostring(rule) .. " (BOOLEAN - NEEDS CONVERSION)")
end
end
elseif msg:match("^toggle%s+") then
local ruleKey = msg:match("^toggle%s+(%S+)")
if IronmanModeDB.rules[ruleKey] ~= nil then
local rule = IronmanModeDB.rules[ruleKey]
if type(rule) == "table" then
IronmanModeDB.rules[ruleKey].enabled = not rule.enabled
print(ruleKey .. " toggled to " .. tostring(IronmanModeDB.rules[ruleKey].enabled))
else
IronmanModeDB.rules[ruleKey] = not rule
print(ruleKey .. " toggled to " .. tostring(IronmanModeDB.rules[ruleKey]) .. " (still boolean - use /ironman convert)")
end
-- Recalculate validity after toggle
IronmanModeDB.validity = Ironman:CalculateValidity()
else
print("Unknown rule: " .. ruleKey)
end
else
print("|cff00ff00Ironman Commands:|r")
print("/ironman or /im - open UI")
print("/ironman rules - list current rule states")
print("/ironman toggle <rule> - toggle a rule")
print("/ironman debug - show detailed debug info")
print("/ironman convert - manually convert rules to object format")
end
end