Skip to content

Commit

Permalink
Merge pull request #188 from aurelion314/master
Browse files Browse the repository at this point in the history
New feature: Native Macros
  • Loading branch information
Sellorio authored Jan 19, 2024
2 parents 91455ad + b7f22a5 commit d3f1a53
Show file tree
Hide file tree
Showing 13 changed files with 564 additions and 200 deletions.
2 changes: 1 addition & 1 deletion MegaMacro.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 100000
## Interface: 100205
## Title: Mega Macro
## Author: Sellorio
## Version: 1.0.0
Expand Down
10 changes: 9 additions & 1 deletion src/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function MegaMacro_InitialiseConfig()
MegaMacroGlobalData = {
Activated = false,
Macros = {},
InactiveMacros = {},
Classes = {}
}
end
Expand All @@ -14,6 +15,12 @@ function MegaMacro_InitialiseConfig()
Specializations = {}
}
end

if MegaMacroConfig == nil then
MegaMacroConfig = {
UseNativeActionBar = true,
}
end
end

function MegaMacroConfig_IsWindowDialog()
Expand All @@ -24,4 +31,5 @@ function MegaMacroConfig_GetWindowPosition()
if MegaMacroGlobalData.WindowInfo then
return MegaMacroGlobalData.WindowInfo.RelativePoint, MegaMacroGlobalData.WindowInfo.X, MegaMacroGlobalData.WindowInfo.Y
end
end
end

7 changes: 5 additions & 2 deletions src/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ MacroLimits = {
PerClassCount = 30,
PerSpecializationCount = 30,
-- limit: 18 character specific macro slots
PerCharacterCount = 8,
PerCharacterSpecializationCount = 10,
PerCharacterCount = 18,
PerCharacterSpecializationCount = 0,
InactiveCount = 160,
MaxGlobalMacros = 120,
MaxCharacterMacros = 18
}
Expand All @@ -16,6 +17,7 @@ MacroIndexOffsets = {
PerSpecialization = MacroLimits.GlobalCount + MacroLimits.PerClassCount,
PerCharacter = MacroLimits.GlobalCount + MacroLimits.PerClassCount + MacroLimits.PerSpecializationCount,
PerCharacterSpecialization = MacroLimits.GlobalCount + MacroLimits.PerClassCount + MacroLimits.PerSpecializationCount + MacroLimits.PerCharacterCount,
Inactive = MacroLimits.GlobalCount + MacroLimits.PerClassCount + MacroLimits.PerSpecializationCount + MacroLimits.PerCharacterCount + MacroLimits.PerCharacterSpecializationCount,
NativeCharacterMacros = 120
}

Expand All @@ -41,6 +43,7 @@ PetActionTextures = {
MegaMacroTexture = 134400
MegaMacroActiveStanceTexture = 136116
MegaMacroCodeMaxLength = 1023
MegaMacroCodeMaxLengthForNative = 250
HighestMaxMacroCount = math.max(MacroLimits.GlobalCount, MacroLimits.PerClassCount, MacroLimits.PerSpecializationCount, MacroLimits.PerCharacterCount, MacroLimits.PerCharacterSpecializationCount)

MegaMacroInfoFunctions = {
Expand Down
7 changes: 7 additions & 0 deletions src/engine/mega-macro-action-bar-engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ local function UpdateRange(button, functions, abilityId, target)
end

local function UpdateActionBar(button, macroId)
if MegaMacroConfig['UseNativeActionBar'] then
return
end

local data = MegaMacroIconEvaluator.GetCachedData(macroId)
local functions = MegaMacroInfoFunctions.Unknown

Expand Down Expand Up @@ -312,6 +316,9 @@ local function UpdateActionBar(button, macroId)
end

local function ResetActionBar(button)
if MegaMacroConfig['UseNativeActionBar'] then
return
end
button:SetChecked(false)
button.Count:SetText("")
button.Border:Hide() -- reset eqipped border
Expand Down
Loading

0 comments on commit d3f1a53

Please sign in to comment.