I want to add the ability for users to make custom messages in
MageTaxi. The problem is I'm not sure how I would go about doing this or the best way to do so.
The current format is as follows:
lua Code:
msg = "MageTaxi: WTS portals to ".. dest.. " from ".. currentLoc.. ", "..MageTaxi_PriceBox:GetText().. "g. ".. MageTaxi_TravelBox:GetText().. "g for me to come to another city."
SendChatMessage(msg, "CHANNEL", nil, trade)
The vision is to add an edit box to the bottom of the GUI. I know in other addons authors used a certain method that I'd like to replicate. The user could do something to the effect of "WTS port to %p from %l" and
%p/%l would automatically fill in the selected portal/current location respectively.
I had the idea of trying a gsub swap before printing the message but not sure if that would be the most effective method since I'd have to check the message multiple times to check/change existing/absent variables.