From e0391ca790c73d13919b44088ac0cd514e5cc40e Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Sat, 18 Sep 2021 18:08:02 +0200 Subject: [PATCH] Added new stats distances: swam, rode, flew, on taxi, as ghost --- Trackster.toc | 4 +- main.lua | 285 ++++++++++++++++++++++++++++++++++++++++++++------ options.lua | 90 ++++++++++++++++ 3 files changed, 347 insertions(+), 32 deletions(-) diff --git a/Trackster.toc b/Trackster.toc index d95cbca..176cf3b 100644 --- a/Trackster.toc +++ b/Trackster.toc @@ -5,7 +5,7 @@ ## Version: 1.2 # Stats stated here are saved per character. -## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter +## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter, Trackster_distanceTravelledCounter__swam, Trackster_distanceTravelledCounter__walked, Trackster_distanceTravelledCounter__groundmount, Trackster_distanceTravelledCounter__flight, Trackster_distanceTravelledCounter__taxi, Trackster_distanceTravelledCounter__ghost # Stats stated here are saved for the whole wow client. @@ -13,7 +13,7 @@ # These are the settings values. -## SavedVariablesPerCharacter: Trackster_deathOffset, Trackster_killsOffset, Trackster_questsOffset, Trackster_dmgOffset, Trackster_jumpOffset, Trackster_IlvlOffset, Trackster_castOffset, Trackster_critOffset, Trackster_loginOffset, Trackster_bossOffset, Trackster_chatOffset, Trackster_itemOffset, Trackster_timeOffset, Trackster_goldOffset, Trackster_distanceTravelledOffset, Trackster_timestampRunBegin, Trackster_HearthstonesOffset +## SavedVariablesPerCharacter: Trackster_deathOffset, Trackster_killsOffset, Trackster_questsOffset, Trackster_dmgOffset, Trackster_jumpOffset, Trackster_IlvlOffset, Trackster_castOffset, Trackster_critOffset, Trackster_loginOffset, Trackster_bossOffset, Trackster_chatOffset, Trackster_itemOffset, Trackster_timeOffset, Trackster_goldOffset, Trackster_distanceTravelledOffset, Trackster_timestampRunBegin, Trackster_HearthstonesOffset, Trackster_distanceTravelledOffset__swam, Trackster_distanceTravelledOffset__walked, Trackster_distanceTravelledOffset__groundmount, Trackster_distanceTravelledOffset__flight, Trackster_distanceTravelledOffset__taxi, Trackster_distanceTravelledOffset__ghost # These are internal values. Just don't touch those. ## SavedVariablesPerCharacter: Trackster_showMainframe, Trackster_frameScale diff --git a/main.lua b/main.lua index 0cb8dd2..15aaf53 100644 --- a/main.lua +++ b/main.lua @@ -15,6 +15,12 @@ Trackster_chatCounter = 0; Trackster_itemCounter = 0; Trackster_goldCounter = 0; Trackster_distanceTravelledCounter = 0; +Trackster_distanceTravelledCounter__swam = 0; +Trackster_distanceTravelledCounter__walked = 0; +Trackster_distanceTravelledCounter__groundmount = 0; +Trackster_distanceTravelledCounter__flight = 0; +Trackster_distanceTravelledCounter__ghost = 0; +Trackster_distanceTravelledCounter__taxi = 0; Trackster_frameScale = 1; @@ -57,10 +63,28 @@ local fsKills = mainFrame:CreateFontString(nil, "OVERLAY", textFont); Trackster_killsOffset = 0; local fsDist = mainFrame:CreateFontString(nil, "OVERLAY", textFont); -Trackster_distanceTravelledOffset = -0; +Trackster_distanceTravelledOffset = 0; + +local fsDist__swam = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__swam = 0; + +local fsDist__walked = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__walked = 0; + +local fsDist__groundmount = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__groundmount = 0; + +local fsDist__flight = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__flight = 0; + +local fsDist__taxi = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__taxi = 0; + +local fsDist__ghost = mainFrame:CreateFontString(nil, "OVERLAY", textFont); +Trackster_distanceTravelledOffset__ghost = 0; local fsQuests = mainFrame:CreateFontString(nil, "OVERLAY", textFont); -Trackster_questsOffset = -0; +Trackster_questsOffset = 0; --local fsDmg = mainFrame:CreateFontString(nil, "OVERLAY", textFont); --Trackster_dmgOffset = 0; @@ -128,22 +152,28 @@ fsDeaths:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (1 * textMarginB))); fsTime:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (2 * textMarginB))); fsAbsTime:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (3 * textMarginB))); fsDist:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (4 * textMarginB))); -fsQuests:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (5 * textMarginB))); -fsPlvl:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (6 * textMarginB))); -fsIlvl:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (7 * textMarginB))); +fsDist__swam:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (5 * textMarginB))); +fsDist__walked:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (6 * textMarginB))); +fsDist__groundmount:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (7 * textMarginB))); +fsDist__flight:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (8 * textMarginB))); +fsDist__taxi:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (9 * textMarginB))); +fsDist__ghost:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (10 * textMarginB))); +fsQuests:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (11 * textMarginB))); +fsPlvl:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (12 * textMarginB))); +fsIlvl:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (13 * textMarginB))); --fsDmg:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (5 * textMarginB))); -fsGold:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (8 * textMarginB))); -fsBoss:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (9 * textMarginB))); -fsCasts:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (10 * textMarginB))); -fsCrits:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (11 * textMarginB))); -fsLogins:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (12 * textMarginB))); +fsGold:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (14 * textMarginB))); +fsBoss:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (15 * textMarginB))); +fsCasts:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (16 * textMarginB))); +fsCrits:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (17 * textMarginB))); +fsLogins:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (18 * textMarginB))); --fsItem:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (12 * textMarginB))); -fsChat:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (13 * textMarginB))); -fsJump:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (14 * textMarginB))); -fsHearthstones:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (15 * textMarginB))); +fsChat:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (19 * textMarginB))); +fsJump:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (20 * textMarginB))); +fsHearthstones:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (21 * textMarginB))); mainFrame:SetWidth(220 + textMarginL); -mainFrame:SetHeight((textMarginT * 2) + (textMarginB * 21)); +mainFrame:SetHeight((textMarginT * 2) + (textMarginB * 22)); mainFrame:EnableMouse(true); mainFrame:SetPoint("CENTER", 480, 0, UIParent); mainFrame:SetMovable(true); @@ -214,29 +244,182 @@ function Round(f) return math.floor(f+0.5); end -local timer = 0; +local timer__all = 0; +local timer__swam = 0; +local timer__walked = 0; +local timer__groundmount = 0; +local timer__flight = 0; +local timer__taxi = 0; +local timer__ghost = 0; function UpdateDistanceTravelled(self, deltaTime, forceTextUpdate) --> Update value in background in every frame - Trackster_distanceTravelledCounter = Trackster_distanceTravelledCounter + (GetUnitSpeed("PLAYER") * 0.9144 * deltaTime); - local val = Round(Trackster_distanceTravelledCounter + Trackster_distanceTravelledOffset); - - timer = timer + deltaTime; - local updateDelayS = 1; - if (val < 5000) then - updateDelayS = 0.1; - elseif (val < 10000) then - updateDelayS = 1; + local deltaDistance = GetUnitSpeed("PLAYER") * 0.9144 * deltaTime; + Trackster_distanceTravelledCounter = Trackster_distanceTravelledCounter + deltaDistance; + + --> Increment specialized distance counters, if the state fits (like, swimming only if IsSwimming() == true) + if (IsSwimming()) then + Trackster_distanceTravelledCounter__swam = Trackster_distanceTravelledCounter__swam + deltaDistance; + elseif (UnitOnTaxi("PLAYER")) then + Trackster_distanceTravelledCounter__taxi = Trackster_distanceTravelledCounter__taxi + deltaDistance; + elseif (IsFlying()) then + Trackster_distanceTravelledCounter__flight = Trackster_distanceTravelledCounter__flight + deltaDistance; + elseif (IsMounted()) then + Trackster_distanceTravelledCounter__groundmount = Trackster_distanceTravelledCounter__groundmount + deltaDistance; + elseif (UnitIsDeadOrGhost("PLAYER")) then + Trackster_distanceTravelledCounter__ghost = Trackster_distanceTravelledCounter__ghost + deltaDistance; else - updateDelayS = 10; + Trackster_distanceTravelledCounter__walked = Trackster_distanceTravelledCounter__walked + deltaDistance; + end + + + local val__all = Round(Trackster_distanceTravelledCounter + Trackster_distanceTravelledOffset); + local val__swam = Round(Trackster_distanceTravelledCounter__swam + Trackster_distanceTravelledOffset__swam); + local val__walked = Round(Trackster_distanceTravelledCounter__walked + Trackster_distanceTravelledOffset__walked); + local val__groundmount = Round(Trackster_distanceTravelledCounter__groundmount + Trackster_distanceTravelledOffset__groundmount); + local val__flight = Round(Trackster_distanceTravelledCounter__flight + Trackster_distanceTravelledOffset__flight); + local val__taxi = Round(Trackster_distanceTravelledCounter__taxi + Trackster_distanceTravelledOffset__taxi); + local val__ghost = Round(Trackster_distanceTravelledCounter__ghost + Trackster_distanceTravelledOffset__ghost); + + timer__all = timer__all + deltaTime; + timer__swam = timer__swam + deltaTime; + timer__walked = timer__walked + deltaTime; + timer__groundmount = timer__groundmount + deltaTime; + timer__flight = timer__flight + deltaTime; + timer__taxi = timer__taxi + deltaTime; + timer__ghost = timer__ghost + deltaTime; + + local updateDelayS__all = 1; + local updateDelayS__swam = 1; + local updateDelayS__walked = 1; + local updateDelayS__groundmount = 1; + local updateDelayS__flight = 1; + local updateDelayS__taxi = 1; + local updateDelayS__ghost = 1; + + if (val__all < 5000) then + updateDelayS__all = 0.1; + elseif (val__all < 10000) then + updateDelayS__all = 1; + else + updateDelayS__all = 10; end - if (timer >= updateDelayS or forceTextUpdate) then --> Update UI text every deltaTime seconds - if (val < 10000) then - fsDist:SetText("Distance travelled: " .. val .. "m"); + if (val__swam < 5000) then + updateDelayS__swam = 0.1; + elseif (val__swam < 10000) then + updateDelayS__swam = 1; + else + updateDelayS__swam = 10; + end + + if (val__walked < 5000) then + updateDelayS__walked = 0.1; + elseif (val__walked < 10000) then + updateDelayS__walked = 1; + else + updateDelayS__walked = 10; + end + + if (val__groundmount < 5000) then + updateDelayS__groundmount = 0.1; + elseif (val__groundmount < 10000) then + updateDelayS__groundmount = 1; + else + updateDelayS__groundmount = 10; + end + + if (val__flight < 5000) then + updateDelayS__flight = 0.1; + elseif (val__flight < 10000) then + updateDelayS__flight = 1; + else + updateDelayS__flight = 10; + end + + if (val__taxi < 5000) then + updateDelayS__taxi = 0.1; + elseif (val__taxi < 10000) then + updateDelayS__taxi = 1; + else + updateDelayS__taxi = 10; + end + + if (val__ghost < 5000) then + updateDelayS__ghost = 0.1; + elseif (val__ghost < 10000) then + updateDelayS__ghost = 1; + else + updateDelayS__ghost = 10; + end + + if (timer__all >= updateDelayS__all or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__all < 10000) then + fsDist:SetText("Distance travelled: " .. val__all .. "m"); else - fsDist:SetText("Distance travelled: " .. Round(val/1000) .. "km"); + fsDist:SetText("Distance travelled: " .. Round(val__all/1000) .. "km"); end - timer = 0; + + timer__all = 0; + end + + if (timer__swam >= updateDelayS__swam or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__swam < 10000) then + fsDist__swam:SetText("Distance swam: " .. val__swam .. "m"); + else + fsDist__swam:SetText("Distance swam: " .. Round(val__swam/1000) .. "km"); + end + + timer__swam = 0; + end + + if (timer__walked >= updateDelayS__walked or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__walked < 10000) then + fsDist__walked:SetText("Distance by foot: " .. val__walked .. "m"); + else + fsDist__walked:SetText("Distance by foot: " .. Round(val__walked/1000) .. "km"); + end + + timer__walked = 0; + end + + if (timer__groundmount >= updateDelayS__groundmount or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__groundmount < 10000) then + fsDist__groundmount:SetText("Distance rode: " .. val__groundmount .. "m"); + else + fsDist__groundmount:SetText("Distance rode: " .. Round(val__groundmount/1000) .. "km"); + end + + timer__groundmount = 0; + end + + if (timer__flight >= updateDelayS__flight or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__flight < 10000) then + fsDist__flight:SetText("Distance flew: " .. val__flight .. "m"); + else + fsDist__flight:SetText("Distance flew: " .. Round(val__flight/1000) .. "km"); + end + + timer__flight = 0; + end + + if (timer__taxi >= updateDelayS__taxi or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__taxi < 10000) then + fsDist__taxi:SetText("Distance on taxi: " .. val__taxi .. "m"); + else + fsDist__taxi:SetText("Distance on taxi: " .. Round(val__taxi/1000) .. "km"); + end + + timer__taxi = 0; + end + + if (timer__ghost >= updateDelayS__ghost or forceTextUpdate) then --> Update UI text every deltaTime seconds + if (val__ghost < 10000) then + fsDist__ghost:SetText("Distance haunted: " .. val__ghost .. "m"); + else + fsDist__ghost:SetText("Distance haunted: " .. Round(val__ghost/1000) .. "km"); + end + + timer__ghost = 0; end end @@ -408,6 +591,48 @@ Trackster.OffsetDistance = function(offset) UpdateDistanceTravelled(0,0,true); end +Trackster.OffsetDistance__swam = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__swam; end; + + Trackster_distanceTravelledOffset__swam = offset; + UpdateDistanceTravelled(0,0,true); +end + +Trackster.OffsetDistance__walked = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__walked; end; + + Trackster_distanceTravelledOffset__walked = offset; + UpdateDistanceTravelled(0,0,true); +end + +Trackster.OffsetDistance__groundmount = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__groundmount; end; + + Trackster_distanceTravelledOffset__groundmount = offset; + UpdateDistanceTravelled(0,0,true); +end + +Trackster.OffsetDistance__flight = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__flight; end; + + Trackster_distanceTravelledOffset__flight = offset; + UpdateDistanceTravelled(0,0,true); +end + +Trackster.OffsetDistance__taxi = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__taxi; end; + + Trackster_distanceTravelledOffset__taxi = offset; + UpdateDistanceTravelled(0,0,true); +end + +Trackster.OffsetDistance__ghost = function(offset) + if(offset == nil) then return Trackster_distanceTravelledOffset__ghost; end; + + Trackster_distanceTravelledOffset__ghost = offset; + UpdateDistanceTravelled(0,0,true); +end + Trackster.OffsetKills = function(offset) if(offset == nil) then return Trackster_killsOffset; end; diff --git a/options.lua b/options.lua index 07a33b7..31382fd 100644 --- a/options.lua +++ b/options.lua @@ -124,6 +124,12 @@ local fsTime = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); local fsHearthstones = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); local fsTimeRunBegin = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); local fsScale = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__swam = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__walked = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__groundmount = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__flight = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__taxi = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); +local fsDist__ghost = optionsFrame:CreateFontString(nil, "OVERLAY", textFont); fsKills:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (0 * textMarginB))) fsDeaths:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (1 * textMarginB))) @@ -143,6 +149,12 @@ fsJump:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (13 * textMarginB))) fsScale:SetPoint("TOPLEFT", textMarginL, -(textMarginT + (14 * textMarginB))) fsHearthstones:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (0 * textMarginB))) +fsDist__swam:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (1 * textMarginB))) +fsDist__walked:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (2 * textMarginB))) +fsDist__groundmount:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (3 * textMarginB))) +fsDist__flight:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (4 * textMarginB))) +fsDist__taxi:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (5 * textMarginB))) +fsDist__ghost:SetPoint("TOPLEFT", textMarginLC2, -(textMarginT + (6 * textMarginB))) buttonReset:SetPoint("TOPLEFT", textMarginL - 5, -(textMarginT + ((15 + 0.2) * textMarginB))); @@ -163,6 +175,12 @@ fsChat:SetText("Chat msg offset:"); fsItem:SetText("Items offset:"); fsScale:SetText("Frame scale:"); fsHearthstones:SetText("Hearthed offset:"); +fsDist__swam:SetText("Dist swam offset:"); +fsDist__walked:SetText("Dist foot offset:"); +fsDist__groundmount:SetText("Dist rode offset:"); +fsDist__flight:SetText("Dist flew offset:"); +fsDist__taxi:SetText("Dist taxi offset:"); +fsDist__ghost:SetText("Dist ghost offset:"); local maxCharacters = 12; local ebWidth = 110; @@ -188,6 +206,48 @@ ebDist:SetMaxLetters(maxCharacters); ebDist:SetAutoFocus(false); ebDist:SetNumeric(false); +local ebDist__swam = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__swam:SetFrameStrata("DIALOG"); +ebDist__swam:SetSize(ebWidth,21); +ebDist__swam:SetMaxLetters(maxCharacters); +ebDist__swam:SetAutoFocus(false); +ebDist__swam:SetNumeric(false); + +local ebDist__walked = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__walked:SetFrameStrata("DIALOG"); +ebDist__walked:SetSize(ebWidth,21); +ebDist__walked:SetMaxLetters(maxCharacters); +ebDist__walked:SetAutoFocus(false); +ebDist__walked:SetNumeric(false); + +local ebDist__groundmount = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__groundmount:SetFrameStrata("DIALOG"); +ebDist__groundmount:SetSize(ebWidth,21); +ebDist__groundmount:SetMaxLetters(maxCharacters); +ebDist__groundmount:SetAutoFocus(false); +ebDist__groundmount:SetNumeric(false); + +local ebDist__flight = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__flight:SetFrameStrata("DIALOG"); +ebDist__flight:SetSize(ebWidth,21); +ebDist__flight:SetMaxLetters(maxCharacters); +ebDist__flight:SetAutoFocus(false); +ebDist__flight:SetNumeric(false); + +local ebDist__taxi = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__taxi:SetFrameStrata("DIALOG"); +ebDist__taxi:SetSize(ebWidth,21); +ebDist__taxi:SetMaxLetters(maxCharacters); +ebDist__taxi:SetAutoFocus(false); +ebDist__taxi:SetNumeric(false); + +local ebDist__ghost = CreateFrame("EditBox", "editboxOffsetDist", optionsFrame, "InputBoxTemplate"); +ebDist__ghost:SetFrameStrata("DIALOG"); +ebDist__ghost:SetSize(ebWidth,21); +ebDist__ghost:SetMaxLetters(maxCharacters); +ebDist__ghost:SetAutoFocus(false); +ebDist__ghost:SetNumeric(false); + local ebQuests = CreateFrame("EditBox", "editboxOffsetQuests", optionsFrame, "InputBoxTemplate"); ebQuests:SetNumeric(false); ebQuests:SetFrameStrata("DIALOG"); @@ -319,6 +379,12 @@ ebJumps:SetPoint("TOPLEFT", editboxMarginL, -(textMarginT + (13 * textMarginB))) ebScale:SetPoint("TOPLEFT", editboxMarginL, -(textMarginT + (14 * textMarginB))); ebHearthstones:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (0 * textMarginB))); +ebDist__swam:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (1 * textMarginB))); +ebDist__walked:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (2 * textMarginB))); +ebDist__groundmount:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (3 * textMarginB))); +ebDist__flight:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (4 * textMarginB))); +ebDist__taxi:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (5 * textMarginB))); +ebDist__ghost:SetPoint("TOPLEFT", editboxMarginLC2, -(textMarginT + (6 * textMarginB))); ebReset:SetPoint("TOPLEFT", editboxMarginL, -(textMarginT + ((15 + 0.2) * textMarginB))); fsTimeUNIT:SetPoint("TOPLEFT", editboxMarginL * 1.75, -(textMarginT + ((2 + 0.2) * textMarginB) - 2)); @@ -380,6 +446,12 @@ local function LoadDefaultTexts(doAnways) ebHearthstones:SetText(Trackster.OffsetHearthstones()); ebTimeRunStarted:SetText(Trackster_timestampRunBegin); ebScale:SetText(Trackster_frameScale); + ebDist__swam:SetText(Trackster.OffsetDistance__swam()); + ebDist__walked:SetText(Trackster.OffsetDistance__walked()); + ebDist__groundmount:SetText(Trackster.OffsetDistance__groundmount()); + ebDist__flight:SetText(Trackster.OffsetDistance__flight()); + ebDist__taxi:SetText(Trackster.OffsetDistance__taxi()); + ebDist__ghost:SetText(Trackster.OffsetDistance__ghost()); areDefValsLoaded = true; end @@ -419,6 +491,12 @@ local function UpdateOffsets() ebTime:ClearFocus(); ebHearthstones:ClearFocus(); ebTimeRunStarted:ClearFocus(); + ebDist__swam:ClearFocus(); + ebDist__walked:ClearFocus(); + ebDist__groundmount:ClearFocus(); + ebDist__flight:ClearFocus(); + ebDist__taxi:ClearFocus(); + ebDist__ghost:ClearFocus(); ebScale:ClearFocus(); Trackster.SetFrameScale(ebScale:GetNumber()); @@ -437,6 +515,12 @@ local function UpdateOffsets() Trackster.OffsetJumps(ebJumps:GetNumber()); Trackster.OffsetTime(ebTime:GetNumber()); Trackster.OffsetHearthstones(ebHearthstones:GetNumber()); + Trackster.OffsetDistance__swam(ebDist__swam:GetNumber()); + Trackster.OffsetDistance__walked(ebDist__walked:GetNumber()); + Trackster.OffsetDistance__groundmount(ebDist__groundmount:GetNumber()); + Trackster.OffsetDistance__flight(ebDist__flight:GetNumber()); + Trackster.OffsetDistance__taxi(ebDist__taxi:GetNumber()); + Trackster.OffsetDistance__ghost(ebDist__ghost:GetNumber()); Trackster_timestampRunBegin = ebTimeRunStarted:GetNumber(); @@ -460,4 +544,10 @@ ebTimeRunStarted:SetScript("OnEnterPressed", UpdateOffsets); ebChat:SetScript("OnEnterPressed", UpdateOffsets); ebJumps:SetScript("OnEnterPressed", UpdateOffsets); ebHearthstones:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__swam:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__walked:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__groundmount:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__flight:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__taxi:SetScript("OnEnterPressed", UpdateOffsets); +ebDist__ghost:SetScript("OnEnterPressed", UpdateOffsets); ebScale:SetScript("OnEnterPressed", UpdateOffsets);