Commit 0307c1a1 authored by Ivaria's avatar Ivaria
Browse files

Fixed 'shield status' display for absorption spells tracked as HoT icons....

Fixed 'shield status' display for absorption spells tracked as HoT icons. Added ability to import/export profiles as strings for sharing purposes. Added ability to import/export bouquets as strings for sharing purposes. Added Huffman compression for profile sharing and storage.
parent bf4a19ba
......@@ -16,6 +16,7 @@ externals:
Libs/LibDataBroker-1.1: git://git.wowace.com/wow/libdatabroker-1-1/mainline.git
Libs/UTF8: svn://svn.wowace.com/wow/utf8/mainline/trunk
Libs/LibCompress: svn://svn.wowace.com/wow/libcompress/mainline/trunk
Libs/LibBase64-1.0: git://git.wowace.com/wow/libbase64-1-0/mainline.git
VuhDoOptions/Libs/ChatThrottleLib: svn://svn.wowace.com/wow/chatthrottlelib/mainline/trunk
......
......@@ -8,6 +8,7 @@
<Script file="Libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua" />
<Script file="Libs\UTF8\utf8.lua" />
<Script file="Libs\LibCompress\LibCompress.lua" />
<Script file="Libs\LibBase64-1.0\LibBase64-1.0.lua" />
<Script file="VuhDoLocalization_en.lua" />
<Script file="VuhDoLocalization_de.lua" />
......
......@@ -7,6 +7,8 @@ VUHDO_LibButtonFacade = nil;
VUHDO_LibCompress = LibStub:GetLibrary("LibCompress");
VUHDO_LibCompressEncode = VUHDO_LibCompress:GetAddonEncodeTable();
VUHDO_LibBase64 = LibStub:GetLibrary("LibBase64-1.0");
VUHDO_LibSharedMedia:Register("font", "Arial Black", "Interface\\AddOns\\VuhDo\\Fonts\\ariblk.ttf");
VUHDO_LibSharedMedia:Register("font", "Emblem", "Interface\\AddOns\\VuhDo\\Fonts\\Emblem.ttf");
VUHDO_LibSharedMedia:Register("font", "Vixar", "Interface\\AddOns\\VuhDo\\Fonts\\vixar.ttf");
......
......@@ -1002,6 +1002,66 @@ end
-- WA2 sandbox for execution - warning best effort!
-- no overrides for now
local VUHDO_OVERRIDE_FUNCTIONS = { };
local VUHDO_BLOCKED_FUNCTIONS = {
-- Lua functions that may allow breaking out of the environment
getfenv = true,
setfenv = true,
loadstring = true,
pcall = true,
-- blocked WoW API
SendMail = true,
SetTradeMoney = true,
AddTradeMoney = true,
PickupTradeMoney = true,
PickupPlayerMoney = true,
TradeFrame = true,
MailFrame = true,
EnumerateFrames = true,
RunScript = true,
AcceptTrade = true,
SetSendMailMoney = true,
EditMacro = true
};
--
local function VUHDO_blockedFunction()
DEFAULT_CHAT_FRAME:AddMessage(VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED, 1.0, 0.0, 0.0);
end
local env_getglobal;
local exec_env = setmetatable({}, { __index =
function(t, k)
if k == "_G" then
return t
elseif k == "getglobal" then
return env_getglobal
elseif VUHDO_BLOCKED_FUNCTIONS[k] then
return VUHDO_blockedFunction
elseif VUHDO_OVERRIDE_FUNCTIONS[k] then
return VUHDO_OVERRIDE_FUNCTIONS[k]
else
return _G[k]
end
end
});
--
function env_getglobal(k)
return exec_env[k];
end
--
local function VUHDO_customFlagValidator(anInfo, aCustom)
if aCustom and aCustom["custom"] and aCustom["custom"][1] then
......@@ -1009,7 +1069,7 @@ local function VUHDO_customFlagValidator(anInfo, aCustom)
if loadedFunction then
_G["VUHDO_anInfo"] = anInfo;
setfenv(loadedFunction, _G)
setfenv(loadedFunction, exec_env);
local _, ret, ret2, ret3, ret4, ret5 = xpcall(loadedFunction,
function()
DEFAULT_CHAT_FRAME:AddMessage(VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE, 1.0, 0.0, 0.0);
......
......@@ -369,6 +369,6 @@ VUHDO_REPLACE_SPELL_NAME = {
--
VUHDO_NATIVE_ASSIGN_SPELLS = {
[VUHDO_SPELL_ID.SOULSTONE] = true, -- wirkt auf tote und lebendige
[VUHDO_SPELL_ID.SURGING_MIST] = true, -- wird instant bei soothing mist
[VUHDO_SPELL_ID.ENVELOPING_MIST] = true,
-- [VUHDO_SPELL_ID.SURGING_MIST] = true, -- wird instant bei soothing mist
-- [VUHDO_SPELL_ID.ENVELOPING_MIST] = true,
};
......@@ -790,10 +790,10 @@ function VUHDO_slashCmd(aCommand)
--[[local _, tProfile = VUHDO_getProfileNamedCompressed("Buh!");
tProfile = VUHDO_compressTable(tProfile);
local tCompressed = VUHDO_compressStringHuffman(VUHDO_compressTable(tProfile));
local tCompressed = VUHDO_compressStringHuffman(tProfile);
local tUnCompressed = VUHDO_decompressIfCompressed(VUHDO_decompressStringHuffman(tCompressed));
VUHDO_xMsg(#tProfile, #tCompressed);]]
VUHDO_xMsg(#tProfile, #tCompressed, #tUnCompressed);]]
elseif aCommand == "?" or strfind(tCommandWord, "help") or aCommand == "" then
......
......@@ -147,20 +147,20 @@ local function _VUHDO_setupHealButtonAttributes(aModiKey, aButtonId, anAction, a
aButton:SetAttribute(aModiKey .. "type" .. aButtonId, "macro");
aButton:SetAttribute(aModiKey .. "macrotext" .. aButtonId,
VUHDO_buildRezMacroText(anAction, tUnit));
VUHDO_buildRezMacroText(anAction, tUnit));
return;
-- Cleansing charmed players is an offensive thing to do
elseif VUHDO_BUFF_REMOVAL_SPELLS[anAction] then
aButton:SetAttribute(aModiKey .. "type" .. aButtonId, "macro");
aButton:SetAttribute(aModiKey .. "macrotext" .. aButtonId,
VUHDO_buildPurgeMacroText(anAction, tUnit));
VUHDO_buildPurgeMacroText(anAction, tUnit));
return;
else
-- build a spell macro
aButton:SetAttribute(aModiKey .. "type" .. aButtonId, "macro");
aButton:SetAttribute(aModiKey .. "macrotext" .. aButtonId,
VUHDO_buildMacroText(anAction, false, tUnit));
VUHDO_buildMacroText(anAction, false, tUnit));
end
else
tMacroId = GetMacroIndexByName(anAction);
......@@ -338,6 +338,11 @@ local tProhibitSmartCastOn = {
["menu"] = true,
["dropdown"] = true,
["tell"] = true,
["boss1"] = true,
["boss2"] = true,
["boss3"] = true,
["boss4"] = true,
["boss5"] = true,
};
-- Setup for smart cast
local tKey;
......
......@@ -424,5 +424,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -433,5 +433,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -434,5 +434,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -432,5 +432,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -498,5 +498,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -426,5 +426,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -426,5 +426,6 @@ VUHDO_I18N_BOSSES = "NPCs";
VUHDO_I18N_BOUQUET_CUSTOM_FLAG = "Custom Flag";
VUHDO_I18N_ERROR_CUSTOM_FLAG_LOAD = "{VuhDo} Error: Your custom flag validator did not load:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_EXECUTE = "{VuhDo} Error: Your custom flag validator did not execute:";
VUHDO_I18N_ERROR_CUSTOM_FLAG_BLOCKED = "{VuhDo} Error: A custom flag of this bouquet tried to call a forbidden function but has been blocked from doing so. Remember only to import strings from trusted sources.";
VUHDO_I18N_ERROR_INVALID_VALIDATOR = "{VuhDo} Error: Invalid validator:";
......@@ -2249,7 +2249,7 @@ local function VUHDO_askSaveProfileCallback(aButtonNum)
VUHDO_DEFAULT_PROFILE = nil;
end
VUHDO_Msg(VUHDO_I18N_PROFILE_SAVED .. "\"" .. VUHDO_TARGET_PROFILE_NAME .. "\"");
VUHDO_Msg(VUHDO_I18N_PROFILE_SAVED .. "\"" .. VUHDO_TARGET_PROFILE_NAME .. "\".");
VUHDO_updateProfileSelectCombo();
if ((VUHDO_CURR_LAYOUT or "") == "") then
......
......@@ -336,7 +336,6 @@ function VUHDO_compressForSending(aTable)
local encodedString = VUHDO_LibCompressEncode:Encode(compressedString);
return encodedString;
-- return VUHDO_compressAndPackTable(aTable);
end
......@@ -347,7 +346,6 @@ function VUHDO_decompressFromSending(aString)
local decompressedTable = VUHDO_decompressIfCompressed(decodedString);
return decompressedTable;
-- return VUHDO_decompressIfCompressed(aString);
end
......
......@@ -1091,3 +1091,6 @@ VUHDO_I18N_HIDE = "Verstecken";
VUHDO_I18N_LEAVE_ALONE = "Unverändert";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
VUHDO_I18N_IMPORT = "Import";
VUHDO_I18N_IMPORT_STRING_INVALID = "Import string was invalid.";
VUHDO_I18N_REALLY_IMPORT = "Do you really want to import?\n\nYou should only import strings from known and\nreputable sources. Never import a string whose\nsource is not trusted.";
......@@ -896,7 +896,7 @@ VUHDO_I18N_GRADIENT = "Gradient";
VUHDO_I18N_INDICATORS = "Indicators";
VUHDO_I18N_COPIED_BOUQUET = "Copied bouquet ";
VUHDO_I18N_BOUQUET_ALREADY_EXISTS = ": Bouquet already exists. Type new name first.";
VUHDO_I18N_CREATED_NEW_BOUQUET = "Created new Bouquet: ";
VUHDO_I18N_CREATED_NEW_BOUQUET = "Created new bouquet: ";
VUHDO_I18N_DELETED_BOUQUET = "Deleted bouquet: ";
VUHDO_I18N_BOUQUET_NOT_FOUND = ": No such bouquet found.";
VUHDO_I18N_SELECT_STORE_BOUQUET_FIRST = "Select bouquet first";
......@@ -1091,3 +1091,6 @@ VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_READY_CHECK = "Ready\nCheck";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
VUHDO_I18N_IMPORT = "Import";
VUHDO_I18N_IMPORT_STRING_INVALID = "Import string was invalid.";
VUHDO_I18N_REALLY_IMPORT = "Do you really want to import?\n\nYou should only import strings from known and\nreputable sources. Never import a string whose\nsource is not trusted.";
......@@ -1106,3 +1106,6 @@ VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
VUHDO_I18N_IMPORT = "Import";
VUHDO_I18N_IMPORT_STRING_INVALID = "Import string was invalid.";
VUHDO_I18N_REALLY_IMPORT = "Do you really want to import?\n\nYou should only import strings from known and\nreputable sources. Never import a string whose\nsource is not trusted.";
......@@ -1107,3 +1107,6 @@ VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
VUHDO_I18N_IMPORT = "Import";
VUHDO_I18N_IMPORT_STRING_INVALID = "Import string was invalid.";
VUHDO_I18N_REALLY_IMPORT = "Do you really want to import?\n\nYou should only import strings from known and\nreputable sources. Never import a string whose\nsource is not trusted.";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment