FlightPoints - first messy version

For now i only figured and partilly fixed tooltip on the destination node.
However data seems to be different from the WoTLK Classic. And would need to be completely rewritten.
Also i have problem with debug string as it is currently unable to get hops FPs in between start and end nodes correctly...

And it seems that my routestring is bad too. As it is for some reason adds un-needed zeroes between nodes
For example: FP from Orgrimmar to Valormok, no hop in between them, Orgrimmar added twice and a lot of un-necessary zeroes in between.
["0.63:0.56:0.00:0.00:0.63:0.64"] =  -- Orgrimmar, Orgrimmar, Valormok
This commit is contained in:
Sattva
2023-06-13 16:09:49 +03:00
parent 6e9c152e65
commit 1eb7d161d3
5 changed files with 566 additions and 541 deletions
+2
View File
@@ -39,6 +39,8 @@ Auto-Ress in BG - With option "Exclude Alterac" will it not auto-res in Alter
Accept Ress - Will it ever accept ressurection if ressurecter in combat ?
QueueTimer - Need to test if timer .After 0.1 is fine in SetupBar func (was 1 second before)
--------------------------------------------------------------------------------
-- Stuff to-do:
+56 -34
View File
@@ -5807,7 +5807,7 @@ function LeaPlusLC:FriendCheck(name)
local function SetupBar()
LibCompat.After(1, function()
LibCompat.After(0.1, function()
if not StaticPopup1:IsShown() and not MiniMapBattlefieldFrame:IsShown() then
-- print("resetting")
started = false
@@ -6163,7 +6163,7 @@ function LeaPlusLC:FriendCheck(name)
local timeBuffer = 15
-- Create editbox
local editFrame = CreateFrame("ScrollFrame", nil, UIParent, "InputScrollFrameTemplate")
local editFrame = CreateFrame("ScrollFrame", nil, UIParent, "Leatrix_InputScrollFrameTemplate")
-- Set frame parameters
editFrame:ClearAllPoints()
@@ -6172,7 +6172,7 @@ function LeaPlusLC:FriendCheck(name)
editFrame:SetFrameStrata("MEDIUM")
editFrame:SetToplevel(true)
editFrame:Hide()
editFrame.CharCount:Hide()
-- editFrame.CharCount:Hide()
-- Add background color
editFrame.t = editFrame:CreateTexture(nil, "BACKGROUND")
@@ -6180,29 +6180,29 @@ function LeaPlusLC:FriendCheck(name)
editFrame.t:SetVertexColor(0.00, 0.00, 0.0, 0.6)
-- Set textures
editFrame.LeftTex:SetTexture(editFrame.RightTex:GetTexture()); editFrame.LeftTex:SetTexCoord(1, 0, 0, 1)
editFrame.BottomTex:SetTexture(editFrame.TopTex:GetTexture()); editFrame.BottomTex:SetTexCoord(0, 1, 1, 0)
editFrame.BottomRightTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0)
editFrame.BottomLeftTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.BottomLeftTex:SetTexCoord(1, 0, 1, 0)
editFrame.TopLeftTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.TopLeftTex:SetTexCoord(1, 0, 0, 1)
-- editFrame.LeftTex:SetTexture(editFrame.RightTex:GetTexture()); editFrame.LeftTex:SetTexCoord(1, 0, 0, 1)
-- editFrame.BottomTex:SetTexture(editFrame.TopTex:GetTexture()); editFrame.BottomTex:SetTexCoord(0, 1, 1, 0)
-- editFrame.BottomRightTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0)
-- editFrame.BottomLeftTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.BottomLeftTex:SetTexCoord(1, 0, 1, 0)
-- editFrame.TopLeftTex:SetTexture(editFrame.TopRightTex:GetTexture()); editFrame.TopLeftTex:SetTexCoord(1, 0, 0, 1)
-- Create title bar
local titleFrame = CreateFrame("ScrollFrame", nil, editFrame, "InputScrollFrameTemplate")
local titleFrame = CreateFrame("ScrollFrame", nil, editFrame, "Leatrix_InputScrollFrameTemplate")
titleFrame:ClearAllPoints()
titleFrame:SetPoint("TOP", 0, 32)
titleFrame:SetSize(600, 24)
titleFrame:SetFrameStrata("MEDIUM")
titleFrame:SetToplevel(true)
titleFrame:SetHitRectInsets(-6, -6, -6, -6)
titleFrame.CharCount:Hide()
-- titleFrame.CharCount:Hide()
titleFrame.t = titleFrame:CreateTexture(nil, "BACKGROUND")
titleFrame.t:SetAllPoints()
titleFrame.t:SetVertexColor(0.00, 0.00, 0.0, 0.6)
titleFrame.LeftTex:SetTexture(titleFrame.RightTex:GetTexture()); titleFrame.LeftTex:SetTexCoord(1, 0, 0, 1)
titleFrame.BottomTex:SetTexture(titleFrame.TopTex:GetTexture()); titleFrame.BottomTex:SetTexCoord(0, 1, 1, 0)
titleFrame.BottomRightTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0)
titleFrame.BottomLeftTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomLeftTex:SetTexCoord(1, 0, 1, 0)
titleFrame.TopLeftTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.TopLeftTex:SetTexCoord(1, 0, 0, 1)
-- titleFrame.LeftTex:SetTexture(titleFrame.RightTex:GetTexture()); titleFrame.LeftTex:SetTexCoord(1, 0, 0, 1)
-- titleFrame.BottomTex:SetTexture(titleFrame.TopTex:GetTexture()); titleFrame.BottomTex:SetTexCoord(0, 1, 1, 0)
-- titleFrame.BottomRightTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomRightTex:SetTexCoord(0, 1, 1, 0)
-- titleFrame.BottomLeftTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.BottomLeftTex:SetTexCoord(1, 0, 1, 0)
-- titleFrame.TopLeftTex:SetTexture(titleFrame.TopRightTex:GetTexture()); titleFrame.TopLeftTex:SetTexCoord(1, 0, 0, 1)
-- Add title
titleFrame.m = titleFrame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
@@ -6219,17 +6219,17 @@ function LeaPlusLC:FriendCheck(name)
titleFrame.x:SetWordWrap(false)
titleFrame.x:SetJustifyH("RIGHT")
local titleBox = titleFrame.EditBox
titleBox:Hide()
titleBox:SetEnabled(false)
titleBox:SetMaxLetters(0)
-- local titleBox = titleFrame.EditBox
-- titleBox:Hide()
-- titleBox:SetEnabled(false)
-- titleBox:SetMaxLetters(0)
-- Create editbox
local editBox = editFrame.EditBox
editBox:SetAltArrowKeyMode(false)
editBox:SetTextInsets(4, 4, 4, 4)
editBox:SetWidth(editFrame:GetWidth() - 30)
editBox:SetSecurityDisablePaste()
-- editBox:SetSecurityDisablePaste()
editBox:SetFont(_G["ChatFrame1"]:GetFont())
editBox:SetMaxLetters(0)
@@ -6306,7 +6306,7 @@ function LeaPlusLC:FriendCheck(name)
if nodeType == "CURRENT" then
-- Get current node
local continent = getContinent()
local continent = true
local startX, startY = TaxiNodePosition(i)
local currentNode = string.format("%0.2f", startX) .. ":" .. string.format("%0.2f", startY)
@@ -6323,9 +6323,9 @@ function LeaPlusLC:FriendCheck(name)
local debugString = '["' .. currentNode
local routeString = currentNode
for i = 2, numHops + 1 do
local hopPosX, hopPosY = TaxiNodePosition(TaxiGetNodeSlot(node, i, true))
local hopPos = string.format("%0.2f", hopPosX) .. ":" .. string.format("%0.2f", hopPosY)
local fpName = string.split(", ", TaxiNodeName(TaxiGetNodeSlot(node, i, true)))
local hopPosX, hopPosY = "TaxiNodePosition(TaxiGetNodeSlot(node, i, true))"
local hopPos = string.format("%0.2f", "hopPosX") .. ":" .. string.format("%0.2f", "hopPosY")
local fpName = string.split(", ", "TaxiNodeName(TaxiGetNodeSlot(node, i, true))")
debugString = debugString .. ":" .. hopPos
routeString = routeString .. ":" .. hopPos
end
@@ -6339,7 +6339,7 @@ function LeaPlusLC:FriendCheck(name)
debugString = debugString .. '"] = TimeTakenPlaceHolder,'
debugString = debugString .. " -- " .. nodeName
for i = 2, numHops + 1 do
local fpName = string.split(",", TaxiNodeName(TaxiGetNodeSlot(node, i, true)))
local fpName = string.split(",", "TaxiNodeName(TaxiGetNodeSlot(node, i, true))")
debugString = debugString .. ", " .. fpName
end
@@ -6519,7 +6519,7 @@ function LeaPlusLC:FriendCheck(name)
end
-- Stop the progress bar under various circumstances
hooksecurefunc("TaxiRequestEarlyLanding", CeaseProgress)
-- hooksecurefunc("TaxiRequestEarlyLanding", CeaseProgress)
hooksecurefunc("AcceptBattlefieldPort", CeaseProgress)
hooksecurefunc("ConfirmSummon", CeaseProgress)
@@ -6532,7 +6532,7 @@ function LeaPlusLC:FriendCheck(name)
if nodeType == "CURRENT" then
-- Get current node
local continent = getContinent()
local continent = GetCurrentMapContinent()
local startX, startY = TaxiNodePosition(i)
local currentNode = string.format("%0.2f", startX) .. ":" .. string.format("%0.2f", startY)
@@ -6546,15 +6546,30 @@ function LeaPlusLC:FriendCheck(name)
local debugString = '["' .. currentNode
local routeString = currentNode
for i = 2, numEnterHops + 1 do
local hopPosX, hopPosY = TaxiNodePosition(TaxiGetNodeSlot(index, i, true)) -- TaxiNodeName
local hopPos = string.format("%0.2f", hopPosX) .. ":" .. string.format("%0.2f", hopPosY)
local fpName = string.split(", ", TaxiNodeName(TaxiGetNodeSlot(index, i, true)))
local nextHopX = string.format("%0.2f", TaxiGetDestX(index, i))
local nextHopY = string.format("%0.2f", TaxiGetDestY(index, i))
local hopPos = nextHopX .. ":" .. nextHopY
local fpName = TaxiNodeName(i)
-- Find comma index
local commaIndex = fpName:find(", ")
-- Get first word
local firstWord = fpName:sub(1, commaIndex - 1)
fpName = firstWord
-- print(fpName)
debugString = debugString .. ":" .. hopPos
routeString = routeString .. ":" .. hopPos
end
-- print(routeString .. destination)
-- If route string does not contain destination, add it to the end (such as Altar of Sha'tar)
if not string.find(routeString, destination) then
-- print(routeString .. "and" .. destination)
debugString = debugString .. ":" .. destination
routeString = routeString .. ":" .. destination
end
@@ -6576,7 +6591,14 @@ function LeaPlusLC:FriendCheck(name)
-- Add node names to debug string
debugString = debugString .. " -- " .. nodeName
for i = 2, numEnterHops + 1 do
local fpName = string.split(",", TaxiNodeName(TaxiGetNodeSlot(index, i, true)))
local fpName = TaxiNodeName(i)
-- Find comma index
local commaIndex = fpName:find(", ")
-- Get first word
local firstWord = fpName:sub(1, commaIndex - 1)
fpName = firstWord
debugString = debugString .. ", " .. fpName
end
@@ -6586,7 +6608,7 @@ function LeaPlusLC:FriendCheck(name)
end
-- Print debug string (used for showing full routes for nodes)
-- print(debugString)
print(debugString)
end
end
@@ -6598,7 +6620,7 @@ function LeaPlusLC:FriendCheck(name)
end
hooksecurefunc("TaxiNodeOnButtonEnter", StopLandingEvent)
hooksecurefunc("TaxiRequestEarlyLanding", StopLandingEvent)
-- hooksecurefunc("TaxiRequestEarlyLanding", StopLandingEvent)
hooksecurefunc("AcceptBattlefieldPort", StopLandingEvent)
hooksecurefunc("ConfirmSummon", StopLandingEvent)
+4 -4
View File
@@ -15,7 +15,7 @@
----------------------------------------------------------------------
-- Alliance: Eastern Kingdoms
[1415] = {
[2] = {
-- Alliance: Acherus (Eastern Plaguelands)
["0.62:0.34:0.61:0.35:0.58:0.06"] = 385, -- Acherus: The Ebon Hold, Light's Hope Chapel, Shattered Sun Staging Area
@@ -714,7 +714,7 @@
},
-- Alliance: Kalimdor
[1414] = {
[1] = {
-- Alliance: Blood Watch (Bloodmyst Isle)
["0.22:0.18:0.21:0.26"] = 77, -- Blood Watch, The Exodar (Nick Bijl reported 110)
@@ -1411,7 +1411,7 @@
},
-- Alliance: Outland
[1945] = {
[3] = {
-- Alliance: Allerian Stronghold (Terokkar Forest)
["0.55:0.77:0.27:0.74"] = 149, -- Allerian Stronghold, Telaar
@@ -1870,7 +1870,7 @@
},
-- Alliance: Northrend
[113] = {
[4] = {
----------------------------------------------------------------------
-- Alliance: Borean Tundra
+8 -8
View File
@@ -15,7 +15,7 @@
----------------------------------------------------------------------
-- Horde: Eastern Kingdoms
[1415] = {
[2] = {
-- Horde: Acherus (Eastern Plaguelands)
["0.62:0.34:0.61:0.35:0.61:0.28:0.58:0.06"] = 392, -- Acherus: The Ebon Hold, Light's Hope Chapel, Zul'Aman, Shattered Sun Staging Area
@@ -560,7 +560,7 @@
},
-- Horde: Kalimdor
[1414] = {
[1] = {
-- Horde: Bloodvenom Post (Felwood)
["0.46:0.30:0.56:0.53:0.55:0.73:0.61:0.80"] = 518, -- Bloodvenom Post, Crossroads, Freewind Post, Gadgetzan
@@ -961,14 +961,14 @@
["0.63:0.44:0.45:0.56"] = 224, -- Orgrimmar, Thunder Bluff (David Galindo suggested 233)
["0.63:0.44:0.56:0.53"] = 110, -- Orgrimmar, Crossroads
["0.63:0.44:0.61:0.55"] = 108, -- Orgrimmar, Ratchet
["0.63:0.44:0.63:0.36"] = 95, -- Orgrimmar, Valormok
["0.63:0.44:0.55:0.42"] = 90, -- Orgrimmar, Splintertree Post
["0.63:0.56:0.00:0.00:0.63:0.64"] = 95, -- Orgrimmar, Valormok
["0.63:0.56:0.00:0.000.63:0.64"] = 90, -- Orgrimmar, Splintertree Post
["0.63:0.44:0.56:0.53:0.41:0.47"] = 258, -- Orgrimmar, Crossroads, Sun Rock Retreat
["0.63:0.44:0.55:0.42:0.41:0.37"] = 249, -- Orgrimmar, Splintertree Post, Zoram'gar Outpost
["0.63:0.44:0.55:0.42:0.50:0.35"] = 168, -- Orgrimmar, Splintertree Post, Emerald Sanctuary
["0.63:0.44:0.46:0.30"] = 252, -- Orgrimmar, Bloodvenom Post
["0.63:0.44:0.63:0.36:0.64:0.23:0.54:0.21"] = 358, -- Orgrimmar, Valormok, Everlook, Moonglade
["0.63:0.44:0.64:0.23"] = 240, -- Orgrimmar, Everlook
["0.63:0.56:0.64:0.77:0.54:0.79:0.00:0.00"] = 358, -- Orgrimmar, Valormok, Everlook, Moonglade
["0.63:0.56:0.00:0.00:0.64:0.77"] = 240, -- Orgrimmar, Everlook
["0.63:0.44:0.55:0.42:0.50:0.35:0.46:0.30:0.54:0.21"] = 371, -- Orgrimmar, Splintertree Post, Emerald Sanctuary, Bloodvenom Post, Moonglade
["0.63:0.44:0.56:0.53:0.41:0.37"] = 339, -- Orgrimmar, Crossroads, Zoram'gar Outpost
["0.63:0.44:0.64:0.23:0.54:0.21"] = 374, -- Orgrimmar, Everlook, Moonglade
@@ -1201,7 +1201,7 @@
},
-- Horde: Outland
[1945] = {
[3] = {
-- Horde: Altar of Sha'tar (Shadowmoon Valley)
["0.81:0.77:0.66:0.77"] = 67, -- Altar of Sha'tar, Shadowmoon Village
@@ -1694,7 +1694,7 @@
},
-- Horde: Northrend
[113] = {
[4] = {
----------------------------------------------------------------------
-- Horde: Borean Tundra
+496 -495
View File
File diff suppressed because it is too large Load Diff