Is there a way to hide/modify the status pane?

I want to use the score function, but I don't want to show the score in the status pane. I was hoping this script would work:

JS.eval ("$('#statusVarsLabel').css('display', 'none')")

JS.eval ("$('#statusVarsAccordion').css('display', 'none')")

But it does not work! (a similar script for turning off the compass pane does work?!)

Alternatively is there a way I can customise what is shown in the status pane? I'd rather show the 'score' as a percentage of progress.


JS.eval ("$('#statusVarsLabel').css('display', 'none')")
JS.eval ("$('#statusVarsAccordion').css('display', 'none')")

Those won't work; because at the end of every turn the function JS.updateStatus is called, which shows the status pane if there are any variables in it, and hides it otherwise.

Alternatively is there a way I can customise what is shown in the status pane?

Yes. The status pane is configured using three dictionaries:

  • game.statusattributes defines which attributes of the game object are shown in the status pane. It is edited on the 'Attributes' tab of the game object (not on the web editor)
  • game.povstatusattributes defines which attributes of the player object are shown in the status pane. It is edited on the 'Player' tab of the game object.
  • The player's statusattributes attribute defines which attributes of the player object are shown in the status pane. It is edited on the 'Attributes' tab of the player object (so that a game which allows the player to choose between characters can display different statistics for each of them; for example only showing Magic Points when the mage is selected)

However, the attributes money, health, and score aren't initially in these dictionaries. They are added by the core function InitStatusAttributes, which runs immediately before the start script. This means that you can't hide these values in the editor,

To remove the score, you can edit the dictionary in your start script. Like this:

dictionary remove (game.statusattributes, "score")

I'd rather show the 'score' as a percentage of progress.

The easiest way to do this would be using a changedscript to update the percentage when the score updates. You could put the code in different places, but I'd say it's probably easier to put something like the following in your start script:

game.changedscore => {
  this.percentscore = 100 * this.score / 1234
}
do (game, "changedscore")
dictionary remove (game.statusattributes, "score")
dictionary add (game.statusattributes, "percentscore", "Score: !%")

(where 1234 is replaced by the maximum score that you want to show a percentage of)


Thank-you so much, this is really helpful, and clear. Wonderful!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums