Dragonflight UI Classic

Dragonflight UI Classic

285k Downloads

[BUG] "Create All" in profession frame needs to be clicked twice

alexandros-megas opened this issue ยท 3 comments

commented

Describe the bug
When I open a profession frame (I have reproduced this with mining and cooking, so far), I select a recipe, and click "CREATE ALL". It will create 1 of the item (the amount field will show 1). The second time I click "CREATE ALL" will update that text field to say "17" for example, and will queue up all the items to be created correctly.

Error Log
none

Versions (please complete the following information):

  • WoW: SoD
  • Addon 0.13.1

Additional context
none

commented

Hey,
that might be something else, because the DragonflightUI profession frame uses the default buttons, they are just moved:

function DragonFlightUIProfessionMixin:AnchorButtons()
    local create = TradeSkillCreateButton
    create:ClearAllPoints()
    create:SetParent(self)
    create:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', -9, 7)

    local createAll = TradeSkillCreateAllButton
    createAll:SetParent(self)

    ......
end

But I know what you mean. I noticed that sometimes too in different versions of wow, even years ago. I'll try to look into the blizzard code, maybe I can spot a bug, or wierd behaviour.

commented

Original OnClick:

<OnClick>
  if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then
	  TradeSkillInputBox:SetNumber(TradeSkillFrame.numAvailable);
	  DoTradeSkill(TradeSkillFrame.selectedSkill, TradeSkillFrame.numAvailable);
	  TradeSkillInputBox:ClearFocus();
  end
</OnClick>

I think sometimes when changing professions or on some edge case the variables on the TradeSkillFrame are not in sync, so I changed the OnClick handler to this:

createAll:SetScript('OnClick', function()
  if ((not PartialPlayTime()) and (not NoPlayTime())) then
      local index = GetTradeSkillSelectionIndex()
      local skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps = GetTradeSkillInfo(index);

      TradeSkillInputBox:SetNumber(numAvailable);
      DoTradeSkill(index, numAvailable);
      TradeSkillInputBox:ClearFocus();
  end
end)

PR: 39508de

In my limited testing, I couldn't get it to bug out anymore, so maybe that worked.
Change will be included in the next version in 2-3 days.

commented

Nice! Looking forward to testing it out :)