Scripting Moderators ds1-e Posted August 26, 2019 Scripting Moderators Share Posted August 26, 2019 Hey, i've encountered a annoying issue. I use: showCursor(not isCursorShowing(), true) For toggle on/off cursor. Code works well, when it's a single use, but whenever i use it 2 times at once (different GUIs), it causes that cursor enables when closing GUI, so to fix this i need to reconnect or mess up with toggling on/off cursor with console. So i am curious how i could fix it. Any ideas? Link to comment
savour Posted August 26, 2019 Share Posted August 26, 2019 It's totally expected, when you hide the gui at the first time, isCursorShowing will return false after, so when you execute the function again it will show the cursor, as simple as that: not true = false not false = true So, it you only want to hide it, why checking for its visibility showCursor(false, true) 1 Link to comment
Moderators IIYAMA Posted August 26, 2019 Moderators Share Posted August 26, 2019 3 hours ago, majqq said: Any ideas? Are we talking about 1 resource or multiple ones? Because resource A can't disable the cursor for resource B. GUI's do not have any influence on the cursor function. 1 Link to comment
Scripting Moderators ds1-e Posted August 26, 2019 Author Scripting Moderators Share Posted August 26, 2019 2 hours ago, IIYAMA said: Are we talking about 1 resource or multiple ones? Because resource A can't disable the cursor for resource B. GUI's do not have any influence on the cursor function. One resource. 2 hours ago, savour said: It's totally expected, when you hide the gui at the first time, isCursorShowing will return false after, so when you execute the function again it will show the cursor, as simple as that: not true = false not false = true So, it you only want to hide it, why checking for its visibility showCursor(false, true) Ye but this is not what i want. For example. 2 GUI's opened, i close 1st, cursor stays until i close 2nd. Link to comment
savour Posted August 26, 2019 Share Posted August 26, 2019 In this case, you need to check to see if any of the two windows are visible, for example: showCursor(guiGetVisible(window1) or guiGetVisible(window2), true) -- or you can make it shorter with oop showCursor(window1.visible or window2.visible, true) 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now