The macro condition behaves differently from the Lua function.
Because of that any vehicle exit button with the visibility state of "[canexitvehicle] show; hide" will not show up on a taxi ride. It will only show in a vehicle. Currently it is not possible to exit a taxi early because the visibility state handler does not reflect CanExitVehicle() properly.
Currently the only way I may be able to it is this ?!
Lua Code:
local A,L = ...
local frame = CreateFrame("Frame", A.."VehicleExitFrame", UIParent, "SecureHandlerStateTemplate")
RegisterStateDriver(frame, "exit", "[canexitvehicle]c;[mounted]m;n")
frame:SetAttribute("_onstate-exit", [[
print("_onstate-exit",newstate)
if CanExitVehicle() then
self:Show()
else
self:Hide()
end
]])
local button = CreateFrame("CHECKBUTTON", A.."VehicleExitButton", frame, "ActionButtonTemplate, SecureHandlerClickTemplate")
button:RegisterForClicks("AnyUp")
button:SetScript("OnClick", function(self) if UnitOnTaxi("player") then TaxiRequestEarlyLanding() else VehicleExit() end self:SetChecked(false) end)
*edit*
Managed to get it done by doing this:
https://github.com/zorker/rothui/com...e827c4357059a8