• Create Account

### #Actualrip-off

Posted 04 June 2012 - 06:24 AM

if you read the code and the statement...

There is a lot of code, and I am not familiar with Irrlicht. I don't have a large amount of time, so I skimmed the code.

... the problem is it only spams the function which causes it to show, it should be off then on when escape is pressed.

Sorry, I did miss the final sentence in your original post. Still, I cannot parse that sentence. I don't know what "to spam" a function means.

Are you trying to say that the escape key is supposed to toggle the menu? Presumably, if you are saying that then the actual behaviour is different. This is what I want to see - a clear description of what the problem is.

As I mentioned, the code as you posted will always show the menu, because you unconditionally assign showGameMenu to "true". As Matthew Wood states, you can fix it by using the double equals comparison operator. Alternatively, you can just write:
if(showGameMenu) {
} else {
}


### #1rip-off

Posted 04 June 2012 - 06:20 AM

if you read the code and the statement...

There is a lot of code, and I am not familiar with Irrlicht. I don't have a large amount of time, so I skimmed the code.

... the problem is it only spams the function which causes it to show, it should be off then on when escape is pressed.

I cannot parse that sentence. I don't know what "to spam" a function means.

Are you trying to say that the escape key is supposed to toggle the menu? Presumably, if you are saying that then the actual behaviour is different. This is what I want to see - a clear description of what the problem is.

As I mentioned, the code as you posted will always show the menu, because you unconditionally assign showGameMenu to "true". As Matthew Wood states, you can fix it by using the double equals comparison operator. Alternatively, you can just write:
if(showGameMenu) {