Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SOD shaman dual wield support #99

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add SOD shaman dual wield support
RagedUnicorn committed Jan 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d56a28d82d7726e3231fa4e05bc737fac4475562
1 change: 1 addition & 0 deletions GearMenu.toc
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ code/GM_Cmd.lua
code/GM_Filter.lua
code/GM_Ticker.lua
code/GM_Common.lua
code/GM_Season.lua
code/GM_Tooltip.lua
code/GM_Target.lua
code/GM_GearManager.lua
1 change: 1 addition & 0 deletions build-resources/gearmenu-development.toc.tpl
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ code/GM_Cmd.lua
code/GM_Filter.lua
code/GM_Ticker.lua
code/GM_Common.lua
code/GM_Season.lua
code/GM_Tooltip.lua
code/GM_Target.lua
code/GM_GearManager.lua
1 change: 1 addition & 0 deletions build-resources/gearmenu-release.toc.tpl
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ code/GM_Cmd.lua
code/GM_Filter.lua
code/GM_Ticker.lua
code/GM_Common.lua
code/GM_Season.lua
code/GM_Tooltip.lua
code/GM_Target.lua
code/GM_GearManager.lua
24 changes: 19 additions & 5 deletions code/GM_GearManager.lua
Original file line number Diff line number Diff line change
@@ -165,12 +165,13 @@ local gearSlots = {
INVTYPE_WEAPON - 19166
]]--
return {"INVTYPE_HOLDABLE", "INVTYPE_WEAPONOFFHAND", "INVTYPE_WEAPON"}
elseif class == "MAGE" or class == "WARLOCK" or class == "PRIEST" or class == "DRUID" then
--[[
e.g. possible itemids
INVTYPE_HOLDABLE - 4984
]]--
elseif class == "MAGE" or class == "WARLOCK" or class == "PRIEST" or class == "DRUID" then
return {"INVTYPE_HOLDABLE"}
elseif class == "HUNTER" then
--[[
e.g. possible itemids
INVTYPE_HOLDABLE - 4984
@@ -179,26 +180,39 @@ local gearSlots = {

INVTYPE_WEAPON - 19166
]]--
elseif class == "HUNTER" then
return {"INVTYPE_WEAPONOFFHAND", "INVTYPE_WEAPON", "INVTYPE_HOLDABLE"}
elseif class == "PALADIN" then
--[[
e.g. possible itemids
INVTYPE_HOLDABLE - 4984

INVTYPE_SHIELD - 19862
]]--
elseif class == "PALADIN" or class == "SHAMAN" then
return {"INVTYPE_HOLDABLE", "INVTYPE_SHIELD"}
elseif class == "SHAMAN" then
--[[
e.g. possible itemids
INVTYPE_HOLDABLE - 4984

INVTYPE_SHIELD - 19862

INVTYPE_WEAPON - 19166

SOD
INVTYPE_WEAPONOFFHAND - 19866
SOD
INVTYPE_WEAPON - 19166
]]--
local invType = {
"INVTYPE_HOLDABLE",
"INVTYPE_SHIELD"
}

-- SOD dual wield support
if mod.season.IsSodActive() then
table.insert(invType, "INVTYPE_WEAPONOFFHAND")
table.insert(invType, "INVTYPE_WEAPON")
end

return invType
elseif class == "WARRIOR" then
return {"INVTYPE_HOLDABLE", "INVTYPE_SHIELD", "INVTYPE_WEAPON", "INVTYPE_WEAPONOFFHAND"}
else
49 changes: 49 additions & 0 deletions code/GM_Season.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
--[[
MIT License

Copyright (c) 2023 Michael Wiesendanger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]--

-- luacheck: globals C_Seasons Enum

local mod = rggm
local me = {}
mod.season = me

me.tag = "Season"

--[[
Test if Season of Discovery is active

Enum.SeasonID.Placeholder = Season of Discovery 2
Enum.SeasonID.Hardcore = Hardcore 3

@return {boolean}
true if SOD is active
false if SOD is not active
]]--
function me.IsSodActive()
if C_Seasons.HasActiveSeason() and C_Seasons.GetActiveSeason() == Enum.SeasonID.Placeholder then
return true
end

return false
end