Skip to content

Commit

Permalink
add option to display timedKeyAmount and RaceIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
Jodsderechte committed Aug 16, 2024
1 parent c59bd66 commit bae8807
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 17 deletions.
53 changes: 50 additions & 3 deletions GroupFinderRio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,26 @@ local function sortSearchResults(results)
DevTool:AddData(LFGListFrame.SearchPanel,"searchpanel")
]]
end
---comment helper to get the timed keys from a RaiderIo profile
---@param profile any
---@return timedKeystonesList
local function getTimedKeys(profile)
---@class timedKeystonesList
---@field fivePlus number
---@field tenPlus number
---@field fifteenPlus number
---@field twentyPlus number
---@return table
local keys = {}
if not profile.mythicKeystoneProfile then
return keys
end
keys.fivePlus = profile.mythicKeystoneProfile.keystoneFivePlus or 0
keys.tenPlus = profile.mythicKeystoneProfile.keystoneTenPlus or 0
keys.fifteenPlus = profile.mythicKeystoneProfile.keystoneFifteenPlus or 0
keys.twentyPlus = profile.mythicKeystoneProfile.keystoneTwentyPlus or 0
return keys
end
---comment helper to get the score for an applicant
---@param applicantID number
---@param numMember number
Expand All @@ -528,6 +548,8 @@ end
---@return boolean healer
---@return boolean damage
---@return boolean isMainRole
---@return number raceID
---@return table timedKeystonesList
local function getApplicantInfoForKeys(applicantID, numMember)
local name, class, localizedClass, level, itemLevel, honorLevel, tank, healer, damage, assignedRole, relationship, dungeonScore, pvpItemLevel, factionGroup, raceID, specID = C_LFGList.GetApplicantMemberInfo(applicantID, numMember)
itemLevel = itemLevel or 0
Expand All @@ -543,9 +565,9 @@ local function getApplicantInfoForKeys(applicantID, numMember)
if dungeonScore and score and dungeonScore>score then
score = dungeonScore
end
return mainScore, score or 0, itemLevel, specID, name, shortLanguage, tank, healer, damage, isMainRole
return mainScore, score or 0, itemLevel, specID, name, shortLanguage, tank, healer, damage, isMainRole, raceID, getTimedKeys(profile)
else
return nil, dungeonScore or 0, itemLevel, specID, name, shortLanguage, tank, healer, damage, true
return nil, dungeonScore or 0, itemLevel, specID, name, shortLanguage, tank, healer, damage, true, raceID, nil
end
end
---comment
Expand Down Expand Up @@ -816,13 +838,17 @@ end
---@param memberIdx integer
local function updateApplicationForDungeons(member, appID, memberIdx)
local applicantInfo = C_LFGList.GetApplicantInfo(appID)
local mainScore, score, itemLevel, specID, name, shortLanguage,_,_,_,isMainRole = getApplicantInfoForKeys(appID,memberIdx)
local mainScore, score, itemLevel, specID, name, shortLanguage,_,_,_,isMainRole, raceID, keystoneList = getApplicantInfoForKeys(appID,memberIdx)
if CustomNames then
local customName = CustomNames.Get(name)
if name ~= customName then
member.Name:SetText(customName)
end
end
if raceID and GFIO.db.profile.showRaceIcon then
local raceInfo = C_CreatureInfo.GetRaceInfo(raceID)
member.Name:SetText(member.Name:GetText().." "..CreateAtlasMarkup("raceicon-"..raceInfo.clientFileString.."-female", 16, 16))
end
local ratingInfoFrame = getRatingInfoFrame(member)
if not ratingInfoFrame then
return
Expand All @@ -849,6 +875,27 @@ local function updateApplicationForDungeons(member, appID, memberIdx)
additionalInfo = additionalInfo.." "..bestrunLevel
end
end
if GFIO.db.profile.showTimedKeys and keystoneList then
if GFIO.db.profile.showTimedKeys == 100 then
if keystoneList.twentyPlus and keystoneList.twentyPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.twentyPlus.." x 20+]"
elseif keystoneList.fifteenPlus and keystoneList.fifteenPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.fifteenPlus.." x 15+]"
elseif keystoneList.tenPlus and keystoneList.tenPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.tenPlus.." x 10+]"
elseif keystoneList.fivePlus and keystoneList.fivePlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.fivePlus.." x 5+]"
end
elseif GFIO.db.profile.showTimedKeys == 20 and keystoneList.twentyPlus and keystoneList.twentyPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.twentyPlus.." x 20+]"
elseif GFIO.db.profile.showTimedKeys == 15 and keystoneList.fifteenPlus and keystoneList.fifteenPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.fifteenPlus.." x 15+]"
elseif GFIO.db.profile.showTimedKeys == 10 and keystoneList.tenPlus and keystoneList.tenPlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.tenPlus.." x 10+]"
elseif GFIO.db.profile.showTimedKeys == 5 and keystoneList.fivePlus and keystoneList.fivePlus >0 then
additionalInfo = additionalInfo.." ["..keystoneList.fivePlus.." x 5+]"
end
end
if additionalInfo ~= "" then
ratingInfoFrame.AdditionalInfo:SetPoint("BOTTOM",member,"BOTTOM",0,0)
ratingInfoFrame.AdditionalInfo:SetPoint("LEFT",member.Name,"LEFT",2,0)
Expand Down
14 changes: 14 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,19 @@ if L then
L["oneClickSignup"] = "One Click Signup"
L["oneClickSignupDescription"] = "Sign up for a group with one click"
L["OneClickSignupNotAvailable"] = "One Click Signup is not available with Premades Group Filter enabled please disable the option and use Premades Group Filters setting instead"
L["highest"] = "Highest Keylevel"
L["twenty"] = "20+"
L["fifteen"] = "15+"
L["ten"] = "10+"
L["five"] = "5+"
L["Disable"] = "Disabled"
L["showTimedKeys"] = "Show Timed Keys"
L["showTimedKeysDescription"] = "Show the amount of the timed keys above a certain threshhold in the Applicant View"
L["showRaceIconDescription"] = "Show a race icon next to the name of the applicant"
L["showRaceIcon"] = "Show race Icon"




GFIO.localisation = L
end
2 changes: 2 additions & 0 deletions Options/OptionDefaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ GFIO.OptionDefaults = {
showInfoInActivityName = true,
oneClickSignup = false,
wrongRoleScoreLimitForSorting = 100,
showTimedKeys = false,
showRaceIcon = false,
spec = {
[62] = true, -- arcane
[63] = true, -- fire
Expand Down
57 changes: 43 additions & 14 deletions Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,51 @@ GFIO.options = {
return GFIO.db.profile.sortApplicants --Sets value of toggles depending on SavedVariables
end,
},
disableSpecSelector = {
name = GFIO.getLocalisation("disableSpecSelector"),
desc = GFIO.getLocalisation("disableSpecSelectorDescription"),
order = 30,
width = "full",
type = "toggle",
set = function(info,val) GFIO.db.profile.disableSpecSelector = val GFIO.createOrShowSpecSelectFrame() end, --Sets value of SavedVariables depending on toggles
get = function(info)
return GFIO.db.profile.disableSpecSelector --Sets value of toggles depending on SavedVariables
end,
},
showRaceIcon = {
name = GFIO.getLocalisation("showRaceIcon"),
desc = GFIO.getLocalisation("showRaceIconDescription"),
order = 30,
width = "full",
type = "toggle",
set = function(info,val) GFIO.db.profile.showRaceIcon = val end, --Sets value of SavedVariables depending on toggles
get = function(info)
return GFIO.db.profile.showRaceIcon --Sets value of toggles depending on SavedVariables
end,
},
showTimedKeys= {
name = GFIO.getLocalisation("showTimedKeys"),
desc = GFIO.getLocalisation("showTimedKeysDescription"),
order = 35,
type = "select",
values = {
[false] = GFIO.getLocalisation("Disable"),
[5] = GFIO.getLocalisation("five"),
[10] = GFIO.getLocalisation("ten"),
[15] = GFIO.getLocalisation("fifteen"),
[20] = GFIO.getLocalisation("twenty"),
[100] = GFIO.getLocalisation("highest"),

},
set = function(info,val) GFIO.db.profile.showTimedKeys = val end, --Sets value of SavedVariables depending on toggles
get = function(info)
return GFIO.db.profile.showTimedKeys--Sets value of toggles depending on SavedVariables
end
},
useOfWrongRoleHighlight = {
name = GFIO.getLocalisation("useOfWrongRoleHighlight"),
desc = GFIO.getLocalisation("useOfWrongRoleHighlightDescription"),
order = 30,
order = 40,
width = "full",
type = "toggle",
set = function(info,val) GFIO.db.profile.useOfWrongRoleHighlight = val end, --Sets value of SavedVariables depending on toggles
Expand All @@ -101,7 +142,7 @@ GFIO.options = {
wrongRoleScoreLimitForSorting= {
name = GFIO.getLocalisation("wrongRoleScoreLimitForSorting"),
desc = GFIO.getLocalisation("wrongRoleScoreLimitForSortingDescription"),
order = 31,
order = 41,
type = "range",
softMin = 0,
softMax = 5000,
Expand All @@ -113,18 +154,6 @@ GFIO.options = {
return GFIO.db.profile.wrongRoleScoreLimitForSorting --Sets value of toggles depending on SavedVariables
end
},
disableSpecSelector = {
name = GFIO.getLocalisation("disableSpecSelector"),
desc = GFIO.getLocalisation("disableSpecSelectorDescription"),
order = 30,
width = "full",
type = "toggle",
set = function(info,val) GFIO.db.profile.disableSpecSelector = val GFIO.createOrShowSpecSelectFrame() end, --Sets value of SavedVariables depending on toggles
get = function(info)
return GFIO.db.profile.disableSpecSelector --Sets value of toggles depending on SavedVariables
end,
},


}
},
Expand Down

0 comments on commit bae8807

Please sign in to comment.