mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-09 01:59:59 +00:00
Remove known/unknown filter (keep ability coloring); fix pet level-up subtitle
This commit is contained in:
@@ -250,7 +250,7 @@ local function MTH_LT_AnnounceTraining(kind, level, eventKind, preview)
|
||||
local isMilestone = kind == "hunter" and (level == 10 or level == 20 or level == 30 or level == 40 or level == 50 or level == 60)
|
||||
local flag = isMilestone and "level.huntermilestone" or (kind == "hunter" and "level.hunter" or "level.pet")
|
||||
if type(MTH_FX_IsEnabled) == "function" and MTH_FX_IsEnabled(flag) and type(MTH_Celebrate) == "function" then
|
||||
local subtitle = kind == "hunter" and (MTH_LT_HunterLines[level] or "New training is available.") or "New pet training is available. The trainer wants coin."
|
||||
local subtitle = kind == "hunter" and (MTH_LT_HunterLines[level] or "New training is available.") or "Your beast grows stronger. Teach it something nasty."
|
||||
if isMilestone and type(MTH_CelebrateBlackHole) == "function" then
|
||||
MTH_CelebrateBlackHole(isLevelCap and headlineText or "Level " .. tostring(level), subtitle)
|
||||
else
|
||||
|
||||
@@ -282,22 +282,6 @@ function MTH_BOOK_ParseBeastTraits(beast)
|
||||
return traits
|
||||
end
|
||||
|
||||
-- "known" keeps beasts with at least one ability the hunter already knows;
|
||||
-- "unknown" keeps beasts that can still teach something not yet learned.
|
||||
function MTH_BOOK_BeastMatchesAbilityKnowledge(beast, mode)
|
||||
if type(MTH_IsPetAbilityKnownByHunter) ~= "function" then return true end
|
||||
local tokens = MTH_BOOK_SplitAbilities(beast and beast.abilities)
|
||||
local n = table.getn(tokens)
|
||||
if n == 0 then return false end
|
||||
for i = 1, n do
|
||||
local _, label, rank = MTH_BOOK_ParseAbilityToken(tokens[i])
|
||||
local known = MTH_IsPetAbilityKnownByHunter(label, rank)
|
||||
if mode == "known" and known then return true end
|
||||
if mode == "unknown" and not known then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function MTH_BOOK_BeastMatches(beastId, beast)
|
||||
if not beast then return false end
|
||||
local forcedBeastId = MTH_BOOK_STATE and tonumber(MTH_BOOK_STATE.forcedBeastId) or nil
|
||||
@@ -321,9 +305,6 @@ function MTH_BOOK_BeastMatches(beastId, beast)
|
||||
if not MTH_BOOK_HasKnownLevel(beast) then return false end
|
||||
if not MTH_BOOK_HasKnownZone(beast) then return false end
|
||||
end
|
||||
if MTH_BOOK_STATE.petKnownFilter and MTH_BOOK_STATE.petKnownFilter ~= "all" then
|
||||
if not MTH_BOOK_BeastMatchesAbilityKnowledge(beast, MTH_BOOK_STATE.petKnownFilter) then return false end
|
||||
end
|
||||
|
||||
if MTH_BOOK_STATE.quick ~= "all" then
|
||||
if familyLower ~= MTH_BOOK_STATE.quick then
|
||||
|
||||
@@ -137,7 +137,6 @@ local MTH_BOOK_STATE = {
|
||||
familyStatsPercent = false,
|
||||
petHideNoAbilities = true,
|
||||
petHideUnknown = true,
|
||||
petKnownFilter = "all",
|
||||
trainerHonoredDiscount = false,
|
||||
forcedBeastId = nil,
|
||||
page = 1,
|
||||
@@ -2337,28 +2336,6 @@ local function MTH_BOOK_UpdateRankDropdownText()
|
||||
MTH_BOOK_DropdownSetText(rankDropdown, label)
|
||||
end
|
||||
|
||||
MTH_BOOK_PetKnownFilterOptions = {
|
||||
{ value = "all", label = "Known/Unknown" },
|
||||
{ value = "known", label = "Known Abilities" },
|
||||
{ value = "unknown", label = "Unknown Abilities" },
|
||||
}
|
||||
|
||||
local function MTH_BOOK_GetKnownFilterLabel(value)
|
||||
for i = 1, table.getn(MTH_BOOK_PetKnownFilterOptions) do
|
||||
local option = MTH_BOOK_PetKnownFilterOptions[i]
|
||||
if option and option.value == value then
|
||||
return option.label
|
||||
end
|
||||
end
|
||||
return "Known/Unknown"
|
||||
end
|
||||
|
||||
local function MTH_BOOK_UpdateKnownFilterDropdownText()
|
||||
local dropdown = getglobal("MTH_BOOK_KnownFilterDropdown")
|
||||
if not dropdown then return end
|
||||
MTH_BOOK_DropdownSetText(dropdown, MTH_BOOK_GetKnownFilterLabel(MTH_BOOK_STATE.petKnownFilter or "all"))
|
||||
end
|
||||
|
||||
local function MTH_BOOK_UpdatePetLearnSourceDropdownText()
|
||||
local sourceDropdown = getglobal("MTH_BOOK_PetLearnSourceDropdown")
|
||||
if not sourceDropdown then return end
|
||||
@@ -2506,8 +2483,6 @@ local function MTH_BOOK_UpdateQuickFilterControls()
|
||||
local petInZoneOnly = getglobal("MTH_BOOK_PetInZoneOnly")
|
||||
local npcInZoneOnly = getglobal("MTH_BOOK_NPCInZoneOnly")
|
||||
local showAllOnMapButton = getglobal("MTH_BOOK_ShowAllOnMapButton")
|
||||
local knownFilterDropdown = getglobal("MTH_BOOK_KnownFilterDropdown")
|
||||
if knownFilterDropdown then knownFilterDropdown:Hide() end
|
||||
local minLevel = getglobal("MTH_BOOK_MinLevel")
|
||||
local maxLevel = getglobal("MTH_BOOK_MaxLevel")
|
||||
local stats = getglobal("MTH_BOOK_StatsText")
|
||||
@@ -2602,10 +2577,6 @@ local function MTH_BOOK_UpdateQuickFilterControls()
|
||||
rankDropdown:Hide()
|
||||
end
|
||||
end
|
||||
if knownFilterDropdown then
|
||||
knownFilterDropdown:Show()
|
||||
MTH_BOOK_UpdateKnownFilterDropdownText()
|
||||
end
|
||||
if petInZoneOnly then
|
||||
petInZoneOnly:Show()
|
||||
petInZoneOnly:SetChecked(MTH_BOOK_STATE.petInZoneOnly and 1 or nil)
|
||||
@@ -3092,34 +3063,6 @@ local function MTH_BOOK_InitRankDropdown()
|
||||
MTH_BOOK_UpdateRankDropdownText()
|
||||
end
|
||||
|
||||
local function MTH_BOOK_InitKnownFilterDropdown()
|
||||
local dropdown = getglobal("MTH_BOOK_KnownFilterDropdown")
|
||||
if not dropdown then return end
|
||||
|
||||
UIDropDownMenu_Initialize(dropdown, function()
|
||||
for i = 1, table.getn(MTH_BOOK_PetKnownFilterOptions) do
|
||||
local option = MTH_BOOK_PetKnownFilterOptions[i]
|
||||
local value = option.value
|
||||
local label = option.label
|
||||
local info = MTH_BOOK_DropdownCreateInfo()
|
||||
info.text = label
|
||||
info.func = function()
|
||||
MTH_BOOK_STATE.petKnownFilter = value
|
||||
MTH_BOOK_STATE.page = 1
|
||||
MTH_BOOK_STATE.selectedEntry = nil
|
||||
MTH_BOOK_DropdownSetText(dropdown, label)
|
||||
MTH_BOOK_RefreshFilter()
|
||||
end
|
||||
info.checked = ((MTH_BOOK_STATE.petKnownFilter or "all") == value)
|
||||
UIDropDownMenu_AddButton(info)
|
||||
end
|
||||
end)
|
||||
|
||||
UIDropDownMenu_SetWidth(140, dropdown)
|
||||
UIDropDownMenu_JustifyText("LEFT", dropdown)
|
||||
MTH_BOOK_UpdateKnownFilterDropdownText()
|
||||
end
|
||||
|
||||
local function MTH_BOOK_InitPetLearnSourceDropdown()
|
||||
local sourceDropdown = getglobal("MTH_BOOK_PetLearnSourceDropdown")
|
||||
if not sourceDropdown then return end
|
||||
@@ -5275,7 +5218,6 @@ local function MTH_BOOK_ResetStateForMode(mode)
|
||||
MTH_BOOK_STATE.npcHideNoZone = true
|
||||
MTH_BOOK_STATE.petHideNoAbilities = false
|
||||
MTH_BOOK_STATE.petHideUnknown = false
|
||||
MTH_BOOK_STATE.petKnownFilter = "all"
|
||||
MTH_BOOK_STATE.forcedBeastId = nil
|
||||
MTH_BOOK_STATE.petLeftOffset = 0
|
||||
|
||||
@@ -5754,7 +5696,6 @@ local function MTH_BOOK_WireUI(frame)
|
||||
MTH_BOOK_InitFamilyDropdown()
|
||||
MTH_BOOK_InitAbilityDropdown()
|
||||
MTH_BOOK_InitRankDropdown()
|
||||
MTH_BOOK_InitKnownFilterDropdown()
|
||||
MTH_BOOK_WireBeastDropdowns()
|
||||
MTH_BOOK_InitPetLearnSourceDropdown()
|
||||
MTH_BOOK_InitItemSubtypeDropdown()
|
||||
|
||||
+2
-7
@@ -289,20 +289,15 @@
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="350" y="-108"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentKnownFilterDropdown" inherits="UIDropDownMenuTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="520" y="-108"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
<CheckButton name="$parentPetInZoneOnly" inherits="UICheckButtonTemplate" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="618" y="-82"/></Offset></Anchor>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="526" y="-106"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</CheckButton>
|
||||
<Button name="$parentShowAllOnMapButton" inherits="UIPanelButtonTemplate" text="Show all on map" hidden="true">
|
||||
<Size><AbsDimension x="122" y="20"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="700" y="-110"/></Offset></Anchor>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="602" y="-110"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Frame name="$parentNPCFunctionDropdown" inherits="UIDropDownMenuTemplate" hidden="true">
|
||||
|
||||
Reference in New Issue
Block a user