Files
garminApp/source/appGlobals.mc
T
2026-10-05 20:55:29 +01:00

108 lines
3.8 KiB
Mason

import Toybox.Lang;
import Toybox.WatchUi;
import Toybox.Graphics;
import Toybox.Time;
import Toybox.Math;
import Toybox.System;
public enum enCard{
RED,
YELLOW,
GREEN
}
public enum enGoal{
PC = "PC",
PS = "PS",
FG = "FG"
}
public enum enTeam{
HOME = "Home",
AWAY = "Away"
}
public enum enPeriod{
PLAY,
BREAK
}
public enum enAction{
GOAL,
CARD,
QUIT
}
public enum enGame{
PREGAME,
INGAME,
POSTGAME
}
// Menus
public var gMenuTeams as WatchUi.Menu2?;
public var gMenuActions as WatchUi.Menu2?;
public var gMenuGoals as WatchUi.Menu2?;
public var gMenuCards as WatchUi.Menu2?;
public var gMenuApp as WatchUi.Menu2?;
public var gScore as String = "0-0";
public var gMatch as Match?;
public var gIconGreen = WatchUi.loadResource(Rez.Drawables.greenCard);
public var gIconYellow = WatchUi.loadResource(Rez.Drawables.yellowCard);
public var gIconRed = WatchUi.loadResource(Rez.Drawables.redCard);
public const gH as Float = Toybox.System.getDeviceSettings().screenHeight.toFloat();
public const gW as Float = Toybox.System.getDeviceSettings().screenWidth.toFloat();
public const gX as Float = gW / 2.0;
public const gY as Float = gH / 2.0;
public const gR as Float = gW / 2.0;
public var gPeriodArc as Float?;// = gTitleArc;
public var gFilledArc as Float?;
public var gStartAngle as Float?;
public var gEndAngle as Float?;
public var gFontTimer = WatchUi.loadResource($.Rez.Fonts.SevenSegment);
public var gFontButtons = WatchUi.loadResource($.Rez.Fonts.fontButtons);
public var gFontClock = WatchUi.loadResource($.Rez.Fonts.led_small);
public var gFontScore = WatchUi.loadResource($.Rez.Fonts.fontCards);
public var gFontCards = WatchUi.loadResource($.Rez.Fonts.fontCards);
public const gFontCardsX = Graphics.getFontHeight($.gFontButtons)/2;
public const gFontCardsW = Graphics.getFontHeight($.gFontButtons);
public const gFontCardsR = Math.sqrt(2 * gFontCardsW * gFontCardsW) / 2.0;
public var gTitleArc1 as Float = 25.0;
public var gPeriodWidth as Float = 6.0;
public const gBUTTON_GPS as Array<Float> = [
$.gX + Math.sin( 60.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth),
$.gY - Math.cos( 60.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth)];
public const gBUTTON_SET as Array<Float> = [
$.gX + Math.sin(120.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth),
$.gY - Math.cos(120.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth)];
public const gBUTTON_DOWN as Array<Float> = [
$.gX + Math.sin(240.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth),
$.gY - Math.cos(240.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth)];
public const gBUTTON_UP as Array<Float> = [
$.gX + Math.sin(270.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth),
$.gY - Math.cos(270.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth)];
public const gBUTTON_CTL as Array<Float> = [
$.gX + Math.sin(300.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth),
$.gY - Math.cos(300.0 * Math.PI / 180.0) * ($.gX - gFontCardsR - gPeriodWidth)];
public var gInfo as Time.Gregorian.Info?;
public var gTime as String?;
public var gTextCard as String?;
public var g1Q as String = "\u007F".toString();
public var g1H as String = "\u0080".toString();
public var g3Q as String = "\u0081".toString();
public var gCards as Array<String> = ["\u0084", "\u0083", "\u0082"];
public var gPlay as String = "\u0030".toString();
public var gPause as String = "\u0031".toString();
public var gPlus as String = "\u0032".toString();
public function closeApp(){
// WatchUi.popView(WatchUi.SLIDE_IMMEDIATE);
System.exit();
}