Skip to content

Commit

Permalink
Merge pull request #132 from djsmithdev/development
Browse files Browse the repository at this point in the history
2.4.4
  • Loading branch information
sampconrad authored Sep 5, 2024
2 parents 2f94aab + ea30305 commit 92c9c1d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CombatMode/CombatMode.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 110002
## Version: 2.4.3
## Version: 2.4.4

## Title: |A:::|a|TInterface\Addons\CombatMode\assets\cmtitle:22:95|t
## Author: justice7ca, sampconrad.
Expand Down
5 changes: 4 additions & 1 deletion CombatMode/Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
local _G = _G
local AceAddon = _G.LibStub("AceAddon-3.0")

-- Check if running on Retail or Classic
local ON_RETAIL_CLIENT = (_G.WOW_PROJECT_ID == _G.WOW_PROJECT_MAINLINE)

-- CACHING GLOBAL VARIABLES
local GetBindingKey = _G.GetBindingKey
local GetCurrentBindingSet = _G.GetCurrentBindingSet
Expand Down Expand Up @@ -877,7 +880,7 @@ local ReticleTargetingOptions = {
return CM.DB.char.crosshairPriority
end,
disabled = function()
return CM.DB.char.reticleTargeting ~= true
return CM.DB.char.reticleTargeting ~= true or ON_RETAIL_CLIENT == false
end
},
friendlyTargetingInCombat = {
Expand Down
15 changes: 13 additions & 2 deletions CombatMode/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ local AceConfig = _G.LibStub("AceConfig-3.0")
local AceConfigDialog = _G.LibStub("AceConfigDialog-3.0")
local AceConfigCmd = _G.LibStub("AceConfigCmd-3.0")

-- Check if running on Retail or Classic
local ON_RETAIL_CLIENT = (_G.WOW_PROJECT_ID == _G.WOW_PROJECT_MAINLINE)

-- CACHING GLOBAL VARIABLES
-- Slightly better performance than doing a global lookup every time
local CreateFrame = _G.CreateFrame
Expand All @@ -31,7 +34,6 @@ local loadstring = _G.loadstring
local MouselookStart = _G.MouselookStart
local MouselookStop = _G.MouselookStop
local OpenToCategory = _G.Settings.OpenToCategory
local IsInBattle = _G.C_PetBattles.IsInBattle
local ReloadUI = _G.ReloadUI
local SaveBindings = _G.SaveBindings
local SetBinding = _G.SetBinding
Expand Down Expand Up @@ -266,6 +268,7 @@ function CM.SetShoulderOffset()
end

function CM.SetCrosshairPriority(enabled)
if ON_RETAIL_CLIENT == false then return end
if enabled then
SetCVar("enableMouseoverCast", 1)
SetModifiedClick("MOUSEOVERCAST", "NONE")
Expand Down Expand Up @@ -536,6 +539,14 @@ local function IsVendorMountOut()
return false
end

local function IsInPetBattle()
if ON_RETAIL_CLIENT then
return _G.C_PetBattles.IsInBattle()
else
return false
end
end

local function IsUnlockFrameVisible()
local isGenericPanelOpen = (GetUIPanel("left") or GetUIPanel("right") or GetUIPanel("center")) and true or false
return CursorUnlockFrameVisible(CM.Constants.FramesToCheck) or CursorUnlockFrameVisible(CM.DB.global.watchlist) or
Expand All @@ -544,7 +555,7 @@ end

local function ShouldFreeLookBeOff()
local evaluate = FreeLookOverride or SpellIsTargeting() or InCinematic() or IsInCinematicScene() or
IsUnlockFrameVisible() or IsCustomConditionTrue() or IsVendorMountOut() or IsInBattle()
IsUnlockFrameVisible() or IsCustomConditionTrue() or IsVendorMountOut() or IsInPetBattle()

return evaluate
end
Expand Down

0 comments on commit 92c9c1d

Please sign in to comment.