So, I want my banner to be much more sophisticated…as in, have more information (and also move it to the left but that isn’t really important here).
I dug around and discovered the object WebStatusWin seems to be responsible for handling the banner components, and it works pretty nicely, from what I can tell. Adding a nice little div tag for each component that is to be displayed. So, I thought it would be easy to override like all other TADS objects. But, so far, I’m wrong. Any suggestions what I’m doing wrong? Basically, I just tried something simple, appending some garbage. I tried several different things, such as adding entirely new divs and just spewing random text, but as far as I can tell, this function I’ve overridden never gets called. Nothing I do here seems to have any effect on the game (I added some bolding to make it easy to spot my change):
modify WebStatusWin
setStatus(room, score?, turns?)
{
/* set up the room text in the left portion */
local msg = ‘
Here is something exciting…well, maybe not so much…
/*
* format the right side: 'score/turns', 'score', or empty,
* depending on what the caller specified
*/
local rt = (score != nil ? toString(score) : '')
+ (turns != nil ? '/' + turns : '');
/* if there's a right side, wrap it with right alignment */
if (rt != '')
msg += '<div class="statusright"><<rt>></div>';
/*
* our left/right divisions are floats, which some browsers don't
* count against the container size; so add a clear:all division
* to make sure we count the height properly
*/
msg += '<div style="clear: both;"></div>';
/* set the text */
setStatusText(msg);
}
;