-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat_cmd_handler.lua
More file actions
135 lines (120 loc) · 5.09 KB
/
Copy pathchat_cmd_handler.lua
File metadata and controls
135 lines (120 loc) · 5.09 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
function EngInventory_cmd(msg)
local cmd, params = EngInventory_SplitSpace(msg);
local param2;
cmd = string.lower(cmd);
if (cmd == "hide") then
EngInventory_frame:Hide();
elseif (cmd == "show") then
EngInventory_frame:Show();
elseif (cmd == "update") then
-- force window update
EngInventory_window_update_required = ENGINVENTORY_MANDATORY;
EngInventory_UpdateWindow();
elseif (cmd == "display") then
-- Debugging - display item cache
EngInventory_UpdateInventoryCache();
EngInventory_DisplayItemCache();
elseif (cmd == "checkhooks") then
EngInventory_RegisterHooks(ENGINVENTORY_HOOKS_CHECK);
elseif (cmd == "debug") then
if (ENGINVENTORY_DEBUGMESSAGES == 0) then
ENGINVENTORY_DEBUGMESSAGES = 1;
EngInventory_Print("EngInventory: Debugging messages on.");
else
ENGINVENTORY_DEBUGMESSAGES = 0;
EngInventory_Print("EngInventory: Debugging messages off.");
end
elseif (cmd == "lock") then
EngInventoryConfig["moveLock"] = 0;
EngInventory_Button_MoveLockToggle:SetText(EILocal["EngInventory_Button_MoveLock_locked"]);
elseif (cmd == "unlock") then
EngInventoryConfig["moveLock"] = 1;
EngInventory_Button_MoveLockToggle:SetText(EILocal["EngInventory_Button_MoveLock_unlocked"]);
elseif (cmd == "scale") then
EngInventoryConfig["frameWindowScale"] = tonumber(params);
EngInventory_SetDefaultValues(0);
EngInventory_window_update_required = ENGINVENTORY_MANDATORY;
EngInventory_UpdateWindow();
EngInventory_Print("Window scale set to: "..EngInventoryConfig["frameWindowScale"]);
elseif (cmd == "set") then
if (params == "") then
EngInventory_Print("Current settings:", 1.0,0.5,0.5);
for key,value in EngInventoryConfig do
if (not string.find(key, "__version")) then
EngInventory_Print(" "..key.." = "..value);
end
end
else
params, param2 = EngInventory_SplitSpace(params);
if ( (EngInventoryConfig[params] ~= nil) and (param2 ~= nil) ) then
EngInventoryConfig[params] = param2;
EngInventory_Print(params.." set to '"..param2.."'", 0,1,0.5);
EngInventory_window_update_required = ENGINVENTORY_MANDATORY;
EngInventory_UpdateWindow();
else
EngInventory_Print("Invalid variable or value. (Variables are case sensitive)", 1,0.2,0.2);
end
end
elseif (cmd == "resetdefaults") then
EngInventoryConfig = {};
EngInventory_SetDefaultValues(1);
EngInventory_Print("Default values loaded..");
EngInventory_Print("If you are resetting defaults because the mod wasn't running, you might have to reload your UI to make it work again. Try /console reloadui", 1,0.2,0.2);
elseif (cmd == "config") then
EngInventory_OptsFrame:Show();
elseif (cmd == "test") then
-- development test stuff
local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType;
local i, i2;
local skillType, numAvailable, isExpanded, tmp, tmp2;
local reagentName, reagentTexture, reagentCount, playerReagentCount;
local craftName, craftSubSpellName, craftType;
--[[
for i = 1, GetNumSkillLines() do
skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType = GetSkillLineInfo(i);
if (isHeader) then
EngInventory_Print(skillName, 1,0,0);
else
EngInventory_Print(skillName, 0,1,1);
end
end
--]]
--[[
if (GetNumTradeSkills() > 0) then
for i = 1, GetNumTradeSkills() do
skillName, skillType, numAvailable, isExpanded = GetTradeSkillInfo(i);
--Print("|cFFFF007F"..skillType.."|r = "..skillName..", |cFF007FFF"..numAvailable.."|r");
if (skillType ~= "header") then
--tmp = GetTradeSkillTools(i);
Print( GetTradeSkillItemLink(i) );
if (GetTradeSkillNumReagents(i) > 0) then
for i2 = 1, GetTradeSkillNumReagents(i) do
reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(i, i2);
Print( "--> "..GetTradeSkillReagentItemLink(i,i2)..", "..reagentCount );
end
end
end
end
local tradeskillName, currentLevel, maxLevel = GetTradeSkillLine();
Print( tradeskillName..", "..currentLevel..", "..maxLevel );
end --]]
if (GetNumCrafts() > 0) then
for i = 1, GetNumCrafts() do
craftName, craftSubSpellName, craftType, numAvailable, isExpanded = GetCraftInfo(i);
Print("|cFFFF007F"..craftType.."|r = "..craftName..", |cFF007FFF"..craftSubSpellName..", "..numAvailable.."|r");
if (GetCraftNumReagents(i) > 0) then
for i2 = 1, GetCraftNumReagents(i) do
reagentName, reagentTexture, reagentCount, playerReagentCount = GetCraftReagentInfo(i, i2);
Print( "--> "..GetCraftReagentItemLink(i,i2)..", "..reagentCount );
end
end
end
local tradeskillName, currentLevel, maxLevel = GetCraftDisplaySkillLine();
Print( tradeskillName..", "..currentLevel..", "..maxLevel );
end
else
for key,value in ENGINVENTORY_HELP[ EILocal["help_text"] ] do
EngInventory_Print(string.gsub(value, "\r", ""));
end
end
end