Enable /wayb to take a name/title as an argument
Jim Whitehead [08-24-16 - 07:31]
Enable /wayb to take a name/title as an argument
If one is not provided, just use the existing behaviour.
diff --git a/TomTom.lua b/TomTom.lua
index cd2100a..13adb16 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -1161,9 +1161,14 @@ end
SLASH_TOMTOM_WAYBACK1 = "/wayb"
SLASH_TOMTOM_WAYBACK2 = "/wayback"
SlashCmdList["TOMTOM_WAYBACK"] = function(msg)
+ local title = L["Wayback"]
+ if msg and msg:match("%S") then
+ title = msg
+ end
+
local backm,backf,backx,backy = TomTom:GetCurrentPlayerPosition()
TomTom:AddMFWaypoint(backm, backf, backx, backy, {
- title = L["Wayback"],
+ title = title,
})
end