Skip to content

Commit

Permalink
Move change trade/craft code to a function (in Skillet.lua)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed May 2, 2021
1 parent 20ec6a6 commit 283ed35
Showing 1 changed file with 19 additions and 30 deletions.
49 changes: 19 additions & 30 deletions UI/MainFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -644,18 +644,7 @@ function Skillet:TradeButton_OnClick(this,button)
if button then
button:SetChecked(false)
end
self.closingTrade = true
if self.isCraft then
CloseCraft()
else
CloseTradeSkill()
end
self:HideAllWindows()
self.changingTrade = tradeID
self.changingName = self.tradeSkillNamesByID[tradeID]
DA.DEBUG(0,"TradeButton_OnClick: changingTrade= "..tostring(self.changingTrade)..", changingName= "..tostring(self.changingName)..
", isCraft= "..tostring(self.isCraft))
StaticPopup_Show("SKILLET_CONTINUE_CHANGE")
self:ChangeTrade(tradeID)
else
self:SetTradeSkill(self.currentPlayer, tradeID)
end
Expand Down Expand Up @@ -2665,13 +2654,13 @@ end
--

local skillMenuSelection = {
--[===[@alpha@
--@alpha@
{
text = "skillMenuSelection",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Select All"],
func = function() Skillet:SkillButton_SetAllSelections(true) Skillet:UpdateTradeSkillWindow() end,
Expand All @@ -2683,13 +2672,13 @@ local skillMenuSelection = {
}

local skillMenuGroup = {
--[===[@alpha@
--@alpha@
{
text = "skillMenuGroup",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Empty Group"],
func = function() Skillet:SkillButton_NewGroup() end,
Expand All @@ -2701,13 +2690,13 @@ local skillMenuGroup = {
}

local skillMenuIgnore = {
--[===[@alpha@
--@alpha@
{
text = "skillMenuIgnore",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Add Recipe to Ignored List"],
func = function()
Expand Down Expand Up @@ -2737,13 +2726,13 @@ local skillMenuIgnore = {
}

local skillMenuList = {
--[===[@alpha@
--@alpha@
{
text = "skillMenuList",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["New Group"],
hasArrow = true,
Expand Down Expand Up @@ -2784,13 +2773,13 @@ local skillMenuList = {
}

local skillMenuListLocked = {
--[===[@alpha@
--@alpha@
{
text = "skillMenuListLocked",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Selection"],
hasArrow = true,
Expand All @@ -2813,13 +2802,13 @@ local skillMenuListLocked = {
}

local headerMenuList = {
--[===[@alpha@
--@alpha@
{
text = "headerMenuList",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Rename Group"],
func = function() Skillet:SkillButton_NameEditEnable(Skillet.menuButton) end,
Expand Down Expand Up @@ -2854,13 +2843,13 @@ local headerMenuList = {
}

local headerMenuListLocked = {
--[===[@alpha@
--@alpha@
{
text = "headerMenuListLocked",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Selection"],
hasArrow = true,
Expand All @@ -2873,13 +2862,13 @@ local headerMenuListLocked = {
}

local headerMenuListMainGroup = {
--[===[@alpha@
--@alpha@
{
text = "headerMenuListMainGroup",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["New Group"],
hasArrow = true,
Expand Down Expand Up @@ -2910,13 +2899,13 @@ local headerMenuListMainGroup = {
}

local headerMenuListMainGroupLocked = {
--[===[@alpha@
--@alpha@
{
text = "headerMenuListMainGroupLocked",
isTitle = true,
notCheckable = true,
},
--@end-alpha@]===]
--@end-alpha@]=]
{
text = L["Selection"],
hasArrow = true,
Expand Down

0 comments on commit 283ed35

Please sign in to comment.