diff --git a/Bindings.xml b/Bindings.xml
index 05c46ab..8bff328 100755
--- a/Bindings.xml
+++ b/Bindings.xml
@@ -31,6 +31,11 @@
FishingBuddy.Command(FishingBuddy.SWITCH);
end
+
+ if ( keystate == "down" ) then
+ FishingBuddy.SuitUpAndGoFishing();
+ end
+
if ( keystate == "up" ) then
diff --git a/FishingBuddy.lua b/FishingBuddy.lua
index 73ff028..d499f4d 100755
--- a/FishingBuddy.lua
+++ b/FishingBuddy.lua
@@ -17,79 +17,183 @@ local POLES = {
}
local FISHINGLURES = {
- ["6533:0:0:0"] = "Aquadynamic Fish Attractor", -- 100 for 5 mins
- ["7307:0:0:0"] = "Flesh Eating Worm", -- 75 for 10 mins
- ["6532:0:0:0"] = "Bright Baubles", -- 75 for 10 mins
- ["6811:0:0:0"] = "Aquadynamic Fish Lens", -- 50 for 10 mins
- ["6530:0:0:0"] = "Nightcrawlers", -- 50 for 10 mins
- ["6529:0:0:0"] = "Shiny Bauble", -- 25 for 10 mins
+ [6533] = "Aquadynamic Fish Attractor", -- 100 for 5 mins
+ [7307] = "Flesh Eating Worm", -- 75 for 10 mins
+ [6532] = "Bright Baubles", -- 75 for 10 mins
+ [6811] = "Aquadynamic Fish Lens", -- 50 for 10 mins
+ [6530] = "Nightcrawlers", -- 50 for 10 mins
+ [6529] = "Shiny Bauble", -- 25 for 10 mins
}
FishingBuddy.OPTIONS = {
- { ["name"] = "ShowNewFishies",
+ ["ShowNewFishies"] = {
["text"] = FishingBuddy.CONFIG_SHOWNEWFISHIES_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_SHOWNEWFISHIES_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 1 },
- { ["name"] = "WatchFishies",
+ ["WatchFishies"] = {
["text"] = FishingBuddy.CONFIG_FISHWATCH_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_FISHWATCH_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 1 },
- { ["name"] = "WatchCurrentSkill",
+ ["WatchCurrentSkill"] = {
["text"] = FishingBuddy.CONFIG_FISHWATCHSKILL_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_FISHWATCHSKILL_INFO,
- ["default"] = 1 },
- { ["name"] = "WatchCurrentZone",
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 1,
+ ["deps"] = { ["WatchFishies"] = "d" } },
+ ["WatchCurrentZone"] = {
["text"] = FishingBuddy.CONFIG_FISHWATCHZONE_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_FISHWATCHZONE_INFO,
- ["default"] = 0 },
- { ["name"] = "WatchOnlyWhenFishing",
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 0,
+ ["deps"] = { ["WatchFishies"] = "d" } },
+ ["WatchOnlyWhenFishing"] = {
["text"] = FishingBuddy.CONFIG_FISHWATCHONLY_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_FISHWATCHONLY_INFO,
- ["default"] = 1 },
- { ["name"] = "WatchFishPercent",
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 1,
+ ["deps"] = { ["WatchFishies"] = "d" } },
+ ["WatchFishPercent"] = {
["text"] = FishingBuddy.CONFIG_FISHWATCHPERCENT_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_FISHWATCHPERCENT_INFO,
- ["default"] = 1 },
- { ["name"] = "SortByPercent",
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 1,
+ ["deps"] = { ["WatchFishies"] = "d" } },
+ ["SortByPercent"] = {
["text"] = FishingBuddy.CONFIG_SORTBYPERCENT_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_SORTBYPERCENT_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 1 },
- { ["name"] = "SuitUpFirst",
+ ["SuitUpFirst"] = {
["text"] = FishingBuddy.CONFIG_SUITUPFIRST_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_SUITUPFIRST_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 0 },
- { ["name"] = "EasyCast",
+ ["EasyCast"] = {
["text"] = FishingBuddy.CONFIG_EASYCAST_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_EASYCAST_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 1 },
- { ["name"] = "FastCast",
- ["text"] = FishingBuddy.CONFIG_FASTCAST_ONOFF,
- ["tooltip"] = FishingBuddy.CONFIG_FASTCAST_INFO,
- ["default"] = 1 },
- { ["name"] = "EasyLures",
+ ["EasyLures"] = {
["text"] = FishingBuddy.CONFIG_EASYLURES_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_EASYLURES_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 0 },
- { ["name"] = "STVTimer",
+ ["STVTimer"] = {
["text"] = FishingBuddy.CONFIG_STVTIMER_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_STVTIMER_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
["default"] = 0 },
- { ["name"] = "UseButtonHole",
+ ["STVPoolsOnly"] = {
+ ["text"] = FishingBuddy.CONFIG_STVPOOLSONLY_ONOFF,
+ ["tooltip"] = FishingBuddy.CONFIG_STVPOOLSONLY_INFO,
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 0,
+ ["deps"] = { ["STVTimer"] = "d", ["EasyCast"] = "d" } },
+ ["UseButtonHole"] = {
["text"] = FishingBuddy.CONFIG_USEBUTTONHOLE_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_USEBUTTONHOLE_INFO,
+ ["v"] = 1,
["default"] = 0,
["check"] = function () return ButtonHole ~= nil; end,
["checkfail"] = 0 },
- { ["name"] = "MinimapButtonVisible",
- ["text"] = FishingBuddy.CONFIG_MINIMAPBUTTON_ONOFF,
+ ["UseGatherer"] = {
+ ["text"] = FishingBuddy.CONFIG_USEGATHERER_ONOFF,
+ ["tooltip"] = FishingBuddy.CONFIG_USEGATHERER_INFO,
+ ["v"] = 1,
+ ["default"] = 0,
+ ["check"] = function () return Gatherer_OnLoad ~= nil; end,
+ ["checkfail"] = 0 },
+ ["MinimapButtonVisible"] = {
["tooltip"] = FishingBuddy.CONFIG_MINIMAPBUTTON_INFO,
+ ["v"] = 1,
["default"] = 1,
["check"] = function () return not FishingBuddy.UseButtonHole(); end,
- ["checkfail"] = 1 },
- { ["name"] = "EnhanceFishingSounds",
+ ["checkfail"] = 0,
+ ["update"] = function(checked)
+ local b = FishingBuddyOption_MinimapButtonVisible;
+ if ( b:GetChecked() ) then
+ b.text = "";
+ else
+ b.text = FishingBuddy.CONFIG_MINIMAPBUTTON_ONOFF;
+ end
+ FishingBuddyOption_MinimapButtonVisibleText:SetText(b.text);
+ end,
+ },
+ ["EnhanceFishingSounds"] = {
["text"] = FishingBuddy.CONFIG_ENHANCESOUNDS_ONOFF,
["tooltip"] = FishingBuddy.CONFIG_ENHANCESOUNDS_INFO,
- ["default"] = 1 },
+ ["v"] = 1,
+ ["m"] = 1,
+ ["default"] = 0 },
+ -- options not in a menu
+ ["ShowLocationZones"] = {
+ ["default"] = 1,
+ },
+ ["GroupByLocation"] = {
+ ["default"] = 1,
+ },
+ ["TitanClickToSwitch"] = {
+ ["default"] = 1,
+ },
+ ["FubarClickToSwitch"] = {
+ ["default"] = 1,
+ },
+ ["InfoBarClickToSwitch"] = {
+ ["default"] = 1,
+ },
+ ["MinimapClickToSwitch"] = {
+ ["default"] = 0,
+ },
+ ["EasyCastKeys"] = {
+ ["default"] = FishingBuddy.KEYS_NONE,
+ ["deps"] = { ["EasyCast"] = "h" },
+ },
+ ["SuitUpKeys"] = {
+ ["default"] = FishingBuddy.KEYS_NONE,
+ },
+ ["EnhanceSoundSoundVolume"] = {
+ ["default"] = 1.0,
+ },
+ ["EnhanceSoundMusicVolume"] = {
+ ["default"] = 0.0,
+ },
+ ["EnhanceSoundAmbienceVolume"] = {
+ ["default"] = 0.0,
+ },
+ ["MinimapButtonPosition"] = {
+ ["default"] = FishingBuddy.DEFAULT_MINIMAP_POSITION,
+ },
+ ["MinimapPosSlider"] = {
+ ["deps"] = { ["MinimapButtonVisible"] = "h", },
+ },
+ ["ClockOffset"] = {
+ ["default"] = 0,
+ ["deps"] = { ["STVTimer"] = "h" },
+ ["visible"] = function()
+ if ( FishingBuddy.ClockOffsets ) then
+ return 1;
+ else
+ return 0;
+ end;
+ end,
+ },
+ ["OutfitManager"] = {
+ ["default"] = "OutfitDisplayFrame",
+ },
}
FishingBuddy.ByFishie = nil;
@@ -103,10 +207,12 @@ local SavedAddMessage = nil;
FishingBuddy.SavedToggleMinimap = nil;
-local StartedFishing = nil;
+FishingBuddy.StartedFishing = nil;
+
local TestingLures = false;
local CastingNow = false;
local AddingLure = false;
+local IsLooting = false;
local FishingSpellID = nil;
local FishingSkillName = nil;
@@ -114,56 +220,156 @@ local FishingSkillName = nil;
local gotSetupDone = false;
local playerName = nil;
local realmName = nil;
+local schooltipText = nil;
FishingBuddy.currentFishies = {};
local DEFAULT_MINIMAP_POSITION = 256;
--- Fill in the player name and realm
-FishingBuddy.SetupNameInfo = function()
- playerName = UnitName("player");
- realmName = GetRealmName();
- return playerName, realmName;
-end
-
-FishingBuddy.GetWasWearing = function()
- if FishingBuddy_Player["WasWearing"] then
- return FishingBuddy_Player["WasWearing"];
+local function GetDefault(setting)
+ local opt = FishingBuddy.OPTIONS[setting];
+ if ( opt ) then
+ if ( opt.check and opt.checkfail ) then
+ if ( not opt.check() ) then
+ return opt.checkfail;
+ end
+ end
+ return opt.default;
end
end
-
-FishingBuddy.SetWasWearing = function(outfit)
- FishingBuddy_Player["WasWearing"] = outfit;
-end
-
-FishingBuddy.GetOutfitItem = function(slotName)
- if (FishingBuddy_Player["Outfit"]) then
- return FishingBuddy_Player["Outfit"][slotName];
- end
-end
-
-FishingBuddy.GetOutfit = function()
- return FishingBuddy_Player["Outfit"];
-end
-
-FishingBuddy.SetOutfit = function(outfit)
- FishingBuddy_Player["Outfit"] = outfit;
-end
+FishingBuddy.GetDefault = GetDefault;
local function GetSetting(setting)
if ( not FishingBuddy_Player or
not FishingBuddy_Player["Settings"] ) then
return;
end
- return FishingBuddy_Player["Settings"][setting];
+ local val = FishingBuddy_Player["Settings"][setting];
+ if ( val == nil ) then
+ val = GetDefault(setting);
+ end
+ return val;
end
FishingBuddy.GetSetting = GetSetting;
local function SetSetting(setting, value)
- FishingBuddy_Player["Settings"][setting] = value;
+ if ( FishingBuddy_Player and setting ) then
+ local val = GetDefault(setting);
+ if ( val == value ) then
+ FishingBuddy_Player["Settings"][setting] = nil;
+ else
+ FishingBuddy_Player["Settings"][setting] = value;
+ end
+ end
end
FishingBuddy.SetSetting = SetSetting;
+local function SetClockOffset(offset)
+ if ( not FishingBuddy_Info["ClockOffsets"] ) then
+ FishingBuddy_Info["ClockOffsets"] = {};
+ end
+ if ( offset == 0 ) then
+ FishingBuddy_Info["ClockOffsets"][realmName] = nil;
+ else
+ FishingBuddy_Info["ClockOffsets"][realmName] = offset;
+ end
+end
+FishingBuddy.SetClockOffset = SetClockOffset;
+
+local function GetClockOffset()
+ if ( not FishingBuddy_Info["ClockOffsets"] or
+ not FishingBuddy_Info["ClockOffsets"][realmName] ) then
+ return 0;
+ end
+ return FishingBuddy_Info["ClockOffsets"][realmName];
+end
+FishingBuddy.GetClockOffset = GetClockOffset;
+
+-- We have to do this at PLAYER_ENTERING_WORLD or PLAYER_LOGIN
+-- GetGameTime isn't correct at VARIABLES_LOADED
+local function CheckClockOffset()
+ local hour,minute = GetGameTime();
+ local lhour = date("%H");
+ local lminute = date("%M");
+ local houroff;
+ houroff = hour - lhour;
+ if ( houroff ~= 0 ) then
+ local houroff24;
+ if ( houroff < 0 ) then
+ houroff24 = 24 + houroff;
+ else
+ houroff24 = houroff - 24;
+ end
+ local offsets = { houroff, houroff24 };
+ FishingBuddy.ClockOffsets = offsets;
+ local current = GetClockOffset();
+ -- don't change it if we've already got a good value
+ if ( current ~= houroff and current ~= houroff24 ) then
+ SetClockOffset(houroff);
+ end
+ else
+ FishingBuddy.ClockOffsets = nil;
+ SetClockOffset(0);
+ end
+ -- Set up the menu and such
+ FishingBuddy.OptionsFrame.SetClockValues(GetClockOffset());
+end
+
+-- look at tooltips
+local function GetTooltipText()
+ local text = "";
+ if ( GameTooltip:IsVisible() ) then
+ text = getglobal("GameTooltipTextLeft1");
+ if ( text ) then
+ return text:GetText();
+ end
+ end
+ return nil;
+end
+FishingBuddy.GetTooltipText = GetTooltipText;
+
+local function OnFishingBobber()
+ local text = GetTooltipText();
+ if ( text ) then
+ -- let a partial match work (for translations)
+ return ( text and string.find(text, FishingBuddy.BOBBER_NAME ) );
+ end
+ return false;
+end
+
+-- support finding the fishing skill
+local function FindSpellID(thisone)
+ local id = 1;
+ local spellTexture = GetSpellTexture(id, BOOKTYPE_SPELL);
+ while (spellTexture) do
+ if (spellTexture and spellTexture == thisone) then
+ return id;
+ end
+ id = id + 1;
+ spellTexture = GetSpellTexture(id, BOOKTYPE_SPELL);
+ end
+ return nil;
+end
+
+local function GetFishingSpellID()
+ if ( not FishingSpellID or not FishingSkillName) then
+ FishingSpellID = FindSpellID(FishingBuddy.FISHINGTEXTURE);
+ end
+ if ( FishingSpellID and not FishingSkillName ) then
+ FishingSkillName = GetSpellName(FishingSpellID, BOOKTYPE_SPELL);
+ end
+end
+
+local function GetFishingSkillName()
+ GetFishingSpellID();
+ if ( not FishingSkillName ) then
+ return FishingBuddy.FISHINGSKILL;
+ else
+ return FishingSkillName;
+ end
+end
+FishingBuddy.GetFishingSkillName = GetFishingSkillName;
+
-- handle option keys for enabling casting
local key_actions = {
[FishingBuddy.KEYS_NONE] = function() return true; end,
@@ -173,7 +379,7 @@ local key_actions = {
}
local function CastingKeys()
local setting = GetSetting("EasyCastKeys");
- if ( key_actions[setting] ) then
+ if ( setting and key_actions[setting] ) then
return key_actions[setting]();
else
return true;
@@ -182,36 +388,153 @@ end
-- get our current fishing skill level
local lastSkillIndex = nil;
-FishingBuddy.GetCurrentSkill = function()
+local function GetCurrentSkill()
if ( lastSkillIndex ) then
local name, _, _, rank, _, modifier = GetSkillLineInfo(lastSkillIndex);
- if ( name == FishingBuddy.GetFishingSkillName() )then
+ if ( name == GetFishingSkillName() )then
return rank, modifier;
end
end
local n = GetNumSkillLines();
for i=1,n do
local name, _, _, rank, _, modifier = GetSkillLineInfo(i);
- if ( name == FishingBuddy.GetFishingSkillName() ) then
+ if ( name == GetFishingSkillName() ) then
lastSkillIndex = i;
return rank, modifier;
end
end
return 0, 0;
end
+FishingBuddy.GetCurrentSkill = GetCurrentSkill;
-FishingBuddy.SetZoneLevel = function(zone, subzone, fishid)
- local skill, mods = FishingBuddy.GetCurrentSkill();
+-- handle dynamic event registration
+local function EventRegistration(frame, events, reg)
+ for _,evt in events do
+ if ( reg ) then
+ frame:RegisterEvent(evt);
+ else
+ frame:UnregisterEvent(evt);
+ end
+ end
+end
+
+
+-- handle the vagaries of zones and subzones
+local function GetZoneInfo()
+ local zone = GetRealZoneText();
+ local subzone = GetSubZoneText();
+ if ( not zone or zone == "" ) then
+ zone = FishingBuddy.UNKNOWN;
+ end
+ if ( not subzone or subzone == "" ) then
+ subzone = zone;
+ end
+ return zone, subzone;
+end
+FishingBuddy.GetZoneInfo = GetZoneInfo;
+
+local zonemapping;
+local subzonemapping;
+
+local function DumpMappings()
+ FishingBuddy.Debug("Zone mapping");
+ FishingBuddy.Dump(zonemapping);
+ FishingBuddy.Debug("SubZone mapping");
+ FishingBuddy.Dump(subzonemapping);
+end
+FishingBuddy.DumpMappings = DumpMappings;
+
+local function GetZoneIndex(zone, subzone)
+ if ( not zone ) then
+ zone, subzone = GetZoneInfo();
+ end
+ if ( not zonemapping ) then
+ zonemapping = {};
+ for idx,z in FishingBuddy_Info["ZoneIndex"] do
+ zonemapping[z] = idx;
+ end
+ end
+ local zidx = zonemapping[zone];
+ if ( not subzonemapping ) then
+ subzonemapping = {};
+ for idx,_ in FishingBuddy_Info["ZoneIndex"] do
+ subzonemapping[idx] = {};
+ if ( FishingBuddy_Info["SubZones"][idx] ) then
+ for jdx,sz in FishingBuddy_Info["SubZones"][idx] do
+ subzonemapping[idx][sz] = jdx;
+ end
+ end
+ end
+ end
+ if ( not zidx ) then
+ return;
+ end
+ if ( not subzonemapping[zidx] ) then
+ subzonemapping[zidx] = {};
+ end
+ if ( not subzone or not subzonemapping[zidx][subzone] ) then
+ return zidx;
+ end
+ return zidx, subzonemapping[zidx][subzone];
+end
+FishingBuddy.GetZoneIndex = GetZoneIndex;
+
+local function AddZoneIndex(zone, subzone)
+ if ( not zone ) then
+ zone, subzone = GetZoneInfo();
+ end
+ if ( type(zone) ~= "string" ) then
+ FishingBuddy.Debug("AddZoneIndex "..zone);
+ end
+ local zidx, sidx = GetZoneIndex(zone, subzone);
+ if ( not zidx ) then
+ tinsert(FishingBuddy_Info["ZoneIndex"], zone);
+ zidx = table.getn(FishingBuddy_Info["ZoneIndex"]);
+ zonemapping[zone] = zidx;
+ -- keep sort helpers up to date
+ if ( FishingBuddy.SortedZones ) then
+ tinsert(FishingBuddy.SortedZones, zone);
+ table.sort(FishingBuddy.SortedZones);
+ end
+ end
+ if ( not subzone ) then
+ return zidx;
+ end
+ if ( not subzonemapping[zidx] ) then
+ subzonemapping[zidx] = {};
+ end
+ if ( not subzonemapping[zidx][subzone] ) then
+ if ( not FishingBuddy_Info["SubZones"][zidx] ) then
+ FishingBuddy_Info["SubZones"][zidx] = {};
+ end
+ tinsert(FishingBuddy_Info["SubZones"][zidx], subzone);
+ subzonemapping[zidx][subzone] = table.getn(FishingBuddy_Info["SubZones"][zidx]);
+ -- keep sort helpers up to date
+ if ( FishingBuddy.SortedByZone ) then
+ FishingBuddy.SortedByZone[zone] = {};
+ tinsert(FishingBuddy.SortedByZone[zone], subzone);
+ table.sort(FishingBuddy.SortedByZone[zone]);
+ tinsert(FishingBuddy.SortedSubZones, subzone);
+ table.sort(FishingBuddy.SortedSubZones);
+ end
+ end
+ return zidx, subzonemapping[zidx][subzone];
+end
+FishingBuddy.AddZoneIndex = AddZoneIndex;
+
+local function SetZoneLevel(zone, subzone, fishid)
+ local skill, mods = GetCurrentSkill();
+ local zidx, sidx = GetZoneIndex(zone, subzone);
local fs = FishingBuddy_Info["FishingSkill"];
- if ( not fs[zone] ) then
- fs[zone] = {};
+ if ( not fs[zidx] ) then
+ fs[zidx] = {};
end
local skillcheck = skill + mods;
if ( skillcheck > 0 ) then
- if ( not fs[zone][subzone] or skillcheck < fs[zone][subzone] ) then
- fs[zone][subzone] = skillcheck;
+ if ( not fs[zidx][sidx] or skillcheck < fs[zidx][sidx] ) then
+ fs[zidx][sidx] = skillcheck;
end
- if ( fishie ) then
+ if ( fishid ) then
if ( not FishingBuddy_Info["Fishies"][fishid].level or
skillcheck < FishingBuddy_Info["Fishies"][fishid].level ) then
FishingBuddy_Info["Fishies"][fishid].level = skillcheck;
@@ -221,27 +544,60 @@ FishingBuddy.SetZoneLevel = function(zone, subzone, fishid)
end
end
end
+FishingBuddy.SetZoneLevel = SetZoneLevel;
local OldBindingKey;
+local OldBindingKey2;
local function UpdateBindings(onoff)
- if ( onoff ) then
- if ( not OldKeyBinding ) then
- OldKeyBinding = GetBindingKey("TURNORACTION");
- if ( OldKeyBinding ) then
- SetBinding(OldKeyBinding, "FISHINGBUDDY_PERFORMCAST");
- else
- FishingBuddy.UIError(FishingBuddy.TOOMANYFISHERMEN);
- end
- end
- else
- if ( OldKeyBinding ) then
- SetBinding(OldKeyBinding, "TURNORACTION");
- OldKeyBinding = nil;
- end
- end
+ if ( onoff ) then
+ if ( not OldKeyBinding ) then
+ OldKeyBinding, OldBindingKey2 = GetBindingKey("TURNORACTION");
+ if ( OldKeyBinding ) then
+ SetBinding(OldKeyBinding, "FISHINGBUDDY_PERFORMCAST");
+ if (OldBindingKey2) then
+ SetBinding(OldBindingKey2, "FISHINGBUDDY_PERFORMCAST");
+ end
+ else
+ FishingBuddy.UIError(FishingBuddy.TOOMANYFISHERMEN);
+ end
+ end
+ else
+ if ( OldKeyBinding ) then
+ SetBinding(OldKeyBinding, "TURNORACTION");
+ OldKeyBinding = nil;
+ if (OldBindingKey2) then
+ SetBinding(OldBindingKey2, "TURNORACTION");
+ OldBindingKey2 = nil;
+ end
+ end
+ end
end
FishingBuddy.UpdateBindings = UpdateBindings;
+-- Something else that should be in a library
+local function SplitLink(link)
+ if ( link ) then
+ local _,_, color, item, name = string.find(link, "|c(%x+)|Hitem:(%d+:%d+:%d+:%d+)|h%[(.-)%]|h|r");
+ return color, item, name;
+ end
+end
+FishingBuddy.SplitLink = SplitLink;
+
+local function SplitFishLink(link)
+ if ( link ) then
+ local _,_, color, id, name = string.find(link, "|c(%x+)|Hitem:(%d+):%d+:%d+:%d+|h%[(.-)%]|h|r");
+ return color, tonumber(id), name;
+ end
+end
+FishingBuddy.SplitFishLink = SplitFishLink;
+
+local function IsLinkableItem(item)
+ local link = "item:"..item;
+ local n,l,_,_,_,_,_,_ = GetItemInfo(link);
+ return ( n and l );
+end
+FishingBuddy.IsLinkableItem = IsLinkableItem;
+
-- Shamelessly stolen from TackleBox
local function IsFishingPole()
-- Get the main hand item texture
@@ -251,13 +607,15 @@ local function IsFishingPole()
-- that matches the fishing pole texture, then we have a fishing pole
if ( itemTexture and string.find(itemTexture, "INV_Fishingpole") ) then
local link = GetInventoryItemLink("player", slot);
- local _, id, _ = FishingBuddy.SplitLink(link);
+ local _, id, _ = SplitLink(link);
-- Make sure it's not "Nat Pagle's Fish Terminator"
- return (id ~= 19944);
+ if ( not string.find(id, "^19944") ) then
+ return true;
+ end
end
return false;
end
-FishingBuddy.IsFishingPole = IsFishingPole;
+FishingBuddy.API.IsFishingPole = IsFishingPole;
-- override the error message method (need an object as the first arg)
local function UIError_AddMessage( o, msg, a, r, g, b, hold )
@@ -273,10 +631,22 @@ local function UIError_AddMessage( o, msg, a, r, g, b, hold )
end
FishingBuddy.AddMessage = UIError_AddMessage;
-local function HijackCheck()
- return ( GetSetting("EasyCast") == 1 and
- CastingKeys() and IsFishingPole() );
+local function NormalHijackCheck()
+ if ( GetSetting("EasyCast") == 1 and
+ CastingKeys() and IsFishingPole() ) then
+ return true;
+ end
end
+FishingBuddy.NormalHijackCheck = NormalHijackCheck;
+
+local HijackCheck = NormalHijackCheck;
+local function SetHijackCheck(func)
+ if ( not func ) then
+ func = NormalHijackCheck;
+ end
+ HijackCheck = func;
+end
+FishingBuddy.SetHijackCheck = SetHijackCheck;
local SavedWFOnMouseUp;
local SavedWFOnMouseDown;
@@ -322,7 +692,7 @@ local function WF_OnMouseUp()
end
-- Find things in our inventory
-local function FindItem(id)
+local function FindItemByID(id)
if ( id ) then
local numSlots = 0;
-- check each of the bags on the player
@@ -334,8 +704,7 @@ local function FindItem(id)
for slot=1, numSlots do
local link = GetContainerItemLink (bag,slot);
if (link) then
- local c, i, n = FishingBuddy.SplitLink(link);
- local check = string.gsub(i, "^(%d+):(%d+):(%d+):(%d+)$", "%1:%2:0:0");
+ local c, check, n = SplitFishLink(link);
if ( check == id ) then
return bag, slot;
end
@@ -362,35 +731,7 @@ local function SafeHookScript(frame, handlername, newscript)
return oldValue;
end
--- Something else that should be in a library
-FishingBuddy.SplitLink = function(link)
- if ( link ) then
- local _,_, color, item, name = string.find(link, "|c(%x+)|Hitem:(%d+:%d+:%d+:%d+)|h%[(.-)%]|h|r");
- return color, item, name;
- end
-end
-
-FishingBuddy.SplitFishLink = function(link)
- if ( link ) then
- local _,_, color, id, name = string.find(link, "|c(%x+)|Hitem:(%d+):%d+:%d+:%d+|h%[(.-)%]|h|r");
- return color, tonumber(id), name;
- end
-end
-
--- handle the vagaries of zones and subzones
-FishingBuddy.GetZoneInfo = function()
- local zone = GetRealZoneText();
- local subzone = GetSubZoneText();
- if ( not zone or zone == "" ) then
- zone = FishingBuddy.UNKNOWN;
- end
- if ( not subzone or subzone == "" ) then
- subzone = zone;
- end
- return zone, subzone;
-end
-
-FishingBuddy.AddFishie = function(color, id, name, zone, subzone, texture, quantity, quality)
+local function AddFishie(color, id, name, zone, subzone, texture, quantity, quality)
if ( not FishingBuddy_Info["Fishies"][id] ) then
FishingBuddy_Info["Fishies"][id] = { };
FishingBuddy_Info["Fishies"][id].name = name;
@@ -404,6 +745,9 @@ FishingBuddy.AddFishie = function(color, id, name, zone, subzone, texture, quant
FishingBuddy.FishSort(FishingBuddy.SortedFishies, true);
end
end
+ if ( name and not FishingBuddy_Info["Fishies"][id].name ) then
+ FishingBuddy_Info["Fishies"][id].name = name;
+ end
if ( not zone ) then
zone = FishingBuddy.UNKNOWN;
@@ -411,37 +755,31 @@ FishingBuddy.AddFishie = function(color, id, name, zone, subzone, texture, quant
if ( not subzone ) then
subzone = zone;
end
+ local zidx, sidx = AddZoneIndex(zone, subzone);
- if ( not FishingBuddy.currentFishies[subzone] ) then
- FishingBuddy.currentFishies[subzone] = {};
+ if ( not FishingBuddy.currentFishies[sidx] ) then
+ FishingBuddy.currentFishies[sidx] = {};
end
- if ( not FishingBuddy.currentFishies[subzone][id] ) then
- FishingBuddy.currentFishies[subzone][id] = quantity;
+ if ( not FishingBuddy.currentFishies[sidx][id] ) then
+ FishingBuddy.currentFishies[sidx][id] = quantity;
else
- FishingBuddy.currentFishies[subzone][id] = FishingBuddy.currentFishies[subzone][id] + quantity;
+ FishingBuddy.currentFishies[sidx][id] = FishingBuddy.currentFishies[sidx][id] + quantity;
end
- if( not FishingBuddy_Info["FishingHoles"][zone] ) then
- FishingBuddy_Info["FishingHoles"][zone] = { };
- tinsert(FishingBuddy.SortedZones, zone);
- table.sort(FishingBuddy.SortedZones);
+ if( not FishingBuddy_Info["FishingHoles"][zidx] ) then
+ FishingBuddy_Info["FishingHoles"][zidx] = { };
end
- if( not FishingBuddy_Info["FishingHoles"][zone][subzone] ) then
- FishingBuddy_Info["FishingHoles"][zone][subzone] = { };
- FishingBuddy.SortedByZone[zone] = {};
- tinsert(FishingBuddy.SortedByZone[zone], subzone);
- table.sort(FishingBuddy.SortedByZone[zone]);
- tinsert(FishingBuddy.SortedSubZones, subzone);
- table.sort(FishingBuddy.SortedSubZones);
+ if( not FishingBuddy_Info["FishingHoles"][zidx][sidx] ) then
+ FishingBuddy_Info["FishingHoles"][zidx][sidx] = { };
end
- local fh = FishingBuddy_Info["FishingHoles"][zone];
- if ( not fh[subzone][id] ) then
- fh[subzone][id] = quantity;
+ local fh = FishingBuddy_Info["FishingHoles"][zidx];
+ if ( not fh[sidx][id] ) then
+ fh[sidx][id] = quantity;
if ( GetSetting("ShowNewFishies") == 1 ) then
FishingBuddy.Print(FishingBuddy.ADDFISHIEMSG, name, subzone);
end
else
- fh[subzone][id] = fh[subzone][id] + quantity;
+ fh[sidx][id] = fh[sidx][id] + quantity;
end
if ( FishingBuddy.ByFishie ) then
@@ -449,14 +787,15 @@ FishingBuddy.AddFishie = function(color, id, name, zone, subzone, texture, quant
FishingBuddy.ByFishie[id] = {};
end
if ( not FishingBuddy.ByFishie[id][subzone] ) then
- FishingBuddy.ByFishie[id][subzone] = quantity;
+ FishingBuddy.ByFishie[id][sidx] = quantity;
else
- FishingBuddy.ByFishie[id][subzone] = FishingBuddy.ByFishie[id][subzone] + quantity;
+ FishingBuddy.ByFishie[id][sidx] = FishingBuddy.ByFishie[id][sidx] + quantity;
end
end
FishingBuddy.Locations.DataChanged(zone, subzone, fishie);
FishingBuddy.WatchUpdate();
end
+FishingBuddy.AddFishie = AddFishie;
FishingBuddy.GetFishie = function(fishid)
if( FishingBuddy_Info["Fishies"][fishid] ) then
@@ -485,7 +824,7 @@ local function ImportFish()
for zone in fz do
for subzone in fz[zone] do
local quantity = fz[zone][subzone];
- FishingBuddy.AddFishie("ffffffff", id, fishie, zone, subzone, texture, quantity, quality)
+ AddFishie("ffffffff", id, fishie, zone, subzone, texture, quantity, quality)
end
end
end
@@ -500,7 +839,7 @@ local function ImportFish()
-- local quantity = imppfishinfoDB[subzone]["itemnames"][item].number;
-- local texture = imppfishinfoDB[subzone]["itemnames"][item].texture;
-- local quality = imppfishinfoDB[subzone]["itemnames"][item].quality;
--- FishingBuddy.AddFishie(color, id, name, subzone, texture, item, quantity, quality)
+-- AddFishie(color, id, name, subzone, texture, item, quantity, quality)
-- end
-- end
-- FishingBuddy_Info["ImppDBLoaded"] = 1;
@@ -513,7 +852,7 @@ local function ImportFish()
-- local quantity = dfl["number"];
-- local texture = dfl["texture"];
-- local quality = dfl["quality"];
--- FishingBuddy.AddFishie(color, id, name, zone, subzone, texture, quantity, quality)
+-- AddFishie(color, id, name, zone, subzone, texture, quantity, quality)
-- end
-- end
-- end
@@ -525,38 +864,6 @@ local function ImportFish()
SetSetting("ShowNewFishies", oldShowNewFishies);
end
-local function FindSpellID(thisone)
- local id = 1;
- local spellTexture = GetSpellTexture(id, BOOKTYPE_SPELL);
- while (spellTexture) do
- if (spellTexture and spellTexture == thisone) then
- return id;
- end
- id = id + 1;
- spellTexture = GetSpellTexture(id, BOOKTYPE_SPELL);
- end
- return nil;
-end
-
-local function GetFishingSpellID()
- if ( not FishingSpellID or not FishingSkillName) then
- FishingSpellID = FindSpellID(FishingBuddy.FISHINGTEXTURE);
- end
- if ( FishingSpellID and not FishingSkillName ) then
- FishingSkillName = GetSpellName(FishingSpellID, BOOKTYPE_SPELL);
- end
-end
-
-FishingBuddy.GetFishingSkillName = function()
- GetFishingSpellID();
- if ( not FishingSkillName ) then
- return FishingBuddy.FISHINGSKILL;
- else
- return FishingSkillName;
- end
-
-end
-
local function InvokeFishing()
GetFishingSpellID();
if ( FishingSpellID ) then
@@ -564,22 +871,36 @@ local function InvokeFishing()
end
end
+local ModeEventTable = {
+ "LOOT_OPENED",
+ "LOOT_CLOSED",
+ "SPELLS_CHANGED",
+ "SPELLCAST_CHANNEL_START",
+ "SPELLCAST_CHANNEL_STOP",
+ "SPELLCAST_START",
+ "SPELLCAST_STOP",
+ "SPELLCAST_INTERRUPTED",
+ "SPELLCAST_FAILED",
+ "SKILL_LINES_CHANGED",
+};
+
-- do everything we think is necessary when we start fishing
-- even if we didn't do the switch to a fishing pole
local function StartFishingMode()
- if ( not StartedFishing ) then
- StartedFishing = GetTime();
+ if ( not FishingBuddy.StartedFishing ) then
+ FishingBuddy.StartedFishing = GetTime();
FishingBuddy.EnhanceFishingSounds(true);
FishingBuddy.WatchUpdate();
+ EventRegistration(FishingBuddyRoot, ModeEventTable, true);
end
end
-FishingBuddy.StartFishingMode = StartFishingMode;
local function StopFishingMode()
- if ( StartedFishing ) then
+ if ( FishingBuddy.StartedFishing ) then
FishingBuddy.EnhanceFishingSounds(false);
FishingBuddy.WatchUpdate();
- StartedFishing = nil;
+ FishingBuddy.StartedFishing = nil;
+ EventRegistration(FishingBuddyRoot, ModeEventTable, false);
end
if ( resetClickToMove ) then
-- Re-enable Click-to-Move if we changed it
@@ -587,7 +908,6 @@ local function StopFishingMode()
resetClickToMove = nil;
end
end
-FishingBuddy.StopFishingMode = StopFishingMode;
local function FishingMode()
if ( IsFishingPole() ) then
@@ -596,19 +916,7 @@ local function FishingMode()
StopFishingMode();
end
end
-FishingBuddy.FishingMode = FishingMode;
-
-local function OnFishingBobber()
- if ( GameTooltip:IsVisible() ) then
- local text = getglobal("GameTooltipTextLeft1");
- if ( text ) then
- text = text:GetText();
- -- let a partial match work (for translations)
- return ( text and string.find(text, FishingBuddy.BOBBER_NAME ) );
- end
- end
- return false;
-end
+FishingBuddy.API.FishingMode = FishingMode;
-- Easy lures (borrowed from Mugendai's excellent code)
local function UpdateLure()
@@ -623,7 +931,7 @@ local function UpdateLure()
local bag, slot;
for lure in FISHINGLURES do
--If we find this lure in the bag, then use it
- bag, slot = FindItem(lure);
+ bag, slot = FindItemByID(lure);
if (bag and slot) then
--We need to temporarily disable the cant use item error, incase this item is too high of a level to use
TestingLures = true;
@@ -679,13 +987,13 @@ FishingBuddy.StopCastingCheck = function()
local time = GetTime();
local pressTime = time - ActionStartTime;
local doubleTime = time - ActionDoubleTime;
- -- if we're not putting on a lure and the casting modifiers are good
+ -- if we're not putting on a lure
if ( not SpellIsTargeting() ) then
-- if the click was "short" enough that we're going to treat it
-- as a cast
if ( ActionStartTime > 0 and ACTIONDOWNWAIT >= pressTime) then
-- if we're already casting, enforce double click timing
- if ( GetSetting("FastCast") ~= 1 and CastingNow and
+ if ( CastingNow and
( ActionDoubleTime == 0 or ACTIONDOUBLEWAIT < doubleTime ) ) then
ActionDoubleTime = GetTime();
else
@@ -704,12 +1012,30 @@ FishingBuddy.PerformCast = function()
end
-- reset the TURNORACTION binding so that everything else works 'right'
UpdateBindings(false);
+
+ if ( not schooltipText or not OnFishingBobber() ) then
+ -- watch for fishing holes
+ schooltipText = GetTooltipText();
+ end
+
-- put on a lure if we need to
if ( not UpdateLure() ) then
InvokeFishing();
end
end
+FishingBuddy.SuitUpAndGoFishing = function()
+ if ( IsFishingPole() ) then
+ -- put on a lure if we need to
+ if ( not UpdateLure() ) then
+ InvokeFishing();
+ end
+ elseif ( GetSetting("SuitUpFirst") == 1 ) then
+ FishingBuddy.OutfitManager.Switch();
+ end
+end
+
+
FishingBuddy.TrapUIErrors = function()
local temp = {};
temp.obj= UIErrorsFrame;
@@ -724,14 +1050,57 @@ FishingBuddy.TrapWorldMouse = function()
SavedWFOnMouseDown = SafeHookScript(WorldFrame, "OnMouseDown", WF_OnMouseDown);
end
--- User interface handling
+-- we should collect these, but then they would be in the cache
+local QuestItems = {};
+QuestItems[6717] = 1; -- Gaffer Jack
+QuestItems[6718] = 1; -- Electropeller
+QuestItems[16970] = 1; -- Misty Reed Mahi Mahi
+QuestItems[16968] = 1; -- Sar'theris Striker
+QuestItems[16969] = 1; -- Savage Coast Blue
+QuestItems[16967] = 1; -- Feralas Ahi
+
+-- User interface handling
+local function IsRareFish(id, forced)
+ -- always skip extravaganza fish
+ if ( FishingBuddy.Extravaganza.Fish[id] ) then
+ return true;
+ end
+ return ( not forced and QuestItems[id] );
+end
+
+FishingBuddy.Commands[FishingBuddy.UPDATEDB] = {};
+FishingBuddy.Commands[FishingBuddy.UPDATEDB].help = FishingBuddy.UPDATEDB_HELP;
+FishingBuddy.Commands[FishingBuddy.UPDATEDB].func =
+ function(what)
+ local ff = FishingBuddy_Info["Fishies"];
+ local forced;
+ if ( what and what == FishingBuddy.FORCE ) then
+ forced = true;
+ end
+ FishingOutfitTooltip:SetOwner(FishingBuddyFrame, "ANCHOR_RIGHT");
+ FishingOutfitTooltip:Show();
+ local count = 0;
+ for id,info in ff do
+ local item = id..":0:0:0";
+ if ( not IsLinkableItem(item) or not info.name ) then
+ if ( not IsRareFish(id, forced) ) then
+ local link = "item:"..item;
+ -- fetch the data (may disconnect)
+ FishingBuddy.Debug(link);
+ FishingOutfitTooltip:SetHyperlink(link);
+ -- now that we have it in our cache, get the name
+ local n,_,_,_,_,_,_,_ = GetItemInfo(link);
+ if ( n ) then
+ count = count + 1;
+ FishingBuddy_Info["Fishies"][id].name = n;
+ end
+ end
+ end
+ end
+ FishingBuddy.Print(FishingBuddy.UPDATEDB_MSG, count);
+ return true;
+ end;
-FishingBuddy.Commands = {};
-FishingBuddy.Commands[FishingBuddy.SWITCH] = {};
-FishingBuddy.Commands[FishingBuddy.SWITCH].func = function()
- FishingBuddy.OutfitManager.Switch();
- return true;
- end;
FishingBuddy.Commands[FishingBuddy.CURRENT] = {};
FishingBuddy.Commands[FishingBuddy.CURRENT].help = FishingBuddy.CURRENT_HELP;
FishingBuddy.Commands[FishingBuddy.CURRENT].func =
@@ -924,26 +1293,35 @@ FishingBuddy.Command = function(msg)
end
end
+FishingBuddy.TooltipBody = function(hintcheck)
+ local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2;
+ if ( hintcheck ) then
+ text = text.."\n".."|c"..FishingBuddy.Colors.GREEN;
+ text = text .. FishingBuddy.TOOLTIP_HINT.." ";
+ if (FishingBuddy.GetSetting(hintcheck) == 1) then
+ text = text..FishingBuddy.TOOLTIP_HINTSWITCH;
+ else
+ text = text..FishingBuddy.TOOLTIP_HINTTOGGLE;
+ end
+ text = text.."|r";
+ end
+ return text;
+end
+
+local IWEventTable = {
+ "ITEM_LOCK_CHANGED",
+};
+
FishingBuddy.OnLoad = function()
+ this:RegisterEvent("PLAYER_ENTERING_WORLD");
+ this:RegisterEvent("PLAYER_LEAVING_WORLD");
+
this:RegisterEvent("PLAYER_LOGIN");
this:RegisterEvent("PLAYER_LOGOUT");
this:RegisterEvent("VARIABLES_LOADED");
- this:RegisterEvent("ITEM_LOCK_CHANGED");
- this:RegisterEvent("LOOT_OPENED");
- this:RegisterEvent("ZONE_CHANGED");
this:RegisterEvent("MINIMAP_ZONE_CHANGED");
- this:RegisterEvent("SPELLS_CHANGED");
- this:RegisterEvent("SPELLCAST_CHANNEL_START");
- this:RegisterEvent("SPELLCAST_CHANNEL_STOP");
- this:RegisterEvent("SPELLCAST_START");
- this:RegisterEvent("SPELLCAST_STOP");
- this:RegisterEvent("SPELLCAST_INTERRUPTED");
- this:RegisterEvent("SPELLCAST_FAILED");
-
- this:RegisterEvent("SKILL_LINES_CHANGED");
-
-- Set up command
SlashCmdList["fishingbuddy"] = FishingBuddy.Command;
SLASH_fishingbuddy1 = "/fishingbuddy";
@@ -952,72 +1330,107 @@ FishingBuddy.OnLoad = function()
FishingBuddy.Output(FishingBuddy.WINDOW_TITLE.." loaded");
end
+local IsZoning;
+local ZoneEvents;
+local function TrackZoneEvents(evt)
+ if ( IsZoning ) then
+ if ( not ZoneEvents ) then
+ ZoneEvents = {};
+ end
+ if ( ZoneEvents[evt] ) then
+ ZoneEvents[evt] = ZoneEvents[evt] + 1;
+ else
+ ZoneEvents[evt] = 1;
+ end
+ end
+end
+
+local function DumpZoneEvents()
+ FishingBuddy.Dump(ZoneEvents);
+ ZoneEvents = nil;
+end
+
FishingBuddy.OnEvent = function()
local needUpdate = false;
- if ( event == "VARIABLES_LOADED" ) then
- FishingBuddy.Initialize();
+-- TrackZoneEvents(event);
+ if ( event == "LOOT_OPENED" ) then
+ IsLooting = true;
+ if ( IsFishingLoot()) then
+ local zone, subzone = GetZoneInfo();
+ local check = FishingBuddy.Schools.CheckFishingHole;
+ for index = 1, GetNumLootItems(), 1 do
+ if (LootSlotIsItem(index)) then
+ local texture, fishie, quantity, quality = GetLootSlotInfo(index);
+ local link = GetLootSlotLink(index);
+ local color, id, name = SplitFishLink(link);
+ AddFishie(color, id, name, zone, subzone, texture, quantity, quality);
+ if ( FishingBuddy.AddTracking ) then
+ FishingBuddy.AddTracking(id, name);
+ end
+ check(schooltipText, id);
+ SetZoneLevel(zone, subzone, id);
+ end
+ end
+ if ( schooltipText ) then
+ schooltipText = nil;
+ end
+ end
+ elseif ( event == "LOOT_CLOSED" ) then
+ IsLooting = false;
+ elseif ( event == "MINIMAP_ZONE_CHANGED" ) then
+ if ( not FishingBuddy.IsLoaded() ) then
+ return;
+ end
+ FishingBuddy.currentFishies = {};
+ needUpdate = true;
+ elseif ( event == "SPELLS_CHANGED" ) then
+ -- Fishing might have moved, go look again
+ FishingSpellID = nil;
+ elseif ( event == "ITEM_LOCK_CHANGED" ) then
+ FishingMode();
+ elseif ( event == "SPELLCAST_CHANNEL_START" ) then
+ -- Mugendai is one sharp cookie (shamelessly stealing from TackleBox)
+ -- Keep up with whether or not we are casting
+ CastingNow = true;
+ elseif ( event == "SPELLCAST_CHANNEL_STOP" ) then
+ CastingNow = false;
+ elseif ( event == "SPELLCAST_START" ) then
+ -- AddingLure = true;
+ elseif ( event == "SPELLCAST_STOP" ) then
+ if ( AddingLure ) then
+ AddingLure = false;
+ -- update the skill line if we have one
+ if ( GetSetting("WatchCurrentSkill") == 1 ) then
+ needUpdate = true;
+ end
+ end
+ elseif ( ( event == "SPELLCAST_INTERRUPTED" ) or ( event == "SPELLCAST_FAILED" ) ) then
+ AddingLure = false;
+ elseif ( event == "SKILL_LINES_CHANGED" ) then
+ if ( GetSetting("WatchCurrentSkill") == 1 ) then
+ needUpdate = true;
+ end
elseif ( event == "PLAYER_LOGIN" ) then
-- set up outfit stuff
+ playerName = UnitName("player");
+ realmName = GetRealmName();
+ CheckClockOffset();
FishingBuddy.OutfitManager.Initialize();
FishingMode();
elseif ( event == "PLAYER_LOGOUT" ) then
-- reset the fishing sounds, if we need to
StopFishingMode();
FishingBuddy.SavePlayerInfo();
- elseif ( event == "ITEM_LOCK_CHANGED" ) then
- FishingMode();
- elseif ( event == "LOOT_OPENED" ) then
- if ( IsFishingLoot()) then
- local zone, subzone = FishingBuddy.GetZoneInfo();
- for index = 1, GetNumLootItems(), 1 do
- if (LootSlotIsItem(index)) then
- local texture, fishie, quantity, quality = GetLootSlotInfo(index);
- local link = GetLootSlotLink(index);
- local color, id, name = FishingBuddy.SplitFishLink(link);
- FishingBuddy.AddFishie(color, id, name, zone, subzone, texture, quantity, quality);
- if ( FishingBuddy.AddTracking ) then
- FishingBuddy.AddTracking(id, name);
- end
- FishingBuddy.SetZoneLevel(zone, subzone, id);
- end
- end
- end
- elseif ( event == "ZONE_CHANGED" or event == "MINIMAP_ZONE_CHANGED" ) then
- if ( not FishingBuddy.IsLoaded() ) then
- return;
- end
- FishingBuddy.currentFishies = {};
- needUpdate = true;
- elseif ( event == "SKILL_LINES_CHANGED" ) then
- if ( GetSetting("WatchCurrentSkill") == 1 ) then
- needUpdate = true;
- end
- elseif ( event == "SPELLS_CHANGED" ) then
- -- Fishing might have moved, go look again
- FishingSpellID = nil;
- else
- -- Mugendai is one sharp cookie (shamelessly stealing from TackleBox again)
- -- Keep up with whether or not we are casting
- if ( event == "SPELLCAST_CHANNEL_START" ) then
- CastingNow = true;
- elseif ( event == "SPELLCAST_CHANNEL_STOP" ) then
- CastingNow = false;
- else
- -- Keep up with whether we are adding a lure (or casting a normal spell) or not
- if ( event == "SPELLCAST_START" ) then
- -- AddingLure = true;
- elseif ( event == "SPELLCAST_STOP" ) then
- if ( AddingLure ) then
- AddingLure = false;
- -- update the skill line if we have one
- if ( GetSetting("WatchCurrentSkill") == 1 ) then
- needUpdate = true;
- end
- end
- elseif ( ( event == "SPELLCAST_INTERRUPTED" ) or ( event == "SPELLCAST_FAILED" ) ) then
- AddingLure = false;
- end
- end
+ elseif ( event == "VARIABLES_LOADED" ) then
+ FishingBuddy.Initialize();
+ this:UnregisterEvent("VARIABLES_LOADED");
+ elseif ( event == "PLAYER_ENTERING_WORLD" ) then
+ IsZoning = nil;
+-- DumpZoneEvents();
+ EventRegistration(this, IWEventTable, true);
+ elseif ( event == "PLAYER_LEAVING_WORLD") then
+ IsZoning = 1;
+ EventRegistration(this, IWEventTable, false);
end
FishingBuddy.Extravaganza.IsTime(true);
if ( needUpdate ) then
@@ -1026,12 +1439,20 @@ FishingBuddy.OnEvent = function()
end
FishingBuddy.PrintHelp = function(tab)
- if ( type(tab) == "table" ) then
- for _,line in tab do
- FishingBuddy.PrintHelp(line);
+ if ( tab ) then
+ if ( type(tab) == "table" ) then
+ for _,line in tab do
+ FishingBuddy.PrintHelp(line);
+ end
+ else
+ -- check for a reference to another help item
+ local _,_,w = string.find(tab, "^@([A-Z0-9_]+)$");
+ if ( w ) then
+ FishingBuddy.PrintHelp(FishingBuddy[w]);
+ else
+ FishingBuddy.Output(tab);
+ end
end
- else
- FishingBuddy.Output(tab);
end
end
@@ -1085,6 +1506,7 @@ local function MakeToggle(name)
end
return ToggleFunctions[name];
end
+FishingBuddy.MakeToggle = MakeToggle;
FishingBuddy.MakeDropDown = function(switchItem, switchSetting)
local info;
@@ -1096,23 +1518,25 @@ FishingBuddy.MakeDropDown = function(switchItem, switchSetting)
info.checked = (GetSetting(switchSetting) == 1);
info.keepShownOnClick = 1;
UIDropDownMenu_AddButton(info);
- info = {};
- info.disabled = 1;
- UIDropDownMenu_AddButton(info);
+ info = {};
+ info.disabled = 1;
+ UIDropDownMenu_AddButton(info);
end
- for _, option in FishingBuddy.OPTIONS do
- local addthis = true;
- if ( option.check ) then
- addthis = option.check();
- end
- if ( addthis ) then
- info = {};
- info.text = option.text;
- info.func = MakeToggle(option.name);
- info.checked = (GetSetting(option.name) == 1);
- info.keepShownOnClick = 1;
- UIDropDownMenu_AddButton(info);
+ for name,option in FishingBuddy.OPTIONS do
+ if ( option.m ) then
+ local addthis = true;
+ if ( option.check ) then
+ addthis = option.check();
+ end
+ if ( addthis ) then
+ info = {};
+ info.text = option.text;
+ info.func = MakeToggle(name);
+ info.checked = (GetSetting(name) == 1);
+ info.keepShownOnClick = 1;
+ UIDropDownMenu_AddButton(info);
+ end
end
end
end
@@ -1142,12 +1566,73 @@ end
FishingBuddy.FishSort = function(tab, forcename)
if ( forcename or GetSetting("SortByPercent") == 0 ) then
- table.sort(tab, function(a,b) return a.text and b.text and a.text 1 ) then
+ fishie = string.sub(fishie, 1, s-1)..string.sub(fishie, e+1);
+ else
+ fishie = string.sub(fishie, e+1);
+ end
+ else
+ s,e = string.find(fishie, " "..FishingBuddy.RAW);
+ if ( s ) then
+ fishie = string.sub(fishie, 1, s-1)..string.sub(fishie, e+1);
+ end
+ end
+ return fishie;
+ end
+ -- this means an import failed somewhere
+ return FishingBuddy.UNKNOWN;
+end
+
+FishingBuddy.ToggleDropDownMenu = function(level, value, menu, anchor, xOffset, yOffset)
+ ToggleDropDownMenu(level, value, menu, anchor, xOffset, yOffset);
+ if (not level) then
+ level = 1;
+ end
+ local anchorName;
+ if ( type(anchor) == "string" ) then
+ anchorName = anchor;
+ else
+ anchorName = anchor:GetName();
+ end
+ local frame = getglobal("DropDownList"..level);
+ local uiScale = UIParent:GetScale()
+ if ( frame:GetRight() > ( GetScreenWidth()*uiScale ) ) then
+ if ( anchorName == "cursor" ) then
+ if ( not xOffset ) then
+ xOffset = 0;
+ end
+ if ( not yOffset ) then
+ yOffset = 0;
+ end
+ local cursorX, cursorY = GetCursorPosition();
+ xOffset = -cursorX + xOffset;
+ yOffset = cursorY + yOffset;
+ else
+ if ( not xOffset or not yOffset ) then
+ xOffset = 8;
+ yOffset = 22;
+ end
+ end
+ frame:ClearAllPoints();
+ frame:SetPoint("TOPRIGHT", anchorName, "BOTTOMLEFT", -xOffset, yOffset);
+ end
+ if ( frame:GetBottom() < 0 ) then
+ frame:ClearAllPoints();
+ frame:SetPoint("BOTTOMRIGHT", anchorName, "BOTTOMLEFT", -xOffset, yOffset);
+ end
+end
+
FishingBuddy.EnglishList = function(list, conjunction)
if ( list ) then
local n = table.getn(list);
diff --git a/FishingBuddy.toc b/FishingBuddy.toc
index 625f50a..1f06b8e 100755
--- a/FishingBuddy.toc
+++ b/FishingBuddy.toc
@@ -1,19 +1,29 @@
-## Interface: 11000
-## Title: FishingBuddy v0.8.6h
-## Notes: Help with fishing related tasks -- clothing, fish information
+## Interface: 11200
+## Title: Fishing Buddy
+## Version: 0.8.8e
+## Notes: Help with fishing related tasks -- clothing, fish information, etc.
+## Notes-ruRU: Отслеживает какую рыбу и где вы поймали и помогает управлять вашим рыболовским снарежением.
## Notes-deDE: Erleichtert das Angeln - Ausr\195\188stung und Fish-Infos
-## Author: Sutorix-Windrunner
-## OptionalDeps: OutfitDisplayFrame, Outfitter, myAddOns, Titan, InfoBar, ButtonHole
+## Notes-frFR: Vous facilite la vie de pecheur. Informations sur les poissons, changement d'habits, etc.
+## Notes-esES: Ayude con las tareas relacionadas pesca -- ropa, informaci\195\179n de los pescados
+## Author: Sutorix=AT=hotmail.com
+## OptionalDeps: FBEnEspagnol, OutfitDisplayFrame, Outfitter, myAddOns, FuBar, Titan, InfoBar, Gatherer, FuBar, ButtonHole
## SavedVariables: FishingBuddy_Info
## SavedVariablesPerCharacter: FishingBuddy_Player
-## ModWatcherID: 104
-## ModWatcherVersion: 11
+localization.lua
+localization.ru.lua
+localization.de.lua
+localization.es.lua
+localization.fr.lua
+FishingDebugging.lua
+FishingSetup.lua
FishingBuddy.xml
FishingBuddyFrame.xml
FishingOptionsFrame.xml
FishingLocationsFrame.xml
-FishingOutfitFrame.xml
FishingOutfitManager.xml
+FishingOutfitFrame.xml
+FishingOutfitter.lua
FishingBuddyTitan.xml
FishingBuddyMinimap.xml
FishingBuddyInfoBar.xml
@@ -21,4 +31,4 @@ FishingExtravaganza.xml
FishingWatcher.xml
GraphHandler.xml
FishingTrackingFrame.xml
-FishingDebugging.lua
+FishingSchools.lua
diff --git a/FishingBuddy.xml b/FishingBuddy.xml
index 6e1cba2..82a8ad1 100755
--- a/FishingBuddy.xml
+++ b/FishingBuddy.xml
@@ -1,9 +1,5 @@
-
-
-
-
diff --git a/FishingBuddyFrame.lua b/FishingBuddyFrame.lua
index 846b300..537cd1b 100755
--- a/FishingBuddyFrame.lua
+++ b/FishingBuddyFrame.lua
@@ -1,28 +1,28 @@
local SUBFRAMES = {
- ["FishingLocationsFrame"] = {
- ["name"] = FishingBuddy.LOCATIONS_TAB,
- ["tooltip"] = FishingBuddy.LOCATIONS_INFO,
- ["toggle"] = "_LOC",
- ["id"] = "1",
- },
- ["FishingOutfitFrame"] = {
- ["name"] = FishingBuddy.OUTFITS_TAB,
- ["tooltip"] = FishingBuddy.OUTFITS_INFO,
- ["toggle"] = "_OUT",
- ["id"] = "2",
- },
- ["FishingTrackingFrame"] = {
- ["name"] = FishingBuddy.TRACKING_TAB,
- ["tooltip"] = FishingBuddy.TRACKING_INFO,
- ["toggle"] = "_TRK",
- ["id"] = "3",
- },
- ["FishingOptionsFrame"] = {
- ["name"] = FishingBuddy.OPTIONS_TAB,
- ["tooltip"] = FishingBuddy.OPTIONS_INFO,
- ["toggle"] = "_OPT",
- ["id"] = "4",
- }
+ ["FishingLocationsFrame"] = {
+ ["name"] = FishingBuddy.LOCATIONS_TAB,
+ ["tooltip"] = FishingBuddy.LOCATIONS_INFO,
+ ["toggle"] = "_LOC",
+ ["id"] = "1",
+ },
+ ["FishingOutfitFrame"] = {
+ ["name"] = FishingBuddy.OUTFITS_TAB,
+ ["tooltip"] = FishingBuddy.OUTFITS_INFO,
+ ["toggle"] = "_OUT",
+ ["id"] = "2",
+ },
+ ["FishingTrackingFrame"] = {
+ ["name"] = FishingBuddy.TRACKING_TAB,
+ ["tooltip"] = FishingBuddy.TRACKING_INFO,
+ ["toggle"] = "_TRK",
+ ["id"] = "3",
+ },
+ ["FishingOptionsFrame"] = {
+ ["name"] = FishingBuddy.OPTIONS_TAB,
+ ["tooltip"] = FishingBuddy.OPTIONS_INFO,
+ ["toggle"] = "_OPT",
+ ["id"] = "4",
+ }
};
local function DisableSubFrame(frameName)
@@ -33,17 +33,34 @@ local function DisableSubFrame(frameName)
local f = getglobal(hideframe);
if ( f ) then
f:Hide();
- end
- id = id + 1;
- f = getglobal("FishingBuddyFrameTab"..id);
- if ( f ) then
- f:SetPoint("LEFT", hideframe, "LEFT", 0, 0)
+ f = getglobal(string.format("FishingBuddyFrameTab%d", id+1));
+ if ( f ) then
+ f:SetPoint("LEFT", hideframe, "LEFT", 0, 0)
+ end
end
end
end
end
FishingBuddy.DisableSubFrame = DisableSubFrame;
+local function EnableSubFrame(frameName)
+ for value,info in SUBFRAMES do
+ if ( value == frameName ) then
+ local id = info.id;
+ local hideframe = string.format("FishingBuddyFrameTab%d", id);
+ local f = getglobal(hideframe);
+ if ( f ) then
+ f:Show();
+ f = getglobal(string.format("FishingBuddyFrameTab%d", id+1));
+ if ( f ) then
+ f:SetPoint("LEFT", hideframe, "RIGHT", -18, 0)
+ end
+ end
+ end
+ end
+end
+FishingBuddy.EnableSubFrame = EnableSubFrame;
+
local function ShowSubFrame(frameName)
for value,_ in SUBFRAMES do
local frame = getglobal(value);
@@ -115,17 +132,16 @@ function FishingBuddyFrame_OnEvent(event)
DisableSubFrame(frame);
end
end
- ToggleFishingBuddyFrame("FishingLocationsFrame");
- ToggleFishingBuddyFrame("FishingLocationsFrame");
+ ShowSubFrame("FishingLocationsFrame");
end
end
function FishingBuddyFrame_OnShow()
- FishingBuddyFramePortrait:SetTexture("Interface\\LootFrame\\FishingLoot-Icon");
- FishingBuddyNameText:SetText(FishingBuddy.WINDOW_TITLE);
- UpdateMicroButtons();
+ FishingBuddyFramePortrait:SetTexture("Interface\\LootFrame\\FishingLoot-Icon");
+ FishingBuddyNameText:SetText(FishingBuddy.WINDOW_TITLE);
+ UpdateMicroButtons();
end
function FishingBuddyFrame_OnHide()
- UpdateMicroButtons();
+ UpdateMicroButtons();
end
diff --git a/FishingBuddyFrame.xml b/FishingBuddyFrame.xml
index f2c2efe..c749712 100755
--- a/FishingBuddyFrame.xml
+++ b/FishingBuddyFrame.xml
@@ -131,7 +131,7 @@
-
+
diff --git a/FishingBuddyInfoBar.lua b/FishingBuddyInfoBar.lua
index 8f54427..bcde667 100755
--- a/FishingBuddyInfoBar.lua
+++ b/FishingBuddyInfoBar.lua
@@ -23,6 +23,8 @@ FishingBuddy.InfoBar.OnClick = function(button)
else
FishingBuddy.Command("");
end
+ elseif ( IsShiftKeyDown() ) then
+ ToggleFishingBuddyFrame("FishingOptionsFrame");
else
-- Toggle menu
local menu = getglobal("FishingBuddyInfoBarMenu");
@@ -37,18 +39,10 @@ FishingBuddy.InfoBar.OnEvent = function()
end
FishingBuddy.InfoBar.Tooltip = function()
- local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2.."\n";
- text = text.."|c"..FishingBuddy.Colors.GREEN;
- if (FishingBuddy.GetSetting("InfoBarClickToSwitch") == 1) then
- text = text..FishingBuddy.TOOLTIP_HINTSWITCH;
- else
- text = text..FishingBuddy.TOOLTIP_HINTTOGGLE;
- end
- text = text.."|r";
- return text;
+ return FishingBuddy.TooltipBody("InfoBarClickToSwitch");
end
FishingBuddy.InfoBar.Menu_Initialize = function()
- FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF,
+ FishingBuddy.MakeDropDown(FishingBuddy.CLICKTOSWITCH_ONOFF,
"InfoBarClickToSwitch");
end
diff --git a/FishingBuddyMinimap.lua b/FishingBuddyMinimap.lua
index b83eb44..b911c4e 100755
--- a/FishingBuddyMinimap.lua
+++ b/FishingBuddyMinimap.lua
@@ -41,12 +41,15 @@ end
FishingBuddy.Minimap.Button_OnClick = function(button)
if ( button == "RightButton" ) then
- -- Toggle menu
- local menu = getglobal("FishingBuddyMinimapMenu");
- menu.point = "TOPRIGHT";
- menu.relativePoint = "CENTER";
- local level = 1;
- ToggleDropDownMenu(level, nil, menu, "FishingBuddyMinimapButton", 0, 0);
+ if ( IsShiftKeyDown() ) then
+ ToggleFishingBuddyFrame("FishingOptionsFrame");
+ else
+ -- Toggle menu
+ local menu = getglobal("FishingBuddyMinimapMenu");
+ menu.point = "TOPRIGHT";
+ menu.relativePoint = "CENTER";
+ ToggleDropDownMenu(1, nil, menu, "FishingBuddyMinimapButton", 0, 0);
+ end
elseif ( FishingBuddy.GetSetting("MinimapClickToSwitch") == 1 ) then
FishingBuddy.Command(FishingBuddy.SWITCH);
else
@@ -83,21 +86,22 @@ FishingBuddy.Minimap.Button_OnEvent = function()
end
FishingBuddy.Minimap.Button_OnEnter = function()
- if ( GameTooltip.finished ) then
+ if ( GameTooltip.fbmmbfinished ) then
return;
end
if ( FishingBuddy.GetSetting("UseButtonHole") == 0 ) then
- GameTooltip.finished = 1;
+ GameTooltip.fbmmbfinished = 1;
GameTooltip:SetOwner(FishingBuddyMinimapFrame, "ANCHOR_LEFT");
GameTooltip:AddLine(FishingBuddy.NAME);
- GameTooltip:AddLine(FishingBuddy.DESCRIPTION,.8,.8,.8,1);
+ local text = FishingBuddy.TooltipBody("MinimapClickToSwitch");
+ GameTooltip:AddLine(text,.8,.8,.8,1);
GameTooltip:Show();
end
end
FishingBuddy.Minimap.Button_OnLeave = function()
GameTooltip:Hide();
- GameTooltip.finished = nil;
+ GameTooltip.fbmmbfinished = nil;
end
function FishingBuddy_ToggleMinimap()
@@ -106,7 +110,7 @@ function FishingBuddy_ToggleMinimap()
end
FishingBuddy.Minimap.Menu_Initialize = function()
- FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF,
+ FishingBuddy.MakeDropDown(FishingBuddy.CLICKTOSWITCH_ONOFF,
"MinimapClickToSwitch");
end
diff --git a/FishingBuddyMinimap.xml b/FishingBuddyMinimap.xml
index 2b002fb..259c5e7 100755
--- a/FishingBuddyMinimap.xml
+++ b/FishingBuddyMinimap.xml
@@ -27,6 +27,7 @@
+
diff --git a/FishingBuddyTitan.lua b/FishingBuddyTitan.lua
index e8f457e..4da5b5c 100755
--- a/FishingBuddyTitan.lua
+++ b/FishingBuddyTitan.lua
@@ -42,19 +42,13 @@ FishingBuddy.Titan.OnEvent = function()
end
function TitanPanelFishingBuddyButton_GetTooltipText()
- local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2.."\n";
- if (FishingBuddy.GetSetting("TitanClickToSwitch") == 1) then
- text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTSWITCH);
- else
- text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTTOGGLE);
- end
- return text;
+ return FishingBuddy.TooltipBody("TitanClickToSwitch");
end
function TitanPanelRightClickMenu_PrepareFishingBuddyMenu()
TitanPanelRightClickMenu_AddTitle(TitanPlugins[FishingBuddy.ID].menuText);
- FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF, "TitanClickToSwitch");
+ FishingBuddy.MakeDropDown(FishingBuddy.CLICKTOSWITCH_ONOFF, "TitanClickToSwitch");
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE,
diff --git a/FishingDebugging.lua b/FishingDebugging.lua
index aeeb6d7..739cba9 100755
--- a/FishingDebugging.lua
+++ b/FishingDebugging.lua
@@ -1,38 +1,63 @@
--- outfit debugging functions
-FishingBuddy.Commands["outfit"] = {};
-FishingBuddy.Commands["outfit"].func =
- function(what)
- if ( what ) then
- if ( what == FishingBuddy.RESET ) then
- FishingBuddy.SetWasWearing(nil);
- elseif ( what == "dump" ) then
- FishingBuddy.Debug("Outfit");
- FishingBuddy.Dump(FishingBuddy.GetOutfit());
- FishingBuddy.Debug("Was Wearing");
- FishingBuddy.Dump(FishingBuddy.GetWasWearing());
- end
- end
- return true;
- end;
+-- debugging
--- test the extravaganze school marking functions
--- need to expand this for 1.9 if we can tell automatically
-FishingBuddy.Commands["mark"] = {};
-FishingBuddy.Commands["mark"].func =
- function(what)
- if ( what == "reset" ) then
- FishingBuddy_Info["Schools"] = nil;
- elseif ( what == "debug" ) then
- local hour,_ = GetGameTime();
- local day = date("%w");
- FishingBuddy.Extravaganza.Debug(day, hour, GetRealZoneText());
- elseif ( what == "dump" ) then
- FishingBuddy.Extravaganza.Dump();
+FishingBuddy = {};
+FishingBuddy.API = {};
+FishingBuddy.Commands = {};
+
+FishingBuddy.Debugging = true;
+
+local function printable(foo)
+ if ( foo ) then
+ if ( type(foo) == "table" ) then
+ return "table";
+ elseif ( type(foo) == "boolean" ) then
+ if ( foo ) then
+ return "true";
+ else
+ return "false";
+ end
else
- FishingBuddy.Extravaganza.MarkSchool();
+ return foo;
end
- return true;
- end;
+ else
+ return "nil";
+ end
+end
+FishingBuddy.printable = printable;
+
+FishingBuddy.Output = function(msg, r, g, b)
+ if ( DEFAULT_CHAT_FRAME ) then
+ if ( not r ) then
+ DEFAULT_CHAT_FRAME:AddMessage(msg);
+ else
+ DEFAULT_CHAT_FRAME:AddMessage(msg, r, g, b);
+ end
+ end
+end
+
+FishingBuddy.Debug = function(msg, fixlinks)
+ if ( FishingBuddy.Debugging ) then
+ if ( fixlinks ) then
+ msg = string.gsub(msg, "|", ";");
+ end
+ local name = FishingBuddy.Name or "Fishing Buddy";
+ FishingBuddy.Output("|c"..FishingBuddy.Colors.RED..name.."|r "..msg);
+ end
+end
+
+FishingBuddy.DebugVars = function()
+ FishingBuddy.Debugging = true;
+end
+
+FishingBuddy.Dump = function(thing)
+ if ( FishingBuddy.Debugging ) then
+ if ( DevTools_Dump ) then
+ DevTools_Dump(thing);
+ else
+ FishingBuddy.Debug("Tried to dump a '"..FishingBuddy.printable(thing).."'.");
+ end
+ end
+end
-- random debugging code, likely out of date
FishingBuddy.Commands["debug"] = {};
@@ -40,7 +65,13 @@ FishingBuddy.Commands["debug"].func =
function(what)
if ( what ) then
if ( what == "on" ) then
- FishingBuddy_Debugging = 1;
+ FishingBuddy.Debugging = true;
+ FishingBuddy.SetSetting("FishDebug", true);
+ FishingBuddy.Debug("Debugging turned on");
+ elseif ( what == "off" ) then
+ FishingBuddy.Debug("Debugging turned off");
+ FishingBuddy.Debugging = nil;
+ FishingBuddy.SetSetting("FishDebug", nil);
elseif ( what == "reset" ) then
FishingBuddy_Info["Testing"] = nil;
elseif ( what == "test" ) then
@@ -58,13 +89,6 @@ FishingBuddy.Commands["debug"].func =
local dist = math.sqrt((dx*xscale*dx*xscale)+(dy*yscale*dy*yscale));
FishingBuddy.Print("PlayerMap: %f, %f - %f", dx, dy, dist);
end
- else
- local func = getglobal("FishingBuddy_Localize_"..what);
- if ( func ) then
- func();
- else
- FishingBuddy_Debugging = 0;
- end
end
end
return true;
diff --git a/FishingExtravaganza.lua b/FishingExtravaganza.lua
index f5964db..c9c43a7 100755
--- a/FishingExtravaganza.lua
+++ b/FishingExtravaganza.lua
@@ -6,7 +6,6 @@ FishingBuddy.Extravaganza = {};
local NUMMINIPOIS = 10;
local ICONPATH = "Interface\\AddOns\\FishingBuddy\\Icons\\";
-local CLOSEENOUGH = 10.0;
-- the actual names don't matter, except to help make sure I've got 'em all
local ExtravaganzaFish = {};
@@ -16,12 +15,16 @@ ExtravaganzaFish[19805] = "Keefer's Angelfish";
-- makes you wonder what item 19804 is, doesn't it...
ExtravaganzaFish[19803] = "Brownell's Blue Striped Racer";
+FishingBuddy.Extravaganza.Fish = ExtravaganzaFish;
+
+local UPDATETIME_POI = 0.2;
local UPDATETIME_SCHOOLS = 0.1;
local UPDATETIME_COUNTER = 60.0;
local STVUpdateTimer = 0;
local numCaught = 0;
local tastyfish_id = 19807;
local tastyfish;
+local ExtravaganzaIsOver;
-- convert zone coords into minimap coords
local STVInfo = { scale = 0.18128603034401,
@@ -35,14 +38,33 @@ ZoomScale[3] = { xscale = 18568.7, yscale = 12472.2 };
ZoomScale[4] = { xscale = 24390.3, yscale = 15628.5 };
ZoomScale[5] = { xscale = 37012.2, yscale = 25130.6 };
-local function GetSTVPosition()
- local x, y = GetPlayerMapPosition("player");
+local function GetSTVPosition(x, y)
+ if ( not x or not y ) then
+ x, y = GetPlayerMapPosition("player");
+ end
x = (x * STVInfo.scale) + STVInfo.xoffset;
y = (y * STVInfo.scale) + STVInfo.yoffset;
return x, y;
end
--- stolen directly from GuildMap
+local function SetTextureCoords(texture, A, B, C, D, E, F)
+ local det = A*E - B*D;
+ local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy;
+
+ ULx, ULy = ( B*F - C*E ) / det, ( -(A*F) + C*D ) / det;
+ LLx, LLy = ( -B + B*F - C*E ) / det, ( A - A*F + C*D ) / det;
+ URx, URy = ( E + B*F - C*E ) / det, ( -D - A*F + C*D ) / det;
+ LRx, LRy = ( E - B + B*F - C*E ) / det, ( -D + A -(A*F) + C*D ) / det;
+
+ texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy);
+end
+
+local function SetTextureAngle(texture, angrads)
+ local c = math.cos(angrads);
+ local s = math.sin(angrads);
+ SetTextureCoords(texture, c, s, 0, -s, c, 0);
+end
+
local function GetAngleIcon(x, y)
local angle = asin(x / 57);
if (x <= 0 and y <= 0) then
@@ -61,7 +83,7 @@ local function GetAngleIcon(x, y)
return ICONPATH.."MiniMapArrow"..fileNumber;
end
-local function PlotPOI(index, x, y)
+local function PlotPOI(index, x, y, rot, scale)
local poi = getglobal("FishingExtravaganzaMini"..index);
if ( poi ) then
if ( x and y ) then
@@ -73,13 +95,22 @@ local function PlotPOI(index, x, y)
if ( dist > 56.5 ) then
x = x * 57 / dist;
y = y * 57 / dist;
- tex:SetTexture(GetAngleIcon(x, y));
- tex:SetTexCoord(0.0, 1.0, 0.0, 1.0);
+ if ( rot) then
+ tex:SetTexture(ICONPATH.."MiniMapArrow");
+ SetTextureAngle(tex, math.asin(x / 57));
+ else
+ tex:SetTexture(GetAngleIcon(x, y));
+ tex:SetTexCoord(0.0, 1.0, 0.0, 1.0);
+ end
else
tex:SetTexture("Interface\\Minimap\\ObjectIcons");
tex:SetTexCoord(0.0, 0.25, 0.25, 0.5);
end
poi:SetPoint("CENTER", "MinimapCluster", "TOPLEFT", 107 + x, y - 92);
+ if ( scale ) then
+ poi:SetWidth(scale);
+ poi:SetHeight(scale);
+ end
poi:Show();
return true;
else
@@ -99,6 +130,12 @@ local function CloseEnough(x1, y1, x2, y2)
return true;
end
+local function GetDistance(x1, y1, x2, y2)
+ local dx = (x1 - x2);
+ local dy = (y1 - y2);
+ return math.sqrt(dx*dx + dy*dy);
+end
+
local function GetMinimapDistance(x1, y1, x2, y2)
local zoom = ZoomScale[Minimap:GetZoom()];
local dx = (x1 - x2) * zoom.xscale;
@@ -106,88 +143,103 @@ local function GetMinimapDistance(x1, y1, x2, y2)
return math.sqrt(dx*dx+dy*dy);
end
-local function FindClosest(row, x, y)
- local dist;
- local didx;
- for idx=1,table.getn(row) do
- local t = row[idx];
- local dx = (t.x - x);
- local dy = (t.y - y);
- local d = dx*dx + dy*dy;
- if ( not dist ) then
- dist = d;
- didx = idx;
- elseif ( d < dist ) then
- dist = d;
- didx = idx;
+local lx, ly;
+local lastten;
+local function GetNearestTen(x, y)
+ local schools = FishingBuddy.Schools.GetSchools(FishingBuddy.STVZONENAME);
+ if ( not x or not y ) then
+ x, y = GetSTVPosition();
+ end
+ -- if we've moved less than half the distance to the closest hole
+ -- don't recalculate
+ if ( lastten ) then
+ if ( lx == x and ly == y ) then
+ return lastten;
+ end
+ if ( table.getn(lastten) > 0 ) then
+ local d = GetDistance(x, y, lx, ly);
+ if ( d < (lastten[1].dist/2) ) then
+ return lastten;
+ end
+ end
+ end
+
+ local bydist = {};
+ for idx=1,table.getn(schools) do
+ local t = schools[idx];
+ if ( t.kind == FishingBuddy.SCHOOL_TASTY ) then
+ local sx, sy = GetSTVPosition(t.x, t.y);
+ local d = GetDistance(sx, sy, x, y);
+ local info = {};
+ info.x = sx;
+ info.y = sy;
+ info.dist = d;
+ tinsert(bydist, info);
end
end
- if ( dist and didx ) then
- local t = row[didx];
- dist = GetMinimapDistance(t.x, t.y, x, y);
+ table.sort(bydist, function(a, b) return a.dist < b.dist; end);
+ local idx = 1;
+ lastten = {};
+ for _,info in bydist do
+ if ( idx < 10 ) then
+ tinsert(lastten, { dist = info.dist, x = info.x, y = info.y });
+ idx = idx + 1;
+ end
end
- return didx, dist;
+ lx = x;
+ ly = y;
+ return lastten;
end
-local function GetNearestTen(x, y, dir)
- local r = math.floor(y * 100);
- local found = 1;
- local limit = 10;
- local locations = {};
- if ( FishingBuddy_Info["Schools"] ) then
- while ( r >=0 and r <100 ) do
- local iy = string.format("%d", r);
- local dist;
- local row = FishingBuddy_Info["Schools"][iy];
- if ( row ) then
- local rowsize = table.getn(row);
- if ( rowsize > 5 and limit < 11 ) then
- limit = limit + rowsize - 5;
- end
- for idx=1,rowsize do
- local t = row[idx];
- local dist = GetMinimapDistance(t.x, t.y, x, y);
- tinsert(locations, { dist = dist, x = t.x, y = t.y });
- found = found + 1;
- if ( found >= limit ) then
- return locations;
- end
- end
- end
- r = r + dir;
- end
- end
- return locations;
-end
-
--- save a school location
-local function MarkSchool()
- if ( not FishingBuddy_Info["Schools"] ) then
- FishingBuddy_Info["Schools"] = {};
- end
+local function UpdatePOI()
local x, y = GetSTVPosition();
- local iy = string.format("%d", y * 100);
- if ( not FishingBuddy_Info["Schools"][iy] ) then
- FishingBuddy_Info["Schools"][iy] = { { x = x, y = y } };
- else
- local idx, dist = FindClosest(FishingBuddy_Info["Schools"][iy], x, y);
- if ( dist > CLOSEENOUGH ) then
- tinsert(FishingBuddy_Info["Schools"][iy], { x = x, y = y });
- STVUpdateTimer = 0;
+ local loc1 = GetNearestTen(x, y);
+ for idx=1,NUMMINIPOIS do
+ local t = loc1[idx];
+ if ( t ) then
+ PlotPOI(idx, t.x - x, y - t.y);
else
- -- average something? that will cascade, which might be okay
- -- or do we store them all during the contest and average later?
- -- i.e. store 'close ones' in a separate place and then clean up
- -- later
+ PlotPOI(idx);
end
end
end
+local function HidePOI()
+ local poi = getglobal("FishingExtravaganzaMini1");
+ if ( poi:IsVisible() ) then
+ for idx=1,NUMMINIPOIS do
+ PlotPOI(idx);
+ end
+ end
+end
+
+local POIUpdateTimer = UPDATETIME_POI;
+FishingBuddy.Extravaganza.POI_OnUpdate = function(elapsed)
+ POIUpdateTimer = POIUpdateTimer - elapsed;
+ if ( POIUpdateTimer < 0 ) then
+ FishingExtravaganzaPOIUpdate:Hide();
+ UpdatePOI();
+ POIUpdateTimer = UPDATETIME_POI;
+ end
+end
+
+local function DoUpdatePOI()
+ POIUpdateTimer = UPDATETIME_POI;
+ FishingExtravaganzaPOIUpdate:Show();
+end
+
-- let an external entity forcibly mark a school
FishingBuddy.Extravaganza.MarkSchool = function()
local zone, subzone = FishingBuddy.GetZoneInfo();
if ( zone == FishingBuddy.STVZONENAME ) then
- MarkSchool();
+ FishingBuddy.Schools.AddFishingSchool(FishingBuddy.SCHOOL_TASTY, tastyfish_id, zone);
+ end
+end
+
+local function ExtravaganzaHijackCheck()
+ if ( FishingBuddy.NormalHijackCheck() ) then
+ -- also check to make sure we're over a pool
+ return FishingBuddy.Schools.IsFishingHole(FishingBuddy.GetTooltipText());
end
end
@@ -200,9 +252,19 @@ local function IsTime(activate)
local showit = false;
if ( FishingBuddy.IsLoaded() ) then
if ( FishingBuddy.GetSetting("STVTimer") == 1 ) then
- local mhour = date("%H");
+ local mhour = date("%H");
local hour,minute = GetGameTime();
local day = date("%w");
+ local off = FishingBuddy.GetClockOffset();
+ if ( off ~= 0 ) then
+ local lhour = date("%H");
+ lhour = lhour + off;
+ if ( lhour >= 24 ) then
+ day = day + 1;
+ elseif( lhour < 0 ) then
+ day = day - 1;
+ end
+ end
-- Is it Sunday?
if ( day == STVDay and
(hour >= (STVStartHour-2) and hour <(STVStartHour+2))) then
@@ -214,36 +276,26 @@ local function IsTime(activate)
if ( activate ) then
FishingExtravaganzaFrame:Show();
end
- elseif ( FishingExtravaganzaFrame:IsVisible() or
- FishingExtravaganzaMini1:IsVisible() ) then
- FishingExtravaganzaFrame:Hide();
- for idx=1,NUMMINIPOIS do
- PlotPOI(idx);
+ if ( FishingBuddy.GetSetting("STVPoolsOnly") == 1 ) then
+ local zone,_ = FishingBuddy.GetZoneInfo();
+ if ( zone == FishingBuddy.STVZONENAME ) then
+ FishingBuddy.SetHijackCheck(ExtravaganzaHijackCheck);
+ else
+ FishingBuddy.SetHijackCheck();
+ end
end
+ else
+ if ( FishingExtravaganzaFrame:IsVisible() or
+ FishingExtravaganzaMini1:IsVisible() ) then
+ FishingExtravaganzaFrame:Hide();
+ HidePOI();
+ end
+ FishingBuddy.SetHijackCheck();
end
return showit;
end
FishingBuddy.Extravaganza.IsTime = IsTime;
-local function UpdatePOI()
- local x, y = GetSTVPosition();
- local loc1 = GetNearestTen(x, y, -1);
- local loc2 = GetNearestTen(x, y+0.01, 1);
- local func = function(a, b) return a.dist < b.dist; end;
- for idx=1,table.getn(loc2) do
- tinsert(loc1, loc2[idx]);
- end
- table.sort(loc1, func);
- for idx=1,NUMMINIPOIS do
- local t = loc1[idx];
- if ( t ) then
- PlotPOI(idx, t.x - x, y - t.y);
- else
- PlotPOI(idx);
- end
- end
-end
-
-- Check for mouse down event for dragging frame.
FishingBuddy.Extravaganza.OnDragStart = function(arg1)
if (arg1 == "LeftButton") then
@@ -270,44 +322,76 @@ FishingBuddy.Extravaganza.OnLoad = function()
this:Hide();
end
+FishingBuddy.Extravaganza.OnShow = function()
+ -- check each of the bags on the player
+ numCaught = 0;
+ for bag=0, NUM_BAG_FRAMES do
+ -- get the number of slots in the bag (0 if no bag)
+ numSlots = GetContainerNumSlots(bag);
+ if (numSlots > 0) then
+ -- check each slot in the bag
+ for slot=1, numSlots do
+ local link = GetContainerItemLink (bag, slot);
+ if (link) then
+ local _,id,_ = FishingBuddy.SplitFishLink(link);
+ if ( id and id == tastyfish_id ) then
+ local _,c,_,_,_ = GetContainerItemInfo(bag, slot);
+ numCaught = numCaught + c;
+ end
+ end
+ end
+ end
+ end
+end
+
FishingBuddy.Extravaganza.OnEvent = function()
local zone, subzone = FishingBuddy.GetZoneInfo();
- if ( event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_LOGIN" ) then
- if ( zone == FishingBuddy.STVZONENAME and IsTime() ) then
- this:RegisterEvent("LOOT_OPENED");
- this:RegisterEvent("MINIMAP_UPDATE_ZOOM");
- else
- this:UnregisterEvent("LOOT_OPENED");
- this:UnregisterEvent("MINIMAP_UPDATE_ZOOM");
- end
- elseif ( event == "LOOT_OPENED" ) then
+ if ( event == "LOOT_OPENED" ) then
if ( IsFishingLoot()) then
for index = 1, GetNumLootItems(), 1 do
if (LootSlotIsItem(index)) then
local fishlink = GetLootSlotLink(index);
- local _, id, _ = FishingBuddy.SplitFishLink(fishlink);
+ local _, id, name = FishingBuddy.SplitFishLink(fishlink);
if ( ExtravaganzaFish[id] ) then
- MarkSchool();
+ FishingBuddy.Schools.AddFishingSchool(FishingBuddy.SCHOOL_TASTY, id, zone);
STVUpdateTimer = 0;
if ( id == tastyfish_id ) then
numCaught = numCaught + 1;
+ -- make sure we've got the name of the fish for display
+ tastyfish = name;
end
end
end
end
end
+ elseif ( event == "CHAT_MSG_YELL" ) then
+ -- Riggle Bassbait yells: We have a winner! (.*) is the Master Angler!
+ local e,s,n = string.find(arg1, FishingBuddy.RIGGLE_BASSBAIT);
+ if ( e ) then
+ ExtravaganzaIsOver = true;
+ end
elseif ( event == "MINIMAP_UPDATE_ZOOM" ) then
if ( zone == FishingBuddy.STVZONENAME ) then
if ( FishingBuddy.GetSetting("STVTimer") == 1 ) then
- UpdatePOI();
- end
+ DoUpdatePOI();
+ end
+ end
+ elseif ( event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_LOGIN" ) then
+ if ( zone == FishingBuddy.STVZONENAME and IsTime() ) then
+ this:RegisterEvent("CHAT_MSG_YELL");
+ this:RegisterEvent("LOOT_OPENED");
+ this:RegisterEvent("MINIMAP_UPDATE_ZOOM");
+ else
+ this:UnregisterEvent("CHAT_MSG_YELL");
+ this:UnregisterEvent("LOOT_OPENED");
+ this:UnregisterEvent("MINIMAP_UPDATE_ZOOM");
end
elseif ( event == "VARIABLES_LOADED" ) then
local _,_,_,_,_,n = FishingBuddy.GetFishie(tastyfish_id);
if ( n ) then
tastyfish = n;
else
- tastyfish = FISH;
+ tastyfish = FishingBuddy.FISH;
end
IsTime(true);
this:UnregisterEvent("VARIABLES_LOADED");
@@ -325,9 +409,24 @@ FishingBuddy.Extravaganza.OnUpdate = function(elapsed)
local minleft;
local checkhour = STVStartHour;
local line;
+ local contestNow = false;
if ( hour >= STVStartHour ) then
- line = FishingBuddy.TIMELEFT;
+ if ( ExtravaganzaIsOver ) then
+ line = FishingBuddy.FATLADYSINGS;
+ else
+ line = FishingBuddy.TIMELEFT;
+ end
+ line = line..FishingBuddy.DASH.." |c";
+ if ( numCaught < 20 ) then
+ line = line..FishingBuddy.Colors.RED;
+ elseif ( numCaught < 39 ) then
+ line = line..FishingBuddy.Colors.YELLOW;
+ else
+ line = line..FishingBuddy.Colors.GREEN;
+ end
+ line = line..FishingBuddy.FISHCAUGHT.."|r";
checkhour = checkhour + 2;
+ contestNow = true;
else
line = FishingBuddy.TIMETOGO;
end
@@ -342,8 +441,9 @@ FishingBuddy.Extravaganza.OnUpdate = function(elapsed)
FishingExtravaganzaFrameButtonText:SetText(line);
local width = FishingExtravaganzaFrameButtonText:GetWidth();
FishingExtravaganzaFrame:SetWidth(width + 16);
- UpdatePOI();
- if ( FishingBuddy_Info["Schools"] ) then
+ local zone,_ = FishingBuddy.GetZoneInfo();
+ if ( zone == FishingBuddy.STVZONENAME ) then
+ DoUpdatePOI();
STVUpdateTimer = UPDATETIME_SCHOOLS;
else
STVUpdateTimer = UPDATETIME_COUNTER;
@@ -352,6 +452,7 @@ FishingBuddy.Extravaganza.OnUpdate = function(elapsed)
end
else
FishingExtravaganzaFrame:Hide();
+ HidePOI();
end
end
@@ -377,22 +478,34 @@ FishingBuddy.Extravaganza.Debug = function(day, hour, zone)
IsTime(true);
end
-FishingBuddy.Extravaganza.Dump = function()
- local x, y = GetSTVPosition();
- local iy = string.format("%d", y * 100);
-
- FishingBuddy.Print("Current location: %d - %f, %f", iy, x, y);
-
- if ( FishingBuddy_Info["Schools"][iy] ) then
- for idx=1,table.getn(FishingBuddy_Info["Schools"][iy]) do
- local t = FishingBuddy_Info["Schools"][iy][idx];
- local dist = GetMinimapDistance(t.x, t.y, x, y);
- FishingBuddy.Print("Distance: %f", dist);
- end
- end
-end
-
-- eventually, display what fish you caught here
FishingBuddy.Extravaganza.MiniMap_OnEnter = function()
end
+-- test the extravaganze school marking functions
+-- need to expand this for 1.9 if we can tell automatically
+FishingBuddy.Commands["mark"] = {};
+FishingBuddy.Commands["mark"].func =
+ function(what)
+ if ( what == "reset" ) then
+ FishingBuddy_Info["FishSchools"] = nil;
+ elseif ( what == "debug" ) then
+ local hour,_ = GetGameTime();
+ local day = date("%w");
+ FishingBuddy.Extravaganza.Debug(day, hour);
+ elseif ( what == "test" ) then
+ FishingBuddy.Debug("mark test");
+ local coord = 0.005;
+ local rot = 1;
+ PlotPOI(1, 0, coord, rot, 16);
+ PlotPOI(2, coord, coord, rot, 16);
+ PlotPOI(3, coord, 0, rot, 16);
+ PlotPOI(4, -coord, 0, rot, 16);
+ PlotPOI(5, -coord, -coord, rot, 16);
+ PlotPOI(6, 0, -coord, rot, 16);
+ else
+ FishingBuddy.Extravaganza.MarkSchool();
+ end
+ return true;
+ end;
+
diff --git a/FishingExtravaganza.xml b/FishingExtravaganza.xml
index ef5dae3..d30e4ae 100755
--- a/FishingExtravaganza.xml
+++ b/FishingExtravaganza.xml
@@ -17,7 +17,7 @@
GameTooltip:Hide();
-
+
@@ -94,6 +94,9 @@
FishingBuddy.Extravaganza.OnLoad();
+
+ FishingBuddy.Extravaganza.OnShow();
+
FishingBuddy.Extravaganza.OnEvent();
@@ -102,5 +105,12 @@
-
+
+
+
+
+ FishingBuddy.Extravaganza.POI_OnUpdate(arg1);
+
+
+
diff --git a/FishingInit.lua b/FishingInit.lua
index 9d11d01..d9be2bb 100755
--- a/FishingInit.lua
+++ b/FishingInit.lua
@@ -3,11 +3,21 @@
-- Everything you wanted support for in your fishing endeavors
local gotSetupDone = false;
+local lastVersion;
local playerName;
local realmName;
local DEFAULT_MINIMAP_POSITION = 256;
+local function tablecount(tab)
+ local n = 0;
+ for k,v in tab do
+ n = n + 1;
+ end
+ return n;
+end
+FishingBuddy.tablecount = tablecount;
+
FishingBuddy.IsLoaded = function()
return gotSetupDone;
end
@@ -28,8 +38,16 @@ FishingBuddy.SavePlayerInfo = function()
end
end
-local Setup = {};
-Setup.CheckPlayerInfo = function()
+local FishingInit = {};
+
+-- Fill in the player name and realm
+FishingInit.SetupNameInfo = function()
+ playerName = UnitName("player");
+ realmName = GetRealmName();
+ return playerName, realmName;
+end
+
+FishingInit.CheckPlayerInfo = function()
local tabs = { "Settings", "Outfit", "WasWearing" };
if ( not FishingBuddy_Player ) then
FishingBuddy_Player = {};
@@ -67,7 +85,7 @@ Setup.CheckPlayerInfo = function()
end
end
-Setup.CheckPlayerSetting = function(setting, defaultvalue)
+FishingInit.CheckPlayerSetting = function(setting, defaultvalue)
if ( not FishingBuddy_Player["Settings"] ) then
FishingBuddy_Player["Settings"] = { };
end
@@ -76,7 +94,7 @@ Setup.CheckPlayerSetting = function(setting, defaultvalue)
end
end
-Setup.CheckGlobalSetting = function(setting, defaultvalue)
+FishingInit.CheckGlobalSetting = function(setting, defaultvalue)
if ( not FishingBuddy_Info[setting] ) then
if ( not defaultvalue ) then
FishingBuddy_Info[setting] = {};
@@ -86,7 +104,7 @@ Setup.CheckGlobalSetting = function(setting, defaultvalue)
end
end
-Setup.CheckRealm = function()
+FishingInit.CheckRealm = function()
local tabs = { "Settings", "Outfit", "WasWearing" };
for _,tab in tabs do
if ( FishingBuddy_Info[tab] ) then
@@ -119,7 +137,23 @@ Setup.CheckRealm = function()
end
end
-Setup.UpdateFishingDB1 = function()
+FishingInit.SetupZoneMapping = function()
+ local continentNames = { GetMapContinents() };
+ if ( not FishingBuddy_Info["ZoneIndex"] ) then
+ FishingBuddy_Info["ZoneIndex"] = {};
+ for idx,name in continentNames do
+ local zones = { GetMapZones(idx) };
+ for jdx,zone in zones do
+ tinsert(FishingBuddy_Info["ZoneIndex"], zone);
+ end
+ end
+ end
+ if ( not FishingBuddy_Info["SubZones"] ) then
+ FishingBuddy_Info["SubZones"] = {};
+ end
+end
+
+FishingInit.UpdateFishingDB1 = function()
local version = FishingBuddy_Info["Version"];
if ( not version ) then
version = 7700; -- be really old
@@ -262,19 +296,133 @@ Setup.UpdateFishingDB1 = function()
FishingBuddy_Info["Locations"] = nil;
end
-Setup.UpdateFishingDB2 = function()
+FishingInit.FixupNumericZones = function()
+ -- fix bad zones from FishSchools update bug
+ local badones;
+ local biggest = 0;
+ local hardfix = false;
+ for zidx,zone in FishingBuddy_Info["ZoneIndex"] do
+ if ( type(zone) ~= "string" ) then
+ if ( not badones ) then
+ badones = {};
+ end
+ badones[zidx] = zone;
+ if ( biggest < zidx ) then
+ biggest = zidx;
+ end
+ elseif ( biggest > 0 ) then
+ -- found a string after we started seeing numbers
+ hardfix = true;
+ end
+ end
+ if ( badones ) then
+ local fs = FishingBuddy_Info["FishingSkill"];
+ local fh = FishingBuddy_Info["FishingHoles"];
+ for bidx,gidx in badones do
+ if ( fs[bidx] ) then
+ for sidx,skill in fs[bidx] do
+ local z = FishingBuddy_Info["ZoneIndex"][gidx];
+ local sz = FishingBuddy_Info["SubZones"][gidx][sidx];
+ FishingBuddy.SetZoneLevel(z, sz, fs[bidx][gidx]);
+ end
+ end
+ if ( fh[bidx] ) then
+ if ( not fh[gidx] ) then
+ fh[gidx] = {};
+ end
+ for sidx,fishies in fh[bidx] do
+ for id,cnt in fishies do
+ if ( fh[gidx] and
+ fh[gidx][sidx] and
+ fh[gidx][sidx][id] ) then
+ fh[gidx][sidx][id] = fh[gidx][sidx][id] + cnt;
+ else
+ if ( not fh[gidx] ) then
+ fh[gidx] = {};
+ end
+ if ( not fh[gidx][sidx] ) then
+ fh[gidx][sidx] = {};
+ end
+ fh[gidx][sidx][id] = cnt;
+ end
+ end
+ end
+ end
+ end
+ if ( not hardfix ) then
+ -- these are already in numerical order
+ local count = table.getn(FishingBuddy_Info["ZoneIndex"]);
+ for idx=count,1,-1 do
+ if ( badones[idx] ) then
+ table.remove(FishingBuddy_Info["ZoneIndex"], idx);
+ FishingBuddy_Info["FishingSkill"][idx] = nil;
+ FishingBuddy_Info["FishingHoles"][idx] = nil;
+ FishingBuddy_Info["SubZones"][idx] = nil;
+ end
+ end
+ else
+ local fixers = { "FishingSkill", "FishingHoles", "SubZones" };
+ -- okay, this gonna be tough
+ -- strip out the numbers after the string
+ while ( badones ) do
+ local count = table.getn(FishingBuddy_Info["ZoneIndex"]);
+ local gotstring = false;
+ local sidx;
+ for idx=count,1,-1 do
+ if ( not gotstring ) then
+ if (type(fh[idx]) ~= "string" ) then
+ table.remove(FishingBuddy_Info["ZoneIndex"], idx);
+ for _,k in fixers do
+ FishingBuddy_Info[k][idx] = nil;
+ end
+ badones[idx] = nil;
+ else
+ gotstring = true;
+ sidx = idx;
+ end
+ end
+ end
+ if ( next(badones) == nil) then
+ badones = nil;
+ end
+ if ( sidx and sidx ~= count ) then
+ count = table.getn(FishingBuddy_Info["ZoneIndex"]);
+ local fidx = 1;
+ while ( fidx < count and type(FishingBuddy_Info["ZoneIndex"][fidx] == "string" ) ) do
+ fidx = fidx + 1;
+ end
+ for k,v in FishingBuddy_Info["ZoneIndex"][sidx] do
+ FishingBuddy_Info["ZoneIndex"][fidx][k] = v;
+ end
+ FishingBuddy_Info["ZoneIndex"][sidx] = nil;
+ for _,f in fixers do
+ for k,v in FishingBuddy_Info[f][sidx] do
+ FishingBuddy_Info[f][fidx][k] = v;
+ end
+ FishingBuddy_Info[f][sidx] = nil;
+ end
+ else
+ -- if it's not already nil, we're in trouble
+ badones = nil;
+ end
+ end
+ end
+ end
+end
+
+FishingInit.UpdateFishingDB2 = function()
local version = FishingBuddy_Info["Version"];
if ( not version ) then
version = 7700; -- be really old
end
-- track the weekly fish that got missed at the end of the year
- if ( version < 8509 ) then
+ if ( version < 8509 and FishingBuddy.ByFishie ) then
local ft = FishingBuddy_Info["FishTracking"]["WEEKLY"];
for id,what in ft do
if ( FishingBuddy.ByFishie[id] ) then
local total = 0;
- for subzone,count in FishingBuddy.ByFishie[id] do
+ for _,count in FishingBuddy.ByFishie[id] do
total = total + count;
end
local tracked = 0;
@@ -290,11 +438,133 @@ Setup.UpdateFishingDB2 = function()
end
end
+ -- version < 8700
+ local needCollapse = true;
+ if ( FishingBuddy_Info["Schools"] ) then
+ -- convert zone coords into minimap coords
+ local STVInfo = { scale = 0.18128603034401,
+ xoffset = 0.39145470225916, yoffset = 0.79412224886668 };
+ local tastyfish_id = 19807;
+
+ local addschool = FishingBuddy.Schools.AddFishingSchool;
+ local zone = FishingBuddy.STVZONENAME;
+ for _,pools in FishingBuddy_Info["Schools"] do
+ for idx,entry in pools do
+ local t;
+ local x = (entry.x - STVInfo.xoffset) / STVInfo.scale;
+ local y = (entry.y - STVInfo.yoffset) / STVInfo.scale;
+ addschool(FishingBuddy.SCHOOL_TASTY, 19807, zone, x, y);
+ end
+ end
+ FishingBuddy_Info["Schools"] = nil;
+ needCollapse = nil;
+ end
+
+ if ( version < 8701 ) then
+ FishingBuddy.SetSetting("FastCast", nil);
+ end
+
+ if ( version < 8703 ) then
+ local azi = FishingBuddy.AddZoneIndex;
+ if ( FishingBuddy_Info["FishingSkill"] ) then
+ didsomething = false;
+ local fixit = false;
+ for zone,info in FishingBuddy_Info["FishingSkill"] do
+ if ( type(zone) == "string" ) then
+ fixit = true;
+ break;
+ end
+ end
+ if ( fixit ) then
+ local newskills = {};
+ for zone,info in FishingBuddy_Info["FishingSkill"] do
+ local zidx = azi(zone);
+ newskills[zidx] = {};
+ for subzone,count in info do
+ local _,sidx = azi(zone,subzone);
+ newskills[zidx][sidx] = count;
+ end
+ FishingBuddy_Info["FishingSkill"][zone] = nil;
+ end
+ FishingBuddy_Info["FishingSkill"] = newskills;
+ end
+ end
+
+ if ( FishingBuddy_Info["FishingHoles"] ) then
+ local fixit = false;
+ for zone,info in FishingBuddy_Info["FishingHoles"] do
+ if ( type(zone) == "string" ) then
+ fixit = true;
+ break;
+ end
+ end
+ if ( fixit ) then
+ local newholes = {};
+ for zone,info in FishingBuddy_Info["FishingHoles"] do
+ local zidx = azi(zone);
+ newholes[zidx] = {};
+ for subzone,stuff in info do
+ local _,sidx = azi(zone,subzone);
+ newholes[zidx][sidx] = stuff;
+ end
+ FishingBuddy_Info["FishingHoles"][zone] = nil;
+ end
+ FishingBuddy_Info["FishingHoles"] = newholes;
+ end
+ end
+ end
+
+ if ( version < 8704 and needCollapse ) then
+ if ( FishingBuddy_Info["FishSchools"] ) then
+ local azi = FishingBuddy.AddZoneIndex;
+ local fixit = false;
+ for zone,info in FishingBuddy_Info["FishSchools"] do
+ if ( type(zone) == "string" ) then
+ fixit = true;
+ break;
+ end
+ end
+ if ( fixit ) then
+ local newschools = {};
+ for zone,info in FishingBuddy_Info["FishSchools"] do
+ local zidx = azi(zone);
+ newschools[zidx] = {};
+ for idx,entry in info do
+ tinsert(newschools[zidx], entry);
+ end
+ FishingBuddy_Info["FishSchools"][zone] = nil;
+ end
+ FishingBuddy_Info["FishSchools"] = newschools;
+ end
+ end
+ FishingBuddy.Schools.CollapseHoles();
+ end
+
+ if ( version < 8707 ) then
+ FishingInit.FixupNumericZones();
+ end
+
+ if ( version < 8712 ) then
+ local ft = FishingBuddy_Info["FishTracking"];
+ for how,info in ft do
+ for id,what in ft[how] do
+ what.plot = 1;
+ end
+ end
+ end
+
+ -- save this for other pieces that might need to update
+ lastVersion = version;
+
FishingBuddy_Info["Version"] = FishingBuddy.CURRENTVERSION;
end
+FishingBuddy.GetLastVersion = function()
+ return lastVersion;
+end
+
-- Based on code in QuickMountEquip
-Setup.HookFunction = function(func, newfunc)
+FishingInit.HookFunction = function(func, newfunc)
local oldValue = getglobal(func);
if ( oldValue ~= getglobal(newfunc) ) then
setglobal(func, getglobal(newfunc));
@@ -305,25 +575,29 @@ end
-- set up alternate view of fish data. do this as startup to
-- lower overall dynamic hit when loading the window
-Setup.SetupByFishie = function()
+FishingInit.SetupByFishie = function()
if ( not FishingBuddy.ByFishie ) then
local fh = FishingBuddy_Info["FishingHoles"];
local ff = FishingBuddy_Info["Fishies"];
FishingBuddy.ByFishie = { };
FishingBuddy.SortedFishies = { };
- for zone in fh do
- for subzone in fh[zone] do
- for id in fh[zone][subzone] do
- local quantity = fh[zone][subzone][id];
+ for zidx in fh do
+ local zone = FishingBuddy_Info["ZoneIndex"][zidx];
+ for sidx in fh[zidx] do
+ local subzone = FishingBuddy_Info["SubZones"][zidx][sidx];
+ local indexer = zidx.."."..sidx;
+ for id in fh[zidx][sidx] do
+ local quantity = fh[zidx][sidx][id];
if ( not FishingBuddy.ByFishie[id] ) then
FishingBuddy.ByFishie[id] = { };
tinsert(FishingBuddy.SortedFishies,
{ text = ff[id].name, id = id });
end
- if ( not FishingBuddy.ByFishie[id][subzone] ) then
- FishingBuddy.ByFishie[id][subzone] = quantity;
+
+ if ( not FishingBuddy.ByFishie[id][indexer] ) then
+ FishingBuddy.ByFishie[id][indexer] = quantity;
else
- FishingBuddy.ByFishie[id][subzone] = FishingBuddy.ByFishie[id][subzone] + quantity;
+ FishingBuddy.ByFishie[id][indexer] = FishingBuddy.ByFishie[id][indexer] + quantity;
end
end
end
@@ -332,85 +606,59 @@ Setup.SetupByFishie = function()
end
end
-Setup.InitSortHelpers = function()
+FishingInit.InitSortHelpers = function()
local fh = FishingBuddy_Info["FishingHoles"];
FishingBuddy.SortedZones = {};
FishingBuddy.SortedByZone = {};
FishingBuddy.SortedSubZones = {};
- for zone in fh do
+ for zidx,zone in FishingBuddy_Info["ZoneIndex"] do
tinsert(FishingBuddy.SortedZones, zone);
FishingBuddy.SortedByZone[zone] = {};
- for subzone in fh[zone] do
- tinsert(FishingBuddy.SortedByZone[zone], subzone);
- tinsert(FishingBuddy.SortedSubZones, subzone);
+ if ( fh[zidx] ) then
+ for sidx in fh[zidx] do
+ local subzone = FishingBuddy_Info["SubZones"][zidx][sidx];
+ tinsert(FishingBuddy.SortedByZone[zone], subzone);
+ tinsert(FishingBuddy.SortedSubZones, subzone);
+ end
+ table.sort(FishingBuddy.SortedByZone[zone]);
end
- table.sort(FishingBuddy.SortedByZone[zone]);
end
table.sort(FishingBuddy.SortedZones);
table.sort(FishingBuddy.SortedSubZones);
end
-Setup.EnhanceSoundDefaults = function()
- Setup.CheckPlayerSetting("EnhanceSoundSoundVolume", 1.0);
- Setup.CheckPlayerSetting("EnhanceSoundMusicVolume", 0.0);
- Setup.CheckPlayerSetting("EnhanceSoundAmbienceVolume", 0.0);
-end
-
-Setup.InitSettings = function()
+FishingInit.InitSettings = function()
if( not FishingBuddy_Info ) then
FishingBuddy_Info = { };
end
-- global stuff
- Setup.UpdateFishingDB1();
- Setup.CheckRealm();
+ FishingInit.SetupZoneMapping();
+ FishingInit.UpdateFishingDB1();
+ FishingInit.CheckRealm();
- Setup.CheckGlobalSetting("ImppDBLoaded", 0);
- Setup.CheckGlobalSetting("FishInfo2", 0);
- Setup.CheckGlobalSetting("DataFish", 0);
- Setup.CheckGlobalSetting("FishingHoles");
- Setup.CheckGlobalSetting("FishingSkill");
- Setup.CheckGlobalSetting("Fishies");
+ FishingInit.CheckGlobalSetting("ImppDBLoaded", 0);
+ FishingInit.CheckGlobalSetting("FishInfo2", 0);
+ FishingInit.CheckGlobalSetting("DataFish", 0);
+ FishingInit.CheckGlobalSetting("FishingHoles");
+ FishingInit.CheckGlobalSetting("FishingSkill");
+ FishingInit.CheckGlobalSetting("Fishies");
+ FishingInit.CheckGlobalSetting("HiddenFishies");
- Setup.CheckPlayerInfo();
+ FishingInit.CheckPlayerInfo();
-- per user stuff
- for _,option in FishingBuddy.OPTIONS do
- local setting = option.default;
- if ( option.check and option.checkfail ) then
- if ( not option.check() ) then
- setting = option.checkfail;
- end
- end
- Setup.CheckPlayerSetting(option.name, setting);
+ if ( not FishingBuddy_Player["Settings"] ) then
+ FishingBuddy_Player["Settings"] = { };
end
-
- -- setting not on option pane (or not checkboxes)
- Setup.CheckPlayerSetting("ShowLocationZones", 1);
- Setup.CheckPlayerSetting("GroupByLocation", 1);
-
- -- titan panel support
- Setup.CheckPlayerSetting("TitanClickToSwitch", 1);
- -- InfoBar support
- Setup.CheckPlayerSetting("InfoBarClickToSwitch", 1);
- -- minimap button support
- Setup.CheckPlayerSetting("MinimapClickToSwitch", 1);
- Setup.CheckPlayerSetting("MinimapButtonPosition", DEFAULT_MINIMAP_POSITION);
-
- -- Option key casting
- Setup.CheckPlayerSetting("EasyCastKeys", FishingBuddy.KEYS_NONE);
- Setup.CheckPlayerSetting("SuitUpKeys", FishingBuddy.KEYS_NONE);
-
- Setup.EnhanceSoundDefaults();
-
if ( FishingBuddy.InitTracking ) then
FishingBuddy.InitTracking();
end
- Setup.SetupByFishie();
- Setup.UpdateFishingDB2();
- Setup.InitSortHelpers();
+ FishingInit.UpdateFishingDB2();
+ FishingInit.SetupByFishie();
+ FishingInit.InitSortHelpers();
end
-Setup.RegisterMyAddOn = function()
+FishingInit.RegisterMyAddOn = function()
-- Register the addon in myAddOns
if (myAddOnsFrame_Register) then
local details = {
@@ -438,31 +686,48 @@ Setup.RegisterMyAddOn = function()
end
end
-Setup.RegisterHandlers = function()
+FishingInit.RegisterHandlers = function()
temp = ToggleMinimap;
- if ( Setup.HookFunction("ToggleMinimap", "FishingBuddy_ToggleMinimap") ) then
+ if ( FishingInit.HookFunction("ToggleMinimap", "FishingBuddy_ToggleMinimap") ) then
FishingBuddy.SavedToggleMinimap = temp;
end
FishingBuddy.TrapWorldMouse()
end
+local WOW = {};
+FishingBuddy.WOWVersion = function()
+ return WOW.major, WOW.minor, WOW.dot;
+end
+
FishingBuddy.Initialize = function()
-- Set everything up, then dump the code we don't need anymore
- playerName, realmName = FishingBuddy.SetupNameInfo();
- if ( Setup ) then
+ playerName, realmName = FishingInit.SetupNameInfo();
+ if ( FishingInit ) then
if ( GetBuildInfo ) then
- local version, buildnum, builddate = GetBuildInfo();
+ local v, b, d = GetBuildInfo();
+ WOW.build = b;
+ WOW.date = d;
+ local s,e,maj,min,dot = string.find("(%d+).(%d+).(%d+)", v);
+ WOW.major = tonumber(maj);
+ WOW.minor = tonumber(min);
+ WOW.dot = tonumber(dot);
else
FishingBuddy.Is10900 = true;
end
- Setup.RegisterHandlers();
- Setup.InitSettings();
+ FishingInit.RegisterHandlers();
+ FishingInit.InitSettings();
-- register with myAddOn
- Setup.RegisterMyAddOn();
+ FishingInit.RegisterMyAddOn();
+ -- clean out some beta trash
+ FishingBuddy.SetSetting("ClockOffset", nil);
+
+ FishingBuddy.Schools.Init();
gotSetupDone = true;
FishingBuddy.WatchUpdate();
+ -- debugging state
+ FishingBuddy.Debugging = FishingBuddy.GetSetting("FishDebug");
-- we don't need these functions anymore, gc 'em
- Setup = nil;
+ FishingInit = nil;
end
end
diff --git a/FishingLocationsFrame.lua b/FishingLocationsFrame.lua
index 09926ed..4f4aa0d 100755
--- a/FishingLocationsFrame.lua
+++ b/FishingLocationsFrame.lua
@@ -10,7 +10,7 @@ local LocationLineSelected = 0;
local LocationLines = {};
local LocationLastLine = 1;
-local function MakeInfo(line, level, collapsible, expanded, hasicon, text, extra, index, id)
+local function MakeInfo(line, level, collapsible, expanded, hasicon, text, tipinfo, index, id)
if ( not LocationLines[line] ) then
LocationLines[line] = {};
end
@@ -19,7 +19,7 @@ local function MakeInfo(line, level, collapsible, expanded, hasicon, text, extra
LocationLines[line].expanded = expanded;
LocationLines[line].hasicon = hasicon;
LocationLines[line].text = text;
- LocationLines[line].extra = extra;
+ LocationLines[line].tipinfo = tipinfo;
if ( index ) then
LocationLines[line].index = index;
else
@@ -37,25 +37,43 @@ local function CountLocationLines()
local info = LocationLines[j];
j = j + 1;
if ( info and info.valid ) then
- linecount = linecount + 1;
+ linecount = linecount + 1;
if ( info.collapsible and not info.expanded ) then
local i2 = LocationLines[j];
- while ( i2 and (i2.level > info.level) ) do
- j = j + 1;
- i2 = LocationLines[j];
+ while ( i2 and i2.valid and (i2.level > info.level) ) do
+ j = j + 1;
+ i2 = LocationLines[j];
end
- end
+ end
end
end
- -- there's a zero-based vs. one-based bug here, somewhere
- if ( linecount > NUM_THINGIES_DISPLAYED and
- limit >= table.getn(LocationLines)) then
- linecount = linecount + 1;
+ if ( linecount > 0 ) then
+ -- I have no idea why this works this way at all
+ if ( linecount > NUM_THINGIES_DISPLAYED and linecount < limit ) then
+ return linecount+1;
+ else
+ return linecount;
+ end
+ else
+ return 0;
end
--- FishingBuddy.Debug("Count "..linecount.." limit "..limit);
- return linecount;
end
+local function FishCount(zone, subzone)
+ local zidx, sidx = FishingBuddy.GetZoneIndex(zone, subzone);
+ local count = 0;
+ local total = 0;
+ local fh = FishingBuddy_Info["FishingHoles"];
+ if( fh[zidx] and fh[zidx][sidx] ) then
+ for fishie in fh[zidx][sidx] do
+ count = count + 1;
+ total = total + fh[zidx][sidx][fishie];
+ end
+ end
+ return count, total;
+end
+FishingBuddy.FishCount = FishCount;
+
local function FishiesChanged()
local fh = FishingBuddy_Info["FishingHoles"];
local ff = FishingBuddy_Info["Fishies"];
@@ -65,52 +83,56 @@ local function FishiesChanged()
for i=1,fishcount,1 do
local fishid = FishingBuddy.SortedFishies[i].id;
- local fishname = ff[fishid].name;
+ local fishname = FishingBuddy.StripRaw(ff[fishid].name);
local locsort = {};
local total = 0;
- for zone in FishingBuddy.ByFishie[fishid] do
- if ( not zonetotals[zone] ) then
- local fi = nil;
- for z in fh do
- if ( fh[z][zone] ) then
- fi = fh[z][zone];
- break;
- end
- end
- if ( fi ) then
- local tot = 0;
- for f in fi do
- tot = tot + fi[f];
- end
- zonetotals[zone] = tot;
+ for indexer,count in FishingBuddy.ByFishie[fishid] do
+ local _,_,zidx,sidx = string.find(indexer, "(%d+).(%d+)");
+ zidx = tonumber(zidx);
+ sidx = tonumber(sidx);
+ if ( not zonetotals[zidx] ) then
+ if ( fh[zidx] and fh[zidx][sidx] ) then
+ local tot = 0;
+ local fi = fh[zidx][sidx];
+ for f in fi do
+ tot = tot + fi[f];
+ end
+ zonetotals[zidx] = tot;
+ end
+ end
+ local info = {};
+ if ( FishingBuddy_Info["SubZones"][zidx] ) then
+ if ( not FishingBuddy_Info["SubZones"][zidx][sidx] ) then
+ info.text = FishingBuddy_Info["ZoneIndex"][zidx];
+ else
+ info.text = FishingBuddy_Info["SubZones"][zidx][sidx];
end
+ else
+ info.text = FishingBuddy.UNKNOWN;
end
- local count = FishingBuddy.ByFishie[fishid][zone];
- local info = {};
- info.text = zone;
- info.count = count;
- info.total = zonetotals[zone];
- if ( not info.total or info.total == 0) then
- info.total = 1;
- end
- tinsert(locsort, info);
- total = total + count;
+ info.count = count;
+ info.total = zonetotals[zidx];
+ if ( not info.total or info.total == 0) then
+ info.total = 1;
+ end
+ tinsert(locsort, info);
+ total = total + count;
end
- local extra = " ("..total.." total";
+ local tipinfo = {};
+ tipinfo.total = total;
if ( ff[fishid].level ) then
- extra = extra..", "..ff[fishid].level;
+ tipinfo.level = ff[fishid].level;
end
- extra = extra..")";
MakeInfo(line, 0, true, true, true, fishname, extra, nil, fishid);
line = line + 1;
FishingBuddy.FishSort(locsort);
for j=1,table.getn(locsort),1 do
- local zone = locsort[j].text;
- local amount = locsort[j].count;
- local total = locsort[j].total;
- local percent = format("%.1f", ( amount / total ) * 100);
- MakeInfo(line, 1, false, false, false, zone, " ("..amount..", "..percent.."%)");
- line = line + 1;
+ local zone = locsort[j].text;
+ local amount = locsort[j].count;
+ local total = locsort[j].total;
+ local percent = format(" (%.1f%%)", ( amount / total ) * 100);
+ MakeInfo(line, 1, false, false, false, zone..percent, { amount = amount, total = total, title = zone });
+ line = line + 1;
end
end
LocationLastLine = line;
@@ -124,38 +146,46 @@ local function BothLocationsChanged()
local zonecount = table.getn(sorted);
for i=1,zonecount,1 do
local zone = sorted[i];
- local where = zone;
- MakeInfo(line, 0, true, true, false, zone, nil, where);
- line = line + 1;
- local subsorted = FishingBuddy.SortedByZone[zone];
- local subcount = table.getn(subsorted);
- for s=1,subcount,1 do
- local subzone = subsorted[s];
- local count, total = FishingBuddy.FishCount(zone, subzone);
- where = zone.."."..subzone;
- local extra = " ("..count.." types, "..total.." total)";
- if ( FishingBuddy_Info["FishingSkill"][zone] and FishingBuddy_Info["FishingSkill"][zone][subzone] ) then
- extra = extra.." ["..FishingBuddy_Info["FishingSkill"][zone][subzone].."]";
- end
- if ( fh[zone][subzone] ) then
- MakeInfo(line, 1, true, true, false, subzone, extra, where);
- line = line + 1;
- local fishsort = {};
- for fishid in fh[zone][subzone] do
- local info = {};
- info.id = fishid;
- info.text = ff[fishid].name;
- info.count = fh[zone][subzone][fishid];
- tinsert(fishsort, info);
- end
- FishingBuddy.FishSort(fishsort);
- for j=1,table.getn(fishsort),1 do
- local fishie = fishsort[j].text;
- local id = fishsort[j].id;
- local amount = fishsort[j].count;
- local percent = format("%.1f", ( amount / total ) * 100);
- MakeInfo(line, 2, false, false, true, fishie, " ("..percent.."%)", nil, id);
- line = line + 1;
+ local zidx = FishingBuddy.GetZoneIndex(zone);
+ if ( fh[zidx] ) then
+ local where = zone;
+ MakeInfo(line, 0, true, true, false, zone, nil, where);
+ line = line + 1;
+ local subsorted = FishingBuddy.SortedByZone[zone];
+ local subcount = table.getn(subsorted);
+ for s=1,subcount,1 do
+ local subzone = subsorted[s];
+ local count, total = FishCount(zone, subzone);
+ if ( total > 0 ) then
+ local zidx, sidx = FishingBuddy.GetZoneIndex(zone, subzone);
+ where = zone.."."..subzone;
+ local tipinfo = {};
+ tipinfo.types = count;
+ tipinfo.total = total;
+ if ( FishingBuddy_Info["FishingSkill"][zidx] and FishingBuddy_Info["FishingSkill"][zidx][sidx] ) then
+ tipinfo.skill = FishingBuddy_Info["FishingSkill"][zidx][sidx];
+ end
+ if ( fh[zidx][sidx] ) then
+ MakeInfo(line, 1, true, true, false, subzone, tipinfo, where);
+ line = line + 1;
+ local fishsort = {};
+ for fishid in fh[zidx][sidx] do
+ local info = {};
+ info.id = fishid;
+ info.text = FishingBuddy.StripRaw(ff[fishid].name);
+ info.count = fh[zidx][sidx][fishid];
+ tinsert(fishsort, info);
+ end
+ FishingBuddy.FishSort(fishsort);
+ for j=1,table.getn(fishsort),1 do
+ local fishie = fishsort[j].text;
+ local id = fishsort[j].id;
+ local amount = fishsort[j].count;
+ local percent = format(" (%.1f%%)", ( amount / total ) * 100);
+ MakeInfo(line, 2, false, false, true, fishie..percent, { amount = amount, total = total, title = fishie }, nil, id);
+ line = line + 1;
+ end
+ end
end
end
end
@@ -169,7 +199,7 @@ local function SubZonesChanged()
local mapping = {};
for zone in fh do
for subzone in fh[zone] do
- mapping[subzone] = zone;
+ mapping[subzone] = zone;
end
end
local line = 1;
@@ -177,30 +207,32 @@ local function SubZonesChanged()
for i=1,zonecount,1 do
local subzone = FishingBuddy.SortedSubZones[i];
local zone = mapping[subzone];
- local extra = nil;
- if ( FishingBuddy_Info["FishingSkill"][zone] and FishingBuddy_Info["FishingSkill"][zone][subzone] ) then
- extra = " ["..FishingBuddy_Info["FishingSkill"][zone][subzone].."]";
- end
- MakeInfo(line, 0, true, true, false, subzone, extra);
- line = line + 1;
- local zone = mapping[subzone];
- local count, total = FishingBuddy.FishCount(zone, subzone);
- local fishsort = {};
- for fishid in fh[zone][subzone] do
- local info = {};
- info.id = fishid;
- info.text = ff[fishid].name;
- info.count = fh[zone][subzone][fishid];
- tinsert(fishsort, info);
- end
- FishingBuddy.FishSort(fishsort);
- for j=1,table.getn(fishsort),1 do
- local id = fishsort[j].id;
- local fishie = fishsort[j].text;
- local amount = fishsort[j].count;
- local percent = format("%.1f", ( amount / total ) * 100);
- MakeInfo(line, 1, false, false, true, fishie, " ("..percent.."%)", nil, id);
+ local count, total = FishCount(zone, subzone);
+ if ( total > 0 ) then
+ local zidx, sidx = FishingBuddy.GetZoneIndex(zone, subzone);
+ local tipinfo = nil;
+ if ( FishingBuddy_Info["FishingSkill"][zidx] and FishingBuddy_Info["FishingSkill"][zidx][sidx] ) then
+ tipinfo = { skill = FishingBuddy_Info["FishingSkill"][zidx][sidx] };
+ end
+ MakeInfo(line, 0, true, true, false, subzone, tipinfo);
line = line + 1;
+ local fishsort = {};
+ for fishid in fh[zidx][sidx] do
+ local info = {};
+ info.id = fishid;
+ info.text = FishingBuddy.StripRaw(ff[fishid].name);
+ info.count = fh[zidx][sidx][fishid];
+ tinsert(fishsort, info);
+ end
+ FishingBuddy.FishSort(fishsort);
+ for j=1,table.getn(fishsort),1 do
+ local id = fishsort[j].id;
+ local fishie = fishsort[j].text;
+ local amount = fishsort[j].count;
+ local percent = format(" (%.1f%%)", ( amount / total ) * 100);
+ MakeInfo(line, 1, false, false, true, fishie..percent, { amount = amount, total = total, title = fishie} , nil, id);
+ line = line + 1;
+ end
end
end
LocationLastLine = line;
@@ -209,9 +241,9 @@ end
local function LinesChanged()
if ( FishingBuddy.GetSetting("GroupByLocation") == 1 ) then
if ( FishingBuddy.GetSetting("ShowLocationZones") == 1 ) then
- BothLocationsChanged();
+ BothLocationsChanged();
else
- SubZonesChanged();
+ SubZonesChanged();
end
else
FishiesChanged();
@@ -242,11 +274,11 @@ function FishingLocationsFrame_SetSelection(id, line)
FishingLocationHighlightFrame:Hide();
if info then
if ( info.collapsible ) then
- info.expanded = not info.expanded;
+ info.expanded = not info.expanded;
else
- LocationLineSelected = line;
- FishingLocationHighlightFrame:SetPoint ( "TOPLEFT" , getglobal("FishingLocations"..id):GetName() , "TOPLEFT" , 5 , 0 )
- FishingLocationHighlightFrame:Show()
+ LocationLineSelected = line;
+ FishingLocationHighlightFrame:SetPoint ( "TOPLEFT" , getglobal("FishingLocations"..id):GetName() , "TOPLEFT" , 5 , 0 )
+ FishingLocationHighlightFrame:Show()
end
end
end
@@ -255,7 +287,6 @@ function FishingLocationsFrame_MoveButtonText(i, what)
local relativeTo = "FishingLocations"..i..what;
local textfield = getglobal("FishingLocations"..i.."Text");
textfield:SetPoint("LEFT", relativeTo, "RIGHT", 2, 0);
- textfield = getglobal("FishingLocations"..i.."HighlightText");
end
FishingBuddy.Locations.Update = function(forced)
@@ -269,8 +300,12 @@ FishingBuddy.Locations.Update = function(forced)
local offset = FauxScrollFrame_GetOffset(FishingLocsScrollFrame);
FauxScrollFrame_Update( FishingLocsScrollFrame, CountLocationLines(),
- NUM_THINGIES_DISPLAYED,
- FishingBuddy.Locations.FRAME_THINGIEHEIGHT );
+ NUM_THINGIES_DISPLAYED,
+ FishingBuddy.Locations.FRAME_THINGIEHEIGHT,
+ nil, nil, nil,
+ FishingLocationHighlightFrame,
+ 230, 230
+ );
local lastlevel = 0;
FishingLocationHighlightFrame:Hide();
@@ -282,135 +317,198 @@ FishingBuddy.Locations.Update = function(forced)
j = j + 1;
o = o + 1;
if ( info.collapsible and not info.expanded ) then
- local i2 = LocationLines[j];
- while ( i2 and i2.level > info.level ) do
+ local i2 = LocationLines[j];
+ while ( i2 and i2.level > info.level ) do
j = j + 1;
- i2 = LocationLines[j];
- end
+ i2 = LocationLines[j];
+ end
end
end
end
for i = 1,NUM_THINGIES_DISPLAYED,1 do
local locButton = getglobal ( "FishingLocations"..i );
- if ( LocationLines[j] ) then
- local icon = getglobal("FishingLocations"..i.."Icon");
- local icontex = getglobal("FishingLocations"..i.."IconTexture");
- local info = LocationLines[j];
+ local info = LocationLines[j];
+ if ( info and info.valid ) then
+ local icon = getglobal("FishingLocations"..i.."Icon");
+ local icontex = getglobal("FishingLocations"..i.."IconTexture");
locButton.id = i;
locButton.line = j;
- local leveloffset = (info.level - lastlevel)*16;
- if ( i == 1 ) then
- locButton:SetPoint("TOPRIGHT", "FishingLocsScrollFrame", "TOPLEFT", leveloffset, 0);
- else
- local t = i - 1;
- locButton:SetPoint("TOPLEFT", "FishingLocations"..t, "BOTTOMLEFT", leveloffset, 0);
- end
- lastlevel = info.level;
+ local leveloffset = (info.level - lastlevel)*16;
+ if ( i == 1 ) then
+ locButton:SetPoint("TOPLEFT", leveloffset+25, -100);
+ else
+ local t = i - 1;
+ locButton:SetPoint("TOPLEFT", "FishingLocations"..t, "BOTTOMLEFT", leveloffset, 0);
+ end
+ lastlevel = info.level;
- local text = info.text;
- if text and info.extra then
- text = text .. info.extra;
- end
+ local text = info.text;
+ if text and info.extra then
+ text = text .. info.extra;
+ end
+ locButton.tipinfo = info.tipinfo;
- locButton:SetText( text );
- icon:ClearAllPoints();
- if ( info.collapsible ) then
- icon:SetPoint("LEFT", "FishingLocations"..i, "LEFT", 21, 0);
- locButton:SetTextColor( 1, 0.82, 0 );
- if ( info.expanded ) then
- locButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
- else
- locButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
- end
- getglobal("FishingLocations"..i.."Highlight"):SetTexture("Interface\\Buttons\\UI-PlusButton-Hilight");
- getglobal("FishingLocations"..i):UnlockHighlight();
- else
- icon:SetPoint("LEFT", "FishingLocations"..i, "LEFT", 3, 0);
- locButton:SetTextColor( .5, .5, .5 );
- locButton:SetNormalTexture("");
- getglobal("FishingLocations"..i.."Highlight"):SetTexture("");
- -- Place the highlight and lock the highlight state
- if ( LocationLineSelected == j ) then
- FishingLocationHighlightFrame:SetPoint("TOPLEFT", "FishingLocations"..i, "TOPLEFT", 21, 0);
- FishingLocationHighlightFrame:Show();
- locButton:LockHighlight();
- else
- locButton:UnlockHighlight();
- end
- end
+ icon:ClearAllPoints();
+ if ( info.collapsible ) then
+ icon:SetPoint("LEFT", "FishingLocations"..i, "LEFT", 21, 0);
+ locButton:SetTextColor( 1, 0.82, 0 );
+ if ( info.expanded ) then
+ locButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
+ else
+ locButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
+ end
+ getglobal("FishingLocations"..i.."Highlight"):SetTexture("Interface\\Buttons\\UI-PlusButton-Hilight");
+ getglobal("FishingLocations"..i):UnlockHighlight();
+ else
+ icon:SetPoint("LEFT", "FishingLocations"..i, "LEFT", 3, 0);
+ locButton:SetTextColor( .5, .5, .5 );
+ locButton:SetNormalTexture("");
+ getglobal("FishingLocations"..i.."Highlight"):SetTexture("");
+ -- Place the highlight and lock the highlight state
+ if ( LocationLineSelected == j ) then
+ FishingLocationHighlightFrame:SetPoint("TOPLEFT", "FishingLocations"..i, "TOPLEFT", 21, 0);
+ FishingLocationHighlightFrame:Show();
+ locButton:LockHighlight();
+ else
+ locButton:UnlockHighlight();
+ end
+ end
- locButton.tooltip = nil;
- if ( info.hasicon ) then
- local item, texture, _, _, _ = FishingBuddy.GetFishie(info.id);
- locButton.item = item;
- locButton.name = info.text;
- if( texture ) then
- icontex:SetTexture(texture);
- icon:Show();
- icontex:Show();
+ locButton.tooltip = nil;
+ if ( info.hasicon ) then
+ local item, texture, _, _, _ = FishingBuddy.GetFishie(info.id);
+ locButton.item = item;
+ locButton.fishid = info.id;
+ locButton.name = info.text;
+ if( texture ) then
+ icontex:SetTexture(texture);
+ icon:Show();
+ icontex:Show();
+ end
+ FishingLocationsFrame_MoveButtonText(i, "Icon");
+ else
+ locButton.item = nil;
+ locButton.fishid = nil;
+ locButton.name = nil;
+ icontex:SetTexture("");
+ icontex:Hide();
+ icon:Hide();
+ FishingLocationsFrame_MoveButtonText(i, "Highlight");
+ end
+
+ if ( info.tipinfo ) then
+ local color = FishingBuddy.Colors.GREEN;
+ if ( locButton.item and
+ not FishingBuddy.IsLinkableItem(locButton.item) ) then
+ color = FishingBuddy.Colors.RED;
end
- FishingLocationsFrame_MoveButtonText(i, "Icon");
- else
- locButton.item = nil;
- locButton.name = nil;
- icontex:SetTexture("");
- icontex:Hide();
- icon:Hide();
- FishingLocationsFrame_MoveButtonText(i, "Highlight");
- end
- locButton:Show();
- j = j + 1;
- if ( info.collapsible and not info.expanded ) then
- local i2 = LocationLines[j];
- while ( i2 and (i2.level > info.level) ) do
- j = j + 1;
- i2 = LocationLines[j];
- end
- end
+ text = text.."|c"..color.."*|r";
+ end
+ locButton:SetText( text );
+ locButton:Show();
+ j = j + 1;
+ if ( info.collapsible and not info.expanded ) then
+ local i2 = LocationLines[j];
+ while ( i2 and (i2.level > info.level) ) do
+ j = j + 1;
+ i2 = LocationLines[j];
+ end
+ end
else
- locButton:Hide();
+ locButton:Hide();
locButton.id = nil;
locButton.line = nil;
end
end
- if LocationLines then
+ if ( LocationLines ) then
-- Set the expand/collapse all button texture
local numHeaders = 0;
local notExpanded = 0;
for i=1,table.getn(LocationLines),1 do
- local j = i + offset;
- local info = LocationLines[j];
- if ( info and info.collapsible ) then
- numHeaders = numHeaders + 1;
- if ( not info.expanded ) then
- notExpanded = notExpanded + 1;
- end
- end
+ local j = i + offset;
+ local info = LocationLines[j];
+ if ( info and info.collapsible ) then
+ numHeaders = numHeaders + 1;
+ if ( not info.expanded ) then
+ notExpanded = notExpanded + 1;
+ end
+ end
end
FishingLocationsCollapseAllButton:Show();
-- If all headers are not expanded then show collapse button, otherwise show the expand button
if ( notExpanded ~= numHeaders ) then
- Collapsed = false;
- FishingLocationsCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
+ Collapsed = false;
+ FishingLocationsCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
else
- Collapsed = true;
- FishingLocationsCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
+ Collapsed = true;
+ FishingLocationsCollapseAllButton:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
end
else
FishingLocationsCollapseAllButton:Hide();
end
end
+local function TrackFishToggle(fishid, how)
+ local tab = FishingBuddy_Info["FishTracking"][how];
+ if ( not tab[fishid] ) then
+ local ff = FishingBuddy_Info["Fishies"];
+ FishingBuddy.TrackThis(how, fishid, ff[fishid].color, ff[fishid].name);
+ else
+ if ( not tab[fishid].nevermore ) then
+ tab[fishid].nevermore = true;
+ else
+ tab[fishid].nevermore = nil;
+ end
+ end
+end
+
+local function MakeTrackFishToggle(fishid, how)
+ local id = fishid;
+ local h = how;
+ return function() TrackFishToggle(id, h); end;
+end
+
+local function TrackFishEntry(fishid, how)
+ local fi = FishingBuddy_Info["FishTracking"];
+ local info = {};
+ info.text = FishingBuddy["TRACKFISH"..how];
+ info.func = MakeTrackFishToggle(fishid, how);
+ info.checked = ( fi[how][fishid] and not fi[how][fishid].nevermore );
+ return info;
+end
+
+local function FishOptionsInitialize()
+ local menu = getglobal("FishingBuddyLocationsMenu");
+ if ( menu.fishid ) then
+ local fishid = menu.fishid;
+ local ff = FishingBuddy_Info["Fishies"];
+ UIDropDownMenu_AddButton(TrackFishEntry(fishid, "HOURLY"));
+ UIDropDownMenu_AddButton(TrackFishEntry(fishid, "WEEKLY"));
+
+ local info = {};
+ info.text = FishingBuddy.HIDEINWATCHER;
+ info.func = FishingBuddy.WatchFrame.MakeToggle(fishid);
+ info.checked = ( not FishingBuddy_Info["HiddenFishies"][fishid] );
+ UIDropDownMenu_AddButton(info);
+ end
+end
+
FishingBuddy.Locations.Button_OnClick = function(button)
if ( button == "LeftButton" ) then
if( IsShiftKeyDown() and this.item ) then
- FishingBuddy.ChatLink(this.item, this.name, this.color);
+ FishingBuddy.ChatLink(this.item, this.name, this.color);
elseif ( this.id and this.line ) then
- FishingLocationsFrame_SetSelection(this.id, this.line);
- FishingBuddy.Locations.Update();
+ FishingLocationsFrame_SetSelection(this.id, this.line);
+ FishingBuddy.Locations.Update();
end
+ elseif ( this.fishid and button == "RightButton" ) then
+ local menu = getglobal("FishingBuddyLocationsMenu");
+
+ menu.fishid = this.fishid;
+ UIDropDownMenu_Initialize(menu, FishOptionsInitialize, "MENU");
+ FishingBuddy.ToggleDropDownMenu(1, nil, menu, this, 0, 0);
end
end
@@ -427,36 +525,77 @@ function FishingLocationsCollapseAllButton_OnClick()
end
FishingBuddy.Locations.Button_OnEnter = function()
- if( GameTooltip.finished ) then
+ if( GameTooltip.locbutfini ) then
return;
end
- if( this.item or this.tooltip ) then
+ if ( this.item or this.tooltip or this.tipinfo ) then
GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
- if ( this.item and this.item ~= "" ) then
- local link = "item:"..this.item;
- local n,l,_,_,_,_,_,_ = GetItemInfo(link);
- if ( n and l ) then
- GameTooltip:SetHyperlink(link);
- else
- this.tooltip = {}
- this.tooltip[1] = { ["text"] = this.name };
- this.tooltip[2] = { ["text"] = FishingBuddy.NOTLINKABLE, ["r"] = 1.0, ["g"] = 0, ["b"] = 0 };
- FishingBuddy.AddTooltip(this.tooltip);
- this.item = nil;
- end
- elseif ( this.tooltip ) then
- FishingBuddy.AddTooltip(this.tooltip, 1, 1, 1);
- end
- GameTooltip.finished = 1;
- GameTooltip:Show();
end
+
+ local gottitle;
+ if( this.item or this.tooltip ) then
+ gottitle = true;
+ if ( this.item and this.item ~= "" ) then
+ if ( FishingBuddy.IsLinkableItem(this.item) ) then
+ GameTooltip:SetHyperlink("item:"..this.item);
+ else
+ this.tooltip = {}
+ this.tooltip[1] = { ["text"] = this.name };
+ this.tooltip[2] = { ["text"] = FishingBuddy.NOTLINKABLE, ["r"] = 1.0, ["g"] = 0, ["b"] = 0 };
+ FishingBuddy.AddTooltip(this.tooltip);
+ this.item = nil;
+ end
+ elseif ( this.tooltip ) then
+ FishingBuddy.AddTooltip(this.tooltip, 1, 1, 1);
+ end
+ end
+ if ( this.tipinfo ) then
+ local ti = this.tipinfo;
+ local line;
+ if ( ti.title ) then
+ GameTooltip:AddLine(ti.title);
+ elseif ( not gottitle ) then
+ GameTooltip:AddLine(this:GetText());
+ end
+ if ( ti.types ) then
+ GameTooltip:AddLine(string.format(FishingBuddy.FISHTYPES, ti.types));
+ end
+ if ( ti.amount ) then
+ line = string.format(FishingBuddy.CAUGHTTHISMANY, ti.amount);
+ end
+ if ( ti.total ) then
+ if ( not line ) then
+ line = "";
+ else
+ line = line.."/";
+ end
+ line = line..string.format(FishingBuddy.CAUGHTTHISTOTAL, ti.total);
+ end
+ if ( ti.percent ) then
+ if ( not line ) then
+ line = "";
+ else
+ line = line.." ";
+ end
+ line = line.."("..ti.percent.."%)";
+ end
+ if ( line ) then
+ GameTooltip:AddLine(line, 1, 1, 1);
+ end
+ if ( ti.skill ) then
+ line = string.format(FishingBuddy.MINIMUMSKILL, ti.skill);
+ GameTooltip:AddLine(line, 0, 1, 0);
+ end
+ end
+ GameTooltip.locbutfini = 1;
+ GameTooltip:Show();
end
FishingBuddy.Locations.Button_OnLeave = function()
- GameTooltip.finished = nil;
- if( this.item or this.tooltip ) then
+ if( this.item or this.tooltip or this.tipinfo ) then
GameTooltip:Hide();
end
+ GameTooltip.locbutfini = nil;
end
FishingBuddy.Locations.DisplayChanged = function()
@@ -465,17 +604,22 @@ FishingBuddy.Locations.DisplayChanged = function()
FishingBuddy.Locations.Update(true);
end
-FishingBuddy.Locations.SwitchDisplay = function()
- -- backwards logic check, we're about to change...
+local function UpdateButtonDisplay()
if ( FishingBuddy.GetSetting("GroupByLocation") == 1 ) then
- FishingLocationsSwitchButton:SetText(FishingBuddy.SHOWLOCATIONS);
- FishingBuddyOptionSLZ:Hide();
- FishingBuddy.SetSetting("GroupByLocation", 0);
- else
FishingLocationsSwitchButton:SetText(FishingBuddy.SHOWFISHIES);
FishingBuddyOptionSLZ:Show();
- FishingBuddy.SetSetting("GroupByLocation", 1);
+ else
+ FishingLocationsSwitchButton:SetText(FishingBuddy.SHOWLOCATIONS);
+ FishingBuddyOptionSLZ:Hide();
end
+end
+
+FishingBuddy.Locations.SwitchDisplay = function()
+ -- backwards logic check, we're about to change...
+ local setting = FishingBuddy.GetSetting("GroupByLocation");
+ setting = 1 - setting;
+ FishingBuddy.SetSetting("GroupByLocation", setting);
+ UpdateButtonDisplay();
FishingBuddy.Locations.DisplayChanged();
end
@@ -495,10 +639,13 @@ FishingBuddy.Locations.OnLoad = function()
FishingBuddyOptionSLZ.name = "ShowLocationZones";
FishingBuddyOptionSLZ.text = FishingBuddy.CONFIG_SHOWLOCATIONZONES_ONOFF;
FishingBuddyOptionSLZ.tooltip = FishingBuddy.CONFIG_SHOWLOCATIONZONES_INFO;
+
+
end
FishingBuddy.Locations.OnShow = function()
if ( FishingBuddy.IsLoaded() ) then
+ UpdateButtonDisplay();
FishingBuddy.Locations.Update();
end
end
@@ -508,19 +655,10 @@ FishingBuddy.Locations.OnEvent = function()
-- this:EnableMouseWheel(0);
end
-FishingBuddy.FishCount = function(zone, subzone)
- local count = 0;
- local total = 0;
- local fh = FishingBuddy_Info["FishingHoles"];
- if( fh[zone] and fh[zone][subzone] ) then
- for fishie in fh[zone][subzone] do
- count = count + 1;
- total = total + fh[zone][subzone][fishie];
- end
- end
- return count, total;
-end
-
FishingBuddy.Locations.DataChanged = function(zone, subzone, fishie)
FishingLocationsFrame.valid = false;
end
+
+FishingBuddy.ShowLocLine = function(j)
+ FishingBuddy.Dump(LocationLines[j]);
+end
diff --git a/FishingLocationsFrame.xml b/FishingLocationsFrame.xml
index 53a9a02..a1f442b 100755
--- a/FishingLocationsFrame.xml
+++ b/FishingLocationsFrame.xml
@@ -58,30 +58,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ FishingBuddy.OutfitFrame.Update(arg1);
+
+
+
diff --git a/FishingOutfitManager.lua b/FishingOutfitManager.lua
index d1f240f..97d9e36 100755
--- a/FishingOutfitManager.lua
+++ b/FishingOutfitManager.lua
@@ -32,6 +32,24 @@ local Accessories = {
[5310] = { ["n"] = "Sea Dog Britches", ["score"] = 4, },
}
+FishingBuddy.Commands[FishingBuddy.SWITCH] = {};
+FishingBuddy.Commands[FishingBuddy.SWITCH].func = function()
+ FishingBuddy.OutfitManager.Switch();
+ return true;
+ end;
+
+local OutfitManagers = {};
+local OutfitManagerCount = 0;
+FishingBuddy.OutfitManager.RegisterManager = function(name, init, choose, switch)
+ if ( not OutfitManagers[name] ) then
+ OutfitManagers[name] = {};
+ OutfitManagerCount = OutfitManagerCount + 1;
+ end
+ OutfitManagers[name].Initialize = init;
+ OutfitManagers[name].Choose = choose;
+ OutfitManagers[name].Switch = switch;
+end
+
FishingBuddy.OutfitManager.ItemStylePoints = function(itemno, enchant)
local points = 0;
if ( itemno ) then
@@ -48,145 +66,119 @@ FishingBuddy.OutfitManager.ItemStylePoints = function(itemno, enchant)
return points;
end
-local CheckSwitch = nil;
+local PoleCheck = nil;
-- update the watcher when we're done switching outfits
FishingBuddy.OutfitManager.WaitForUpdate =
function(arg1)
- local hasPole = FishingBuddy.IsFishingPole();
- if ( hasPole == CheckSwitch ) then
+ local hasPole = FishingBuddy.API.IsFishingPole();
+ if ( hasPole == PoleCheck ) then
FishingOutfitUpdateFrame:Hide();
- FishingBuddy.FishingMode();
+ FishingBuddy.API.FishingMode();
end
end
-FishingBuddy.OutfitManager.CheckSwitch = function(topole)
- CheckSwitch = topole;
+local function CheckSwitch(topole)
+ PoleCheck = topole;
FishingOutfitUpdateFrame:Show();
end
+FishingBuddy.OutfitManager.CheckSwitch = CheckSwitch;
+
+local function HasManager()
+ return (OutfitManagerCount > 0);
+end
+FishingBuddy.OutfitManager.HasManager = HasManager;
FishingBuddy.OutfitManager.Switch = function(outfitname)
- if ( OutfitDisplayFrame_OnLoad ) then
- FishingBuddy.OutfitFrame.Switch();
- else
- local vOut, vCat, vInd = Outfitter_FindOutfitByStatId(Outfitter_cFishingStatName);
- if ( vOut ) then
- if ( FishingBuddy.IsFishingPole() ) then
- Outfitter_RemoveOutfit(vOut);
- FishingBuddy.OutfitManager.CheckSwitch(false);
- else
- vOut.Disabled = nil;
- Outfitter_WearOutfit(vOut, vCat);
- FishingBuddy.OutfitManager.CheckSwitch(true);
- end
- Outfitter_Update(true);
+ if ( HasManager() ) then
+ local outfitter = FishingBuddy.GetSetting("OutfitManager");
+ if ( outfitter and OutfitManagers[outfitter] ) then
+ local wasPole = OutfitManagers[outfitter].Switch(outfitname);
+ CheckSwitch(not wasPole);
end
+ else
+ FishingBuddy.UIError(FishingBuddy.COMPATIBLE_SWITCHER);
end
-- if we're now sporting a fishing pole, let's go fishing
- FishingBuddy.FishingMode();
+ FishingBuddy.API.FishingMode();
end
-FishingBuddy.OutfitManager.HasManager = function()
- return ( OutfitDisplayFrame_OnLoad or Outfitter_OnLoad );
+local current_manager;
+
+local function OutfitManagerMenuSetup()
+ for manager,_ in OutfitManagers do
+ local mgr = manager;
+ local info = {};
+ info.text = manager;
+ info.func = function() FishingBuddy.OutfitManager.ChooseManager(mgr); end;
+ info.checked = ( current_manager == manager )
+ UIDropDownMenu_AddButton(info);
+ end
end
+local function SetOutfitManagerDisplay()
+ if ( OutfitManagerCount == 0 ) then
+ FishingBuddyOption_OutfitMenu:Hide();
+ FishingBuddyOption_OutfitText:SetText(FishingBuddy.OUTFITS_TAB..": |c"..FishingBuddy.Colors.RED..FishingBuddy.NONEAVAILABLE_MSG.."|r");
+ elseif ( OutfitManagerCount == 1 ) then
+ FishingBuddyOption_OutfitMenu:Hide();
+ FishingBuddyOption_OutfitText:SetText(FishingBuddy.OUTFITS_TAB..": |c"..FishingBuddy.Colors.GREEN..current_manager.."|r");
+ else
+ FishingBuddyOption_OutfitText:Hide();
+ UIDropDownMenu_Initialize(FishingBuddyOption_OutfitMenu,
+ OutfitManagerMenuSetup);
+ local show = 1;
+ for name,_ in OutfitManagers do
+ if ( name == current_manager ) then
+ break;
+ end
+ show = show + 1;
+ end
+ local label = getglobal("FishingBuddyOption_OutfitMenuLabel");
+ label:SetText(FishingBuddy.OUTFITS_TAB..": ");
+ local menu = FishingBuddyOption_OutfitMenu;
+ UIDropDownMenu_SetWidth(210, menu);
+ UIDropDownMenu_SetSelectedValue(menu, show);
+ UIDropDownMenu_SetText(current_manager, menu);
+ end
+end
+
+local function ChooseManager(manager)
+ if ( manager and OutfitManagers[manager] ) then
+ current_manager = manager;
+ if ( not OutfitManagers[manager].initialized ) then
+ OutfitManagers[manager].Initialize();
+ OutfitManagers[manager].initialized = 1;
+ end
+ for om,info in OutfitManagers do
+ info.Choose(om == manager);
+ end
+ SetOutfitManagerDisplay();
+ return true;
+ end
+end
+FishingBuddy.OutfitManager.ChooseManager = ChooseManager;
+
FishingBuddy.OutfitManager.Initialize = function()
-- no outfit managers, no outfit switching
- if ( not FishingBuddy.OutfitManager.HasManager() ) then
+ if ( not HasManager() ) then
FishingBuddy.SetSetting("InfoBarClickToSwitch", 0);
FishingBuddy.SetSetting("TitanClickToSwitch", 0);
FishingBuddy.SetSetting("MinimapClickToSwitch", 0);
- end
- if ( (not OutfitDisplayFrame_OnLoad) and Outfitter_OnLoad ) then
- -- create the default fishing outfit, if it doesn't exist
- if ( gOutfitter_Settings ) then
- local vOut, vCat, vInd = Outfitter_FindOutfitByStatId(Outfitter_cFishingStatName);
- local vName = "Fishing Buddy";
- if ( not vOut ) then
- vOut = Outfitter_GenerateSmartOutfit(vName, Outfitter_cFishingStatName, OutfitterItemList_GetEquippableItems(true));
- if not vOut then
- vOut = Outfitter_NewEmptyOutfit(vName);
- end
-
- local vCategoryID = Outfitter_AddOutfit(vOut);
+ else
+ if ( OutfitManagerCount == 1 ) then
+ -- we pretty much have to use this one
+ current_manager = next(OutfitManagers);
+ else
+ current_manager = FishingBuddy.GetSetting("OutfitManager");
+ if ( not manager or not OutfitManagers[manager] ) then
+ -- no valid ones, use the first one
+ current_manager = next(OutfitManagers);
end
end
+ ChooseManager(current_manager);
+ -- in case we changed things (do we want/need to do this?)
+ -- FishingBuddy.SetSetting("OutfitManager", current_manager);
end
+ SetOutfitManagerDisplay();
end
-
--- calculate scores based on Outfitter
-local function StylePoints(outfit)
- local isp = FishingBuddy.OutfitManager.ItemStylePoints;
- local points = 0;
- if ( outfit )then
- for slot in outfit.Items do
- points = points + isp(outfit.Items[slot].Code,
- outfit.Items[slot].EnchantCode);
- end
- end
- return points;
-end
-
-local function BonusPoints(outfit, vStatID)
- local points = 0;
- if ( outfit )then
- for slot in outfit.Items do
- if ( outfit.Items[slot][vStatID] ) then
- points = points + outfit.Items[slot][vStatID];
- end
- -- Enternium Fishing Line
- if ( outfit.Items[slot].EnchantCode == 2603 ) then
- points = points + 5;
- end
- end
- end
- return points;
-end
-
--- Outfitter patches
-
-function Outfitter_FindOutfitByStatId(pStatID)
- if not pStatID or pStatID == "" then
- return nil;
- end
-
- for vCategoryID, vOutfits in gOutfitter_Settings.Outfits do
- for vOutfitIndex, vOutfit in vOutfits do
- if vOutfit.StatID and vOutfit.StatID == pStatID then
- return vOutfit, vCategoryID, vOutfitIndex;
- end
- end
- end
-
- -- return nil, nil, nil;
-end
-
-local Saved_OutfitterItem_OnEnter = OutfitterItem_OnEnter;
-FishingBuddy.OutfitManager.OutfitterItem_OnEnter = function(pItem)
- Saved_OutfitterItem_OnEnter(pItem);
- if ( not pItem.isCategoryItem ) then
- local vOutfit = Outfitter_GetOutfitFromListItem(pItem);
- if ( vOutfit and vOutfit.StatID == Outfitter_cFishingStatName ) then
- local vDescription;
- local bp = BonusPoints(vOutfit, Outfitter_cFishingStatName);
- if ( bp >= 0 ) then
- bp = "+"..bp;
- else
- bp = 0 - bp;
- bp = "-"..bp;
- end
- bp = Outfitter_cFishingStatName.." "..bp;
- local sp = StylePoints(vOutfit);
- local pstring;
- if ( points == 1 ) then
- pstring = FishingBuddy.POINT;
- else
- pstring = FishingBuddy.POINTS;
- end
- vDescription = string.format(FishingBuddy.CONFIG_OUTFITTER_TEXT,
- bp, sp)..pstring;
- GameTooltip_AddNewbieTip(vOutfit.Name, 1.0, 1.0, 1.0, vDescription, 1);
- end
- end
-end
-OutfitterItem_OnEnter = FishingBuddy.OutfitManager.OutfitterItem_OnEnter;
diff --git a/FishingOutfitManager.xml b/FishingOutfitManager.xml
index 4074f65..2cd18f8 100755
--- a/FishingOutfitManager.xml
+++ b/FishingOutfitManager.xml
@@ -1,7 +1,6 @@
-
diff --git a/FishingOutfitter.lua b/FishingOutfitter.lua
new file mode 100644
index 0000000..c1927a4
--- /dev/null
+++ b/FishingOutfitter.lua
@@ -0,0 +1,140 @@
+-- Interface with the Outfitter addon by mundocani
+
+local function OutfitterSwitch(outfitName)
+ -- this uses a static string of "Fishing" *not* the translation
+ local vOut, vCat, vInd = Outfitter_FindOutfitByStatID("Fishing");
+ if ( vOut ) then
+ local wasPole = FishingBuddy.API.IsFishingPole();
+ if ( wasPole ) then
+ Outfitter_RemoveOutfit(vOut);
+ else
+ vOut.Disabled = nil;
+ Outfitter_WearOutfit(vOut, vCat);
+ end
+ Outfitter_Update(true);
+ return wasPole;
+ end
+end
+
+local function CleanOutDuplicates(vName)
+ local count = 0;
+ for vCategoryID, vOutfits in gOutfitter_Settings.Outfits do
+ for vOutfitIndex, vOutfit in vOutfits do
+ if ( vOutfit.Name == vName ) then
+ count = count + 1;
+ end
+ end
+ end
+ if ( count > 0 ) then
+ -- nuke all of the outfits named 'Fishing Buddy' since they're
+ -- likely wrong, so that we can create a new 'good' one
+ local vOut,_,_ = Outfitter_FindOutfitByName(vName);
+ while ( vOut ) do
+ Outfitter_DeleteOutfit(vOut);
+ vOut,_,_ = Outfitter_FindOutfitByName(vName);
+ end
+ end
+end
+
+local function OutfitterInitialize()
+ if ( gOutfitter_Settings ) then
+ local vName = "Fishing Buddy";
+ CleanOutDuplicates(vName);
+ -- create the default fishing outfit, if it doesn't exist
+ local vOut,_,_ = Outfitter_FindOutfitByStatID("Fishing");
+ if ( not vOut ) then
+ vOut = Outfitter_GenerateSmartOutfit(vName, "Fishing", OutfitterItemList_GetEquippableItems(true));
+ if ( vOut ) then
+ local vCategoryID = Outfitter_AddOutfit(vOut);
+ -- we're done
+ end
+ end
+ end
+end
+
+-- calculate scores based on Outfitter
+local function StylePoints(outfit)
+ local isp = FishingBuddy.OutfitManager.ItemStylePoints;
+ local points = 0;
+ if ( outfit )then
+ for slot in outfit.Items do
+ points = points + isp(outfit.Items[slot].Code,
+ outfit.Items[slot].EnchantCode);
+ end
+ end
+ return points;
+end
+
+local function BonusPoints(outfit, vStatID)
+ local points = 0;
+ if ( outfit )then
+ for slot in outfit.Items do
+ if ( outfit.Items[slot][vStatID] ) then
+ points = points + outfit.Items[slot][vStatID];
+ end
+ -- Enternium Fishing Line
+ if ( outfit.Items[slot].EnchantCode == 2603 ) then
+ points = points + 5;
+ end
+ end
+ end
+ return points;
+end
+
+-- Outfitter patches ( not needed in 1.2)
+if ( not Outfitter_FindOutfitByStatID ) then
+ Outfitter_FindOutfitByStatID = function(pStatID)
+ if not pStatID or pStatID == "" then
+ return nil;
+ end
+
+ for vCategoryID, vOutfits in gOutfitter_Settings.Outfits do
+ for vOutfitIndex, vOutfit in vOutfits do
+ if vOutfit.StatID and vOutfit.StatID == pStatID then
+ return vOutfit, vCategoryID, vOutfitIndex;
+ end
+ end
+ end
+
+ -- return nil, nil, nil;
+ end
+end
+
+local Saved_OutfitterItem_OnEnter = OutfitterItem_OnEnter;
+local function Patch_OutfitterItem_OnEnter(pItem)
+ Saved_OutfitterItem_OnEnter(pItem);
+ if ( not pItem.isCategoryItem ) then
+ local vOutfit = Outfitter_GetOutfitFromListItem(pItem);
+ if ( vOutfit and vOutfit.StatID == "Fishing" ) then
+ local vDescription;
+ local bp = BonusPoints(vOutfit, "Fishing");
+ if ( bp >= 0 ) then
+ bp = "+"..bp;
+ else
+ bp = 0 - bp;
+ bp = "-"..bp;
+ end
+ bp = Outfitter_cFishingStatName.." "..bp;
+ local sp = StylePoints(vOutfit);
+ local pstring;
+ if ( points == 1 ) then
+ pstring = FishingBuddy.POINT;
+ else
+ pstring = FishingBuddy.POINTS;
+ end
+ vDescription = string.format(FishingBuddy.CONFIG_OUTFITTER_TEXT,
+ bp, sp)..pstring;
+ GameTooltip_AddNewbieTip(vOutfit.Name, 1.0, 1.0, 1.0, vDescription, 1);
+ end
+ end
+end
+-- point to our new function so we get our own tooltip
+OutfitterItem_OnEnter = Patch_OutfitterItem_OnEnter;
+
+if ( Outfitter_OnLoad ) then
+ FishingBuddy.OutfitManager.RegisterManager("Outfitter",
+ OutfitterInitialize,
+ function(useme) end,
+ OutfitterSwitch);
+end
+
diff --git a/FishingSchools.lua b/FishingSchools.lua
new file mode 100644
index 0000000..cce78b9
--- /dev/null
+++ b/FishingSchools.lua
@@ -0,0 +1,165 @@
+-- Support for schools
+
+FishingBuddy.Schools = {};
+
+local SCHOOLS = {};
+local CLOSEENOUGH = 0.000001;
+
+local function distance(x1, y1, x2, y2)
+ local x = (x1 - x2);
+ local y = (y1 - y2);
+ return sqrt( (x * x) + (y * y) );
+end
+
+-- Let's store fishing holes like this
+-- FishingBuddy_Info["Schools"][ZONE]
+-- Store everything to two digits?
+
+local function AddFishingSchool(kind, fishid, zidx, x, y)
+ local entry = {};
+ if ( not zidx ) then
+ zidx, _ = FishingBuddy.GetZoneIndex();
+ elseif ( type(zidx) == "string" ) then
+ zidx = FishingBuddy.GetZoneIndex(zidx);
+ end
+ if ( not x or not y ) then
+ x, y = GetPlayerMapPosition("player");
+ end
+ if ( not FishingBuddy_Info["FishSchools"] ) then
+ FishingBuddy_Info["FishSchools"] = {};
+ end
+ if ( not FishingBuddy_Info["FishSchools"][zidx] ) then
+ FishingBuddy_Info["FishSchools"][zidx] = {};
+ else
+ -- how do we find the same pool?
+ for _,hole in FishingBuddy_Info["FishSchools"][zidx] do
+ local d = distance(hole.x, hole.y, x, y);
+ if ( d < CLOSEENOUGH ) then
+ if ( fishid ) then
+ if ( hole.fish ) then
+ for f,count in hole.fish do
+ if ( f == fishid ) then
+ hole.fish[f] = count + 1;
+ return;
+ end
+ end
+ else
+ hole.fish = {};
+ end
+ hole.fish[fishid] = 1;
+ end
+ if ( hole.count ) then
+ hole.count = hole.count + 1;
+ else
+ hole.count = 1;
+ end
+ return;
+ end
+ end
+ end
+ entry.kind = kind;
+ entry.x = x;
+ entry.y = y;
+ entry.count = 1;
+ if ( fishid ) then
+ entry.fish = {};
+ entry.fish[fishid] = 1;
+ end
+ tinsert(FishingBuddy_Info["FishSchools"][zidx], entry);
+ return true;
+end
+FishingBuddy.Schools.AddFishingSchool = AddFishingSchool;
+
+local function IsFishingHole(text)
+ if ( text ) then
+ for match, info in SCHOOLS do
+ if ( string.find(text, match) ) then
+ return info;
+ end
+ end
+ end
+end
+FishingBuddy.Schools.IsFishingHole = IsFishingHole;
+
+local function CheckFishingHole(text, fishid)
+ local info = IsFishingHole(text);
+ if ( info ) then
+ if ( Gatherer_AddGatherHere and
+ FishingBuddy.GetSetting("UseGatherer") == 1 ) then
+ Gatherer_AddGatherHere(info.gather, 0, info.gather, 2);
+ end
+ if ( AddFishingSchool(info.kind, fishid) and
+ FishingBuddy.GetSetting("ShowNewFishies") == 1 ) then
+ local zone,_ = FishingBuddy.GetZoneInfo();
+ FishingBuddy.Print(FishingBuddy.ADDSCHOOLMSG, text, zone);
+ end
+ end
+end
+FishingBuddy.Schools.CheckFishingHole = CheckFishingHole;
+
+local function GetSchools(zidx)
+ if ( type(zidx) == "string" ) then
+ zidx = FishingBuddy.GetZoneIndex(zidx);
+ end
+ if ( FishingBuddy_Info["FishSchools"] and FishingBuddy_Info["FishSchools"][zidx] ) then
+ return FishingBuddy_Info["FishSchools"][zidx];
+ else
+ return {};
+ end
+end
+FishingBuddy.Schools.GetSchools = GetSchools;
+
+FishingBuddy.Schools.Init = function()
+ -- hook into Gatherer
+ SCHOOLS[FishingBuddy.SCHOOL] = {
+ ["gather"] = TREASURE_FISHNODE,
+ ["kind"] = FishingBuddy.SCHOOL_FISH,
+ };
+ SCHOOLS[FishingBuddy.FLOATING_WRECKAGE] = {
+ ["gather"] = TREASURE_FISHWRECK,
+ ["kind"] = FishingBuddy.SCHOOL_WRECKAGE,
+ };
+ SCHOOLS[FishingBuddy.FLOATING_DEBRIS] = {
+ ["gather"] = TREASURE_FISHWRECK,
+ ["kind"] = FishingBuddy.SCHOOL_DEBRIS,
+ };
+ SCHOOLS[FishingBuddy.ELEM_WATER] = {
+ ["gather"] = TREASURE_FISHELEM,
+ ["kind"] = FishingBuddy.SCHOOL_WATER,
+ };
+ SCHOOLS[FishingBuddy.OIL_SPILL] = {
+ ["gather"] = TREASURE_FISHWRECK,
+ ["kind"] = FishingBuddy.SCHOOL_OIL,
+ };
+end
+
+local function CollapseHoles()
+ if ( FishingBuddy_Info["FishSchools"] ) then
+ local zonecopy = {};
+ for zidx,holes in FishingBuddy_Info["FishSchools"] do
+ local copy = {};
+ for _,hole in holes do
+ tinsert(copy, hole);
+ end
+ zonecopy[zidx] = copy;
+ end
+ for zidx,holes in zonecopy do
+ FishingBuddy_Info["FishSchools"][zidx] = nil;
+ for _,hole in holes do
+
+ FishingBuddy.Dump(hole);
+
+ if ( hole.fish ) then
+ for f,c in hole.fish do
+ for i in 1,c do
+ AddFishingSchool(hole.kind, f, zidx, hole.x, hole.y);
+ end
+ end
+ else
+ AddFishingSchool(hole.kind, nil, zidx, hole.x, hole.y);
+ end
+ end
+ end
+ end
+end
+FishingBuddy.Schools.CollapseHoles = CollapseHoles;
diff --git a/FishingSetup.lua b/FishingSetup.lua
index f1eba14..1eba225 100755
--- a/FishingSetup.lua
+++ b/FishingSetup.lua
@@ -2,91 +2,45 @@
--
-- Load out translation strings and such
-FishingBuddy = {};
-
-FishingBuddy.VERSION = "0.8.6h";
-FishingBuddy.CURRENTVERSION = 8600;
+FishingBuddy.VERSION = GetAddOnMetadata("FishingBuddy", "Version");
+FishingBuddy.CURRENTVERSION = 8800;
FishingBuddy.Colors = {};
FishingBuddy.Colors.RED = "ffff0000";
FishingBuddy.Colors.GREEN = "ff00ff00";
FishingBuddy.Colors.BLUE = "ff0000ff";
+FishingBuddy.Colors.YELLOW = "ff00ffff";
+FishingBuddy.Colors.PURPLE = "ffff00ff";
FishingBuddy.Colors.WHITE = "ffffffff";
--- debugging
+FishingBuddy.DEFAULT_MINIMAP_POSITION = 256;
-FishingBuddy.printable = function(foo)
- if ( foo ) then
- if ( type(foo) == "table" ) then
- return "table";
- elseif ( type(foo) == "boolean" ) then
- if ( foo ) then
- return "true";
- else
- return "false";
- end
- else
- return foo;
- end
- else
- return "nil";
- end
-end
+local Setup = {};
-FishingBuddy.Output = function(msg, r, g, b)
- if ( DEFAULT_CHAT_FRAME ) then
- if ( not r ) then
- DEFAULT_CHAT_FRAME:AddMessage(msg);
- else
- DEFAULT_CHAT_FRAME:AddMessage(msg, r, g, b);
- end
- end
-end
-
-local FishingBuddy_Debugging = 1;
-FishingBuddy.Debug = function(msg, fixlinks)
- if ( FishingBuddy_Debugging == 1 ) then
- if ( fixlinks ) then
- msg = string.gsub(msg, "|", ";");
- end
- local name = FishingBuddy.Name or "Fishing Buddy";
- FishingBuddy.Output("|c"..FishingBuddy.Colors.RED..name.." DEBUG|r "..msg);
- end
-end
-
-FishingBuddy.Dump = function(thing)
- if ( FishingBuddy_Debugging == 1 ) then
- if ( DevTools_Dump ) then
- DevTools_Dump(thing);
- else
- FishingBuddy.Debug("Tried to dump a '"..FishingBuddy.printable(thing).."'.");
- end
- end
-end
-
-local function LoadTranslation(lang)
- local translation = FishingTranslations[lang];
- for tag,value in translation do
- if ( not FishingBuddy[tag] ) then
- FishingBuddy[tag] = value;
- end
- end
-end
-
-local function FixupThis(tag, what)
+Setup.FixupThis = function(tag, what)
if ( type(what) == "table" ) then
for idx,str in what do
- what[idx] = FixupThis(tag, str);
+ what[idx] = Setup.FixupThis(tag, str);
end
return what;
elseif ( type(what) == "string" ) then
- local pattern = "#([A-Z0-9]+)#";
+ local pattern = "#([A-Z0-9_]+)#";
local s,e,w = string.find(what, pattern);
while ( w ) do
- local s1 = strsub(what, 1, s-1);
- local s2 = strsub(what, e+1);
- what = s1..FishingBuddy[w]..s2;
- s,e,w = string.find(what, pattern);
+ if ( type(FishingBuddy[w]) == "string" ) then
+ local s1 = strsub(what, 1, s-1);
+ local s2 = strsub(what, e+1);
+ what = s1..FishingBuddy[w]..s2;
+ s,e,w = string.find(what, pattern);
+ elseif ( FishingBuddy.Colors[w] ) then
+ local s1 = strsub(what, 1, s-1);
+ local s2 = strsub(what, e+1);
+ what = s1..FishingBuddy.Colors[w]..s2;
+ s,e,w = string.find(what, pattern);
+ else
+ -- stop if we can't find something to replace it with
+ w = nil;
+ end
end
return what;
else
@@ -95,15 +49,15 @@ local function FixupThis(tag, what)
end
end
-local function FixupStrings()
+Setup.FixupStrings = function(locale)
local translation = FishingTranslations["enUS"];
- for tag,str in translation do
- FishingBuddy[tag] = FixupThis(tag, str);
+ for tag,_ in translation do
+ FishingBuddy[tag] = Setup.FixupThis(tag, FishingBuddy[tag]);
end
end
-local function FixupBindings(lang)
- local translation = FishingTranslations[lang];
+Setup.FixupBindings = function()
+ local translation = FishingTranslations["enUS"];
for tag,str in translation do
if ( string.find(tag, "^BINDING") ) then
setglobal(tag, FishingBuddy[tag]);
@@ -112,18 +66,48 @@ local function FixupBindings(lang)
end
end
-local locale = GetLocale();
-LoadTranslation(locale);
-if ( locale ~= "enUS" ) then
- LoadTranslation("enUS");
+local missing = {};
+Setup.LoadTranslation = function(lang, record)
+ local translation = FishingTranslations[lang];
+ for tag,value in translation do
+ if ( not FishingBuddy[tag] ) then
+ FishingBuddy[tag] = value;
+ if ( record ) then
+ missing[tag] = 1;
+ end
+ end
+ end
end
-FixupStrings();
-FixupBindings(locale);
+Setup.Translate = function()
+ local locale = GetLocale();
+ if ( FBEnEspagnolFlag ) then
+ locale = "esES";
+ end
+ --locale = "deDE";
+ Setup.LoadTranslation(locale);
+ if ( locale ~= "enUS" ) then
+ Setup.LoadTranslation("enUS");
+ end
+ Setup.FixupStrings(locale);
+ Setup.FixupBindings();
+end
+
+Setup.Translate();
+
+-- throw all this away now that we're done with it
+Setup = nil;
-- dump the memory we've allocated for all the translations
FishingTranslations = nil;
-FishingBuddy.BYWEEKS_TABLE = {["Jan"] = 0, ["Apr"] = 13, ["Jul"] = 26, ["Oct"] = 39, ["Dec"] = 52};
+local byweeks = {};
+byweeks[FishingBuddy.ABBREV_JANUARY] = 0;
+byweeks[FishingBuddy.ABBREV_APRIL] = 13;
+byweeks[FishingBuddy.ABBREV_JULY] = 26;
+byweeks[FishingBuddy.ABBREV_OCTOBER] = 39;
+byweeks[FishingBuddy.ABBREV_DECEMBER] = 52;
+
+FishingBuddy.BYWEEKS_TABLE = byweeks;
FishingBuddy.KEYS_NONE = 0;
FishingBuddy.KEYS_SHIFT = 1;
@@ -134,3 +118,10 @@ FishingBuddy.Keys[FishingBuddy.KEYS_NONE] = FishingBuddy.KEYS_NONE_TEXT;
FishingBuddy.Keys[FishingBuddy.KEYS_SHIFT] = FishingBuddy.KEYS_SHIFT_TEXT;
FishingBuddy.Keys[FishingBuddy.KEYS_CTRL] = FishingBuddy.KEYS_CTRL_TEXT;
FishingBuddy.Keys[FishingBuddy.KEYS_ALT] = FishingBuddy.KEYS_ALT_TEXT;
+
+FishingBuddy.SCHOOL_FISH = 0;
+FishingBuddy.SCHOOL_WRECKAGE = 1;
+FishingBuddy.SCHOOL_DEBRIS = 2;
+FishingBuddy.SCHOOL_WATER = 3;
+FishingBuddy.SCHOOL_TASTY = 4;
+FishingBuddy.SCHOOL_OIL = 5;
diff --git a/FishingTrackingFrame.lua b/FishingTrackingFrame.lua
index 83140d4..cdfd4d2 100755
--- a/FishingTrackingFrame.lua
+++ b/FishingTrackingFrame.lua
@@ -13,21 +13,33 @@ local trackingWordMap = {
local byhours = {
[13759] = {
- ["n"] = "Raw Nightfin Snapper",
+ ["enUS"] = "Raw Nightfin Snapper",
+ ["ruRU"] = "Сырой ночной луциан",
+ ["deDE"] = "Roher Nachtflossenschnapper",
+ ["frFR"] = "Lutjan nagenuit cru",
["c"] = { r = 0.5, g = 0.5, b = 1.0, a = 0.75 },
},
[13760] = {
- ["n"] = "Raw Sunscale Salmon",
- ["c"] = { r = 0.8, g = 0.8, b = 0.1, a = 0.75 },
+ ["enUS"] = "Raw Sunscale Salmon",
+ ["ruRU"] = "Сырой радужный лосось",
+ ["deDE"] = "Roher Sonnenschuppenlachs",
+ ["frFR"] = "Saumon sol\195\169caille cru",
+ ["c"] = { r = 0.8, g = 0.8, b = 0.1, a = 0.75 },
},
};
local byweeks = {
[13756] = {
- ["n"] = "Raw Summer Bass",
+ ["enUS"] = "Raw Summer Bass",
+ ["ruRU"] = "Сырой летний окунь",
+ ["deDE"] = "Roher Sommerbarsch",
+ ["frFR"] = "Perche estivale crue",
["c"] = { r = 1.0, g = 1.0, b = 0.0, a = 0.75 },
},
[13755] = {
- ["n"] = "Winter Squid",
+ ["enUS"] = "Winter Squid",
+ ["ruRU"] = "Зимний кальмар",
+ ["deDE"] = "Winterkalmar",
+ ["frFR"] = "Calmar hivernal",
["c"] = { r = 0.4, g = 0.1, b = 0.4, a = 0.75 },
},
};
@@ -75,6 +87,7 @@ local function TrackThis(how, id, color, name)
FishingBuddy_Info["FishTracking"][how][id].color = color;
end
end
+FishingBuddy.TrackThis = TrackThis;
FishingBuddy.Commands[FishingBuddy.TRACK] = {};
FishingBuddy.Commands[FishingBuddy.TRACK].args = {};
@@ -146,6 +159,18 @@ end
FishingBuddy.AddTracking = function(id, name)
local ft = FishingBuddy_Info["FishTracking"];
local index, how;
+
+ -- clean up fish removed from the tracking system
+ local hourly = ft["HOURLY"][id];
+ local weekly = ft["WEEKLY"][id];
+ if ( hourly and hourly.nevermore ) then
+ FishingBuddy_Info["FishTracking"]["HOURLY"][id] = nil;
+ end
+ if ( weekly and weekly.nevermore ) then
+ FishingBuddy_Info["FishTracking"]["WEEKLY"][id] = nil;
+ end
+
+ ft = FishingBuddy_Info["FishTracking"];
if ( ft["HOURLY"][id] ) then
how = "HOURLY";
index,_ = GetGameTime();
@@ -166,33 +191,19 @@ FishingBuddy.AddTracking = function(id, name)
return true;
end
-local function PlotData(graph, num, bw, bs, tab, hlabels)
- local plotem = {};
+local function PlotData(graph, num, bw, bs, graphdata, plotthese, hlabels)
local maxval = 0;
local width = 0;
- local plotted = false;
- local fdx = 1;
local line;
- local mv = 0;
- for _,info in tab do
- plotem[fdx] = false;
- -- our data is zero based...
- local n = table.getn(info.data);
- width = n * (bw+bs);
- n = n - 1;
- for idx=0,n do
- if ( info.data[idx] > mv ) then
- mv = info.data[idx];
- end
+ GraphHandler.ClearPlot(graph);
+ for _,info in graphdata do
+ if ( info.maxval and info.maxval > maxval ) then
+ maxval = info.maxval;
end
- if ( mv > 0 ) then
- if ( mv > maxval ) then
- maxval = mv;
- end
- plotem[fdx] = true;
- plotted = true;
+ local w = info.count * (bw+bs);
+ if ( w > width ) then
+ width = w;
end
- fdx = fdx + 1;
end
local delta = math.mod(maxval, 5);
if ( delta > 0 ) then
@@ -202,45 +213,175 @@ local function PlotData(graph, num, bw, bs, tab, hlabels)
graph.barWidth = bw;
graph.barSpacing = bs;
local count = num;
- fdx = 1;
- for id, info in tab do
- if ( count > 0 and plotem[fdx] ) then
- local c = info.color or {};
- local item, texture, _, _, _ = FishingBuddy.GetFishie(id);
- GraphHandler.PlotLegend(graph, num-count+1, info.name, id,
- texture, c.r, c.g, c.b);
- local w = GraphHandler.PlotData(graph, info.data, num-count, 1,
+ for idx,fishid in plotthese do
+ local info = graphdata[fishid];
+ local c = info.color;
+ GraphHandler.PlotLegend(graph, num-count+1,
+ info.name, info.item, info.texture,
+ c.r, c.g, c.b);
+ _ = GraphHandler.PlotData(graph, info.data, num-count, 1,
c.r, c.g, c.b);
- if ( info.name ) then
- if ( line ) then
- line = line.." / "..info.name;
- else
- line = info.name;
- end
- end
- count = count - 1;
+ if ( line ) then
+ line = line.." / "..info.name;
+ else
+ line = info.name;
end
- fdx = fdx + 1;
+ count = count - 1;
end
- if ( plotted ) then
- local values = {};
- local delta = maxval/5;
- for v=0,5 do
- values[string.format("%d", v*delta)] = v;
+ local values = {};
+ local delta = maxval/5;
+ for v=0,5 do
+ values[string.format("%d", v*delta)] = v;
+ end
+ GraphHandler.PlotGrid(graph, line or "", values, width, hlabels);
+end
+
+local function UpdateGraphData(id, info)
+ local maxval = 0;
+ local n = table.getn(info.data);
+ info.count = n;
+ -- we're zero based
+ n = n - 1;
+ for idx=0,n do
+ if ( info.data[idx] > maxval ) then
+ maxval = info.data[idx];
end
- GraphHandler.PlotGrid(graph, line or "", values, width, hlabels);
+ end
+ info.maxval = maxval;
+ info.data = info.data;
+ if ( not info.color ) then
+ info.color = {};
else
- GraphHandler.PlotGrid(graph, FishingBuddy.NODATAMSG );
+ if ( type(info.color) == "string") then
+ local a = tonumber(string.sub(color,1,2),16);
+ local r = tonumber(string.sub(color,3,4),16);
+ local g = tonumber(string.sub(color,5,6),16);
+ local b = tonumber(string.sub(color,7,8),16);
+ info.color = { a = a, r = r, g = g, b = b };
+ end
+ end
+ local name;
+ info.item, info.texture, _, _, _, name = FishingBuddy.GetFishie(id);
+ local loc = GetLocale();
+ if ( not info.name ) then
+ if ( byhours[id] and byhours[id][loc] ) then
+ info.name = byhours[id][loc];
+ elseif ( byweeks[d] and byweeks[id][loc] ) then
+ info.name = byweeks[id][loc];
+ elseif ( not name ) then
+ info.name = FishingBuddy.FISH.." ("..id..")";
+ else
+ info.name = name;
+ end
+ end
+ info.name = FishingBuddy.StripRaw(info.name);
+end
+
+local function DrawTrackingGraph(how, num, bw, bs)
+ local fi = FishingBuddy_Info["FishTracking"];
+ local graph;
+ local labels;
+ if ( how == "HOURLY" ) then
+ graph = getglobal("FishingTrackingFrameGraph1");
+ labels = {["00:00"] = 0, ["06:00"] = 6, ["12:00"] = 12, ["18:00"] = 18, ["23:59"] = 24};
+ if ( not num ) then
+ num = 2;
+ bw = 5;
+ bs = 5;
+ end
+ else
+ graph = getglobal("FishingTrackingFrameGraph2");
+ labels = FishingBuddy.BYWEEKS_TABLE;
+ if ( not num ) then
+ num = 2;
+ bw = 3;
+ bs = 2;
+ end
+ end
+ local plotthese = {};
+ local count = 0;
+ graph.tracking = how;
+ for id,info in fi[how] do
+ UpdateGraphData(id, info);
+ if ( count < num and fi[how][id].plot == 1 ) then
+ count = count + 1;
+ tinsert(plotthese, id);
+ end
+ end
+ PlotData(graph, num, bw, bs, fi[how], plotthese, labels);
+end
+
+local function DrawTrackingGraphs()
+ DrawTrackingGraph("HOURLY");
+ DrawTrackingGraph("WEEKLY");
+end
+
+local function PlotFishToggle(fishid, how)
+ local tab = FishingBuddy_Info["FishTracking"][how];
+ if ( not tab[fishid].plot ) then
+ tab[fishid].plot = 1;
+ else
+ tab[fishid].plot = 1 - tab[fishid].plot;
+ end
+ DrawTrackingGraph(how);
+end
+
+local PlotToggleFunctions = {};
+local function PlotMakeToggle(fishid, how)
+ if ( not PlotToggleFunctions[fishid] ) then
+ local id = fishid;
+ local h = how;
+ PlotToggleFunctions[fishid] = function() PlotFishToggle(id, h); end;
+ end
+ return PlotToggleFunctions[fishid];
+end
+
+local function PlotMenuInitialize()
+ local fi = FishingBuddy_Info["FishTracking"];
+ local ff = FishingBuddy_Info["Fishies"];
+ local how = this.tracking;
+ local locale = GetLocale();
+ for id,_ in fi[how] do
+ if ( not fi[how][id].plot ) then
+ fi[how][id].plot = 1;
+ end
+ info = {};
+ if ( ff[id] and ff[id].name ) then
+ info.text = ff[id].name;
+ elseif ( byhours[id] ) then
+ info.text = byhours[id][locale];
+ elseif ( byweeks[id] ) then
+ info.text = byweeks[id][locale];
+ end
+ if ( info.text ) then
+ info.func = PlotMakeToggle(id, how);
+ info.checked = ( fi[how][id].plot == 1 );
+ UIDropDownMenu_AddButton(info);
+ end
+ end
+end
+
+FishingBuddy.TrackingFrame.OnClick = function(button, graph)
+ if ( button == "RightButton" ) then
+ local menu = getglobal("FishingBuddyGraphMenu");
+ menu.tracking = this.tracking;
+ menu.point = "CENTER";
+ menu.relativePoint = "CENTER";
+ UIDropDownMenu_Initialize(menu, PlotMenuInitialize, "MENU");
+ FishingBuddy.ToggleDropDownMenu(1, nil, menu, this, 0, 0);
end
- return width, maxval, line;
end
FishingBuddy.TrackingFrame.OnShow = function()
- local fi = FishingBuddy_Info["FishTracking"];
- local graph1 = getglobal("FishingTrackingFrameGraph1");
- local graph2 = getglobal("FishingTrackingFrameGraph2");
-
- PlotData(graph1, 2, 5, 5, fi["HOURLY"],
- {["00:00"] = 0, ["06:00"] = 6, ["12:00"] = 12, ["18:00"] = 18, ["23:59"] = 24});
- PlotData(graph2, 2, 3, 2, fi["WEEKLY"], FishingBuddy.BYWEEKS_TABLE);
+ DrawTrackingGraphs();
end
+
+FishingBuddy.TrackingFrame.OnEnter = function()
+ GameTooltip_AddNewbieTip(FishingBuddy.TRACKINGFRAME, 1.0, 1.0, 1.0,
+ FishingBuddy.TRACKINGFRAME_CLICKS, 1);
+end
+
+FishingBuddy.TrackingFrame.OnLeave = function()
+ GameTooltip:Hide();
+end
+
diff --git a/FishingTrackingFrame.xml b/FishingTrackingFrame.xml
index f5e841a..8e68b9c 100755
--- a/FishingTrackingFrame.xml
+++ b/FishingTrackingFrame.xml
@@ -92,6 +92,14 @@
+
+
+
+ this:SetFrameLevel(0);
+ UIDropDownMenu_SetWidth(180);
+
+
+
@@ -99,10 +107,21 @@
-
+
+
+
+ FishingBuddy.TrackingFrame.OnClick(arg1);
+
+
+ FishingBuddy.TrackingFrame.OnEnter();
+
+
+ FishingBuddy.TrackingFrame.OnLeave();
+
+
@@ -115,6 +134,17 @@
+
+
+ FishingBuddy.TrackingFrame.OnClick(arg1);
+
+
+ FishingBuddy.TrackingFrame.OnEnter();
+
+
+ FishingBuddy.TrackingFrame.OnLeave();
+
+
diff --git a/FishingWatcher.lua b/FishingWatcher.lua
index ed976ef..71d231a 100755
--- a/FishingWatcher.lua
+++ b/FishingWatcher.lua
@@ -7,121 +7,113 @@ local WATCHDRAGGER_SHOW_DELAY = 0.2;
local WATCHDRAGGER_FADE_TIME = 0.15;
-local DRAGFRAME_TEXTURES = {
- "Background",
- "TopLeft",
- "TopRight",
- "BottomLeft",
- "BottomRight",
- "Top",
- "Bottom",
- "Left",
- "Right"
-};
+local function PlaceDraggerFrame()
+ local where = FishingBuddy.GetSetting("WatcherLocation");
+ if ( not where ) then
+ where = {};
+ where.x = 0;
+ where.y = -384;
+ end
+ FishingWatchDrag:ClearAllPoints();
+ FishingWatchDrag:SetPoint("TOPLEFT", "UIParent", "TOPLEFT",
+ where.x, where.y);
+end
local function ShowDraggerFrame()
- if ( not FishingWatchDragFrame:IsVisible() ) then
+ if ( not FishingWatchDrag:IsVisible() ) then
+ FishingWatchFrame:Show();
local width = FishingWatchFrame:GetWidth();
local height = FishingWatchFrame:GetHeight();
- FishingWatchDragFrame:SetHeight(height);
- FishingWatchDragFrame:SetWidth(width);
- FishingWatchDragFrame:Show();
- for index, value in DRAGFRAME_TEXTURES do
- UIFrameFadeIn(getglobal("FishingWatchDragFrame"..value), WATCHDRAGGER_FADE_TIME, 0, 0.25);
- end
+ FishingWatchDrag:SetHeight(height);
+ FishingWatchDrag:SetWidth(width);
+ FishingWatchTab:SetText(FishingBuddy.NAME);
+ PanelTemplates_TabResize(10, FishingWatchTab);
+ FishingWatchDrag:Show();
+ FishingWatchTab:Show();
+ UIFrameFadeIn(FishingWatchDrag, WATCHDRAGGER_FADE_TIME, 0, 0.15);
+ UIFrameFadeIn(FishingWatchTab, WATCHDRAGGER_FADE_TIME, 0, 1.0);
+ GameTooltip_AddNewbieTip(FishingBuddy.NAME, 1.0, 1.0, 1.0,
+ FishingBuddy.WATCHERCLICKHELP, 1);
end
end
-local function HideDraggerFrame()
- if ( FishingWatchDragFrame:IsVisible() ) then
- for index, value in DRAGFRAME_TEXTURES do
- UIFrameFadeOut(getglobal("FishingWatchDragFrame"..value), WATCHDRAGGER_FADE_TIME, 0.25, 0);
+local function HideDraggerFrame(save)
+ if ( FishingWatchDrag:IsVisible() ) then
+ if ( save ) then
+ FishingWatchFrame:Show();
+ local qx = UIParent:GetLeft()
+ local qy = UIParent:GetTop();
+ local wx = FishingWatchDrag:GetLeft()
+ local wy = FishingWatchDrag:GetTop();
+ local where;
+ if ( wx and wy ) then
+ where = {};
+ where.x = wx - qx;
+ where.y = wy - qy;
+ end
+ FishingBuddy.SetSetting("WatcherLocation", where);
end
- FishingWatchDragFrame:Hide();
- local qx, qy = UIParent:GetCenter();
- local wx, wy = FishingWatchDragFrame:GetCenter();
- local where = {};
- where.x = qx - wx;
- where.y = wy - qy;
- FishingBuddy.SetSetting("WatcherLocation", where);
+ UIFrameFadeOut(FishingWatchDrag, WATCHDRAGGER_FADE_TIME, 0.15, 0);
+ UIFrameFadeOut(FishingWatchTab, WATCHDRAGGER_FADE_TIME, 1.0, 0);
+ FishingWatchDrag:Hide();
+ FishingWatchTab:Hide();
+ GameTooltip:Hide();
end
end
+local function ResetWatcherFrame(update)
+ FishingWatchTab:Show();
+ FishingWatchDrag:Show();
+ FishingWatchDrag:ClearAllPoints();
+ FishingWatchDrag:SetPoint("CENTER", "UIParent", "CENTER", 0, 0);
+ HideDraggerFrame(true);
+ if ( update ) then
+ FishingBuddy.WatchUpdate();
+ end
+end
+
+FishingBuddy.ShowDraggerFrame = ShowDraggerFrame;
+FishingBuddy.HideDraggerFrame = HideDraggerFrame;
+FishingBuddy.PlaceDraggerFrame = PlaceDraggerFrame;
+FishingBuddy.ResetWatcherFrame = ResetWatcherFrame;
+
FishingBuddy.Commands[FishingBuddy.WATCHER] = {};
FishingBuddy.Commands[FishingBuddy.WATCHER].help = FishingBuddy.WATCHER_HELP;
FishingBuddy.Commands[FishingBuddy.WATCHER].func =
function(what)
if ( what and ( what == FishingBuddy.RESET ) ) then
- FishingWatchDragFrame:ClearAllPoints();
- FishingWatchDragFrame:SetPoint("CENTER", "UIParent",
- "CENTER", 0, 0);
- FishingWatchDragFrame:Hide();
- FishingBuddy.SetSetting("WatcherLocation", nil);
- return true;
+ ResetWatcherFrame(true);
+ return true;
end
end;
--- handle really old versions
-local function UpdateUnknownZones(zone, subzone)
- if ( FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN] ) then
- if ( FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN][subzone] ) then
- if ( not FishingBuddy_Info["FishingHoles"][zone] ) then
- FishingBuddy_Info["FishingHoles"][zone] = { };
- tinsert(FishingBuddy.SortedZones, zone);
- table.sort(FishingBuddy.SortedZones);
- end
- if ( not FishingBuddy_Info["FishingHoles"][zone][subzone] ) then
- FishingBuddy_Info["FishingHoles"][zone][subzone] = { };
- end
- for k,v in FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN][subzone] do
- FishingBuddy_Info["FishingHoles"][zone][subzone][k] = v;
- end
- FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN][subzone] = nil;
- end
- FishingBuddy.Locations.DataChanged(zone, subzone);
- -- Duh, table.getn doesn't work because there aren't any integer
- -- keys in this table
- if ( next(FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN]) == nil ) then
- FishingBuddy_Info["FishingHoles"][FishingBuddy.UNKNOWN] = nil;
- local pos;
- while ( pos < table.getn(FishingBuddy.SortedZones) ) do
- if ( FishingBuddy.SortedZones[pos] == FishingBuddy.UNKNOWN ) then
- break;
+-- fix old data
+local function UpdateUnknownZone(zone, subzone, zidx, sidx)
+ local uzidx = FishingBuddy.GetZoneIndex(FishingBuddy.UNKNOWN);
+ if ( uzidx ) then
+ local fh = FishingBuddy_Info["FishingHoles"];
+ for usidx in fh[uzidx] do
+ local uszone = FishingBuddy_Info["SubZones"][uzidx][usidx];
+ if ( uszone == subzone ) then
+ for k,v in fh[uzidx][usidx] do
+ if ( fh[zidx][sidx][k] ) then
+ fh[zidx][sidx][k] = fh[zidx][sidx][k] + v;
+ else
+ fh[zidx][sidx][k] = v;
+ end
+ end
+ for k,_ in fh[uzidx][usidx] do
+ fh[uzidx][usidx][k] = nil;
end
- pos = pos + 1;
- end
- tremove(FishingBuddy.SortedZones, pos);
- end
- end
-end
-
--- fix a bug where we were recording 'GetZoneText' instead
--- of 'GetRealZoneText'
-local function UpdateRealZones(zone, subzone)
- local oldzone = GetZoneText();
- if ( FishingBuddy_Info["FishingHoles"][oldzone] and oldzone ~= zone ) then
- if ( not FishingBuddy_Info["FishingHoles"][zone] ) then
- FishingBuddy_Info["FishingHoles"][zone] = { };
- end
- for oldsubzone in FishingBuddy_Info["FishingHoles"][oldzone] do
- local sub = oldsubzone;
- if ( oldsubzone == oldzone ) then
- sub = subzone;
- end
- if ( not FishingBuddy_Info["FishingHoles"][zone][sub] ) then
- FishingBuddy_Info["FishingHoles"][zone][sub] = {};
- end
- for k,v in FishingBuddy_Info["FishingHoles"][oldzone][oldsubzone] do
- FishingBuddy_Info["FishingHoles"][zone][sub][k] = v;
end
end
- FishingBuddy_Info["FishingHoles"][oldzone] = nil;
end
end
-- Fish watcher functions
FishingBuddy.WatchUpdate = function()
if ( FishingWatchFrame:IsVisible() ) then
+ HideDraggerFrame();
FishingWatchFrame:Hide();
for i=1, MAX_FISHINGWATCH_LINES, 1 do
local line = getglobal("FishingWatchLine"..i);
@@ -129,50 +121,60 @@ FishingBuddy.WatchUpdate = function()
end
end
+ local reset = FishingBuddy.GetSetting("ResetWatcher");
+ if ( not reset or reset < 1 ) then
+ ResetWatcherFrame(false);
+ FishingBuddy.SetSetting("ResetWatcher", 1);
+ end
+
local zone, subzone = FishingBuddy.GetZoneInfo();
+ local zidx, sidx = FishingBuddy.GetZoneIndex(zone, subzone);
- UpdateUnknownZones(zone, subzone);
- UpdateRealZones(zone, subzone);
+ UpdateUnknownZone();
- local fz = FishingBuddy_Info["FishingHoles"][zone];
- if ( FishingBuddy.GetSetting("WatchFishies") == 0 or
- not fz or not fz[subzone] ) then
+ if ( FishingBuddy.GetSetting("WatchFishies") == 0 ) then
return;
end
if ( FishingBuddy.GetSetting("WatchOnlyWhenFishing") == 1 and
- not FishingBuddy.IsFishingPole() ) then
+ not FishingBuddy.API.IsFishingPole() ) then
return;
end
+ local fz = FishingBuddy_Info["FishingHoles"][zidx];
local current = FishingBuddy.currentFishies;
local ff = FishingBuddy_Info["Fishies"];
local fishsort = {};
local totalCount = 0;
local totalCurrent = 0;
local gotDiffs = false;
- for fishid in fz[subzone] do
- local info = {};
- info.text = ff[fishid].name;
- info.count = fz[subzone][fishid];
- totalCount = totalCount + info.count;
- if ( current[subzone] ) then
- info.current = current[subzone][fishid] or 0;
- else
- info.current = 0;
- end
- if ( info.current > 0 and info.current ~= info.count ) then
- gotDiffs = true;
- end
- totalCurrent = totalCurrent + info.current;
- tinsert(fishsort, info);
- end
- if ( totalCount == 0 ) then
- return;
- end
+ if ( fz and fz[sidx] ) then
+ for fishid in fz[sidx] do
+ local info = {};
+ if ( not FishingBuddy_Info["HiddenFishies"][fishid] ) then
+ info.text = ff[fishid].name;
+ end
+ info.count = fz[sidx][fishid];
+ totalCount = totalCount + info.count;
+ if ( current[sidx] ) then
+ info.current = current[sidx][fishid] or 0;
+ else
+ info.current = 0;
+ end
+ if ( info.current > 0 and info.current ~= info.count ) then
+ gotDiffs = true;
+ end
+ totalCurrent = totalCurrent + info.current;
+ tinsert(fishsort, info);
+ end
- FishingBuddy.FishSort(fishsort);
+-- if ( totalCount == 0 and totalCurrent == 0 ) then
+-- return;
+-- end
+
+ FishingBuddy.FishSort(fishsort);
+ end
local fishingWatchMaxWidth = 0;
local tempWidth;
@@ -195,6 +197,7 @@ FishingBuddy.WatchUpdate = function()
local entry = getglobal("FishingWatchLine"..index);
local skill, mods = FishingBuddy.GetCurrentSkill();
local line = "Skill: |cff00ff00"..skill.."+"..mods.."|r";
+ local StartedFishing = FishingBuddy.StartedFishing;
if ( StartedFishing ) then
local elapsed = GetTime() - StartedFishing;
local t = math.floor(elapsed);
@@ -231,71 +234,59 @@ FishingBuddy.WatchUpdate = function()
if( index <= MAX_FISHINGWATCH_LINES ) then
local entry = getglobal("FishingWatchLine"..index);
local fishie = info.text;
- local amount = info.count;
- local s,e = string.find(fishie, FishingBuddy.RAW.." ");
- if ( s ) then
- if ( s > 1 ) then
- fishie = string.sub(fishie, 1, s-1)..string.sub(fishie, e+1);
- else
- fishie = string.sub(fishie, e+1);
+ if ( fishie ) then
+ fishie = FishingBuddy.StripRaw(fishie);
+ local amount = info.count;
+ local fishietext = fishie.." ("..amount;
+ if ( dopercent == 1 ) then
+ local percent = format("%.1f", ( amount / totalCount ) * 100);
+ fishietext = fishietext.." : "..percent.."%";
end
- else
- s,e = string.find(fishie, " "..FishingBuddy.RAW);
- if ( s ) then
- fishie = string.sub(fishie, 1, s-1)..string.sub(fishie, e+1);
+ if ( gotDiffs ) then
+ amount = info.current;
+ local color;
+ fishietext = fishietext..", |c"..FishingBuddy.Colors.GREEN..amount;
+ if ( dopercent == 1 ) then
+ local percent = format("%.1f", ( amount / totalCurrent ) * 100);
+ fishietext = fishietext.." : "..percent.."%";
+ end
+ fishietext = fishietext.."|r";
end
- end
- local fishietext = fishie.." ("..amount;
- if ( dopercent == 1 ) then
- local percent = format("%.1f", ( amount / totalCount ) * 100);
- fishietext = fishietext.." : "..percent.."%";
- end
- if ( gotDiffs ) then
- amount = info.current;
- local color;
- fishietext = fishietext..", |c"..FishingBuddy.Colors.GREEN..amount;
- if ( dopercent == 1 ) then
- local percent = format("%.1f", ( amount / totalCurrent ) * 100);
- fishietext = fishietext.." : "..percent.."%";
- end
- fishietext = fishietext.."|r";
- end
- fishietext = fishietext..")";
- entry:SetText(fishietext);
- tempWidth = entry:GetWidth();
- entry:Show();
- if ( tempWidth > fishingWatchMaxWidth ) then
- fishingWatchMaxWidth = tempWidth;
+ fishietext = fishietext..")";
+ entry:SetText(fishietext);
+ tempWidth = entry:GetWidth();
+ entry:Show();
+ if ( tempWidth > fishingWatchMaxWidth ) then
+ fishingWatchMaxWidth = tempWidth;
+ end
+ index = index + 1;
end
end
- index = index + 1;
end
- FishingWatchFrame:SetHeight(index * 13);
+ FishingWatchFrame:SetHeight((index - 1) * 13);
FishingWatchFrame:SetWidth(fishingWatchMaxWidth + 10);
+ ShowDraggerFrame();
+ PlaceDraggerFrame();
FishingWatchFrame:Show();
end
FishingBuddy.WatchFrame.OnLoad = function()
- local where = FishingBuddy.GetSetting("WatcherLocation");
- if ( not where ) then
- where = {};
- where.x = 0;
- where.y = 0;
- end
- FishingWatchDragFrame:ClearAllPoints();
- FishingWatchDragFrame:SetPoint("CENTER", "UIParent", "CENTER",
- where.x, where.y);
- FishingWatchDragFrame:Hide();
-
this:ClearAllPoints();
- this:SetPoint("TOPRIGHT", "FishingWatchDragFrame", "TOPRIGHT", 0, 0);
+ this:SetPoint("TOPLEFT", "FishingWatchDrag", "TOPLEFT", 0, 0);
+
+ -- Make everything draw at least once
+ FishingWatchDrag:Show();
+ FishingWatchTab:Show();
+ FishingWatchDrag:Hide();
+ FishingWatchTab:Hide();
end
local hover;
FishingBuddy.WatchFrame.OnUpdate = function(elapsed)
if ( FishingWatchFrame:IsVisible() ) then
- if ( MouseIsOver(FishingWatchFrame) ) then
+ if ( MouseIsOver(FishingWatchFrame) or
+ ( FishingWatchTab:IsVisible() and MouseIsOver(FishingWatchTab) ) ) then
local xPos, yPos = GetCursorPosition();
if ( hover ) then
if ( hover.xPos == xPos and hover.yPos == yPos ) then
@@ -315,12 +306,68 @@ FishingBuddy.WatchFrame.OnUpdate = function(elapsed)
ShowDraggerFrame();
end
else
- HideDraggerFrame();
+ HideDraggerFrame(true);
hover = nil;
end
elseif ( hover ) then
- HideDraggerFrame();
+ HideDraggerFrame(true);
hover = nil;
end
end
+FishingBuddy.WatchFrame.OnMouseDown = function()
+ if ( arg1 == "LeftButton" ) then
+ FishingWatchDrag:StartMoving();
+ end
+end
+
+FishingBuddy.WatchFrame.OnMouseUp = function()
+ if ( arg1 == "LeftButton" ) then
+ FishingWatchDrag:StopMovingOrSizing();
+ end
+end
+
+local function HiddenFishToggle(id)
+ if ( FishingBuddy_Info["HiddenFishies"][id] ) then
+ FishingBuddy_Info["HiddenFishies"][id] = nil;
+ else
+ FishingBuddy_Info["HiddenFishies"][id] = true;
+ end;
+ FishingBuddy.WatchUpdate();
+end
+
+-- save some memory by keeping one copy of each one
+local WatcherToggleFunctions = {};
+-- let's use closures
+local function WatcherMakeToggle(fishid)
+ if ( not WatcherToggleFunctions[fishid] ) then
+ local id = fishid;
+ WatcherToggleFunctions[fishid] = function() HiddenFishToggle(id); end;
+ end
+ return WatcherToggleFunctions[fishid];
+end
+FishingBuddy.WatchFrame.MakeToggle = WatcherMakeToggle;
+
+local function WatchMenu_Initialize()
+ local zidx, sidx = FishingBuddy.GetZoneIndex();
+ local fz = FishingBuddy_Info["FishingHoles"][zidx];
+ if ( fz and fz[sidx] ) then
+ local ff = FishingBuddy_Info["Fishies"];
+ for fishid in fz[sidx] do
+ info = {};
+ info.text = ff[fishid].name;
+ info.func = WatcherMakeToggle(fishid);
+ info.checked = ( not FishingBuddy_Info["HiddenFishies"][fishid] );
+ info.keepShownOnClick = 1;
+ UIDropDownMenu_AddButton(info);
+ end
+ end
+end
+
+FishingBuddy.WatchFrame.OnClick = function()
+ if ( arg1 == "RightButton" ) then
+ local menu = getglobal("FishingBuddyWatcherMenu");
+ UIDropDownMenu_Initialize(menu, WatchMenu_Initialize, "MENU");
+ ToggleDropDownMenu(level, nil, menu, "FishingWatchDrag", 0, 0);
+ end
+end
diff --git a/FishingWatcher.xml b/FishingWatcher.xml
index 4aaae29..9896fb1 100755
--- a/FishingWatcher.xml
+++ b/FishingWatcher.xml
@@ -7,258 +7,252 @@
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT");
- GameTooltip:SetText(FishingBuddy.LEFTCLICKTODRAG);
-
-
- GameTooltip:Hide();
-
+
+ this:RegisterForClicks("RightButtonUp");
+
+
+ FishingBuddy.WatchFrame.OnClick();
+
- if ( arg1 == "LeftButton" ) then
- this:StartMoving();
- end
+ FishingBuddy.WatchFrame.OnMouseDown();
- this:StopMovingOrSizing();
+ FishingBuddy.WatchFrame.OnMouseUp();
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FishingBuddy.WatchFrame.OnLoad();
-
-
- FishingBuddy.WatchFrame.OnUpdate(arg1);
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ this:RegisterForClicks("RightButtonUp");
+
+
+ FishingBuddy.WatchFrame.OnClick();
+
+
+ FishingBuddy.WatchFrame.OnMouseDown();
+
+
+ FishingBuddy.WatchFrame.OnMouseUp();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ this:SetFrameLevel(0);
+ UIDropDownMenu_SetWidth(180);
+
+
+
+
+
+
+ FishingBuddy.WatchFrame.OnLoad();
+
+
+ FishingBuddy.WatchFrame.OnUpdate(arg1);
+
+
+
diff --git a/GraphHandler.lua b/GraphHandler.lua
index 15b9c1d..ab28dc5 100755
--- a/GraphHandler.lua
+++ b/GraphHandler.lua
@@ -104,6 +104,14 @@ GraphHandler.Register = function(kind, what)
end
end
+GraphHandler.ClearPlot = function(frame)
+ for _,elem in { GraphHandler.BAR, GraphHandler.LEGEND } do
+ for idx,what in frame.elements[elem] do
+ what:Hide();
+ end
+ end
+end
+
GraphHandler.PlotData = function(frame, data, offset, skip, r, g, b)
local limit = table.getn(data);
local start = 1;
@@ -144,6 +152,7 @@ GraphHandler.PlotLegend = function(frame, ldx, name, item, texture, r, g, b)
local color = getglobal(name.."Color");
-- SetColorBar(color, legend, nil, nil, nil, nil, r, g, b);
SetColorBar(color, legend, 0, 1, 10, 16, r, g, b);
+ color:Show();
icon:Show();
tex:SetTexture(texture);
tex:Show();
@@ -233,6 +242,7 @@ GraphHandler.PlotGrid = function(frame, label, texth, width, textv, height)
else
text:SetPoint("TOP", line, "BOTTOM", 0, -4);
end
+ text:Show();
tdx = tdx + 1;
end
end
diff --git a/Icons/MiniMapArrow.blp b/Icons/MiniMapArrow.blp
new file mode 100644
index 0000000..f7f42d9
Binary files /dev/null and b/Icons/MiniMapArrow.blp differ
diff --git a/changes.txt b/changes.txt
index 528ce65..5d87af6 100755
--- a/changes.txt
+++ b/changes.txt
@@ -1,3 +1,88 @@
+Version 0.8.8e
+- Split out FBEnEspagnol addon to a separate download (new feature
+
+Version 0.8.8d
+- Update toc for patch 1.12
+- Small cleanup changes
+
+Version 0.8.8c
+- Handle "Oil Spills" as fishing pools
+- Fix an intermittent text alignment bug in the locations window
+- Make FishingBuddyFu for Fubar 2.0 work nicely (mostly expose some functions)
+
+Version 0.8.8b
+- Add tracking selection menu to locations window
+
+Version 0.8.8a
+- Fix a nil error in the tracking popup if you haven't caught one of the
+ default fish
+- '/fb updatedb' print out a message
+- Grab the names of fish we catch if we don't know it already (old data updating)
+
+Version 0.8.8
+- Improved cycle fish tracking -- right-click to choose fish to graph
+- Update the TastyFish count every time the window is shown during the
+ Exravaganza so that our count is always 'right'
+- Fix window always showing bug
+
+Version 0.8.7g
+- Fix a typo introduced in version f
+- Really, really check for Pat Nagle's Fish Terminator correctly (thanks Saur!)
+
+Version 0.8.7f
+- Put changes from d and e into the same release
+
+Version 0.8.7g
+- Fix a typo introduced in version f
+- Really, really check for Pat Nagle's Fish Terminator correctly
+
+Version 0.8.7f
+- Put changes from d and e into the same release
+
+Version 0.8.7e
+- Fix missing color 'YELLOW'
+- Fix translation errors that were causing string.format errors in German and Spanish
+- Fix problems with the Terminator
+
+Version 0.8.7d
+- Fix broken minimap enable logic for menus
+- Fix nil error in startup conversion of old versions
+
+Version 0.8.7c
+- Fix incompatibility with version 1.11 and highlight text
+
+Version 0.8.7b
+- Clean up event handling some more (only listen when we're fishing)
+- Fix 'doubled' fishing location display for new fishing areas
+
+Version 0.8.7a
+- Hopefully fix an intermittent bug that crashes the client during
+ the Extravaganza when leaving Booty Bay
+- Stop losing the OutfitDisplayFrame outfit when logging out
+- Should correctly reset the Watcher Window for all toons
+- Add in 'FBEnEspagnol' for Spanish-speaking fisherbuddies
+- Use the now-builtin Outfitter 'find by stat' function
+
+Version 0.8.7
+- Integration with Gatherer (depends on the tooltip when you cast)
+- Add a 'hide these icky fish' menu to the watcher window
+- Put the keybinding for 'Suit Up and Go Fishing!' back in
+- Add an option to only fish from pools during the Extravaganza
+- Better (and more) French translation support from krogh
+- Rework debugging output so that people don't get surprised by it anymore
+- Rework zone and subzone storage to reduce space
+- Don't save default values (smaller saved vars, faster loading)
+- Tune event handling for faster world transitions
+- Move a lot of information into tooltips in the display window
+- Removed 'Fast Cast' again since patch 1.10.1 breaks it
+- Fix translation loader to actually work (even in English!)
+- Rewrite Extravaganza code and hopefully fix the crashes
+- Add an offset menu to handle differences between game and machine time
+- Fix the display bug when switching between locations and fishes
+- If more than one outfit switcher is available, allow a choice
+- Don't allow a recast if the fishing loot window is up
+- Add 'updatedb' command to link info for fish with missing data (can disconnect!)
+
Version 0.8.6h
- Fast Cast is back!
@@ -47,7 +132,7 @@ Version 0.8.5g
- Include OutfitDisplayFrame fix for nil error when fewer than five bags
Version 0.8.5f
-- Auto-set sound volumes to make the bobber sounds stand out
+- Auto-set sound volumes to make the bobber noise stand out (Good suggestion SBaL!)
Version 0.8.5e
- Don't count "Nat Pagle's Fish Terminator" as a fishing pole, even if it looks like one
diff --git a/future.txt b/future.txt
new file mode 100644
index 0000000..f51b849
--- /dev/null
+++ b/future.txt
@@ -0,0 +1,40 @@
+Future features
+
+- Count tastyfish in your bag instead of as you catch them (lrdx)
+- Built-in notepad (Kiiingy)
+- "fish trash" feature (Jaim Sandar)
+* only fish in schools during Extravaganza (Lrdx)
+- multi-machine database merge (Alcasius)
+* mute everything but bobber sounds (SBaL)
+- current inventory fish count (islandercaleb)
+- more summary information while fishing (time now/session fish now/session) (Xantandor)
+- Grand totals in fish window
+- select specific frame to show when icons are clicked (Talyn)
+- remove quest items from the list of things caught (zino)
+- separate out pool fish from everything else for counting and percentages
+* save the show fish/locations choice (Dark Imakuni)
+* display both lifetime and current fish info in the watcher (LBlaze)
+* Save helm/cloak settings per outfit in ODF (Valzic)
+* remember tastyfish pool locations (KayJayDK)
+*/- Track cycle fish (Bruntlief)
+* Show current zone in watcher (Buio)
+* Force item slot empty in ODF (Dark Imakuni)
+* Minimap icon (Tarklash)
+- Skinning buddy (Devonkross)
+* elapsed fishing time (Anakar)
+* show current skill level in watcher (Valzic)
+* Titan Panel support (Dark Imakuni)
+* Only show counts -- no percentages (Dark Imakuni)
+* Gatherer integration (Vreejack)
+- Recipe list for fish (Paul2200)
+- display total fish caught all time and this session (truefreak)
+- fish caught database per toon (Filius)
+* Outfitter support (lots)
+* Fishing watcher movable (lots)
+* Save fishing level information (Yeoman, RamahP)
+- Lost fish count (RamahP)
+- HUD for fishing (lures, target fish?, counts, etc.)
+- Graphical fish watcher window, i.e. icons with counts
+- Font/size selection for watcher window (Fritos)
+- Auto-open support for fished items (chests, bloated fish, clams)
+- Expand fish pool tracking (i.e. display them like tastyfish schools)
diff --git a/localization.de.lua b/localization.de.lua
index a238401..1384f0a 100755
--- a/localization.de.lua
+++ b/localization.de.lua
@@ -14,7 +14,7 @@ FishingTranslations["deDE"] = {
LOCATIONS_TAB = "Fische",
OUTFITS_INFO = "W\195\164hlen aus, was du beim Fischen tragen willst",
OUTFITS_TAB = "Ausr\195\188stung",
- OPTIONS_INFO = "Einstellungen",
+ OPTIONS_INFO = " Einstellungen",
OPTIONS_TAB = "Einstellungen",
TRACKING_INFO = "Zeige graphische #NAME#-Anzeige der letzten F\195\164nge",
TRACKING_TAB = "Saisonfische",
@@ -34,6 +34,13 @@ FishingTranslations["deDE"] = {
NOTRACK = "Aufzeichnung-nicht",
TRACKING = "aufzeichnen",
+ -- Thanks Maischter!
+ SCHOOL = "Schwarm", -- e.g. '\195\150lige Schwarzmaul Schwarm'
+ FLOATING_WRECKAGE = "Schwimmende Wrackteile",
+ FLOATING_DEBRIS = "Schwimmende Tr\195\188mmer",
+ ELEM_WATER = "Elementarwasser",
+ OIL_SPILL = "\195\150lpest",
+
ADD = "hinzuf\195\188gen",
REPLACE = "ersetze",
UPDATE = "update",
@@ -43,8 +50,6 @@ FishingTranslations["deDE"] = {
CHECK = "check",
NOW = "now",
- NOREALM = "unknown realm",
-
WATCHER = "Watcher",
WATCHER_LOCK = "fixieren",
WATCHER_UNLOCK = "freigeben",
@@ -82,7 +87,7 @@ FishingTranslations["deDE"] = {
CONFIG_SORTBYPERCENT_ONOFF = "Sortiere nach Anzahl gefangener Fische",
CONFIG_SORTBYPERCENT_INFO = "Anzeige sortiert nach Zahl der gefangenen Fische, anstelle von Fischnamen.",
CONFIG_STVTIMER_ONOFF = "Angelwettbewerb-Timer.",
- CONFIG_STVTIMER_INFO = "Wenn Sie erm\195\182glicht werden, zeigen Sie einen Countdowntimer fr den Anfang des Fischens Extravaganza und ein Countdown vom Timer nach links an.",
+ CONFIG_STVTIMER_INFO = "Wenn Sie erm\195\182glicht werden, zeigen Sie einen Countdowntimer f\195\188r den Anfang des Fischens Extravaganza und ein Countdown vom Timer nach links an.",
CONFIG_USEBUTTONHOLE_ONOFF = "Verwenden Sie ButtonHole",
CONFIG_USEBUTTONHOLE_INFO = "Wenn es erm\195\182glicht wird, steuert das ButtonHole-addon die minimaptaste. Nehmen bewirkt auf dem folgenden LOGON.",
@@ -91,8 +96,8 @@ FishingTranslations["deDE"] = {
CONFIG_STYLISH_INFO = "Styling-Punkte, inspiriert durch die Draznars Fishing-FAQ auf den (englischen) WoW-Foren.",
CONFIG_STYLISH_TEXT = "Styling: ",
- TITAN_CLICKTOSWITCH_ONOFF = "Zum Wechseln der Ausr\195\188stung klicken.",
- TITAN_CLICKTOSWITCH_INFO = "Wenn aktiviert, wechselt ein Linksklcik die Ausr\195\188stung, statt nur das #NAME#-Fenster zu \195\182ffnen.",
+ CLICKTOSWITCH_ONOFF = "Zum Wechseln der Ausr\195\188stung klicken.",
+ CLICKTOSWITCH_INFO = "Wenn aktiviert, wechselt ein Linksklcik die Ausr\195\188stung, statt nur das #NAME#-Fenster zu \195\182ffnen.",
LEFTCLICKTODRAG = "Link-Klicken zum Schleppen",
@@ -101,7 +106,7 @@ FishingTranslations["deDE"] = {
CONFIG_MINIMAPBUTTON_ONOFF = "Anzeigen des Minimapikons",
CONFIG_MINIMAPBUTTON_INFO = "Zeige #NAME#-Ikon auf der Minimap an.",
- CONFIG_ENHANCESOUNDS_ONOFF = "Erh\195\192hen Sie Fischent\195\192ne",
+ CONFIG_ENHANCESOUNDS_ONOFF = "Erh\195\182hen Sie Fischent\195\182ne",
CONFIG_ENHANCESOUNDS_INFO = "Maximieren Sie Klangvolumen und setzen Sie umgebende Ausgabe herab, um das bobber noise zu lassen wahrnehmbareres beim Fischen.",
-- messages
@@ -119,80 +124,76 @@ FishingTranslations["deDE"] = {
POLEALREADYEQUIPPED = "Sie werden bereits f\195\188r Fischen ausger\195\188stet.",
CANTSWITCHBACK = "Sie haben bereits Ihre Fischenausr\195\188stung entfernt.",
CLEANUP_NONEMSG = "Keine alten Einstellungen bleiben.",
- CLEANUP_WILLMSG = "Alte Einstellungen restlich f\195\188r |c0000FF00%s|r: %s.",
- CLEANUP_DONEMSG = "Alte Einstellungen entfernt f\195\188r |c0000FF00%s|r: %s.",
- CLEANUP_NOOLDMSG = "Es gibt keine alten Einstellungen f\195\188r Spieler |c0000FF00%s|r.",
+ CLEANUP_WILLMSG = "Alte Einstellungen restlich f\195\188r |c#GREEN#%s|r: %s.",
+ CLEANUP_DONEMSG = "Alte Einstellungen entfernt f\195\188r |c#GREEN#%s|r: %s.",
+ CLEANUP_NOOLDMSG = "Es gibt keine alten Einstellungen f\195\188r Spieler |c#GREEN#%s|r.",
NOTLINKABLE = "",
TIMETOGO = "Angelwettbewerb beginnt in %d:%02d",
- TIMELEFT = "Angelwettbewerb endet in %d:%02d -- %d %s",
+ TIMELEFT = "Angelwettbewerb endet in %d:%02d",
STVZONENAME = "Stranglethorn",
- TOOLTIP_HINTSWITCH = "Hinweis: wechselt ein Linksklcik die Ausr\195\188stung",
- TOOLTIP_HINTTOGGLE = "Hinweis: das #NAME#-Fenster zu \195\182ffnen.",
+ TOOLTIP_HINT = "Hinweis:";
+ TOOLTIP_HINTSWITCH = "wechselt ein Linksklcik die Ausr\195\188stung",
+ TOOLTIP_HINTTOGGLE = "das #NAME#-Fenster zu \195\182ffnen.",
-- Key binding support
BINDING_HEADER_FISHINGBUDDY_BINDINGS = "#NAME#",
BINDING_NAME_FISHINGBUDDY_TOGGLE = "#NAME# anzeigen",
BINDING_NAME_FISHINGBUDDY_SWITCH = "Ausr\195\188stung wechseln",
- BINDING_NAME_TOGGLEFISHINGBUDDY_LOC = "#NAME# #LOCATIONS# Fenster anzeigen",
- BINDING_NAME_TOGGLEFISHINGBUDDY_OUT = "#NAME# #OUTFITS# Fenster anzeigen",
- BINDING_NAME_TOGGLEFISHINGBUDDY_TRK = "#NAME# #TRACKING# Fenster anzeigen",
- BINDING_NAME_TOGGLEFISHINGBUDDY_OPT = "#NAME# #OPTIONS# Fenster anzeigen",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_LOC = "#NAME# Zonen-Fenster anzeigen",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_OUT = "#NAME# Outfit-Fenster anzeigen",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_TRK = "#NAME# Tracking-Fenster anzeigen",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_OPT = "#NAME# Optionen-Fenster anzeigen",
};
FishingTranslations["deDE"].IMPORT_HELP = {
- "|c0000FF00/fb #IMPORT#|r",
+ "|c#GREEN#/fb #IMPORT#|r",
" Importiere Impp's Fishinfo or FishInfo2 Daten.",
};
FishingTranslations["deDE"].SWITCH_HELP = {
- "|c0000FF00/fb #SWITCH#|r",
+ "|c#GREEN#/fb #SWITCH#|r",
" wechsele deine Fischereiausr\195\188stung und -kleidung.",
};
FishingTranslations["deDE"].WATCHER_HELP = {
- "|c0000FF00/fb #WATCHER#|r [|c0000FF00#WATCHER_LOCK#|r oder |c0000FF00#WATCHER_UNLOCK#|r oder |c0000FF00#RESET#|r]",
+ "|c#GREEN#/fb #WATCHER#|r [|c#GREEN##WATCHER_LOCK#|r oder |c#GREEN##WATCHER_UNLOCK#|r oder |c#GREEN##RESET#|r]",
" fixieren .. Fixieren des Watcher-Fenster,",
" freigeben .. Entriegeln zum Verschieben,",
" reset .. Zur\195\188ckstellen",
};
FishingTranslations["deDE"].CURRENT_HELP = {
- "|c0000FF00/fb #CURRENT# #RESET#|r",
+ "|c#GREEN#/fb #CURRENT# #RESET#|r",
" Zur\195\188ckstellen der w\195\164hrend der gegenw\195\164rtigen Session gefangenen Fische.",
};
FishingTranslations["deDE"].CLEANUP_HELP = {
- "|c0000FF00/fb #CLEANUP#|r [|c0000FF00#CHECK#|r or |c0000FF00#NOW#|r]",
- " S\195\164ubern Sie herauf alte Einstellungen. |c0000FF00#CHECK#|r verzeichnet",
- " die alten Einstellungen, die von |c0000FF00#NOW#|r entfernt werden.",
+ "|c#GREEN#/fb #CLEANUP#|r [|c#GREEN##CHECK#|r or |c#GREEN##NOW#|r]",
+ " S\195\164ubern Sie herauf alte Einstellungen. |c#GREEN##CHECK#|r verzeichnet",
+ " die alten Einstellungen, die von |c#GREEN##NOW#|r entfernt werden.",
};
FishingTranslations["deDE"].TRACKING_HELP = {
- "|c0000FF00/fb #TRACK#|r [|c0000FF00#HOURLY#|r oder |c0000FF00#WEEKLY#|r] |c00FF00FF|r",
+ "|c#GREEN#/fb #TRACK#|r [|c#GREEN##HOURLY#|r oder |c#GREEN##WEEKLY#|r] |c#PURPLE#|r",
" zeichne die Angeldauer f\195\188r die angegebenen",
" Fischart (ein Shift-Klick Link) auf",
- "|c0000FF00/fb #NOTRACK#|r |c00FF00FF|r",
+ "|c#GREEN#/fb #NOTRACK#|r |c#PURPLE#|r",
" remove the specified fish (a shift click link) from the tracker",
- "|c0000FF00/fb #TRACKING#|r",
+ "|c#GREEN#/fb #TRACKING#|r",
" eine einfache Anzeige, wann die gefangenen",
" Fische gefangen wurden",
};
-FishingTranslations["deDE"].HELPMSG = {
- "Du kannst |c0000FF00/fishingbuddy|r oder |c0000FF00/fb|r f\195\188r alle Befehle benutzen",
- "|c0000FF00/fb|r: schaltet das Fenster ein/aus.",
- "|c0000FF00/fb #HELP#|r: zeigt diesern Hilfetext",
- "#SWITCH_HELP#",
- "#WATCHER_HELP#",
- "#CURRENT_HELP#",
- "#CLEANUP_HELP#",
- "#IMPORT_HELP#",
- "#TRACKING_HELP#",
- " ",
+FishingTranslations["deDE"].PRE_HELP = {
+ "Du kannst |c#GREEN#/fishingbuddy|r oder |c#GREEN#/fb|r f\195\188r alle Befehle benutzen",
+ "|c#GREEN#/fb|r: schaltet das Fenster ein/aus.",
+ "|c#GREEN#/fb #HELP#|r: zeigt diesern Hilfetext",
+};
+FishingTranslations["deDE"].POST_HELP = {
"Du kannst die Fensteraktivierung und den",
"Befehl zum Wechseln deiner Ausstattung in den",
"\"Tastaturbelegungen\" festlegen.",
diff --git a/localization.es.lua b/localization.es.lua
index 8a9f366..5309d93 100755
--- a/localization.es.lua
+++ b/localization.es.lua
@@ -1,7 +1,7 @@
FishingTranslations["esES"] = {
NAME = "Fishing Buddy",
DESCRIPTION1 = "Seguimiento de las capturas que has hecho",
- DESCRIPTION2 = "y maneja tu caña de pescar.",
+ DESCRIPTION2 = "y maneja tu ca\195\177a de pescar.",
-- Tab labels and tooltips
LOCATIONS_INFO = "Muestra info de zona de pesca",
@@ -10,7 +10,7 @@ FishingTranslations["esES"] = {
OUTFITS_TAB = "Equipos",
OPTIONS_INFO = "Establece #NAME# opciones",
OPTIONS_TAB = "Opciones",
- TRACKING_INFO = "Muestra #NAME# informacióon de pesca ciclica",
+ TRACKING_INFO = "Muestra #NAME# informaci\195\179on de pesca ciclica",
TRACKING_TAB = "Seguimiento",
POINT = "punto",
@@ -28,7 +28,9 @@ FishingTranslations["esES"] = {
NOTRACK = "no siguas",
TRACKING = "siguiendo",
- ADD = "añde",
+ OIL_SPILL = "Perdita de Petro'leo",
+
+ ADD = "a\195\177de",
REPLACE = "reemplaza",
UPDATE = "actualiza",
CURRENT = "actual",
@@ -64,55 +66,54 @@ FishingTranslations["esES"] = {
-- Option names and tooltips
CONFIG_SHOWNEWFISHIES_ONOFF = "Muestra nuevos peces",
- CONFIG_SHOWNEWFISHIES_INFO = "Muestra un mensaje en el chat cuando la captura es nueva en el área actual.",
+ CONFIG_SHOWNEWFISHIES_INFO = "Muestra un mensaje en el chat cuando la captura es nueva en el \195\161rea actual.",
CONFIG_FISHWATCH_ONOFF = "Observador",
- CONFIG_FISHWATCH_INFO = "Muestra un texto con la captura en el área actual.",
+ CONFIG_FISHWATCH_INFO = "Muestra un texto con la captura en el \195\161rea actual.",
CONFIG_FISHWATCHSKILL_ONOFF = "Muestra habilidad actual",
- CONFIG_FISHWATCHSKILL_INFO = "Muestra habilidad y mods en el área de observación.",
+ CONFIG_FISHWATCHSKILL_INFO = "Muestra habilidad y mods en el \195\161rea de observaci\195\179n.",
CONFIG_FISHWATCHZONE_ONOFF = "Muestra zona actual",
- CONFIG_FISHWATCHZONE_INFO = "Muestra zona actual en el área de observación.",
+ CONFIG_FISHWATCHZONE_INFO = "Muestra zona actual en el \195\161rea de observaci\195\179n.",
CONFIG_FISHWATCHONLY_ONOFF = "Solo cuando pescas",
CONFIG_FISHWATCHONLY_INFO = "Solo muestra capturas en el observador si estas pescando actualmente",
CONFIG_FISHWATCHPERCENT_ONOFF = "Muestra porcentaje capturado",
CONFIG_FISHWATCHPERCENT_INFO = "Muestra el porcentaje de cada tipo de pez en el observador",
- CONFIG_EASYLURES_ONOFF = "Señuelo facil",
- CONFIG_EASYLURES_INFO = "Si activado, se aplicará un señuelo a tu caña antes de empezar a pescar siempre que lo necesites.",
- CONFIG_ONLYMINE_ONOFF = "Equipa solo caña",
- CONFIG_ONLYMINE_INFO = "Si activado, captura facil solo cequeará si llevas la caña (p.ej. no buscará todas las posibilidades).",
+ CONFIG_EASYLURES_ONOFF = "Se\195\177uelo facil",
+ CONFIG_EASYLURES_INFO = "Si activado, se aplicar\195\161 un se\195\177uelo a tu ca\195\177a antes de empezar a pescar siempre que lo necesites.",
+ CONFIG_ONLYMINE_ONOFF = "Equipa solo ca\195\177a",
+ CONFIG_ONLYMINE_INFO = "Si activado, captura facil solo cequear\195\161 si llevas la ca\195\177a (p.ej. no buscar\195\161 todas las posibilidades).",
CONFIG_SHOWLOCATIONZONES_ONOFF = "Muestra zonas",
CONFIG_SHOWLOCATIONZONES_INFO = "Muestra zonas y subzonas.",
- CONFIG_SORTBYPERCENT_ONOFF = "Por número de capturas",
- CONFIG_SORTBYPERCENT_INFO = "Ordena la pantalla con el número de peces capturadas y no por el nombre.",
+ CONFIG_SORTBYPERCENT_ONOFF = "Por n\195\186mero de capturas",
+ CONFIG_SORTBYPERCENT_INFO = "Ordena la pantalla con el n\195\186mero de peces capturadas y no por el nombre.",
CONFIG_STVTIMER_ONOFF = "Marcador de Fishing Extravaganza",
CONFIG_STVTIMER_INFO = "Si activado, muestra la cuenta atras para el comienzo de Fishing Extravaganza y muestra el tiempo restante.",
CONFIG_USEBUTTONHOLE_ONOFF = "Usa ButtonHole",
- CONFIG_USEBUTTONHOLE_INFO = "Si activo, al addon ButtonHole controlará el botón del minimapa. Hace efecto al siguiente login.",
+ CONFIG_USEBUTTONHOLE_INFO = "Si activo, al addon ButtonHole controlar\195\161 el bot\195\179n del minimapa. Hace efecto al siguiente login.",
CONFIG_SKILL_INFO = "Bonus de equipo total.",
CONFIG_SKILL_TEXT = "Pescando ",
- CONFIG_STYLISH_INFO = "Style points loosely inspired by Draznar's Fishing FAQ in the WoW forums.",
CONFIG_STYLISH_TEXT = "Estilo: ",
CONFIG_OUTFITTER_TEXT = "Bonus equipo habilidad: %s\r\nPuntuacion estilo Draznar's: %d ";
- TITAN_CLICKTOSWITCH_ONOFF = "Click para cambiar",
- TITAN_CLICKTOSWITCH_INFO = "Si activado, click-izq. Cambia equipos, sino saltarála ventana Fishing Buddy.",
+ CLICKTOSWITCH_ONOFF = "Click para cambiar",
+ CLICKTOSWITCH_INFO = "Si activado, click-izq. Cambia equipos, sino saltar\195\161la ventana Fishing Buddy.",
LEFTCLICKTODRAG = "Click-izq para mover",
- MINIMAPBUTTONPLACEMENT = "Posición Botón",
+ MINIMAPBUTTONPLACEMENT = "Posici\195\179n Bot\195\179n",
MINIMAPBUTTONPLACEMENTTOOLTIP = "Permite mover el #NAME# icono alrdedor del minimapa",
CONFIG_MINIMAPBUTTON_ONOFF = "Muestra icono minimapa",
CONFIG_MINIMAPBUTTON_INFO = "Muestra un #NAME# icono en el minimapa.",
CONFIG_ENHANCESOUNDS_ONOFF = "Activa sonidos de pesca",
- CONFIG_ENHANCESOUNDS_INFO = "Maximiza el volúmen y minimiza el volúmen del ambiente para que se aprecie mejor el sonido cuando se pesca.",
+ CONFIG_ENHANCESOUNDS_INFO = "Maximiza el vol\195\186men y minimiza el vol\195\186men del ambiente para que se aprecie mejor el sonido cuando se pesca.",
-- messages
- FAILEDINIT = "No inicializó correctamente.",
+ FAILEDINIT = "No inicializ\195\179 correctamente.",
IMPORTMSG = "BaseDatos '%s' importada.",
NOIMPORTMSG = "No Impp, DataFish, o FishInfo2 BasesDatos encontradas.",
- ADDFISHIEMSG = "Añdiendo %s a zona %s.",
+ ADDFISHIEMSG = "A\195\177diendo %s a zona %s.",
CURSORBUSYMSG = "no pudo cambiar por estar el cursor ocupado!",
NOOUTFITDEFINED = "No tienes objetos en tu equipo de pesca.",
NODATAMSG = "No datos pesca disponibles.",
@@ -121,77 +122,21 @@ FishingTranslations["esES"] = {
NOTRACKMSG = "Pesca ciclica borrada '%s'.",
POLEALREADYEQUIPPED = "Ya estas equipado para pescar.",
CANTSWITCHBACK = "Ya te has quitado el equipamiento de pesca.",
- CLEANUP_NONEMSG = "No quedan antigÜos ajustes.",
- CLEANUP_WILLMSG = "Ajustes antigÜos quedan para |c0000FF00%s|r: %s.",
- CLEANUP_DONEMSG = "Borrados ajustes antigÜos para |c0000FF00%s|r: %s.",
- CLEANUP_NOOLDMSG = "No hay ajustes antigÜos para jugador |c0000FF00%s|r.",
+ CLEANUP_NONEMSG = "No quedan antig\195\186os ajustes.",
+ CLEANUP_WILLMSG = "Ajustes antig\195\186os quedan para |c#GREEN#%s|r: %s.",
+ CLEANUP_DONEMSG = "Borrados ajustes antig\195\186os para |c#GREEN#%s|r: %s.",
+ CLEANUP_NOOLDMSG = "No hay ajustes antig\195\186os para jugador |c#GREEN#%s|r.",
NOTLINKABLE = "",
TIMETOGO = "Extravaganza comienza en %d:%02d",
- TIMELEFT = "Extravaganza acaba en %d:%02d -- %d %s",
+ TIMELEFT = "Extravaganza acaba en %d:%02d",
STVZONENAME = "Stranglethorn Vale",
- TOOLTIP_HINTSWITCH = "Consejo: click para cambiar equipos",
- TOOLTIP_HINTTOGGLE = "Consejo: click para mostar #NAME# ventana.",
-
- -- Key binding support
- BINDING_HEADER_FISHINGBUDDY_BINDINGS = "#NAME#",
- BINDING_NAME_FISHINGBUDDY_TOGGLE = "Toggle #NAME# Window",
- BINDING_NAME_FISHINGBUDDY_SWITCH = "Switch Fishing Outfit",
- BINDING_NAME_FISHINGBUDDY_GOFISHING = "Suit up and go fishing",
-
- BINDING_NAME_TOGGLEFISHINGBUDDY_LOC = "Toggle #NAME# Locations Pane",
- BINDING_NAME_TOGGLEFISHINGBUDDY_OUT = "Toggle #NAME# Outfit Pane",
- BINDING_NAME_TOGGLEFISHINGBUDDY_TRK = "Toggle #NAME# Tracking Pane",
- BINDING_NAME_TOGGLEFISHINGBUDDY_OPT = "Toggle #NAME# Options Pane",
+ TOOLTIP_HINT = "Consejo:",
+ TOOLTIP_HINTSWITCH = "click para cambiar equipos",
+ TOOLTIP_HINTTOGGLE = "click para mostar #NAME# ventana.",
};
-FishingTranslations["esES"].IMPORT_HELP = {
- "|c0000FF00/fb #IMPORT#|r",
- " Import Impp's fishinfo or FishInfo2 data.",
- };
-FishingTranslations["esES"].SWITCH_HELP = {
- "|c0000FF00/fb #SWITCH#|r",
- " swap outfits (if OutfitDisplayFrame or Outfitter is available)",
- };
-FishingTranslations["esES"].WATCHER_HELP = {
- "|c0000FF00/fb #WATCHER#|r [|c0000FF00#WATCHER_LOCK#|r or |c0000FF00#WATCHER_UNLOCK#|r or |c0000FF00#RESET#|r]",
- " Unlock the watcher to move the window,",
- " lock to stop, reset to reset",
- };
-FishingTranslations["esES"].CURRENT_HELP = {
- "|c0000FF00/fb #CURRENT# #RESET#|r",
- " Reset the fish caught during the current session.",
-};
-FishingTranslations["esES"].CLEANUP_HELP = {
- "|c0000FF00/fb #CLEANUP#|r [|c0000FF00f#CHECK#|r or |c0000FF00#NOW#|r]",
- " Clean up old settings. |c0000FF00#CHECK#|r lists which",
- " settings will be removed by |c0000FF00#NOW#|r.",
- };
-FishingTranslations["esES"].TRACKING_HELP = {
- "|c0000FF00/fb #TRACK#|r [|c0000FF00#HOURLY#|r or |c0000FF00#WEEKLY#|r] |c00FF00FF|r",
- " track the catch times for the specified fish (a shift click link)",
- "|c0000FF00/fb #NOTRACK#|r |c00FF00FF|r",
- " remove the specified fish (a shift click link) from the tracker",
- "|c0000FF00/fb #TRACKING#|r",
- " a really bad display of when tracked fish were caught",
- };
-
-FishingTranslations["esES"].HELPMSG = {
- "You can use |c0000FF00/fishingbuddy|r or |c0000FF00/fb|r for all commands",
- "|c0000FF00/fb|r: by itself, toggle the Fishing Buddy window",
- "|c0000FF00/fb #HELP#|r: display this message",
- "#SWITCH_HELP#",
- "#WATCHER_HELP#",
- "#CURRENT_HELP#",
- "#CLEANUP_HELP#",
- "#IMPORT_HELP#",
- "#TRACKING_HELP#",
- " ",
- "You can bind both the window toggle and the outfit",
- " switch command to keys in the \"Key Bindings\" window.",
- };
-
diff --git a/localization.fr.lua b/localization.fr.lua
index 0d4fde0..274acdc 100755
--- a/localization.fr.lua
+++ b/localization.fr.lua
@@ -5,13 +5,13 @@ FishingTranslations["frFR"] = {
-- Tab labels and tooltips
LOCATIONS_INFO = "Affiche les informations de p\195\170che locales";
- LOCATIONS = "R\195\169gions";
+ LOCATIONS = "Localisations";
OUTFITS_INFO = "Pr\195\169pare votre equipement de p\195\170che";
OUTFITS = "Equipement";
OPTIONS_INFO = "R\195\168gle les options";
OPTIONS = "Options";
TRACKING_INFO = "Affiche les donn\195\169es sur les poissons";
- TRACKING = "Donn\195\169es";
+ TRACKING = "Archives";
POINT = "point";
POINTS = "points";
@@ -44,10 +44,16 @@ FishingTranslations["frFR"] = {
WEEKLY = "Hebdomadaire";
HOURLY = "toutes les heures";
+ KEYS_LABEL_TEXT = "Touches:",
+ KEYS_NONE_TEXT = "Aucune",
+ KEYS_SHIFT_TEXT = "Shift",
+ KEYS_CTRL_TEXT = "CTRL",
+ KEYS_ALT_TEXT = "Alt",
+
SHOWFISHIES = "Poissons";
SHOWFISHIES_INFO = "Affiche vos prises class\195\169es par type de poisson.";
- SHOWLOCATIONS = "R\195\169gions";
+ SHOWLOCATIONS = "Montrer les zones";
SHOWLOCATIONS_INFO = "Affiche vos prises class\195\169es par r\195\169gions.";
SWITCHOUTFIT = "Equipement";
@@ -55,8 +61,30 @@ FishingTranslations["frFR"] = {
CONFIG_SKILL_TEXT = "P\195\170che ";
- TITAN_CLICKTOSWITCH_ONOFF = "Clique pour changer";
- TITAN_CLICKTOSWITCH_INFO = "Si activ\195\169, un clic gauche change l'\195\169quipement, si d\195\169sactiv\195\169, affiche la fen\195\170tre.";
+ -- Option names and tooltips
+ CONFIG_SHOWNEWFISHIES_ONOFF = "Montrer les nouveaux poissons",
+ CONFIG_SHOWNEWFISHIES_INFO = "Affiche un message dans la zone de texte quand un nouveau poisson est p\195\169ch\195\169.",
+ CONFIG_FISHWATCH_ONOFF = "Archives des poissons",
+ CONFIG_FISHWATCH_INFO = "Affiche une zone de texte avec les poissons d\195\169j\195\160 p\195\169ch\195\169s dans la zone courante.",
+ CONFIG_FISHWATCHONLY_ONOFF = "Seulement en p\195\169chant",
+ CONFIG_FISHWATCHONLY_INFO = "Montrer seulement les poissons lorsque vous \195\170tes en train de p\195\169cher.",
+ CONFIG_FISHWATCHSKILL_ONOFF = "Niveau actuel",
+ CONFIG_FISHWATCHSKILL_INFO = "Affiche votre niveau courant en p\195\170che ainsi que les am\195\169liorations dans la zone de texte.",
+ CONFIG_FISHWATCHZONE_ONOFF = "Zone courante",
+ CONFIG_FISHWATCHZONE_INFO = "Affiche la zone courante dans la zone de texte.",
+ CONFIG_FISHWATCHPERCENT_ONOFF = "Montrer les pourcentages",
+ CONFIG_FISHWATCHPERCENT_INFO = "Affiche les pourcentages pour chaque type de poissons dans la zone de texte.",
+ CONFIG_EASYCAST_ONOFF = "Lancer la ligne facilement",
+ CONFIG_EASYCAST_INFO = "Si activ\195\169, lorsque votre canne \195\160 p\195\170che est \195\169quip\195\169e, un clic droit lance la ligne.",
+ CONFIG_SORTBYPERCENT_ONOFF = "Trier par quantit\195\169 de poissons",
+ CONFIG_SORTBYPERCENT_INFO = "Trie l'affichage par quantit\195\169 de poissons p\195\169ch\195\169s au lieu du nom.",
+ CONFIG_STVTIMER_ONOFF = "Timer du concours de p\195\170che",
+ CONFIG_STVTIMER_INFO = "Si activ\195\169, un compteur sera affich\195\169 indiquant le temps restant avant le debut et la fin du concours.",
+ CONFIG_USEGATHERER_ONOFF = "Utiliser Gatherer",
+ CONFIG_USEGATHERER_INFO = "Si activ\195\169, un compteur sera affich\195\169 indiquant le temps restant avant le debut et la fin du concours.",
+
+ CLICKTOSWITCH_ONOFF = "Clique pour changer";
+ CLICKTOSWITCH_INFO = "Si activ\195\169, un clic gauche change l'\195\169quipement, si d\195\169sactiv\195\169, affiche la fen\195\170tre.";
LEFTCLICKTODRAG = "Clique gauche pour bouger";
@@ -72,46 +100,6 @@ FishingTranslations["frFR"] = {
TIMELEFT = "Le concours de p\195\170che se termine dans %d:%02d";
STVZONENAME = "Vall\195\169e de Strangleronce";
-};
-
-FishingTranslations["frFR"].IMPORT_HELP = {
- "|c0000FF00/fb #IMPORT#|r",
- " Importe les donn\195\169es d'Impp's fishinfo ou de FishInfo2.",
- };
-FishingTranslations["frFR"].SWITCH_HELP = {
- "|c0000FF00/fb #SWITCH#|r",
- " Change l'\195\169quipement (si OutfitDisplayFrame ou Outfitter est charg\195\169)",
- };
-FishingTranslations["frFR"].WATCHER_HELP = {
- "|c0000FF00/fb #WATCHER#|r [|c0000FF00#WATCHER_LOCK#|r or |c0000FF00#WATCHER_UNLOCK#|r or |c0000FF00#RESET#|r]",
- " D\195\169v\195\169rouille pour bouger la fen\195\170tre,",
- " lock pour arr\195\170ter, reset pour mettre a z\195\169ro",
- };
-FishingTranslations["frFR"].CURRENT_HELP = {
- "|c0000FF00/fb #CURRENT# #RESET#|r",
- " Met a z\195\169ro des poissons pris durant cette session.",
- };
-FishingTranslations["frFR"].TRACKING_HELP = {
- "|c0000FF00/fb #TRACK#|r [|c0000FF00#HOURLY#|r or |c0000FF00#WEEKLY#|r] |c00FF00FF|r",
- " Surveille le temps de prise pour ce poisson (Maj-Click)",
- "|c0000FF00/fb #NOTRACK#|r |c00FF00FF|r",
- " Retire ce poisson (Maj-Click) du surveillant",
- "|c0000FF00/fb #TRACKING#|r",
- " Un mauvais affichage du moment de prise d'un poisson surveill\195\169",
- };
-
-FishingTranslations["frFR"].HELPMSG = {
- "Vous pouvez utiliser |c0000FF00/fishingbuddy|r ou |c0000FF00/fb|r pour toutes les commandes",
- "|c0000FF00/fb|r: seul, affiche/cache la fen\195\170tre de FishingBuddy",
- "|c0000FF00/fb #HELP#|r: affiche ce message",
- "#SWITCH_HELP#",
- "#WATCHER_HELP#",
- "#CURRENT_HELP#",
- "#IMPORT_HELP#",
- "#TRACKING_HELP#",
- " ",
- "Vous pouvez assigner une touche pour afficher/cacher la fen\195\170tre et/ou",
- "changer d'\195\169quipement dans la fen\195\170tre \"Raccourcis\".",
BINDING_HEADER_FISHINGBUDDY_BINDINGS = "#NAME#";
BINDING_NAME_FISHINGBUDDY_TOGGLE = "Toggle:#NAME#(Fen\195\170tre)";
@@ -121,4 +109,42 @@ FishingTranslations["frFR"].HELPMSG = {
BINDING_NAME_TOGGLEFISHINGBUDDY_OUT = "Toggle: #NAME# (Panneau d'\195\169quipement)";
BINDING_NAME_TOGGLEFISHINGBUDDY_TRK = "Toggle: #NAME# (Panneau de donn\195\169es)";
BINDING_NAME_TOGGLEFISHINGBUDDY_OPT = "Toggle: #NAME# (Panneau d'options)";
+
+ ABBREV_APRIL = "Avr",
+};
+
+FishingTranslations["frFR"].IMPORT_HELP = {
+ "|c#GREEN#/fb #IMPORT#|r",
+ " Importe les donn\195\169es d'Impp's fishinfo ou de FishInfo2.",
+};
+FishingTranslations["frFR"].SWITCH_HELP = {
+ "|c#GREEN#/fb #SWITCH#|r",
+ " Change l'\195\169quipement (si OutfitDisplayFrame ou Outfitter est charg\195\169)",
+};
+FishingTranslations["frFR"].WATCHER_HELP = {
+ "|c#GREEN#/fb #WATCHER#|r [|c#GREEN##WATCHER_LOCK#|r or |c#GREEN##WATCHER_UNLOCK#|r or |c#GREEN##RESET#|r]",
+ " D\195\169v\195\169rouille pour bouger la fen\195\170tre,",
+ " lock pour arr\195\170ter, reset pour mettre a z\195\169ro",
+};
+FishingTranslations["frFR"].CURRENT_HELP = {
+ "|c#GREEN#/fb #CURRENT# #RESET#|r",
+ " Met a z\195\169ro des poissons pris durant cette session.",
+};
+FishingTranslations["frFR"].TRACKING_HELP = {
+ "|c#GREEN#/fb #TRACK#|r [|c#GREEN##HOURLY#|r or |c#GREEN##WEEKLY#|r] |c#PURPLE#|r",
+ " Surveille le temps de prise pour ce poisson (Maj-Click)",
+ "|c#GREEN#/fb #NOTRACK#|r |c#PURPLE#|r",
+ " Retire ce poisson (Maj-Click) du surveillant",
+ "|c#GREEN#/fb #TRACKING#|r",
+ " Un mauvais affichage du moment de prise d'un poisson surveill\195\169",
+};
+
+FishingTranslations["frFR"].PRE_HELP = {
+ "Vous pouvez utiliser |c#GREEN#/fishingbuddy|r ou |c#GREEN#/fb|r pour toutes les commandes",
+ "|c#GREEN#/fb|r: seul, affiche/cache la fen\195\170tre de FishingBuddy",
+ "|c#GREEN#/fb #HELP#|r: affiche ce message",
+};
+FishingTranslations["frFR"].POST_HELP = {
+ "Vous pouvez assigner une touche pour afficher/cacher la fen\195\170tre et/ou",
+ "changer d'\195\169quipement dans la fen\195\170tre \"Raccourcis\".",
};
diff --git a/localization.lua b/localization.lua
index 1835d06..d1d7e81 100755
--- a/localization.lua
+++ b/localization.lua
@@ -7,10 +7,10 @@ FishingTranslations["enUS"] = {
DESCRIPTION2 = "and manage your fishing gear.",
DESCRIPTION = "#DESCRIPTION1# #DESCRIPTION2#",
- ID = "FishingBuddy";
+ ID = "FishingBuddy",
- WINDOW_TITLE = "#NAME# v#VERSION#";
- FISHINGTEXTURE = "Interface\\Icons\\Trade_Fishing";
+ WINDOW_TITLE = "#NAME# v#VERSION#",
+ FISHINGTEXTURE = "Interface\\Icons\\Trade_Fishing",
-- Tab labels and tooltips
LOCATIONS_INFO = "Show fishing location information",
@@ -36,6 +36,14 @@ FishingTranslations["enUS"] = {
TRACK = "track",
NOTRACK = "notrack",
TRACKING = "tracking",
+ UPDATEDB = "updatedb",
+ FORCE = "force",
+
+ SCHOOL = "School", -- e.g. 'Oily Blackmouth School'
+ FLOATING_WRECKAGE = "Floating Wreckage",
+ FLOATING_DEBRIS = "Floating Debris",
+ ELEM_WATER = "Elemental Water",
+ OIL_SPILL = "Oil Spill",
ADD = "add",
REPLACE = "replace",
@@ -56,6 +64,8 @@ FishingTranslations["enUS"] = {
WEEKLY = "weekly",
HOURLY = "hourly",
+ OFFSET_LABEL_TEXT = "Offset:";
+
KEYS_LABEL_TEXT = "Modifiers:",
KEYS_NONE_TEXT = "None",
KEYS_SHIFT_TEXT = "Shift",
@@ -76,20 +86,18 @@ FishingTranslations["enUS"] = {
CONFIG_SHOWNEWFISHIES_INFO = "Display a message in the chat area when a new fish for the current location is caught.",
CONFIG_FISHWATCH_ONOFF = "Fish watcher",
CONFIG_FISHWATCH_INFO = "Display a text overlay with the fish caught in the current location.",
- CONFIG_FISHWATCHSKILL_ONOFF = "Display current skill",
- CONFIG_FISHWATCHSKILL_INFO = "Display your current fishing skill and mods in the fish watch area.",
- CONFIG_FISHWATCHZONE_ONOFF = "Display current zone",
- CONFIG_FISHWATCHZONE_INFO = "Display the current zone in the fish watch area.",
CONFIG_FISHWATCHONLY_ONOFF = "Only while fishing",
CONFIG_FISHWATCHONLY_INFO = "Only watch the fish caught when we're actually fishing",
- CONFIG_FISHWATCHPERCENT_ONOFF = "Show percentage caught",
+ CONFIG_FISHWATCHSKILL_ONOFF = "Current skill",
+ CONFIG_FISHWATCHSKILL_INFO = "Display your current fishing skill and mods in the fish watch area.",
+ CONFIG_FISHWATCHZONE_ONOFF = "Current zone",
+ CONFIG_FISHWATCHZONE_INFO = "Display the current zone in the fish watch area.",
+ CONFIG_FISHWATCHPERCENT_ONOFF = "Show percentages",
CONFIG_FISHWATCHPERCENT_INFO = "Display the percentage of each kind of fish on the watch display",
- CONFIG_SUITUPFIRST_ONOFF = "Dress for succcess",
+ CONFIG_SUITUPFIRST_ONOFF = "Dress for success",
CONFIG_SUITUPFIRST_INFO = "Put on your fishing outfit if you're not wearing it when the binding key is pressed",
CONFIG_EASYCAST_ONOFF = "Easy Cast",
CONFIG_EASYCAST_INFO = "If enabled, then when a fishing pole is equipped and you right click, you will cast the line.",
- CONFIG_FASTCAST_ONOFF = "Fast Cast";
- CONFIG_FASTCAST_INFO = "If enabled, you can throw your line at the same time you click your bobber.";
CONFIG_EASYLURES_ONOFF = "Easy Lures",
CONFIG_EASYLURES_INFO = "If enabled, a lure will applied to your fishing pole before you start fishing, whenever you need one.",
CONFIG_ONLYMINE_ONOFF = "Outfit Pole Only",
@@ -102,20 +110,26 @@ FishingTranslations["enUS"] = {
CONFIG_SORTBYPERCENT_INFO = "Order displays by the number of fish caught instead of by name.",
CONFIG_STVTIMER_ONOFF = "Fishing Extravaganza timer",
CONFIG_STVTIMER_INFO = "If enabled, display a countdown timer for the start of the Fishing Extravaganza and a countdown of the timer left.",
+ CONFIG_STVPOOLSONLY_ONOFF = "Only cast in pools",
+ CONFIG_STVPOOLSONLY_INFO = "If enabled, easy cast will only be enabled if the cursor is over a fishing hole.",
CONFIG_USEBUTTONHOLE_ONOFF = "Use ButtonHole",
CONFIG_USEBUTTONHOLE_INFO = "If enabled, the ButtonHole addon will control the minimap button. Takes effect on the next login.",
+ CONFIG_USEGATHERER_ONOFF = "Use Gatherer",
+ CONFIG_USEGATHERER_INFO = "If enabled, #NAME# will inform Gatherer about fishing holes.",
CONFIG_SKILL_INFO = "Total outfit skill bonus.",
CONFIG_SKILL_TEXT = "Fishing ",
CONFIG_STYLISH_INFO = "Style points loosely inspired by Draznar's Fishing FAQ in the WoW forums.",
CONFIG_STYLISH_TEXT = "Style: ",
- CONFIG_OUTFITTER_TEXT = "Outfit skill bonus: %s\r\nDraznar's style score: %d ";
+ CONFIG_OUTFITTER_TEXT = "Outfit skill bonus: %s\r\nDraznar's style score: %d ",
- TITAN_CLICKTOSWITCH_ONOFF = "Click to switch",
- TITAN_CLICKTOSWITCH_INFO = "If enabled, a left click switches outfits, otherwise it brings up the Fishing Buddy window.",
+ CLICKTOSWITCH_ONOFF = "Click to switch",
+ CLICKTOSWITCH_INFO = "If enabled, a left click switches outfits, otherwise it brings up the Fishing Buddy window.",
LEFTCLICKTODRAG = "Left-click to drag",
+ RIGHTCLICKFORMENU = "Right-click for menu",
+ WATCHERCLICKHELP = "#LEFTCLICKTODRAG#\n#RIGHTCLICKFORMENU#",
MINIMAPBUTTONPLACEMENT = "Button Placement",
MINIMAPBUTTONPLACEMENTTOOLTIP = "Allows you to move the #NAME# icon around the minimap",
@@ -125,12 +139,24 @@ FishingTranslations["enUS"] = {
CONFIG_ENHANCESOUNDS_ONOFF = "Enhance fishing sounds",
CONFIG_ENHANCESOUNDS_INFO = "Maximize sound volume and minimize ambient volume to make the bobber noise more noticeable while fishing.",
+ TRACKINGFRAME = "Tracking Frame",
+ TRACKINGFRAME_RIGHTCLICK = "Right-click to draw graphs for fish",
+ TRACKINGFRAME_LEFTCLICK = "Left-click to choose fish to track",
+-- TRACKINGFRAME_CLICKS = "#TRACKINGFRAME_RIGHTCLICK#\r#TRACKINGFRAME_LEFTCLICK#",
+ TRACKINGFRAME_CLICKS = "#TRACKINGFRAME_RIGHTCLICK#",
+
+ TRACKFISHHOURLY = "Track this fish hourly",
+ TRACKFISHWEEKLY = "Track this fish weekly",
+ HIDEINWATCHER = "Display this fish in the watcher",
+
-- messages
+ COMPATIBLE_SWITCHER = "No compatible outfit switcher found.",
TOOMANYFISHERMEN = "You have more than one easy cast mod installed.",
FAILEDINIT = "Did not initialize correctly.",
IMPORTMSG = "Imported '%s' database.",
NOIMPORTMSG = "No Impp, DataFish, or FishInfo2 databases found.",
ADDFISHIEMSG = "Adding %s to location %s.",
+ ADDSCHOOLMSG = "Adding '%s' to location %s.",
CURSORBUSYMSG = "Couldn't switch because the cursor is busy!",
NOOUTFITDEFINED = "You don't have any items in your fishing outfit.",
NODATAMSG = "No fishing data available.",
@@ -140,23 +166,37 @@ FishingTranslations["enUS"] = {
POLEALREADYEQUIPPED = "You're already equipped for fishing.",
CANTSWITCHBACK = "You've already removed your fishing equipment.",
CLEANUP_NONEMSG = "No old settings remain.",
- CLEANUP_WILLMSG = "Old settings remaining for |c0000FF00%s|r: %s.",
- CLEANUP_DONEMSG = "Old settings removed for |c0000FF00%s|r: %s.",
- CLEANUP_NOOLDMSG = "There are no old settings for player |c0000FF00%s|r.",
+ CLEANUP_WILLMSG = "Old settings remaining for |c#RED#%s|r: %s.",
+ CLEANUP_DONEMSG = "Old settings removed for |c#RED#%s|r: %s.",
+ CLEANUP_NOOLDMSG = "There are no old settings for player |c#GREEN#%s|r.",
+ NONEAVAILABLE_MSG = "None available",
+ UPDATEDB_MSG = "Updated %d fish names.",
- MINIMUMSKILL = "Minimum skill: %d";
+ MINIMUMSKILL = "Minimum skill: %d",
NOTLINKABLE = "",
- CAUGHTTHISMANY = "Caught %d";
- CAUGHTTHISTOTAL = "Total %d";
- FISHTYPES = "Fish types: %d";
+ CAUGHTTHISMANY = "Caught %d",
+ CAUGHTTHISTOTAL = "Total %d",
+ FISHTYPES = "Fish types: %d",
+ DASH = " -- ",
+ FISHCAUGHT = "%d %s",
TIMETOGO = "Extravaganza starts in %d:%02d",
- TIMELEFT = "Extravaganza ends in %d:%02d -- %d %s",
+ TIMELEFT = "Extravaganza ends in %d:%02d",
+ FATLADYSINGS = "|c#RED#Extravaganza is over|r (%d:%02d left)",
+ RIGGLE_BASSBAIT = "^Riggle Bassbait .*: .*! (.*) .*!$",
STVZONENAME = "Stranglethorn Vale",
- TOOLTIP_HINTSWITCH = "Hint: click to switch outfits",
- TOOLTIP_HINTTOGGLE = "Hint: click to show the #NAME# window.",
+ TOOLTIP_HINT = "Hint:",
+ TOOLTIP_HINTSWITCH = "click to switch outfits",
+ TOOLTIP_HINTTOGGLE = "click to show the #NAME# window.",
+
+ -- months for Tracking frame
+ ABBREV_JANUARY = "Jan",
+ ABBREV_APRIL = "Apr",
+ ABBREV_JULY = "Jul",
+ ABBREV_OCTOBER = "Oct",
+ ABBREV_DECEMBER = "Dec",
-- Key binding support
BINDING_HEADER_FISHINGBUDDY_BINDINGS = "#NAME#",
@@ -171,48 +211,62 @@ FishingTranslations["enUS"] = {
};
FishingTranslations["enUS"].IMPORT_HELP = {
- "|c0000FF00/fb #IMPORT#|r",
+ "|c#GREEN#/fb #IMPORT#|r",
" Import Impp's fishinfo or FishInfo2 data.",
- };
+};
FishingTranslations["enUS"].SWITCH_HELP = {
- "|c0000FF00/fb #SWITCH#|r",
+ "|c#GREEN#/fb #SWITCH#|r",
" swap outfits (if OutfitDisplayFrame or Outfitter is available)",
- };
+};
FishingTranslations["enUS"].WATCHER_HELP = {
- "|c0000FF00/fb #WATCHER#|r [|c0000FF00#WATCHER_LOCK#|r or |c0000FF00#WATCHER_UNLOCK#|r or |c0000FF00#RESET#|r]",
+ "|c#GREEN#/fb #WATCHER#|r [|c#GREEN##WATCHER_LOCK#|r or |c#GREEN##WATCHER_UNLOCK#|r or |c#GREEN##RESET#|r]",
" Unlock the watcher to move the window,",
" lock to stop, reset to reset",
- };
+};
FishingTranslations["enUS"].CURRENT_HELP = {
- "|c0000FF00/fb #CURRENT# #RESET#|r",
+ "|c#GREEN#/fb #CURRENT# #RESET#|r",
" Reset the fish caught during the current session.",
};
+FishingTranslations["enUS"].UPDATEDB_HELP = {
+ "|c#GREEN#/fb #UPDATEDB# [#FORCE#]|r",
+ " Try and find the names of all the fish we don't know already.",
+ " An attempt is made to skip 'rare' fish that may disconnect you",
+ " from the server -- use the '#FORCE#' option to override the check.",
+};
FishingTranslations["enUS"].CLEANUP_HELP = {
- "|c0000FF00/fb #CLEANUP#|r [|c0000FF00f#CHECK#|r or |c0000FF00#NOW#|r]",
- " Clean up old settings. |c0000FF00#CHECK#|r lists which",
- " settings will be removed by |c0000FF00#NOW#|r.",
- };
+ "|c#GREEN#/fb #CLEANUP#|r [|c#GREEN#f#CHECK#|r or |c#GREEN##NOW#|r]",
+ " Clean up old settings. |c#GREEN##CHECK#|r lists which",
+ " settings will be removed by |c#GREEN##NOW#|r.",
+};
FishingTranslations["enUS"].TRACKING_HELP = {
- "|c0000FF00/fb #TRACK#|r [|c0000FF00#HOURLY#|r or |c0000FF00#WEEKLY#|r] |c00FF00FF|r",
+ "|c#GREEN#/fb #TRACK#|r [|c#GREEN##HOURLY#|r or |c#GREEN##WEEKLY#|r] |c#PURPLE#|r",
" track the catch times for the specified fish (a shift click link)",
- "|c0000FF00/fb #NOTRACK#|r |c00FF00FF|r",
+ "|c#GREEN#/fb #NOTRACK#|r |c#PURPLE#|r",
" remove the specified fish (a shift click link) from the tracker",
- "|c0000FF00/fb #TRACKING#|r",
+ "|c#GREEN#/fb #TRACKING#|r",
" a really bad display of when tracked fish were caught",
- };
+};
-FishingTranslations["enUS"].HELPMSG = {
- "You can use |c0000FF00/fishingbuddy|r or |c0000FF00/fb|r for all commands",
- "|c0000FF00/fb|r: by itself, toggle the Fishing Buddy window",
- "|c0000FF00/fb #HELP#|r: display this message",
- "#SWITCH_HELP#",
- "#WATCHER_HELP#",
- "#CURRENT_HELP#",
- "#CLEANUP_HELP#",
- "#IMPORT_HELP#",
- "#TRACKING_HELP#",
- " ",
+FishingTranslations["enUS"].PRE_HELP = {
+ "You can use |c#GREEN#/fishingbuddy|r or |c#GREEN#/fb|r for all commands",
+ "|c#GREEN#/fb|r: by itself, toggle the Fishing Buddy window",
+ "|c#GREEN#/fb #HELP#|r: display this message",
+};
+FishingTranslations["enUS"].POST_HELP = {
"You can bind both the window toggle and the outfit",
" switch command to keys in the \"Key Bindings\" window.",
- };
+};
+
+FishingTranslations["enUS"].HELPMSG = {
+ "@PRE_HELP",
+ "@SWITCH_HELP",
+ "@WATCHER_HELP",
+ "@CURRENT_HELP",
+ "@CLEANUP_HELP",
+ "@IMPORT_HELP",
+ "@TRACKING_HELP",
+ "@UPDATEDB_HELP",
+ " ",
+ "@POST_HELP",
+};
diff --git a/localization.ru.lua b/localization.ru.lua
new file mode 100644
index 0000000..9999eae
--- /dev/null
+++ b/localization.ru.lua
@@ -0,0 +1,258 @@
+-- Version : Russian ( by Maus )
+
+
+FishingTranslations["ruRU"] = {
+ NAME = "Fishing Buddy",
+ DESCRIPTION1 = "Отслеживает какую рыбу и где вы поймали",
+ DESCRIPTION2 = "и помогает управлять вашим рыболовским снарежением.",
+ DESCRIPTION = "#DESCRIPTION1# #DESCRIPTION2#",
+
+ ID = "FishingBuddy",
+
+ WINDOW_TITLE = "#NAME# вер. #VERSION#",
+ FISHINGTEXTURE = "Interface\\Icons\\Trade_Fishing",
+
+ -- Tab labels and tooltips
+ LOCATIONS_INFO = "Отображает информацию о расположении рыбы",
+ LOCATIONS_TAB = "Располож",
+ OUTFITS_INFO = "Выбрать что снарядить во время рыбалки",
+ OUTFITS_TAB = "Снаряжение",
+ OPTIONS_INFO = "Настройки #NAME#",
+ OPTIONS_TAB = "Настройки",
+ TRACKING_INFO = "Отображает #NAME# информацию о рыбе",
+ TRACKING_TAB = "Отслеживание",
+
+ POINT = "очко",
+ POINTS = "очков",
+
+ RAW = "сырой",
+ FISH = "Рыба",
+
+ BOBBER_NAME = "Поплавок",
+ FISHINGSKILL = "Рыбная ловля",
+ HELP = "help",
+ SWITCH = "switch",
+ IMPORT = "import",
+ TRACK = "track",
+ NOTRACK = "notrack",
+ TRACKING = "tracking",
+ UPDATEDB = "updatedb",
+ FORCE = "force",
+
+ SCHOOL = "косяк", -- e.g. 'Oily Blackmouth School'
+ FLOATING_WRECKAGE = "Плавающие обломки",
+ FLOATING_DEBRIS = "Плавающий мусор",
+ ELEM_WATER = "Первородная вода",
+ OIL_SPILL = "Нефтяное пятно",
+
+ ADD = "add",
+ REPLACE = "replace",
+ UPDATE = "update",
+ CURRENT = "current",
+ RESET = "reset",
+ CLEANUP = "cleanup",
+ CHECK = "check",
+ NOW = "now",
+
+ NOREALM = "неизвестный сервер",
+
+ WATCHER = "watcher",
+ WATCHER_LOCK = "lock",
+ WATCHER_UNLOCK = "unlock",
+
+ UNKNOWN = "Unknown",
+ WEEKLY = "weekly",
+ HOURLY = "hourly",
+
+ OFFSET_LABEL_TEXT = "Смещение:";
+
+ KEYS_LABEL_TEXT = "Клавиша:",
+ KEYS_NONE_TEXT = "Нету",
+ KEYS_SHIFT_TEXT = "Shift",
+ KEYS_CTRL_TEXT = "Control",
+ KEYS_ALT_TEXT = "Alt",
+
+ SHOWFISHIES = "Рыба",
+ SHOWFISHIES_INFO = "Показать весь ваш улов, сгруппированный по названию рыбы.",
+
+ SHOWLOCATIONS = "Локации",
+ SHOWLOCATIONS_INFO = "Показать весь ваш улов, отсортированно по зоне ловли.",
+
+ SWITCHOUTFIT = "Переключение",
+ SWITCHOUTFIT_INFO = "Переключение между снаряжением для рыбной ловли и тем, что было надето на вас раньше.",
+
+ -- Option names and tooltips
+ CONFIG_SHOWNEWFISHIES_ONOFF = "Новая рыба",
+ CONFIG_SHOWNEWFISHIES_INFO = "Выводит сообщение в окно чата, когда вы поймали новую рыбы в текущем месте.",
+ CONFIG_FISHWATCH_ONOFF = "Наблюдатель",
+ CONFIG_FISHWATCH_INFO = "Отображать текстовый фрейм с информацией о пойманных рыбках в текущем месте.",
+ CONFIG_FISHWATCHONLY_ONOFF = "Только во время рыбалки",
+ CONFIG_FISHWATCHONLY_INFO = "Наблюдатель будет активен только во время рыбалки",
+ CONFIG_FISHWATCHSKILL_ONOFF = "Текущий навык",
+ CONFIG_FISHWATCHSKILL_INFO = "Показывать текущий уровень навыка и его модификаторы.",
+ CONFIG_FISHWATCHZONE_ONOFF = "Текущая зона",
+ CONFIG_FISHWATCHZONE_INFO = "Показывать текущую локацию.",
+ CONFIG_FISHWATCHPERCENT_ONOFF = "В процентах",
+ CONFIG_FISHWATCHPERCENT_INFO = "Отображать проценты для каждой рыбки в наблюдателе.",
+ CONFIG_SUITUPFIRST_ONOFF = "Одежда для успеха",
+ CONFIG_SUITUPFIRST_INFO = "Положите на рыбное снаряжение, если вы не используете его когда нажата клавиша связывания.",
+ CONFIG_EASYCAST_ONOFF = "Простая ловля",
+ CONFIG_EASYCAST_INFO = "Если активно, то когда ваша удочка надета и кликните пкм, вы забросите удочку.",
+ CONFIG_EASYLURES_ONOFF = "Авто-наживка",
+ CONFIG_EASYLURES_INFO = "Наживка будет автоматически применяться к вашей удочке, если это необходимо, конечно.",
+ CONFIG_ONLYMINE_ONOFF = "Одеть только удочку",
+ CONFIG_ONLYMINE_INFO = "Если включено, во время простой ловли будет проверяться ваше снаряжение только на наличие удочки.",
+ CONFIG_MOUSEFISHING_ONOFF = "Рыбалка мышкой",
+ CONFIG_MOUSEFISHING_INFO = "Если активно, лкм забросить удочку, пкм выудить.",
+ CONFIG_SHOWLOCATIONZONES_ONOFF = "Зоны",
+ CONFIG_SHOWLOCATIONZONES_INFO = "Показывать зоны и подзоны.",
+ CONFIG_SORTBYPERCENT_ONOFF = "Сорт по улову",
+ CONFIG_SORTBYPERCENT_INFO = "Упорядочить информацию об улове по его количеству, а не по алфавиту.",
+ CONFIG_STVTIMER_ONOFF = "Рыболовный таймер Рыбомании",
+ CONFIG_STVTIMER_INFO = "Если включено, отображает обратный отсчет времени до начал Рыбомании и обратный отсчет после.",
+ CONFIG_STVPOOLSONLY_ONOFF = "Забрасывать только в водоёмы",
+ CONFIG_STVPOOLSONLY_INFO = "Простая ловля будет применяться только тогда, когда курсор находится над водоёмом.",
+ CONFIG_USEBUTTONHOLE_ONOFF = "Use ButtonHole",
+ CONFIG_USEBUTTONHOLE_INFO = "If enabled, the ButtonHole addon will control the minimap button. Takes effect on the next login.",
+ CONFIG_USEGATHERER_ONOFF = "Использовать Gatherer",
+ CONFIG_USEGATHERER_INFO = "Если активно, #NAME# известит о рыбной лунке.",
+
+ CONFIG_SKILL_INFO = "Общий бонус к навыку от снаряжения.",
+ CONFIG_SKILL_TEXT = "Рыбалка ",
+ CONFIG_STYLISH_INFO = "Style points loosely inspired by Draznar's Fishing FAQ in the WoW forums.",
+ CONFIG_STYLISH_TEXT = "Style: ",
+
+ CONFIG_OUTFITTER_TEXT = "Бонус от снарежения: %s\r\nСчет (в стиле Draznar'а): %d ",
+
+ CLICKTOSWITCH_ONOFF = "Клик для смени набора",
+ CLICKTOSWITCH_INFO = "Левый клик будет переключать выбранный набор экипировки, вместо того, чтобы открывать главное окно #NAME#.",
+
+ LEFTCLICKTODRAG = "[Левый-клик] - перемещение",
+ RIGHTCLICKFORMENU = "[Правый-клик] - меню",
+ WATCHERCLICKHELP = "#LEFTCLICKTODRAG#\n#RIGHTCLICKFORMENU#",
+
+ MINIMAPBUTTONPLACEMENT = "Размещение",
+ MINIMAPBUTTONPLACEMENTTOOLTIP = "Позволяет перемещать иконку #NAME# у мини-карты",
+ CONFIG_MINIMAPBUTTON_ONOFF = "Иконка у мини карты",
+ CONFIG_MINIMAPBUTTON_INFO = "Показывать иконку #NAME# у мини карте.",
+
+ CONFIG_ENHANCESOUNDS_ONOFF = "Повысить громкость",
+ CONFIG_ENHANCESOUNDS_INFO = "Во время рыбалки, #NAME# увеличит громкость звука до максимума и уменьшит громкость звука окружающей среды до минимума.",
+
+ TRACKINGFRAME = "Tracking Frame",
+ TRACKINGFRAME_RIGHTCLICK = "Right-click to draw graphs for fish",
+ TRACKINGFRAME_LEFTCLICK = "Left-click to choose fish to track",
+-- TRACKINGFRAME_CLICKS = "#TRACKINGFRAME_RIGHTCLICK#\r#TRACKINGFRAME_LEFTCLICK#",
+ TRACKINGFRAME_CLICKS = "#TRACKINGFRAME_RIGHTCLICK#",
+
+ TRACKFISHHOURLY = "Track this fish hourly",
+ TRACKFISHWEEKLY = "Track this fish weekly",
+ HIDEINWATCHER = "Display this fish in the watcher",
+
+ -- messages
+ COMPATIBLE_SWITCHER = "Не найдено подходящего снаряжения.",
+ TOOMANYFISHERMEN = "У вас установлен другой аддон для простой ловли.",
+ FAILEDINIT = "Инициализация выполнена с ошибками.",
+ IMPORTMSG = "Imported '%s' database.",
+ NOIMPORTMSG = "No Impp, DataFish, or FishInfo2 databases found.",
+ ADDFISHIEMSG = "добавлено: %s, к локации %s.",
+ ADDSCHOOLMSG = "добавлено: '%s', к локации %s.",
+ CURSORBUSYMSG = "Couldn't switch because the cursor is busy!",
+ NOOUTFITDEFINED = "You don't have any items in your fishing outfit.",
+ NODATAMSG = "Не обнаружено данных.",
+ TRACKINGMSG = "Tracking '%s' %s.",
+ NOTRACKERRMSG = "Can't remove default cycle fish.",
+ NOTRACKMSG = "Removed cycle fish '%s'.",
+ POLEALREADYEQUIPPED = "You're already equipped for fishing.",
+ CANTSWITCHBACK = "You've already removed your fishing equipment.",
+ CLEANUP_NONEMSG = "Старых настроек не обнаружено.",
+ CLEANUP_WILLMSG = "Обнаружены старые настройки для |c#RED#%s|r: %s.",
+ CLEANUP_DONEMSG = "Старые настройки удалены для |c#RED#%s|r: %s.",
+ CLEANUP_NOOLDMSG = "Не обнаружено старых настроек у игрока |c#GREEN#%s|r.",
+ NONEAVAILABLE_MSG = "Недоступно",
+ UPDATEDB_MSG = "Обновлено название рыбы: %d.",
+
+ MINIMUMSKILL = "Минимальный навык: %d",
+ NOTLINKABLE = "<Создание ссылки невозможно>",
+ CAUGHTTHISMANY = "Поймано %d",
+ CAUGHTTHISTOTAL = "Всего %d",
+ FISHTYPES = "Типы рыб: %d",
+
+ DASH = " -- ",
+ FISHCAUGHT = "%d %s",
+ TIMETOGO = "Начало Рыбомании через %d:%02d",
+ TIMELEFT = "Конец Рыбомании через %d:%02d",
+ FATLADYSINGS = "|c#RED#Окончание Рыбомании|r (осталось %d:%02d)",
+ RIGGLE_BASSBAIT = "^Риггл Мормыш .*: .*! (.*) .*!$",
+
+ STVZONENAME = "Тернистая долина",
+
+ TOOLTIP_HINT = "Cовет:",
+ TOOLTIP_HINTSWITCH = "кликните, чтобы переключить набор снаряжения",
+ TOOLTIP_HINTTOGGLE = "кликните, чтобы открыть окно #NAME#.",
+
+ -- months for Tracking frame
+ ABBREV_JANUARY = "Янв",
+ ABBREV_APRIL = "Апр",
+ ABBREV_JULY = "Ию",
+ ABBREV_OCTOBER = "Окт",
+ ABBREV_DECEMBER = "Дек",
+
+ -- Key binding support
+ BINDING_HEADER_FISHINGBUDDY_BINDINGS = "#NAME#",
+ BINDING_NAME_FISHINGBUDDY_TOGGLE = "Переключение окна #NAME#",
+ BINDING_NAME_FISHINGBUDDY_SWITCH = "Переключение наборов снаряжения",
+ BINDING_NAME_FISHINGBUDDY_GOFISHING = "Экипироваться и начать рыбалку",
+
+ BINDING_NAME_TOGGLEFISHINGBUDDY_LOC = "Переключение окна локаций #NAME#",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_OUT = "Переключение окна снаряжения #NAME#",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_TRK = "Переключение окна отслеживания #NAME#",
+ BINDING_NAME_TOGGLEFISHINGBUDDY_OPT = "Переключение окна опций #NAME#",
+};
+
+FishingTranslations["ruRU"].IMPORT_HELP = {
+ "|c#GREEN#/fb #IMPORT#|r",
+ " Import Impp's fishinfo or FishInfo2 data.",
+};
+FishingTranslations["ruRU"].SWITCH_HELP = {
+ "|c#GREEN#/fb #SWITCH#|r",
+ " переключение между набора снаряжения (если доступны OutfitDisplayFrame или Outfitter)",
+};
+FishingTranslations["ruRU"].WATCHER_HELP = {
+ "|c#GREEN#/fb #WATCHER#|r [|c#GREEN##WATCHER_LOCK#|r or |c#GREEN##WATCHER_UNLOCK#|r or |c#GREEN##RESET#|r]",
+ " unlock - разблокировать окно наблюдателя для его перемещения,",
+ " lock - блокировать, reset - установить позицию по-умолчанию",
+};
+FishingTranslations["ruRU"].CURRENT_HELP = {
+ "|c#GREEN#/fb #CURRENT# #RESET#|r",
+ " Сбросить количество пойманной рыбы в этой сессии.",
+};
+FishingTranslations["ruRU"].UPDATEDB_HELP = {
+ "|c#GREEN#/fb #UPDATEDB# [#FORCE#]|r",
+ " Попробовать найти названия рыб, которые ещё не известны #NAME#.",
+ " Во время поиска не проверяются 'редкие' рыбы, которые могут",
+ " привести к отключения от сервера -- используйте опцию '#FORCE#' для их принудительной проверки.",
+};
+FishingTranslations["ruRU"].CLEANUP_HELP = {
+ "|c#GREEN#/fb #CLEANUP#|r [|c#GREEN#f#CHECK#|r or |c#GREEN##NOW#|r]",
+ " Очистка старых настроек. |c#GREEN##CHECK#|r - выдать список настроек,",
+ " которые будут удалены опцией |c#GREEN##NOW#|r.",
+};
+FishingTranslations["ruRU"].TRACKING_HELP = {
+ "|c#GREEN#/fb #TRACK#|r [|c#GREEN##HOURLY#|r or |c#GREEN##WEEKLY#|r] |c#PURPLE#|r",
+ " track the catch times for the specified fish (a shift click link)",
+ "|c#GREEN#/fb #NOTRACK#|r |c#PURPLE#|r",
+ " remove the specified fish (a shift click link) from the tracker",
+ "|c#GREEN#/fb #TRACKING#|r",
+ " a really bad display of when tracked fish were caught",
+};
+
+FishingTranslations["ruRU"].PRE_HELP = {
+ "You can use |c#GREEN#/fishingbuddy|r or |c#GREEN#/fb|r for all commands",
+ "|c#GREEN#/fb|r: переключение главного окна Fishing Buddy",
+ "|c#GREEN#/fb #HELP#|r: показать это сообщение",
+};
+FishingTranslations["ruRU"].POST_HELP = {
+ "Вы можете назначить клавиши для аддона в окне \"Назначение клавиш\"",
+};
+
diff --git a/readme.txt b/readme.txt
index 05cac10..c4e7252 100755
--- a/readme.txt
+++ b/readme.txt
@@ -49,7 +49,7 @@ Fishing Buddy
and many, many others!
- Feel free to send comments to Sutorix on the Windrunner server.
+ Feel free to send comments to Sutorix=AT=hotmail.com.
Installation
------------