I'm working on a hockey interface for use with Xpression. I have timers set up for penalties, and I have made them children of the main timer. Each timer has buttons to quickly add 2min, 4min, 5min or reset to 0.
So the issue is, the timers default to 5min on startup. Not a huge deal, the operator can easily reset the clocks before the game begins. However, I'm dreading the day when a green operator comes in and starts the game and all 5 clocks appear on air.
I have included a "reset all" button which clears all the fields and resets all the clocks, but for some reason this sometimes freezes Xpression.
So I'm trying to find a solution where the clocks default to zero on startup. Obviously I've tried just setting the start time to 0, but then they just start counting up instead of down.
Here is the code I have on my start button (integer, choice constraint, toggle button widget)
var penTimer1 = ogscript.getTimerManager().getTimer('Home Pen 1');
var penTimer2 = ogscript.getTimerManager().getTimer('Home Pen 2');
var penTimer3 = ogscript.getTimerManager().getTimer('Away Pen 1');
var penTimer4 = ogscript.getTimerManager().getTimer('Away Pen 2');
var periodTimer = ogscript.getTimerManager().getTimer('Period');
// When timer is stopped
if (this.getValue() == '0'){
periodTimer.stopTimer(false);
// When timer is started
}
if (this.getValue() == '1') {
penTimer1.startTimer(false);
penTimer2.startTimer(false);
penTimer3.startTimer(false);
penTimer4.startTimer(false);
periodTimer.startTimer(false);
Anyone have any ideas? Any help is appreciated. Thanks!