Skip to content

Commit

Permalink
Merge pull request #225 from bpapuni/master
Browse files Browse the repository at this point in the history
Several minor fixes incl. issue 224
  • Loading branch information
Sellorio authored Aug 5, 2024
2 parents 41bdfef + 599e4a0 commit 211c9d6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PetActionTextures = {

MegaMacroTexture = 134400
MegaMacroActiveStanceTexture = 136116
MegaMacroCodeMaxLength = 255
MegaMacroCodeMaxLength = 250
MegaMacroCodeMaxLengthForNative = 250
HighestMaxMacroCount = math.max(MacroLimits.GlobalCount, MacroLimits.PerClassCount, MacroLimits.PerSpecializationCount, MacroLimits.PerCharacterCount, MacroLimits.PerCharacterSpecializationCount)

Expand Down
10 changes: 7 additions & 3 deletions src/engine/mega-macro-icon-evaluator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ local function GetAbilityData(ability)
end
else
local spellInfo = C_Spell.GetSpellInfo(ability)
if (spellInfo == nil) then
return
local spellName, texture, spellId

if spellInfo then
spellName = spellInfo.name
texture = spellInfo.iconID
spellId = spellInfo.spellID
end
local spellName, _, texture, _, _, _, spellId = spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID

if spellId then
local shapeshiftFormIndex = GetShapeshiftForm()
local isActiveStance = shapeshiftFormIndex and shapeshiftFormIndex > 0 and spellId == select(4, GetShapeshiftFormInfo(shapeshiftFormIndex))
Expand Down
6 changes: 3 additions & 3 deletions src/engine/parsing/parsing-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ local function ParseResult(parsingContext, length, colour)
local text = string.sub(parsingContext.Code, parsingContext.Index, parsingContext.Index + length - 1)
parsingContext.Index = parsingContext.Index + length

if parsingContext.Index > 256 then
local validText = #text - (parsingContext.Index - 256) >= 1 and text:sub(1, #text - (parsingContext.Index - 256)) or ""
local overflowText = #validText > 0 and text:sub(#text - (parsingContext.Index - 257)) or text
if parsingContext.Index > (MegaMacroCodeMaxLengthForNative + 1) then
local validText = #text - (parsingContext.Index - (MegaMacroCodeMaxLengthForNative + 1)) >= 1 and text:sub(1, #text - (parsingContext.Index - (MegaMacroCodeMaxLengthForNative + 1))) or ""
local overflowText = #validText > 0 and text:sub(#text - (parsingContext.Index - (MegaMacroCodeMaxLengthForNative + 2))) or text
return validText .. "|c"..GetMegaMacroParsingColourData().Error..overflowText.."|r"
else
return colour and "|c"..colour..text.."|r" or text
Expand Down
3 changes: 2 additions & 1 deletion src/tooltip-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function ShowToolTipForMegaMacro(macroId)
GameTooltip:SetSpellByID(data.Id)
-- GameTooltip:SetToyByItemID(itemId)
elseif data.Type == "item" then
GameTooltip:SetItemByID(data.Id)
-- GameTooltip:SetItemByID(data.Id)
GameTooltip:SetInventoryItemByID(data.Id)
elseif data.Type == "equipment set" then
GameTooltip:SetEquipmentSet(data.Name)
else
Expand Down

0 comments on commit 211c9d6

Please sign in to comment.