Eggszecutor
Member
- Gender
- Male
- Guildcard
- 42038428
Is it possible to change the color of the lady's outfit at the Check in counter to reflect whether you currently have access to the character bank or the shared bank?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
local _WindowSize = { 20, 20 }
local _BankColors = {
Character = 0x0000FF44,
Shared = 0xFF000044,
Unknown = 0x00000044
}
local present = (function()
local function RGBA(color)
local r = (math.floor(color / 0x01000000) % 0x100) / 0xFF
local g = (math.floor(color / 0x00010000) % 0x100) / 0xFF
local b = (math.floor(color / 0x00000100) % 0x100) / 0xFF
local a = (math.floor(color / 0x00000001) % 0x100) / 0xFF
return r, g, b, a
end
local ShipChanged = (function()
local ShipAddress = 0x00AA6D00
local CurrentShip = pso.read_wstr(ShipAddress, 0xFF)
return function()
local ship = pso.read_wstr(ShipAddress, 0xFF)
local changed = ship ~= CurrentShip
CurrentShip = ship
return changed
end
end)()
local NotificationAddress = 0x00AAECC8
local ActiveBank = "Unknown"
local WindowSize = _WindowSize
local BankColors = _BankColors
return function()
local addr = pso.read_u32(NotificationAddress)
if (addr ~= 0) then
local text = pso.read_wstr(addr + 0x14, 0xFF)
local bank = string.match(text, "Bank: (%a+)")
if bank then
ActiveBank = bank
end
end
if ShipChanged() then
ActiveBank = "Character"
end
local bankColor = BankColors[ActiveBank]
imgui.PushStyleColor("WindowBg", RGBA(bankColor))
local width, height = unpack(WindowSize)
imgui.SetNextWindowSize(width, height, "Always")
imgui.Begin("Bank Indicator", true, { "NoTitleBar", "NoResize" })
imgui.End()
imgui.PopStyleColor()
end
end)()
local function init()
return
{
name = "Bank Indicator",
version = "1.0.0",
author = "staphen",
description = "Indicates which bank is active",
present = present
}
end
return {
__addon = {
init = init
}
}