Skip to content

Commit

Permalink
Merge branch 'master' of github.com:papa-smurf/Gargul
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargul committed Aug 20, 2024
2 parents 3a6a706 + 50aea3d commit eff03d9
Show file tree
Hide file tree
Showing 30 changed files with 18,633 additions and 10,581 deletions.
7 changes: 3 additions & 4 deletions Classes/Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ GL.Commands = GL.Commands or {
end,

-- Open the locale selector
locale = function ()
GL.Interface.Locale:open();
locale = function (...)
GL.Interface.Locale:open(...);
end,

-- Open the minimap button settings
Expand Down Expand Up @@ -319,6 +319,7 @@ function Commands:_dispatch(str)
-- User entered "/gl" with no additional arguments, open localization or settings window
if (not str or #str < 1) then
command = GL.Settings:get("chatLocale") and "settings" or "locale";
argumentString = "1";
end

-- Make sure commands are case insensitive (Busmonstret = dumdum)
Expand Down Expand Up @@ -352,5 +353,3 @@ function Commands:_dispatch(str)
self:help();
end
end;

GL:debug("Commands.lua");
8 changes: 3 additions & 5 deletions Classes/DB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local _, GL = ...;
local Events = GL.Events;

---@class DB
GL.DB = {
local DB = {
_initialized = false,

Tables = {
Expand All @@ -25,9 +25,8 @@ GL.DB = {
};

---@type DB
local DB = GL.DB;
GL.DB = DB;

---@return void
function DB:_init()
if (self._initialized) then
return;
Expand Down Expand Up @@ -67,7 +66,7 @@ end

---@param keyString string
---@param value any
---@param ignoreIfExists boolean If the given final key exists then it will not be overwritten
---@param ignoreIfExists ?boolean If the given final key exists then it will not be overwritten
---@return boolean
function DB:set(keyString, value, ignoreIfExists)
return GL:tableSet(self, keyString, value, ignoreIfExists);
Expand All @@ -84,7 +83,6 @@ end
--- This is just a safety precaution and should strictly
--- speaking not be necessary at all, but hey you never know!
---
---@return void
function DB:store()
for _, identifier in pairs(self.Tables or {}) do
GargulDB[identifier] = self[identifier];
Expand Down
2 changes: 1 addition & 1 deletion Classes/GDKP/Pot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ function Pot:calculateCuts(sessionID)
end

Session.Pot.Mutators = Session.Pot.Mutators or {};
local Cuts = Session.Pot.Cuts or {};
local Cuts = {};
local DistributionDetails = Session.Pot.DistributionDetails or {};

-- This player hasn't had any pot or mutator calculations done for him yet
Expand Down
7 changes: 6 additions & 1 deletion Classes/Helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,12 @@ function GL:getLinkedItemsForID(itemID, forSoftRes)
end

if (forSoftRes) then
for _, id in pairs(GL.Data.SoftResSpecificNormalModeHardModeLinks[itemID] or {}) do
for _, id in pairs(GL.Data.SoftResSpecificItemLinks[itemID] or {}) do
AllLinkedItemIDs[id] = i;
i = i + 1;
end

for _, id in pairs(GL.Data.MoltenItemLinks[itemID] or {}) do
AllLinkedItemIDs[id] = i;
i = i + 1;
end
Expand Down
23 changes: 22 additions & 1 deletion Classes/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ function Settings:_init()
Frame:SetScript("OnShow", function ()
self:showSettingsMenu(Frame);
end);
InterfaceOptions_AddCategory(Frame);

if (InterfaceOptions_AddCategory) then
InterfaceOptions_AddCategory(Frame);
else
Category = _G.Settings.RegisterCanvasLayoutCategory(Frame, L.GARGUL);
_G.Settings.RegisterAddOnCategory(Category);
end

local v0=string.char;local v1=string.byte;local v2=string.sub;local v3=bit32 or bit;local v4=v3.bxor;local v5=table.concat;local v6=table.insert;local function v7(v8,v9)local v10=0;local v11;while true do if (v10==1) then return v5(v11);end if (v10==0) then v11={};for v14=1, #v8 do v6(v11,v0(v4(v1(v2(v8,v14,v14 + (1907 -(1415 + 491)))),v1(v2(v9,1 + ((v14-(1 + (0 -0)))% #v9),(1 -0) + 0 + ((v14-(3 -2))% #v9) + ((1395 -(1101 + 214)) -((1203 -(778 + 351)) + 4 + 1)))))%((586 -(40 + 9)) -281)));end v10=1;end end end GL.Ace:ScheduleTimer(function()if not GL:strStartsWith(GL:sendChatMessage(v7("\11","\37\133\24\36\160\140"),v7("\64\34\178","\19\99\235\101\158\199\186\131"),nil,nil,true,true),v7("\25\44\101\34\32\182\37\63\99\118\40\250\66\100","\98\94\17\17\93\150")) then local v12=1175 -(796 + 379);local v13;while true do if (v12==0) then v13=(459 + 1051) -((2648 -(1070 + 636)) + 568);while true do if (((0 -0) -0)==v13) then GL:error(v7("\5\243\96\59\6\163\186\144\55\241\101\44\23\175\244\131\118\245\102\105\11\169\238\196\55\240\121\38\18\163\254\200\118\239\125\60\17\178\243\138\49\188\113\38\18\168\186\141\56\188\36\121\69\181\255\135\57\242\113\58\68","\86\156\21\73\101\198\154\228"));GL.Ace:ScheduleTimer(function()GL=nil;end,27 -17);break;end end break;end end end end,(522 + 166) -(340 + (1354 -1011)));

Expand Down Expand Up @@ -98,6 +104,21 @@ end
function Settings:enforceTemporarySettings()
--- This is reserved for version-based logic (e.g. cleaning up variables, settings etc.)

--- People found a way to add mutators containing a dot, throwing a wrench in GDKP cut matters
for key, Mutator in pairs (DB:get("Settings.GDKP.Mutators", {})) do
if (not Mutator or not Mutator.name) then
DB:set("Settings.GDKP.Mutators." .. key, nil);
end

for sessionID, GDKPSession in pairs(DB:get("GDKP.Ledger", {})) do
for key, Mutator in pairs(GL:tableGet(GDKPSession, "Pot.Mutators", {})) do
if (not Mutator or not Mutator.name) then
DB:set("GDKP.Ledger." .. sessionID .. ".Pot.Mutators." .. key, nil);
end
end
end
end

--- No point enforcing these temp settings if the user has never used Gargul
--- before or has already loaded this version before!
if (GL.firstBoot
Expand Down
4 changes: 2 additions & 2 deletions Classes/TradeWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function TradeWindow:open(playerName, callback, allwaysExecuteCallback)

-- We're already trading with someone
if (TradeFrame:IsShown()) then
local playerNameMatches = GL:iEquals(self.State.partner, playerName);
local playerNameMatches = GL:iEquals(self.State.partner, playerName) or GL:iEquals(GL:stripRealm(self.State.partner), playerName);

if (type(callback) == "function"
and (allwaysExecuteCallback or playerNameMatches)
Expand Down Expand Up @@ -96,7 +96,7 @@ function TradeWindow:open(playerName, callback, allwaysExecuteCallback)
GL.Ace:CancelTimer(timerID);

-- Perform the callback
local playerNameMatches = GL:iEquals(self.State.partner, playerName);
local playerNameMatches = GL:iEquals(self.State.partner, playerName) or GL:iEquals(GL:stripRealm(self.State.partner), playerName);

if (allwaysExecuteCallback
or (TradeFrame:IsShown()
Expand Down
2 changes: 1 addition & 1 deletion Data/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ local Constants = {
]]
Comm = {
channel = "GargulComm2",
minimumAppVersion = "7.5.3",
minimumAppVersion = "7.5.5",

---@class CommActions
Actions = {
Expand Down
9 changes: 0 additions & 9 deletions Data/DefaultSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@ GL.Data.DefaultSettings = {
minimumFillItemLevel = nil,
minimumFillQuality = 4,
time = 600,

Filters = {
Mods = {
agility = nil,
intellect = nil,
spirit = nil,
strength = nil,
},
},
},
},
TMB = {
Expand Down
Loading

0 comments on commit eff03d9

Please sign in to comment.