Jump to content

getElementsByType VS GUI Elements [solved]


Kayl

Recommended Posts

Hello,

I have, for a mini-game, a requirement to hide some gui elements, such as buttons and windows.

Since those elements belong to the freeroam resource and have known names, it easy to find them and force their visibility to "false" simply by looking at the results of getElementsByType("gui-window") and getElementsByType("gui-button").

However I have noticed that this getElementsByType function, for some players only, doesn't return anything for the aforementioned types.

When looking at GetElementsByType we can see that the gui types are not referenced even though they appear in the Element tree.

It seems that the players for which it doesn't work are running the 1.0 version whereas those for which it works have 1.0.2.

Is there a documented change that explains why GetElementsByType now works with the GUI types, and is there a way to make it work for 1.0 or should I just prevent the access to this minigame for 1.0 users?

Thanks.

Edited by Guest
Link to comment

I couldn't wait to test with players, I downloaded 1.0 client and was able to confirm the bug.

With the method of traversing the element tree manually however it works fine and gui elements can be found and hidden correctly.

Since it's pretty quick and well targeted, I decided to go for this method even for 1.0.2 players.

Thanks for the tip.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...