From 4b7c7c97e2a32635ab5f3684bea1bfcbe086aafe Mon Sep 17 00:00:00 2001 From: Ulidan Date: Wed, 14 Jul 2021 01:55:21 +0300 Subject: [PATCH 1/3] Changes and localizations 1. Changed fishing tables to be language insensitive. 3. Removed obsolete translations of said tables. 3. Added more translation files - used google translate. Recommend testing by local users. --- Fishbringer.toc | 6 + Localization.deDE.lua | 87 +------------- Localization.esES.lua | 27 +++++ Localization.frFR.lua | 27 +++++ Localization.ptBR.lua | 27 +++++ Localization.ruRU.lua | 93 +-------------- fishy.lua | 255 +++++++++++++++++++++++++----------------- 7 files changed, 242 insertions(+), 280 deletions(-) create mode 100644 Localization.esES.lua create mode 100644 Localization.frFR.lua create mode 100644 Localization.ptBR.lua diff --git a/Fishbringer.toc b/Fishbringer.toc index 104abd6..38cf210 100755 --- a/Fishbringer.toc +++ b/Fishbringer.toc @@ -9,8 +9,14 @@ ## SavedVariables: FishbringerDB ## Version: 2.5.1-2 +# localizations: localization.core.lua Localization.deDE.lua Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua + +# main: fishy.lua diff --git a/Localization.deDE.lua b/Localization.deDE.lua index 8b41a71..cbba643 100644 --- a/Localization.deDE.lua +++ b/Localization.deDE.lua @@ -11,6 +11,7 @@ if namespace.locale == "deDE" then L["- /fishbringer reset - Resets the fish database."] = "- /fishbringer reset - Fishbringer Datenbank zurücksetzen." --Anzeige auf Bildschirm + L["\124c%s%s\124r\nNo fish in this zone"] = "\124c%s%s\124r\nKein fisch in dieser zone" L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"] = "\124c%s%s\124r\n%d Angelskill benötigt zum Angeln\n(%d benötigt für 100%% Fangchance)" L["%d%% catch rate"] = "%d%% Fangchance" L["%s%s fishing skill%s"] = "%s%s Angelskill%s" @@ -18,95 +19,9 @@ if namespace.locale == "deDE" then L["%d fish caught at this level"] = "%d Fische auf diesem Level gefangen" -- Name des Angelperks / Name of the Fishingperk - L["Fishing"] = "Angeln" -- Login Message - L["Pack yer bags, we be leavin' fer fishin'!"] = "Pack deine Taschen, wir gehen angeln!" - -- Angelzonen / Fishingzones - - L["Dun Morogh"] = "Dun Morogh" - L["Durotar"] = "Durotar" - L["Elwynn Forest"] = "Wald von Elwynn" - L["Mulgore"] = "Mulgore" - L["Eversong Forest"] = "Immersangwald" - L["Azuremyst Isle"] = "Azurmythosinsel" - L["Teldrassil"] = "Teldrassil" - L["Tirisfal"] = "Tirisfal" - L["Orgrimmar"] = "Orgrimmar" - L["Ironforge"] = "Eisenschmiede" - L["Stormwind City"] = "Sturmwind" - L["Thunder Bluff"] = "Donnerfels" - L["Silvermoon City"] = "Silbermond" - L["The Exodar"] = "Die Exodar" - L["Darnassus"] = "Darnassus" - L["Undercity"] = "Unterstadt" - L["The Barrens"] = "Brachland" - L["Blackfathom Deeps"] = "Blackfathom-Tiefe" - L["Bloodmyst Isle"] = "Blutmythosinsel" - L["Darkshore"] = "Dunkelküste" - L["The Deadmines"] = "Die Todesminen" - L["Ghostlands"] = "Geisterlande" - L["Loch Modan"] = "Loch Modan" - L["Silverpine Forest"] = "Silberwald" - L["The Wailing Caverns"] = "Die Höhlen des Wehklagens" - L["Westfall"] = "Westfall" - L["Ashenvale"] = "Eschental" - L["Duskwood"] = "Dämmerwald" - L["Hillsbrad Foothills"] = "Vorgebirge des Hügellands" - L["Redridge Mountains"] = "Rotkammgebirge" - L["Stonetalon Mountains"] = "Steinkrallengebirge" - L["Wetlands"] = "Sumpfland" - L["Alterac Mountains"] = "Alteracgebirge" - L["Arathi Highlands"] = "Arathihochland" - L["Desolace"] = "Desolace" - L["Dustwallow Marsh"] = "Düstermarschen" - L["Scarlet Monastery"] = "Das scharlachrote Kloster" - L["Stranglethorn Vale"] = "Schlingendorntal" - L["Swamp of Sorrows"] = "Sümpfe des Elends" - L["Thousand Needles"] = "Tausend Nadeln" - L["Azshara"] = "Azshara" - L["Felwood"] = "Teufelswald" - L["Feralas"] = "Feralas" - L["The Hinterlands"] = "Hinterland" - L["Maraudon"] = "Maraudon" - L["Moonglade"] = "Mondlichtung" - L["Tanaris"] = "Tanaris" - L["The Temple of Atal'Hakkar"] = "Der Tempel von Atal'Hakkar" - L["Un'Goro Crater"] = "Un'Goro-Krater" - L["Western Plaguelands"] = "Westliche Pestländer" - L["Shadowmoon Valley"] = "Schattenmondtal" - L["Burning Steppes"] = "Brennende Steppe" - L["Deadwind Pass"] = "Gebirgspass der Todenwinde" - L["Eastern Plaguelands"] = "Östliche Pestländer" - L["Scholomance"] = "Scholomance" - L["Silithus"] = "Silithus" - L["Stratholme"] = "Stratholme" - L["Winterspring"] = "Winterspring" - L["Zul'Gurub"] = "Zul'Gurub" - --- Burning Crusade - L["Hellfire Peninsula"] = "Höllenfeuerhalbinsel" - L["Terokkar Forest"] = "Wälder von Terokkar" - L["Nagrand"] = "Nagrand" - L["Netherstorm"] = "Nethersturm" - L["Zangarmarsh"] = "Zangarmarschen" - -- Burning Crusade Subzones - L["Lake Sunspring"] = "Lake Sunspring" -- Nagrand - L["Marshlight Lake"] = "Sumpflichtsee" -- Zangarmarschen - L["Sporewind Lake"] = "Sporenwindsee" -- Zangarmarschen - L["Serpent Lake"] = "Schlangensee" -- Zangarmarschen - L["Blackwind Lake"] = "Schattenwindsee" -- Wälder von Terokarr - L["Lake Ere'Noru"] = "See von Ere'Noru" -- Wälder von Terokarr - L["Lake Jorune"] = "Jorunsee" -- Wälder von Terokarr - --- WOTLK - L["Borean Tundra"] = "Boreanische Tundra" - L["Dragonblight"] = "Drachenöde" - L["Howling Fjord"] = "Heulende Fjord" - L["Crystalsong Forest"] = "Kristallsangwald" - L["Dalaran"] = "Dalaran" - L["Sholazar Basin"] = "Sholazarbecken" - L["The Frozen Sea"] = "Die gefrorene See" - return end \ No newline at end of file diff --git a/Localization.esES.lua b/Localization.esES.lua new file mode 100644 index 0000000..7b34ccd --- /dev/null +++ b/Localization.esES.lua @@ -0,0 +1,27 @@ +local ADDON_NAME, namespace = ... +local L = namespace.L + +if namespace.locale == "esES" then + + --ShowHelp Function + L["Nat Pagle would be proud of you."] = "Nat Pagle estaría orgulloso de ti." + L["- /fishbringer show - Toggles visibility."] = "- /fishbringer show - Alterna la visibilidad." + L["- /fishbringer align - Cycles through text alignment."] = "- /fishbringer align - Recorre la alineación del texto." + L["- /fishbringer count - Toggles fish count visibility."] = "- /fishbringer count - Alterna la visibilidad del recuento de peces." + L["- /fishbringer reset - Resets the fish database."] = "- /fishbringer reset - Restablece la base de datos de peces." + + --Fishbringer Overlay/Display Widget + L["\124c%s%s\124r\nNo fish in this zone"] = "\124c%s%s\124r\nNo hay peces en esta zona" + L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"] = "\124c%s%s\124r\n%d habilidad necesaria para pescar\n(%d necesario para una tasa de captura del 100%%)" + L["%d%% catch rate"] = "%d%% tasa de captura" + L["%s%s fishing skill%s"] = "%s%s habilidad de pesca" + L["\n%d fish needed to skill up"] = "\n%d peces necesarios para mejorar" + L["%d fish caught at this level"] = "%d pescado capturado a este nivel" + + -- Angeln/Fishing - Name of the Fishing Perk + L["Fishing"] = "Pescar" + + -- Welcome Message on Login + L["Pack yer bags, we be leavin' fer fishin'!"] = "¡Prepara tus maletas, nos vamos 'a pescar'!" + +return end diff --git a/Localization.frFR.lua b/Localization.frFR.lua new file mode 100644 index 0000000..8ed59c2 --- /dev/null +++ b/Localization.frFR.lua @@ -0,0 +1,27 @@ +local ADDON_NAME, namespace = ... +local L = namespace.L + +if namespace.locale == "frFR" then + + --ShowHelp Function + L["Nat Pagle would be proud of you."] = "Nat Pagle serait fier de vous." + L["- /fishbringer show - Toggles visibility."] = "- /fishbringer show - Bascule la visibilité." + L["- /fishbringer align - Cycles through text alignment."] = "- /fishbringer align - Fait défiler l'alignement du texte." + L["- /fishbringer count - Toggles fish count visibility."] = "- /fishbringer count - Bascule la visibilité du nombre de poissons." + L["- /fishbringer reset - Resets the fish database."] = "- /fishbringer reset - Réinitialise la base de données des poissons." + + --Fishbringer Overlay/Display Widget + L["\124c%s%s\124r\nNo fish in this zone"] = "\124c%s%s\124r\nPas de poisson dans cette zone" + L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"] = "\124c%s%s\124r\n%d compétence nécessaire pour pêcher\n(%d nécessaire pour un taux de capture de 100%%)" + L["%d%% catch rate"] = "%d%% taux de capture" + L["%s%s fishing skill%s"] = "%s%s compétence de pêche" + L["\n%d fish needed to skill up"] = "\n%d рыб poisson nécessaire pour se perfectionner" + L["%d fish caught at this level"] = "%d poisson pêché à ce niveau" + + -- Angeln/Fishing - Name of the Fishing Perk + L["Fishing"] = "Pêche" + + -- Welcome Message on Login + L["Pack yer bags, we be leavin' fer fishin'!"] = "Faites vos valises, nous partons « à la pêche » !" + +return end diff --git a/Localization.ptBR.lua b/Localization.ptBR.lua new file mode 100644 index 0000000..91d9369 --- /dev/null +++ b/Localization.ptBR.lua @@ -0,0 +1,27 @@ +local ADDON_NAME, namespace = ... +local L = namespace.L + +if namespace.locale == "ptBR" then + + --ShowHelp Function + L["Nat Pagle would be proud of you."] = "Nat Pagle ficaria orgulhoso de você." + L["- /fishbringer show - Toggles visibility."] = "- /fishbringer show - Alterna a visibilidade." + L["- /fishbringer align - Cycles through text alignment."] = "- /fishbringer align - Percorre o alinhamento do texto." + L["- /fishbringer count - Toggles fish count visibility."] = "- /fishbringer count - Alterna a visibilidade da contagem de peixes." + L["- /fishbringer reset - Resets the fish database."] = "- /fishbringer reset - Reinicia o banco de dados de peixes." + + --Fishbringer Overlay/Display Widget + L["\124c%s%s\124r\nNo fish in this zone"] = "\124c%s%s\124r\nNenhum peixe nesta zona" + L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"] = "\124c%s%s\124r\n%d habilidade necessária para pescar\n(%d necessário para 100%% de taxa de captura)" + L["%d%% catch rate"] = "%d%% taxa de captura" + L["%s%s fishing skill%s"] = "%s%s habilidade de pesca" + L["\n%d fish needed to skill up"] = "\n%d peixes precisavam de habilidade" + L["%d fish caught at this level"] = "%d peixes capturados neste nível" + + -- Angeln/Fishing - Name of the Fishing Perk + L["Fishing"] = "pescaria" + + -- Welcome Message on Login + L["Pack yer bags, we be leavin' fer fishin'!"] = "Faça as malas, vamos partir 'para pescar'!" + +return end diff --git a/Localization.ruRU.lua b/Localization.ruRU.lua index f541e47..96e3a73 100644 --- a/Localization.ruRU.lua +++ b/Localization.ruRU.lua @@ -3,8 +3,6 @@ local L = namespace.L if namespace.locale == "ruRU" then - --*** Important Info: Don't change the Original Text - --ShowHelp Function L["Nat Pagle would be proud of you."] = "Нат Пэгл будет гордиться тобой." L["- /fishbringer show - Toggles visibility."] = "- /fishbringer show - Переключает видимость." @@ -12,101 +10,18 @@ if namespace.locale == "ruRU" then L["- /fishbringer count - Toggles fish count visibility."] = "- /fishbringer count - Переключает видимость счетчика пойманной рыбы." L["- /fishbringer reset - Resets the fish database."] = "- /fishbringer reset - Сбросить данные." - --Anzeige auf Bildschirm - Fishbringer Overlay/Display Widget + --Fishbringer Overlay/Display Widget + L["\124c%s%s\124r\nNo fish in this zone"] = "\124c%s%s\124r\nВ этой зоне нет рыбы" L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"] = "\124c%s%s\124r\n%d навыка требуется для рыбалки\n(%d требуется для 100%% успеха)" L["%d%% catch rate"] = "%d%% шанс поймать" L["%s%s fishing skill%s"] = "%s%s навык рыбной ловли" L["\n%d fish needed to skill up"] = "\n%d рыб осталось до повышения навыка" L["%d fish caught at this level"] = "%d рыб поймано на этом уровне" - -- Angeln/Fishing - Name of the Fishing Perk - put the localized name into the "" + -- Angeln/Fishing - Name of the Fishing Perk L["Fishing"] = "Рыбная ловля" - -- Welcome Message on Login - put the localized text into the "" + -- Welcome Message on Login L["Pack yer bags, we be leavin' fer fishin'!"] = "Пакуй снасти, валим рыбачить!" - -- Angelzonen/Fishing Zones - put the localized names into the "". Example: L["Dun Morogh"] = "Localized Name of the Zone" - L["Dun Morogh"] = "Дун Морог" - L["Durotar"] = "Дуротар" - L["Elwynn Forest"] = "Элвиннский лес" - L["Mulgore"] = "Мулгор" - L["Eversong Forest"] = "Леса Вечной Песни" - L["Azuremyst Isle"] = "Остров Лазурной Дымки" - L["Teldrassil"] = "Тельдрассил" - L["Tirisfal"] = "Тирисфаль" - L["Orgrimmar"] = "Оргриммар" - L["Ironforge"] = "Стальгорн" - L["Stormwind City"] = "Штормград" - L["Thunder Bluff"] = "Громовой Утес" - L["Silvermoon City"] = "Луносвет" - L["The Exodar"] = "Экзодар" - L["Darnassus"] = "Дарнас" - L["Undercity"] = "Подгород" - L["The Barrens"] = "Степи" - L["Blackfathom Deeps"] = "Непроглядная Пучина" - L["Bloodmyst Isle"] = "Остров Кровавой Дымки" - L["Darkshore"] = "Темные берега" - L["The Deadmines"] = "Мертвые копи" - L["Ghostlands"] = "Призрачные земли" - L["Loch Modan"] = "Лок Модан" - L["Silverpine Forest"] = "Серебряный бор" - L["The Wailing Caverns"] = "Пещеры Стенаний" - L["Westfall"] = "Западный Край" - L["Ashenvale"] = "Ясеневый лес" - L["Duskwood"] = "Сумеречный лес" - L["Hillsbrad Foothills"] = "Предгорья Хилсбрада" - L["Redridge Mountains"] = "Красногорье" - L["Stonetalon Mountains"] = "Когтистые горы" - L["Wetlands"] = "Болотина" - L["Alterac Mountains"] = "Альтеракские горы" - L["Arathi Highlands"] = "Нагорье Арати" - L["Desolace"] = "Пустоши" - L["Dustwallow Marsh"] = "Пылевые топи" - L["Scarlet Monastery"] = "Монастырь Алого ордена" - L["Stranglethorn Vale"] = "Тернистая долина" - L["Swamp of Sorrows"] = "Болото Печали" - L["Thousand Needles"] = "Тысяча Игл" - L["Azshara"] = "Азшара" - L["Felwood"] = "Оскверненный лес" - L["Feralas"] = "Фералас" - L["The Hinterlands"] = "Внутренние земли" - L["Maraudon"] = "Мародон" - L["Moonglade"] = "Лунная поляна" - L["Tanaris"] = "Танарис" - L["The Temple of Atal'Hakkar"] = "Храм Атал'Хаккара" - L["Un'Goro Crater"] = "Кратер Ун'Горо" - L["Western Plaguelands"] = "Западные Чумные земли" - L["Shadowmoon Valley"] = "Долина Призрачной Луны" - L["Burning Steppes"] = "Пылающие степи" - L["Deadwind Pass"] = "Перевал Мертвого Ветра" - L["Eastern Plaguelands"] = "Восточные Чумные земли" - L["Scholomance"] = "Некроситет" - L["Silithus"] = "Силитус" - L["Stratholme"] = "Стратхольм" - L["Winterspring"] = "Зимние Ключи" - L["Zul'Gurub"] = "Зул'Гуруб" - -- The Burning Crusade - L["Hellfire Peninsula"] = "Полуостров Адского Пламени - Темный портал" - L["Terokkar Forest"] = "Лес Тероккар" - L["Nagrand"] = "Награнд" - L["Netherstorm"] = "Пустоверть" - L["Zangarmarsh"] = "Зангартопь" - -- Burning Crusade Subzones - L["Lake Sunspring"] = "Озеро Солнечного Источника" -- Nagrand - L["Marshlight Lake"] = "Озеро Болотных Огоньков" -- Zangarmarschen - L["Sporewind Lake"] = "Озеро Спороветра" -- Zangarmarschen - L["Serpent Lake"] = "Змеиное озеро" -- Zangarmarschen - L["Blackwind Lake"] = "Озеро Черного Ветра" -- Wälder von Terokarr - L["Lake Ere'Noru"] = "Озеро Эре'Нору" -- Wälder von Terokarr - L["Lake Jorune"] = "Озеро Иорун" -- Wälder von Terokarr - -- Wrath of the Lich King - L["Borean Tundra"] = "Борейская тундра" - L["Dragonblight"] = "Драконий Погост" - L["Howling Fjord"] = "Ревущий фьорд" - L["Crystalsong Forest"] = "Лес Хрустальной Песни" - L["Dalaran"] = "Даларан" - L["Sholazar Basin"] = "Низина Шолазар" - L["The Frozen Sea"] = "Ледяное море" - - return end diff --git a/fishy.lua b/fishy.lua index 3017dc6..3c410d0 100755 --- a/fishy.lua +++ b/fishy.lua @@ -7,6 +7,7 @@ local ADDON_NAME, namespace = ... --localization local L = namespace.L --localization local version = GetAddOnMetadata(ADDON_NAME, "Version") local addoninfo = 'v'..version +local areaTable = {} fb:RegisterEvent"PLAYER_ENTERING_WORLD" @@ -23,103 +24,100 @@ local function Print(text) end local zones = { - [L["Dun Morogh"]] = -70, - [L["Durotar"]] = -70, - [L["Elwynn Forest"]] = -70, - [L["Mulgore"]] = -70, - [L["Teldrassil"]] = -70, - [L["Tirisfal Glades"]] = -70, - [L["Orgrimmar"]] = -20, - [L["Ironforge"]] = -20, - [L["Stormwind City"]] = -20, - [L["Thunder Bluff"]] = -20, - [L["Darnassus"]] = -20, - [L["Undercity"]] = -20, - [L["The Barrens"]] = -20, - [L["Blackfathom Deeps"]] = -20, - [L["Darkshore"]] = -20, - [L["The Deadmines"]] = -20, - [L["Loch Modan"]] = -20, - [L["Silverpine Forest"]] = -20, - [L["The Wailing Caverns"]] = -20, - [L["Westfall"]] = -20, - [L["Ashenvale"]] = 55, - [L["Duskwood"]] = 55, - [L["Hillsbrad Foothills"]] = 55, - [L["Redridge Mountains"]] = 55, - [L["Stonetalon Mountains"]] = 55, - [L["Wetlands"]] = 55, - [L["Alterac Mountains"]] = 130, - [L["Arathi Highlands"]] = 130, - [L["Desolace"]] = 130, - [L["Dustwallow Marsh"]] = 130, - [L["Scarlet Monastery"]] = 130, - [L["Stranglethorn Vale"]] = 130, - [L["Swamp of Sorrows"]] = 130, - [L["Thousand Needles"]] = 130, - [L["Azshara"]] = 205, - [L["Felwood"]] = 205, - [L["Feralas"]] = 205, - [L["The Hinterlands"]] = 205, - [L["Maraudon"]] = 205, - [L["Moonglade"]] = 205, - [L["Tanaris"]] = 205, - [L["The Temple of Atal'Hakkar"]] = 205, - [L["Un'Goro Crater"]] = 205, - [L["Western Plaguelands"]] = 205, - [L["Burning Steppes"]] = 330, - [L["Deadwind Pass"]] = 330, - [L["Eastern Plaguelands"]] = 330, - [L["Scholomance"]] = 330, - [L["Silithus"]] = 330, - [L["Stratholme"]] = 330, - [L["Winterspring"]] = 330, - [L["Zul'Gurub"]] = 330, - -- Burning Crusade - [L["Azuremyst Isle"]] = -70, - [L["Bloodmyst Isle"]] = -20, - [L["Silvermoon City"]] = -20, - [L["The Exodar"]] = -20, - [L["Ghostlands"]] = -20, - [L["Eversong Woods"]] = -70, - [L["Hellfire Peninsula"]] = 280, - [L["Shadowmoon Valley"]] = 280, - [L["Zangarmarsh"]] = 305, - [L["Terokkar Forest"]] = 355, - [L["Nagrand"]] = 380, - [L["Netherstorm"]] = 380, - -- Wrath of the Lich King - [L["Borean Tundra"]] = 380, - [L["Dragonblight"]] = 380, - [L["Howling Fjord"]] = 380, - [L["Crystalsong Forest"]] = 405, - [L["Dalaran"]] = 430, - [L["Sholazar Basin"]] = 430, - [L["The Frozen Sea"]] = 480, + [1411] = -70, + [1412] = -70, + [1413] = -20, + [1416] = 130, + [1417] = 130, + [1420] = -70, + [1421] = -20, + [1422] = 205, + [1423] = 330, + [1424] = 55, + [1425] = 205, + [1426] = -70, + [1428] = 330, + [1429] = -70, + [1430] = 330, + [1431] = 55, + [1432] = -20, + [1433] = 55, + [1434] = 130, + [1435] = 130, + [1436] = -20, + [1437] = 55, + [1438] = -70, + [1439] = -20, + [1440] = 55, + [1441] = 130, + [1442] = 55, + [1443] = 130, + [1444] = 205, + [1445] = 130, + [1446] = 205, + [1447] = 205, + [1448] = 205, + [1449] = 205, + [1450] = 205, + [1451] = 330, + [1452] = 330, + [1453] = -20, + [1454] = -20, + [1455] = -20, + [1456] = -20, + [1457] = -20, + [1458] = -20, + [1941] = -70, + [1942] = -20, + [1943] = -70, + [1944] = 280, + [1946] = 305, + [1947] = -20, + [1948] = 280, + [1950] = -20, + [1951] = 380, + [1952] = 355, + [1953] = 380, + [1954] = -20, } local subzones = { - ["Jaguero Isle"] = 205, - ["Bay of Storms"] = 330, - ["Hetaera's Clutch"] = 330, - ["Scalebeard's Cave"] = 330, - ["Jademir Lake"] = 330, - ["Silmyr Lake"] = 405, - [L["Marshlight Lake"]] = 355, - [L["Sporewind Lake"]] = 355, - [L["Serpent Lake"]] = 355, - [L["Lake Sunspring"]] = 395, - [L["Skysong Lake"]] = 395, - [L["Blackwind Lake"]] = 405, - [L["Lake Ere'Noru"]] = 405, - [L["Lake Jorune"]] = 405, - ["Silmyr Lake"] = 405, - ["Skettis"] = 405, - ["Blackwind Lake"] = 405, - ["Terokk's Rest"] = 405, - ["Veil Ala'rak"] = 405, - ["Veil Harr'ik"] = 405, + [297] = 205, + [718] = -20, --Wailing Caverns Entrance + [719] = -20, --BFD Entrance + [1112] = 330, + [1222] = 330, + [1227] = 330, + [1477] = 205, -- ST Entrance + [1977] = 330, -- ZG Entrance + [2100] = 205, --Maraudon Entrance + [3140] = 330, + [3614] = 395, + [3621] = 395, + [3653] = 355, + [3656] = 355, + [3658] = 355, + [3679] = 405, + [3690] = 405, + [3691] = 405, + [3692] = 405, + [3859] = 405, + [3974] = 405, + [3975] = 405, + [3976] = 405, +} +local instances = { + [36] = -20, + [43] = -20, + [48] = -20, + [109] = 205, + [309] = 309, + [329] = 330, + [349] = 205, + [548] = 405, + [1001] = 130, + [1004] = 130, + [1007] = 330, } - local fishingpoles = { [6256] = true, [6365] = true, @@ -161,13 +159,52 @@ local function ResetFishCounter(numFish) UpdateFishCount(false) end -local function UpdateCatchInfo() - local zoneText = GetSubZoneText() - local zoneSkill = subzones[zoneText] +local function populateAreaTable() + local areaName + for areaId=1,10500 do + areaName=C_Map.GetAreaInfo(areaId) + if areaName then + areaTable[areaName]=areaId + end + end +end - if not zoneSkill then +--[[ GetExploredAreaIDsAtPosition doesn't always work for many locations - UNRELIABLE +local function getPlayerAreaId() + local areaId + local unit = "Player" + local mapId = C_Map.GetBestMapForUnit(unit) + local mapPos = C_Map.GetPlayerMapPosition(mapId, unit) + areaIds = C_MapExplorationInfo.GetExploredAreaIDsAtPosition(mapId,mapPos) + if areaIds and areaIds[1] then + areaId = areaIds[1] + end + return areaId +end +--]] + +local function UpdateCatchInfo() + local zoneText + local zoneSkill + + if IsInInstance() then + local _,_,_,_,_,_,_,instanceId = GetInstanceInfo() + zoneSkill = instances[instanceId] zoneText = GetRealZoneText() - zoneSkill = zones[zoneText] + else + zoneText = GetSubZoneText() + if zoneText == "" then + zoneText = GetRealZoneText() + end + local areaId = areaTable[zoneText] + if areaId then + zoneSkill = subzones[areaId] + end + if not zoneSkill then + zoneText = GetRealZoneText() + local mapId = C_Map.GetBestMapForUnit("Player") + zoneSkill = zones[mapId] + end end -- Sometimes we can trigger this before the player is in any zone @@ -207,11 +244,19 @@ local function UpdateCatchInfo() else color = "ff40bf40" end - Fishbringer.zoneInfo:SetFormattedText( - L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"], - color, zoneText, zoneSkill, maxZoneSkill, chance * 100 - ) - Fishbringer.catchRate:SetFormattedText(L["%d%% catch rate"], chance * 100) + if zoneSkill == 0 then + Fishbringer.zoneInfo:SetFormattedText( + L["\124c%s%s\124r\nNo fish in this zone"], + color, zoneText, zoneSkill, maxZoneSkill, chance * 100 + ) + Fishbringer.catchRate:SetText("") + else + Fishbringer.zoneInfo:SetFormattedText( + L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"], + color, zoneText, zoneSkill, maxZoneSkill, chance * 100 + ) + Fishbringer.catchRate:SetFormattedText(L["%d%% catch rate"], chance * 100) + end end local function GetFishingSkill() @@ -330,7 +375,7 @@ local function InitializeDB(resetDatabase) db = {} FishbringerDB = db end - + populateAreaTable() if resetDatabase or not db[char] then db[char] = { fishingSkill = 0, From df59fe1fdfffafe7bcedefcc4db01e3641c9b17f Mon Sep 17 00:00:00 2001 From: Ulidan Date: Wed, 14 Jul 2021 02:04:13 +0300 Subject: [PATCH 2/3] Update Fishbringer.toc --- Fishbringer.toc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Fishbringer.toc b/Fishbringer.toc index 38cf210..0bceb4e 100755 --- a/Fishbringer.toc +++ b/Fishbringer.toc @@ -4,10 +4,13 @@ ## Title-ruRU: Fishbringer ## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! ## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! -## Notes-ruRU: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! -## Author: Kalerath, Fye (Localization Code & Bugfixes), leafoe (Russian Localization) +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) ## SavedVariables: FishbringerDB -## Version: 2.5.1-2 +## Version: 2.5.1-3 # localizations: localization.core.lua From dd6e0b222d39b18351bcfc846c108178f13041f5 Mon Sep 17 00:00:00 2001 From: Ulidan Date: Wed, 14 Jul 2021 13:54:10 +0300 Subject: [PATCH 3/3] Classic Era compatibility Added classic Era Compatibility --- Fishbringer.toc => Fishbringer-BCC.toc | 49 ++++++++-------- Fishbringer-Classic.toc | 24 ++++++++ fishy.lua | 79 ++++++-------------------- 3 files changed, 65 insertions(+), 87 deletions(-) rename Fishbringer.toc => Fishbringer-BCC.toc (96%) mode change 100755 => 100644 create mode 100644 Fishbringer-Classic.toc diff --git a/Fishbringer.toc b/Fishbringer-BCC.toc old mode 100755 new mode 100644 similarity index 96% rename from Fishbringer.toc rename to Fishbringer-BCC.toc index 0bceb4e..4e23d17 --- a/Fishbringer.toc +++ b/Fishbringer-BCC.toc @@ -1,25 +1,24 @@ -## Interface: 20501 -## Title: Fishbringer -## Title-deDE: Fishbringer -## Title-ruRU: Fishbringer -## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! -## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! -## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! -## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! -## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! -## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! -## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) -## SavedVariables: FishbringerDB -## Version: 2.5.1-3 - -# localizations: -localization.core.lua -Localization.deDE.lua -Localization.ruRU.lua -Localization.esES.lua -Localization.frFR.lua -Localization.ptBR.lua - -# main: -fishy.lua - +## Interface: 20501 +## Title: Fishbringer +## Title-deDE: Fishbringer +## Title-ruRU: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## SavedVariables: FishbringerDB +## Version: 2.5.1-4 + +# main: +localization.core.lua +fishy.lua + +# localizations: +Localization.deDE.lua +Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua diff --git a/Fishbringer-Classic.toc b/Fishbringer-Classic.toc new file mode 100644 index 0000000..a849b45 --- /dev/null +++ b/Fishbringer-Classic.toc @@ -0,0 +1,24 @@ +## Interface: 11307 +## Title: Fishbringer +## Title-deDE: Fishbringer +## Title-ruRU: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## SavedVariables: FishbringerDB +## Version: 2.5.1-4 + +# main: +localization.core.lua +fishy.lua + +# localizations: +Localization.deDE.lua +Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua diff --git a/fishy.lua b/fishy.lua index 3c410d0..ca44314 100755 --- a/fishy.lua +++ b/fishy.lua @@ -7,6 +7,9 @@ local ADDON_NAME, namespace = ... --localization local L = namespace.L --localization local version = GetAddOnMetadata(ADDON_NAME, "Version") local addoninfo = 'v'..version +local _,_,_,interface = GetBuildInfo() +local classicEra = (interface==11307) +local classicTBC = (interface==20501) local areaTable = {} @@ -390,12 +393,25 @@ local function InitializeDB(resetDatabase) end end +local function classicEraCreateFrame() + return CreateFrame("Frame", "Fishbringer", UIParent) +end +local function classicTBCCreateFrame() + return CreateFrame("Frame", "Fishbringer", UIParent, "BackdropTemplate") +end + local function InitializeFrame() -- Frame madness if Fishbringer then return end - local Fishbringer = CreateFrame("Frame", "Fishbringer", UIParent, "BackdropTemplate") + if classicEra then + local Fishbringer = classicEraCreateFrame() + elseif classicTBC then + local Fishbringer = classicTBCCreateFrame() + else + return + end Fishbringer:EnableMouse(true) Fishbringer:SetMovable(true) Fishbringer:SetUserPlaced(true) @@ -522,67 +538,6 @@ local function ShowHelp() Print(L["- /fishbringer reset - Resets the fish database."]) end -local function FishbringerMenu() - - --[[ - if FishrbingerUI then - return - end - - local FishbringerUI = CreateFrame("Frame", "FishbringerUI", UIParent, "BasicFrameTemplateWithInset") - FishbringerUI:SetSize(300, 400); - FishbringerUI:SetPoint("Center", UIParent, "Center"); - FishbringerUI:EnableMouse(true); - FishbringerUI:SetMovable(false); - FishbringerUI:RegisterForDrag("LeftButton") - FishbringerUI:SetScript("OnDragStart", FishbringerUI.StartMoving) - FishbringerUI:SetScript("OnDragStop", FishbringerUI.StopMovingOrSizing) - FishbringerUI:SetBackdrop({ - bgFile = "Interface\\ChatFrame\\ChatFrameBackground", - tile = true, - tileSize = 16, - insets = { - left = 4, - right = 4, - top = 4, - bottom = 4 - }, - }) - FishbringerUI:SetBackdropColor(0, 0, 0, .6) - FishbringerUI:Show(); - - FishbringerUI.title = FishbringerUI:CreateFontString(nil, "Overlay"); - FishbringerUI.title:SetFontObject("GameFontHighlight"); - FishbringerUI.title:SetPoint("Center", FishbringerUI.TitleBg, "Center", 5, 0); - FishbringerUI.title:SetText("|cFF00FF00Fishbringer v1.13.4"); - - tinsert(UISpecialFrames, FishbringerUI:GetName()) - - local MoveButton = CreateFrame("CheckButton", "MoveButton_GlobalName", FishbringerUI, "ChatConfigCheckButtonTemplate"); - MoveButton:SetPoint("TOPLEFT", 10, -60); - MoveButton_GlobalNameText:SetText("Window Moveable"); - MoveButton.tooltip = "Let's move the Window...or not?"; - MoveButton:SetScript("OnClick", - function() - if FishbringerUI:IsMovable == false then - FishbringerUI:SetMovable(true) - else - FishbringerUI:SetMovable(false) - end - end - ); - - local ToggleButton = CreateFrame("CheckButton", "ToggleButton_GlobalName", FishbringerUI, "ChatConfigCheckButtonTemplate"); - ToggleButton:SetPoint("TOPLEFT", 10, -30); - ToggleButton_GlobalNameText:SetText("Show/Hide the Fishing Widget"); - ToggleButton.tooltip = "Toggles the Widget visibility."; - ToggleButton:SetScript("OnClick", - function() - Toggle(); - end - ); --]] -end - SlashCmdList["FISHBRINGER"] = function(arg) if arg == "align" then return CycleAlignment()