I need to clean up a bunch of my gui code that's a total unreadable mess. Question:
Is there an existing function to return the geyser label based on the label name?
Example, my existing code:
gGroupStatusWindow = Geyser.Label:new({name="gGroupStatusWindow", x="0%", y="-1c", width="100%", height="1c",})
gGroupStatusWindow:setOnEnter( "closeNests" )
What i'd like to do is get rid of the gGroupStatusWindow variable, and only access that using the "gGroupStatusWindow" window name. Something so
gGroupStatusWindow:setOnEnter( "closeNests" )
could be replaced with something similar to
label:get("gGroupStatusWindow"):setOnEnter( "closeNests" )
(and yes, I need to rename a bunch of those also)
(edit)
Took a look at the instructions
Geyser.Label:getWindow(label) -- label is the name, the return value is the object
Find and access label by name?
Re: Find and access label by name?
I wrote some code for finding any existing window by name (so not only labels):
Do note that:
Would have to find the label with that name every time. It would be better to cache it in a table instead.