Jump to content

guiSetVisible odd bug


'LinKin

Recommended Posts

Hello,

I've an odd bug right here..

Let me explain;

I have a setting (Animate Window on Open/Close) by default is 'false'

So it won't animate the window if it's 'false'.

When, I start the resource and press the key to toggle my window visible/not visible, it opens/closes normally, without animation. All good so far.

Then, I go to the admin panel and I change the Animation setting to 'true'.

Then, I press the key to toggle my window visible/not visible, it opens/closes normally, with animation this time. All good untill this point

But then, I go back to the admin panel and I change the Animation setting back to 'false'.

Then, I press the key to toggle my window visible/not visible, BUT, it doesn't get visible!

It shows the cursor, but the window is not visible..

I verified if the window was getting it's visibility changed by this line:

outputChatBox(tostring(guiSetVisible(g_Window.window, not isVisible))) 

And it returns true..

But the window is not visible.. I must restart the resource and then press the key so that it works.

Link to comment

I don't think so..

If the setting is false before the resource start, it will work good.

But if I change it to false while the resource is running, it get's bugged..

This doesn't happen when I set it to true..

I can change from false to true with no problems.

The following inside onSettingChange

SERVER

  
animateWindow = toBoolean(fromJSON(newValue)) 
triggerClientEvent(root, "onServerUpdateAnimation", root, animateWindow) 
  

CLIENT

  
addEvent("onServerUpdateAnimation", true) 
addEventHandler("onServerUpdateAnimation", root, 
function(isAnimated) 
    animateWindow = isAnimated 
end) 
  

I don't think there's a mistake in the code..

I used with outputChatBox to check if the script was getting into some if conditions.. It's working fine... I think it's a bug..

Link to comment

It's a bug...

The code is ok.

I'm even doing this check:

  
if guiGetVisible(g_Window.window) then 
    outputChatBox("Visible") 
    guiSetEnabled(g_Window.window, true) 
end 
  

And it outputs "Visible" in the chat.. Also, cursor is shown, but the window is not visible.

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...