Skip to content

Commit 45e0541

Browse files
committed
Fix an edge case where you couldn't fill in a loadout name when importing (closes #24)
1 parent 82889ed commit 45e0541

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/SideBarMixin.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,16 @@ function SideBarMixin:CreateImportDialog()
360360
checkbox:SetScript('OnLeave', function()
361361
GameTooltip:Hide();
362362
end);
363-
checkbox:SetScript('OnClick', function(cb)
364-
local checked = cb:GetChecked();
363+
local function checkboxOnChange(cb)
364+
local checked = cb:IsShown() and cb:GetChecked();
365365
local dialog = cb:GetParent();
366366
dialog.NameControl:SetShown(not checked);
367367
dialog.NameControl:SetText(checked and '*importing into current loadout*' or '');
368368
dialog:UpdateAcceptButtonEnabledState();
369-
end);
369+
end
370+
checkbox:SetScript('OnClick', checkboxOnChange);
371+
checkbox:SetScript('OnHide', checkboxOnChange);
372+
checkbox:SetScript('OnShow', checkboxOnChange);
370373
checkbox.text = checkbox:CreateFontString(nil, 'ARTWORK', 'GameFontNormal');
371374
checkbox.text:SetPoint('LEFT', checkbox, 'RIGHT', 0, 1);
372375
checkbox.text:SetText(string.format('Import into currently selected custom loadout'));

0 commit comments

Comments
 (0)