Skip to content

Commit 7342052

Browse files
committed
Slightly adjusted settings around PlayerChoice UIs - you can now disable using the keybind to select the first player choice option, instead requiring to use number keys (closes #13)
1 parent 9989b5e commit 7342052

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

main.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function DialogKey:InitMainProxyFrame()
152152
end
153153

154154
function DialogKey:OnPlayerChoiceShow()
155-
if not self.db.handlePlayerChoice then return end
155+
if not self.db.handlePlayerChoice and not self.db.numKeysForPlayerChoice then return end
156156
local frame = PlayerChoiceFrame;
157157
if not frame or not frame:IsVisible() then return end
158158

@@ -514,7 +514,10 @@ function DialogKey:HandleKey(key)
514514
end
515515

516516
-- Player Choice
517-
if self.db.handlePlayerChoice and next(self.playerChoiceButtons) and (doAction or self.db.numKeysForPlayerChoice) then
517+
if
518+
((self.db.handlePlayerChoice and doAction) or (self.db.numKeysForPlayerChoice and not doAction))
519+
and next(self.playerChoiceButtons)
520+
then
518521
local button = self.playerChoiceButtons[keynum]
519522
if button and (not self.db.ignoreDisabledButtons or button:IsEnabled()) then
520523
self:SetClickbuttonBinding(button, key)

options.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,17 @@ function ns:GetOptionsTable()
272272
},
273273
handlePlayerChoice = {
274274
order = increment(),
275-
name = wrapName("Player Choice"),
275+
name = wrapName("Keybind for Player Choice"),
276276
desc = "Use keybinding to select the first Player Choice option",
277277
descStyle = "inline", width = "full", type = "toggle",
278-
hidden = not C_AddOns.DoesAddOnExist("Blizzard_PlayerChoiceUI"),
278+
hidden = not C_AddOns.DoesAddOnExist("Blizzard_PlayerChoice"),
279279
},
280280
numKeysForPlayerChoice = {
281281
order = increment(),
282282
name = wrapName("Number keys for Player Choice"),
283283
desc = "Use the number keys (1 -> 0) to select Player Choices",
284-
disabled = function() return not db.handlePlayerChoice end,
285284
descStyle = "inline", width = "full", type = "toggle",
286-
hidden = not C_AddOns.DoesAddOnExist("Blizzard_PlayerChoiceUI"),
285+
hidden = not C_AddOns.DoesAddOnExist("Blizzard_PlayerChoice"),
287286
},
288287
handleSpecFrame = {
289288
order = increment(),

0 commit comments

Comments
 (0)