I am creating a tabbed menu option and want to change the color of active and inactive tabs when a user clicks on them however when using the gui.set_color
function it seems to be setting it for each of the tabs.
I have the follow tab table
chat_tabs = {
system = { enabled = true, url = "/hud#chat_tab_system", node = gui.get_node("chat_tab_system")},
corporation = { enabled = false, url = "/hud#chat_tab_corporation", node = gui.get_node("chat_tab_corporation")}
}
With the follow function to cycle and disable/set_color.
function chat_set_active_tab(tab)
for k,v in pairs(chat_tabs) do
if k == tab then
chat_tabs[k].enabled = true
gui.set_color(chat_tabs[k].node, vmath.vector4(0, 0.039, 0,1))
else
chat_tabs[k].enabled = false
gui.set_color(chat_tabs[k].node, vmath.vector4(0,0,0,1))
end
end
end
On load it looks like this:
When I click the system tab I see this:
I am looking for the result to be “Gray” as my active and “Black” as my inactive (these are sandbox colors as I am the system/logic dev not the artist )