Commit f12cda63 authored by Darth Predator's avatar Darth Predator
Browse files

Tweaks to fishing part of professions module + one new option

parent 6770c939
......@@ -61,6 +61,7 @@ V["sle"] = {
["UseLures"] = true,
["IgnorePole"] = false,
["CastButton"] = "Shift",
["relureThreshold"] = 8,
},
},
......
......@@ -704,7 +704,9 @@ L["Ingore Poles"] = true
L["If enabled will start fishing even if you don't have fishing pole equipped. Will not work if you have fish key set to \"None\"."] = true
L["Fish Key"] = true
L["Hold this button while clicking to allow fishing action."] = true
L["SLE_Prof_Relure_Error"] = "Can't use lure due to threshlod. Time left: %.1f seconds."
L["Re-lure Threshold"] = true
L["Time after the previous attemp to apply a lure before the next attempt will occure."] = true
--PvP
L["Functions dedicated to player versus player modes."] = true
......
......@@ -695,7 +695,9 @@ L["Ingore Poles"] = true
L["If enabled will start fishing even if you don't have fishing pole equipped. Will not work if you have fish key set to \"None\"."] = true
L["Fish Key"] = true
L["Hold this button while clicking to allow fishing action."] = true
L["SLE_Prof_Relure_Error"] = "Can't use lure due to threshlod. Time left: %.1f seconds."
L["Re-lure Threshold"] = true
L["Time after the previous attemp to apply a lure before the next attempt will occure."] = true
--PvP
L["Functions dedicated to player versus player modes."] = true
......
......@@ -701,7 +701,9 @@ L["Ignore Poles"] = "Без удочки"
L["If enabled will start fishing even if you don't have fishing pole equipped. Will not work if you have fish key set to \"None\"."] = "При включении будет начинать рыбачить даже без надетой удочки. Не будет работать, если модификатор рыбалки выставлен на \"Нет\"."
L["Fish Key"] = "Модификатор рыбалки"
L["Hold this button while clicking to allow fishing action."] = "Удерживайте эту кнопку для быстрой рыбалки."
L["SLE_Prof_Relure_Error"] = "Не могу использовать приманку из-за заданного интервала задержки. Осталось времени: %.1f секунд."
L["Re-lure Threshold"] = "Задержка наживки"
L["Time after the previous attemp to apply a lure before the next attempt will occure."] = "Время после последней попытки использования наживки, через котороне наживка вновь будет автоматически применяться."
--PvP
L["Functions dedicated to player versus player modes."] = "Функции для режима игрок Против Игрока."
......
......@@ -21,24 +21,26 @@ local function HideAwayAll(self, button, down)
end
function Pr:GetUpdateLure()
local lureinventory, useinventory = FL:GetLureInventory();
-- local lureinventory, useinventory = FL:GetLureInventory();
if E.private.sle.professions.fishing.UseLures then
-- only apply a lure if we're actually fishing with a "real" pole
if (FL:IsFishingPole()) then
-- Let's wait a bit so that the enchant can show up before we lure again
if ( Pr.LastLure and Pr.LastLure.time and ((Pr.LastLure.time - T.GetTime()) > 0) ) then
SLE:Print(T.format(L["SLE_Prof_Relure_Error"], Pr.LastLure.time - T.GetTime()))
return false;
end
if ( Pr.LastLure ) then
Pr.LastLure.time = nil;
Pr.LureState = 0
end
local skill, _, _, _ = FL:GetCurrentSkill();
if (skill > 0) then
local NextLure, NextState;
local pole, tempenchant = FL:GetPoleBonus();
local tempenchant = FL:GetPoleBonus();
local state, bestlure = FL:FindBestLure(tempenchant, Pr.LureState);
if ( state and bestlure and tempenchant == 0 ) then
NextState = state;
......@@ -56,7 +58,7 @@ function Pr:GetUpdateLure()
Pr.AddingLure = true;
Pr.LastLure = DoLure;
Pr.LureState = NextState;
Pr.LastLure.time = T.GetTime() + Pr.RELURE_DELAY;
Pr.LastLure.time = T.GetTime() + E.private.sle.professions.fishing.relureThreshold;
local id = DoLure.id;
local name = DoLure.n;
return true, id, name;
......@@ -123,7 +125,7 @@ function Pr:FishingInitialize()
Pr.LastLure = nil
Pr.LureState = 0
Pr.LastCastTime = nil
Pr.RELURE_DELAY = 8 --Wait before trying to lure again 3 (cast time) + 5 second wait
-- Pr.RELURE_DELAY = 8 --Wait before trying to lure again 3 (cast time) + 5 second wait
Pr.FishingUpdateFrame = CreateFrame("Frame", "SLE_FishingUpdateFrame", E.UIParent)
Pr.FishingUpdateFrame:SetScript("OnUpdate", function(self)
local stop = true;
......@@ -131,7 +133,7 @@ function Pr:FishingInitialize()
FL:ResetOverride();
if ( Pr.AddingLure ) then
local sp, sub, txt, tex, st, et, trade, int = UnitChannelInfo("player");
local _, lure = FL:GetPoleBonus();
local lure = FL:GetPoleBonus();
if ( not sp or not Pr.LastLure or (lure and lure == Pr.LastLure.b) ) then
Pr.AddingLure = false;
FL:UpdateLureInventory();
......@@ -146,6 +148,7 @@ function Pr:FishingInitialize()
end)
Pr.FishingUpdateFrame:Hide()
FL:GetPoleType()
FL:CreateSAButton()
FL:SetSAMouseEvent()
TrapWorldMouse()
......
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file='professions.lua'/>
<!-- <Script file='fishing.lua'/> -->
<Script file='fishing.lua'/>
<Script file='enchant.lua'/>
<Script file='deconstruct.lua'/>
</Ui>
\ No newline at end of file
......@@ -187,8 +187,18 @@ local function configTable()
get = function(info) return E.private.sle.professions.fishing.UseLures end,
set = function(info, value) E.private.sle.professions.fishing.UseLures = value; end,
},
IgnorePole = {
relureThreshold = {
order = 4,
type = 'range',
name = L["Re-lure Threshold"],
desc = L["Time after the previous attemp to apply a lure before the next attempt will occure."],
min = 1, max = 15, step = 1,
disabled = function() return not E.private.sle.professions.fishing.EasyCast or not E.private.sle.professions.fishing.UseLures end,
get = function(info) return E.private.sle.professions.fishing.relureThreshold end,
set = function(info, value) E.private.sle.professions.fishing.relureThreshold = value; end,
},
IgnorePole = {
order = 5,
name = L["Ignore Poles"],
desc = L["If enabled will start fishing even if you don't have fishing pole equipped. Will not work if you have fish key set to \"None\"."],
type = "toggle",
......@@ -197,7 +207,7 @@ local function configTable()
set = function(info, value) E.private.sle.professions.fishing.IgnorePole = value; end,
},
CastButton = {
order = 5,
order = 6,
name = L["Fish Key"],
desc = L["Hold this button while clicking to allow fishing action."],
type = "select",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment