View Single Post
02/17/23, 01:16 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question refresh UI and font without a reloadui?

Hey! I'm looking for a way to basically refresh the UI or something to update font settings. Im working on a feature in my addon that bumps up the nameplate font size a touch, but I cant seem to get it to update it right away without reloadui which I'd really like to avoid for a more pleasant user experience. Any ideas? Ive added a chat feedback and a 1sec delay so the user can see it was changed and then a reload to activate the larger font but ideally it would just activate instantly some other way.

Heres most of what im working with:

Code:
-- Nameplate Font Boost Toggle
function RidinDirty.NamePlatesToggle()
   local fontBoost = RidinDirty.savedVariables.fontBoost
   if fontBoost == nil or fontBoost == "" or fontBoost == "disabled" then
		fontBoost = "enabled"
		RidinDirty.savedVariables.fontBoost = fontBoost
		df("|c9900FF[RidinDirty]|r FontBoost: %s", fontBoost)
		zo_callLater(function() ReloadUI("ingame") end, 1000)
	else
		fontBoost = "disabled"
		RidinDirty.savedVariables.fontBoost = fontBoost
		df("|c9900FF[RidinDirty]|r FontBoost: %s", fontBoost)
		zo_callLater(function() ReloadUI("ingame") end, 1000)
	end
end

Last edited by sinnereso : 02/17/23 at 08:58 AM.
  Reply With Quote