Skip to content

Commit

Permalink
Disable LFG Button until level 10 and add tooltip and some translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Anderson committed Nov 22, 2024
1 parent 2a7b7ad commit 009f0ae
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
"GameTooltip_AddErrorLine",
"UIDropDownMenu_SetSelectedValue",
"UIDropDownMenu_Initialize",
"UIDropDownMenu_ClearAll"
"UIDropDownMenu_ClearAll",
"RED_FONT_COLOR_CODE"
],
"Lua.runtime.version": "Lua 5.1",
"Lua.runtime.builtin": {
Expand Down
12 changes: 12 additions & 0 deletions Core/Atlas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ function addon:SearchAndRefresh(text)
end

function addon:SearchLFG()
-- LFG tool isn't available until level 10
if (UnitLevel("player") < 10) then return end

-- Open LFG to the group browser
ShowLFGParentFrame(2);

Expand All @@ -358,6 +361,15 @@ function addon:SearchLFG()
LFGBrowse_DoSearch();
end

function addon:SearchLFG_Enter(button)
GameTooltip:SetOwner(button, "ANCHOR_RIGHT");
if (UnitLevel("player") < 10) then
GameTooltip:SetText(L["Find group for this instance"].."\n"..RED_FONT_COLOR_CODE..L["LFG is unavailable until level 10"]);
else
GameTooltip:SetText(L["Find group for this instance"]);
end
end

local function parse_entry_strings(typeStr, id, preStr, index, lineplusoffset)
if (typeStr == "item") then
local itemID = id
Expand Down
3 changes: 1 addition & 2 deletions Core/Atlas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText("Find group for this instance");
Atlas:SearchLFG_Enter(self);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
<OnClick>
Expand Down
3 changes: 3 additions & 0 deletions Locale/Atlas-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,6 @@ L["Wave 6"] = "Welle 6"
L["West"] = "Westen"
L["Yarley <Armorer>"] = "Yarley <Rüstungsschmied>"
L["Zaladormu"] = "Zaladormu"

L["Find group for this instance"] = "Gruppe für diese Instanz suchen"
L["LFG is unavailable until level 10"] = "LFG ist bis Level 10 nicht verfügbar"
3 changes: 3 additions & 0 deletions Locale/Atlas-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,6 @@ L["West"] = "West"
L["MapNotYetAvailable"] = "This map is not yet available."
L["Yarley <Armorer>"] = "Yarley <Armorer>"
L["Zaladormu"] = "Zaladormu"

L["Find group for this instance"] = "Find group for this instance"
L["LFG is unavailable until level 10"] = "LFG is unavailable until level 10"
3 changes: 3 additions & 0 deletions Locale/Atlas-esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,6 @@ L["Wave 6"] = "Ola 6"
L["West"] = "Oeste"
L["Yarley <Armorer>"] = "Yarley <Armero>"
L["Zaladormu"] = "Zaladormu"

L["Find group for this instance"] = "Buscar grupo para esta instancia"
L["LFG is unavailable until level 10"] = "LFG no está disponible hasta el nivel 10"
3 changes: 3 additions & 0 deletions Locale/Atlas-esMX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,6 @@ L["Wave 6"] = "Ola 6"
L["West"] = "Oeste"
L["Yarley <Armorer>"] = "Yarley <Armero>"
L["Zaladormu"] = "Zaladormu"

L["Find group for this instance"] = "Buscar grupo para esta instancia"
L["LFG is unavailable until level 10"] = "LFG no está disponible hasta el nivel 10"
3 changes: 3 additions & 0 deletions Locale/Atlas-frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,6 @@ L["Wave 6"] = "Vague 6"
L["West"] = "Ouest"
L["Yarley <Armorer>"] = "Yarley <Armurier>"
L["Zaladormu"] = "Zaladormu"

L["Find group for this instance"] = "Rechercher un groupe pour cette instance"
L["LFG is unavailable until level 10"] = "LFG n'est pas disponible jusqu'au niveau 10"

0 comments on commit 009f0ae

Please sign in to comment.