Skip to content

Commit

Permalink
Fixed: Award to random automatically adds +1 if +1 was previously che…
Browse files Browse the repository at this point in the history
…cked
  • Loading branch information
papa-smurf committed Mar 16, 2024
1 parent 36bd73d commit 19a987e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
.idea
.idea
.vscode
6 changes: 3 additions & 3 deletions Interface/Award/Award.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function Award:draw(itemLink, callback)
itemLink = GL.Interface:get(self, "EditBox.Item"):GetText();
local winner = false;

local award = function ()
local award = function (random)
winner = GL:addRealm(winner);

local isOS, addPlusOne = false;
Expand All @@ -184,7 +184,7 @@ function Award:draw(itemLink, callback)
end

local addPlusOneCheckBox = GL.Interface:get(GL.Interface.Dialogs.AwardDialog, "CheckBox.PlusOne");
if (addPlusOneCheckBox) then
if (not random and addPlusOneCheckBox) then
addPlusOne = GL:toboolean(addPlusOneCheckBox:GetValue());

if (addPlusOne) then
Expand Down Expand Up @@ -259,7 +259,7 @@ function Award:draw(itemLink, callback)
end

GL:sendChatMessage(string.format("Random winner for %s selected (%s)", itemLink, winner), "GROUP");
award();
award(true);
end,
};
end
Expand Down

0 comments on commit 19a987e

Please sign in to comment.