Allow for theme to be toggleable in-game

Refactored UI code to run after variables are loaded so that this information can be retrieved before the UI is constructed
This commit is contained in:
OldManAlpha
2025-06-25 20:37:21 -07:00
parent f412bad657
commit 1ea4a114fa
8 changed files with 1048 additions and 1015 deletions
+12
View File
@@ -4,11 +4,16 @@ local T = require 'T'
local aux = require 'aux'
local info = require 'aux.util.info'
local post = require 'aux.tabs.post'
local gui = require 'aux.gui'
function status(enabled)
return (enabled and aux.color.green'on' or aux.color.red'off')
end
function warn_reload()
aux.print(aux.color.orange('A relog or reload is required for this change to take effect.'))
end
_G.SLASH_AUX1 = '/aux'
function SlashCmdList.AUX(command)
if not command then return end
@@ -27,6 +32,7 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
aux.account_data.post_bid = not aux.account_data.post_bid
aux.print('post bid ' .. status(aux.account_data.post_bid))
warn_reload()
elseif arguments[1] == 'post' and arguments[2] == 'duration' and T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]] then
aux.account_data.post_duration = T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]]
aux.print('post duration ' .. aux.color.blue(aux.account_data.post_duration / 60 * 3 .. 'h'))
@@ -61,6 +67,10 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'sharing' then
aux.account_data.sharing = not aux.account_data.sharing
aux.print('sharing ' .. status(aux.account_data.sharing))
elseif arguments[1] == 'theme' and (arguments[2] == 'default' or arguments[2] == 'blizzard') then
aux.account_data.theme = arguments[2]
aux.print('theme ' .. aux.color.blue(aux.account_data.theme))
warn_reload()
elseif arguments[1] == 'show' and arguments[2] == 'hidden' then
aux.account_data.showhidden = not aux.account_data.showhidden
aux.print('show hidden ' .. status(aux.account_data.showhidden))
@@ -81,6 +91,8 @@ function SlashCmdList.AUX(command)
aux.print('- clear item cache')
aux.print('- populate wdb')
aux.print('- sharing [' .. status(aux.account_data.sharing) .. ']')
aux.print('- theme [' .. aux.color[gui.is_blizzard() and 'red' or 'green']('default') .. ' | ' ..
aux.color[gui.is_blizzard() and 'green' or 'red']('blizzard') .. ']')
aux.print('- show hidden [' .. status(aux.account_data.showhidden) .. ']')
end
end