From eb70f9135233c02b25796b8cbbcb015fb0d87bb9 Mon Sep 17 00:00:00 2001 From: Polite Kiwi Date: Mon, 18 Nov 2019 11:21:13 -0500 Subject: [PATCH] Added The Following... - Updated to version 2.3.2 - Translation - Sped up the Locale.lua - Function L is now a table - Fallback function added - Command.lua /kiwiii - Now uses Fallback - You can now use English for commands - You can now use translated commands - Fixed a missed translation string - Item Compare updated - Now displays stat change calcs - Basic Stats show +x attack power - Basic Stats show crit chance - Resistances show % increase - etc - Translated in all languages - zhCN incomplete - Some abbreviations may be incorrect - Some words can be incorrect - Some sentence structure may be incorrect - Command /kiwiii without args shows settings frame - Customize the plugin using this - Please respect the formatting - Failure to coop could break it - Only relevant to strings - Added variable item_compare_extra - Controls basic stat changes calcs - For you to turn off Item Compare on specifically --- Tooltip.lua | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Tooltip.lua b/Tooltip.lua index 8cf7b34..a0f0138 100644 --- a/Tooltip.lua +++ b/Tooltip.lua @@ -687,10 +687,20 @@ KiwiItemInfo.DisplayItemCompare = function(base_tooltip, tooltip, sel) if(KiwiItemInfo_Vars.vars["item_compare_extra"] == true) then if(agility_ap_melee ~= 0) then - send_line(L["TOOLTIP_EX_AGI_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_melee) .. " (" .. (agility_ap_melee < 0 and "-" or "+") .. tostring(agility_ap_melee/14):match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + local temp = tostring(agility_ap_melee/14) + if(temp:match("%d+.%d")) then + send_line(L["TOOLTIP_EX_AGI_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_melee) .. " (" .. (agility_ap_melee < 0 and "-" or "+") .. temp:match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + else + send_line(L["TOOLTIP_EX_AGI_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_melee) .. " (" .. (agility_ap_melee < 0 and "-" or "+") .. temp:match("%d+") .. ".0 DPS)"), 1, 1, 1, true) + end end if(agility_ap_range ~= 0) then - send_line(L["TOOLTIP_EX_AGI_R_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_range) .. " (" .. (agility_ap_range < 0 and "-" or "+") .. tostring(agility_ap_range/14):match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + local temp = tostring(agility_ap_range/14) + if(temp:match("%d+.%d")) then + send_line(L["TOOLTIP_EX_AGI_R_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_range) .. " (" .. (agility_ap_range < 0 and "-" or "+") .. temp:match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + else + send_line(L["TOOLTIP_EX_AGI_R_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_ap_range) .. " (" .. (agility_ap_range < 0 and "-" or "+") .. temp:match("%d+") .. ".0 DPS)"), 1, 1, 1, true) + end end if(agility_crit ~= 0) then send_line(L["TOOLTIP_EX_AGI_CRIT"] .. string.format("|cFFEFEF00%s|r", tostring(agility_crit):sub(1, 6) .. "%"), 1, 1, 1, true) @@ -702,13 +712,23 @@ KiwiItemInfo.DisplayItemCompare = function(base_tooltip, tooltip, sel) send_line(L["TOOLTIP_EX_AGI_AR"] .. string.format("|cFFEFEF00%s|r", tostring(agility_armor)), 1, 1, 1, true) end if(agility_catform_ap_melee ~= 0) then - send_line(L["TOOLTIP_EX_AGI_M_CAT_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_catform_ap_melee) .. " (" .. (agility_catform_ap_melee < 0 and "-" or "+") .. tostring(agility_catform_ap_melee/14):match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + local temp = tostring(agility_catform_ap_melee/14) + if(temp:match("%d+.%d")) then + send_line(L["TOOLTIP_EX_AGI_M_CAT_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_catform_ap_melee) .. " (" .. (agility_catform_ap_melee < 0 and "-" or "+") .. temp:match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + else + send_line(L["TOOLTIP_EX_AGI_M_CAT_AP"] .. string.format("|cFFEFEF00%s|r", tostring(agility_catform_ap_melee) .. " (" .. (agility_catform_ap_melee < 0 and "-" or "+") .. temp:match("%d+") .. ".0 DPS)"), 1, 1, 1, true) + end end if(stamina_health ~= 0) then send_line(L["TOOLTIP_EX_STM_HP"] .. string.format("|cFFEFEF00%s|r", tostring(stamina_health)), 1, 1, 1, true) end if(strength_ap_melee ~= 0) then - send_line(L["TOOLTIP_EX_STR_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(strength_ap_melee) .. " (" .. (strength_ap_melee < 0 and "-" or "+") .. tostring(strength_ap_melee/14):match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + local temp = tostring(strength_ap_melee/14) + if(temp:match("%d+.%d")) then + send_line(L["TOOLTIP_EX_STR_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(strength_ap_melee) .. " (" .. (strength_ap_melee < 0 and "-" or "+") .. temp:match("%d+.%d") .. " DPS)"), 1, 1, 1, true) + else + send_line(L["TOOLTIP_EX_STR_M_AP"] .. string.format("|cFFEFEF00%s|r", tostring(strength_ap_melee) .. " (" .. (strength_ap_melee < 0 and "-" or "+") .. tostring(strength_ap_melee/14):match("%d+") .. ".0 DPS)"), 1, 1, 1, true) + end end if(strength_block ~= 0) then send_line(L["TOOLTIP_EX_STR_BLOCK"] .. string.format("|cFFEFEF00%s|r", tostring(strength_block) .. "%"), 1, 1, 1, true)