|
|||
|
I have a script like this:
//soundoff Menu.onUpdateItem = function (id, state) { switch (id) { case "id3": state.enable = true; break; case "id4": state.enable = false; break; } } I also have another script that defines id1 and id2 The funny thing! is that when I run my 'soundoff script it somehow also affects my id1 and id2, - because their state are set to enable = true!! How can this be?? ??? Kind regards Godowsky |
|
|||
|
Well, it works if I set a global var to indicate the state of the state.enable var.
like this, - not a beauty.... //soundoff Menu.onUpdateItem = function (id, state) { switch (id) { case "id3": state.enable = true; break; case "id4": state.enable = false; break; } if(rememberMax == 1) { switch (id) { case "id1": state.enable = false; break; case "id2": state.enable = true; break; } } else { switch (id) { case "id1": state.enable = true; break; case "id2": state.enable = false; break; } } } after putting var rememberMax = 1 in my init script. ![]() |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|