[SOLVED] How To Show An Menu Item Only When

I Did use this lint. That’s how I fixed 1 Syntax.
Okay, let’s see.

IT WOOOOOOOOOOOOOOORKS!

Yeeeeeeeeeeeeeeey

Thank @Darkly, @DzjengisKhan and @SirEverard!

1 Like

Now, another problem,
If I want to set other budget and more hype for bigger games,
Is there something like .gameSize/game.gameSize?

If you check my custom prices there should be something useful for you, I needed to check the game size as well

Hmmmm

game.gameSize === “medium”

Found it so fast.

There is exactly that!
Now, why medium is a string?

Can it be something like:

if (GameManager.company.isCurrentlyDevelopingGame() && game.gameSize === "small") {
hype = GameManager.company.adjustHype(12 + 18 * GameManager.company.getRandom());
cost = GameManager.company.adjustCash(-30000, "Game Announcement");	
fans = GameManager.company.adjustFans(2 + 8 *  GameManager.company.getRandom());
}

?

1 Like

Yes something like that would be correct (can’t tell for sure since I don’t know all the code). But you might want to change ‘===’ into ‘==’ :wink:

Oopsy.
But, can You tell me, why did You use string to tell the gameSize? Is that how it is in CodeNW?

Yea, the game size of a game is stored as a string in gameSize.

Oh okay.

Now I Did if (GameManager.company.isCurrentlyDevelopingGame() && game.gameSize == "small/medium/large/aaa")

And, In the real code, showing the menu pop-up should I just write the var names?

Oh God.

Now There is error Cannot call method 'isCurrentlyDevelopingGame' of undefined
Tried the JSLint,

if (GameManager.company.isCurrentlyDevelopingGame() && game.gameSize == "small") {
    =^
    SyntaxError: missing { before function body

Tried To Fix it,
Nope, new errors everywhere.

Edit: That shouldn’t be reply…

EDIT: NEVERMIND! Code on JSLint Is Okay, But there is same error…

Sorry For Little spam, but

IT IZ DONE!
It Works!

Thanks @Darkly,@DzjengisKhan and @SirEverard Again!
Especially to DzjengisKhan, because he allowed me to study his code.

2 Likes