Skip to content

Commit

Permalink
Add '/skillet swapshiftkey'
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Dec 7, 2024
1 parent 2f63368 commit 2ff9598
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1215,14 +1215,15 @@ end
-- Checks to see if the current trade is one that we support.
-- Control key says we do (even if we don't, debugging)
-- Shift key says we don't support it (even if we do)
-- Shift key behavior can be swapped with "/skillet swapshiftkey"
--
function Skillet:IsSupportedTradeskill(tradeID)
--DA.DEBUG(0,"IsSupportedTradeskill("..tostring(tradeID)..")")
if self:IsModKey2Down() then
return true
end
if self:IsModKey1Down() then
return false
return Skillet.db.profile.swapshiftkey
end
if not tradeID or self.BlizzardSkillList[tradeID] or self.currentPlayer ~= UnitName("player") then
DA.DEBUG(3,"IsSupportedTradeskill: BlizzardSkillList="..tostring(self.BlizzardSkillList[tradeID]))
Expand All @@ -1233,7 +1234,7 @@ function Skillet:IsSupportedTradeskill(tradeID)
DA.DEBUG(3,"IsSupportedTradeskill: not ranks")
return false
end
return true
return not Skillet.db.profile.swapshiftkey
end

--
Expand Down
2 changes: 2 additions & 0 deletions SkilletData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ function Skillet:GetSkill(player,trade,index)
if not Skillet.data.skillList[trade][index] and Skillet.data.skillDB[trade][index] then
local skillString = Skillet.data.skillDB[trade][index]
if skillString then
--DA.DEBUG(1,"GetSkill: skillString= ",DA.DUMP1(skillString))
local skill = {}
local data = { string.split(" ",skillString) }
if data[1] == "header" or data[1] == "subheader" then
skill.id = 0
else
--DA.DEBUG(1,"GetSkill: data= ",DA.DUMP1(data))
local difficulty = string.sub(data[1],1,1)
local recipeID = string.sub(data[1],2)
skill.id = tonumber(recipeID)
Expand Down
9 changes: 9 additions & 0 deletions SkilletNewsData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ local isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC

Skillet.NewsName = "Skillet News"
Skillet.NewsData = {
{ version = "5.36",
data = {
{ name = "Changes",
data = {
{ header = "Mod Keys", body = "Add '/skillet swapshiftkey' to change default shift behavior" },
},
},
},
},
{ version = "5.35",
data = {
{ name = "Changes",
Expand Down
12 changes: 12 additions & 0 deletions SkilletOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,18 @@ Skillet.options =
end,
order = 77
},
swapshiftkey = {
type = "toggle",
name = "SwapShiftKey",
desc = "Swap Shift Key to open the Blizzard frames",
get = function()
return Skillet.db.profile.swapshiftkey
end,
set = function(self,value)
Skillet.db.profile.swapshiftkey = value
end,
order = 77
},
collectdetails = {
type = "toggle",
name = "Collect details",
Expand Down

0 comments on commit 2ff9598

Please sign in to comment.