[SOLVED] How To Show An Menu Item Only When

But mine also checks for other things since employees can’t be doing anything else before you can give them the Black Bull (things like researching). ^^

The basics are still the same in my code :smiley:

Okay, now an optional thing:

I Want to make something like this:

label: "Announce {0}".localize().format(game.title)

I Don’t think that it will work…
So…

Help Pl0x?

I Was training (Running…) And I’ve drank some…thing, maybe just a water, maybe a soda…

Well, it almost works. You only need to add var game = GameManager.company.currentGame;

Then it should work :smiley: (You shouldn’t get ‘Can not read property ‘currentGame’ of undifined’ since you already checked if there’s a game being made)

Oh yea. That makes sense. But, Can’t I just simply do

.localize().format(currentGame.title)?

EDIT: NopeNopeNopeNopeNope, I Can’t.

If you want to do that, then you need to make it GameManager.company.currentGame (else the game won’t know where to get the currentGame from).

But I suggest using my code, it makes it easier to make a change without having to change something in every code. + It saves some typing work if you want to add the title multiple times ^^ (programmers are lazy :wink:)

Yep.
I Did edit my post 1 second before You posted that :wink:

I’ll make an final test!

Unexpected token var

THAT IS JUST

OH WTF!

Euhm… are you sure you’re syntaxes are right??

No…
I Did It The Other Way.

But
Butt

That is just
There is no word to describe that!

Oh Yeah, there was a single {, just. For no reason.

You didn’t just try to do:GameManager.company.currentGame = var

Did you?? You know what, just don’t awnser it xD

Da Fuq?
No!

I’ve just copied Yours var game = GameManager.company.currentGame;
That’s all!

(Ive copied it to make sure that it is good…)

Alright, then it’s good ^^ Just tell me if you need to know anything else :smile:

 Unexpected token if

It Is going pretty well.

I Dun Get it

if (GameManager.company.isCurrentlyDevelopingGame())

Is Just from PriceSet, which works.

I’d say, keep trying and you’ll figure out what’s wrong. Check every little detail (codes are a b*tch sometimes :stuck_out_tongue:)

If you can’t figure it out, PM me.
I’ll check it out tomorrow morning since I need to get some sleep now :smile:

Yep.
I Know. Sometime I was working on a ONE STUPID SHIPZ GAME in java, and something was wrong…
Just one letter… It should be a capital letter…

Rage!
RAGE!

It is fixed (Random semicolons), but now…

 company is not defined

in company.adjustCash etc.

That’s funny.

Use

GameManager.company.adjustCash

company is often used for short when it is passed into a function.

Edit: http://www.javascriptlint.com/online_lint.php Use this to check your code or get yourself an IDE like Aptana: http://www.aptana.com/products/studio3