event PLAYER_STOPPED_MOVING combined with the command to hide all the ui, UIParent:Hide()
Code:
local addonName, addonTable = ... ;
local addon = CreateFrame("Frame");
addon:RegisterEvent("PLAYER_STOPPED_MOVING");
addon:RegisterEvent("PLAYER_STARTED_MOVING");
addon:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_STOPPED_MOVING" then
UIParent:Hide();
end;
if event == "PLAYER_STARTED_MOVING" then
UIParent:Show();
end;
end);