Code:
local primaryAttributes = {
"type", "spell", "item", "action", "macro", "macrotext", "checkselfcast", "checkfocuscast",
"toy", "flyoutDirection", "clickbutton", "unit", "marker", "harmbutton", "helpbutton", "attribute-name",
"attribute-value", "actionpage", "downbutton", "unit-suffix", "toggleForVehicle", "allowVehicleTarget"
}
local function potentialProperties(startingTable, attr, prefix, suffix)
if (type(attr) ~= "string") then return startingTable end
if (prefix) then prefix = "*" else prefix = "" end
if (suffix) then suffix = "*" else suffix = "" end
table.insert(startingTable, prefix..attr..suffix)
table.insert(startingTable, prefix.."alt-"..attr..suffix);
table.insert(startingTable, prefix.."alt-ctrl-"..attr..suffix);
table.insert(startingTable, prefix.."alt-shift-"..attr..suffix);
if (prefix ~= "*") then
table.insert(startingTable, prefix.."alt-ctrl-shift-"..attr..suffix);
end
table.insert(startingTable, prefix.."ctrl-"..attr..suffix);
table.insert(startingTable, prefix.."ctrl-shift-"..attr..suffix);
table.insert(startingTable, prefix.."shift-"..attr..suffix);
return startingTable;
end
local function generateAllPossibleAttributes()
local results = { };
for attribIndex,attrib in ipairs(primaryAttributes) do
results = potentialProperties(results, attrib, false, false)
results = potentialProperties(results, attrib, false, true)
results = potentialProperties(results, attrib, true, false)
results = potentialProperties(results, attrib, true, true)
for idx = 1, 5 do
results = potentialProperties(results, attrib..tostring(idx), false, false)
results = potentialProperties(results, attrib..tostring(idx), true, false)
end
end
return results;
end