Skip to content

Commit 21d027f

Browse files
authored
remove support for FR735, FR935, Fenix5 (#130)
* Revert "Revert "migrate to menu2 (#126)" (#129)" This reverts commit 471dadf. * remove support for FR735, FR935, F5
1 parent 780bf91 commit 21d027f

File tree

8 files changed

+89
-42
lines changed

8 files changed

+89
-42
lines changed

manifest.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
<iq:product id="epix2pro42mm"/>
2727
<iq:product id="epix2pro47mm"/>
2828
<iq:product id="epix2pro51mm"/>
29-
<iq:product id="fenix5"/>
30-
<iq:product id="fenix5plus"/>
31-
<iq:product id="fenix5s"/>
32-
<iq:product id="fenix5splus"/>
33-
<iq:product id="fenix5x"/>
34-
<iq:product id="fenix5xplus"/>
3529
<iq:product id="fenix6"/>
3630
<iq:product id="fenix6pro"/>
3731
<iq:product id="fenix6s"/>
@@ -66,9 +60,7 @@
6660
<iq:product id="fr57047mm"/>
6761
<iq:product id="fr645"/>
6862
<iq:product id="fr645m"/>
69-
<iq:product id="fr735xt"/>
7063
<iq:product id="fr745"/>
71-
<iq:product id="fr935"/>
7264
<iq:product id="fr945"/>
7365
<iq:product id="fr945lte"/>
7466
<iq:product id="fr955"/>

resources/menus/golden_point.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

resources/menus/number_of_sets.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

resources/menus/super_tie.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

source/delegates/initialScreenDelegate.mc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,30 @@ class InitialScreenDelegate extends WatchUi.InputDelegate {
88
}
99

1010
function onKey(keyEvent as WatchUi.KeyEvent) as Boolean {
11-
1211
switch (keyEvent.getKey()) {
1312
case KEY_ESC: {
1413
System.exit();
1514
}
1615
case KEY_ENTER: {
17-
WatchUi.pushView(new Rez.Menus.GoldenPointMenu(), new MenuGoldenPointDelegate(), WatchUi.SLIDE_BLINK);
16+
17+
var menu = new WatchUi.Menu2({:title=>"Score"});
18+
menu.addItem(
19+
new MenuItem(
20+
"Golden Point",
21+
"",
22+
:golden_point_yes,
23+
{}
24+
)
25+
);
26+
menu.addItem(
27+
new MenuItem(
28+
"Advantages",
29+
"",
30+
:golden_point_no,
31+
{}
32+
)
33+
);
34+
WatchUi.pushView(menu, new MenuGoldenPointDelegate(), WatchUi.SLIDE_BLINK);
1835
break;
1936
}
2037
}

source/delegates/menu/menuGoldenPointDelegate.mc

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,49 @@ import Toybox.Lang;
22
import Toybox.System;
33
import Toybox.WatchUi;
44

5-
class MenuGoldenPointDelegate extends WatchUi.MenuInputDelegate {
5+
class MenuGoldenPointDelegate extends WatchUi.Menu2InputDelegate {
66

77
function initialize() {
8-
MenuInputDelegate.initialize();
8+
Menu2InputDelegate.initialize();
99
}
1010

11-
function onMenuItem(item as Symbol) as Void {
12-
13-
var goldenPoint = true;
14-
if (item == :golden_point_yes) {
11+
function onSelect(item as MenuItem) {
12+
var goldenPoint = true;
13+
if (item.getId() == :golden_point_yes) {
1514
goldenPoint = true;
16-
} else if (item == :golden_point_no) {
15+
} else if (item.getId() == :golden_point_no) {
1716
goldenPoint = false;
1817
}
1918

2019
Application.getApp().getMatchConfig().setGoldenPoint(goldenPoint);
21-
WatchUi.pushView(new Rez.Menus.SetsMenu(), new MenuNumberSetsDelegate(), WatchUi.SLIDE_BLINK);
20+
21+
var menu = new WatchUi.Menu2({:title=>"Sets"});
22+
menu.addItem(
23+
new MenuItem(
24+
"Unlimited",
25+
"",
26+
:sets_unlimited,
27+
{}
28+
)
29+
);
30+
menu.addItem(
31+
new MenuItem(
32+
"3",
33+
"",
34+
:sets_3,
35+
{}
36+
)
37+
);
38+
menu.addItem(
39+
new MenuItem(
40+
"5",
41+
"",
42+
:sets_5,
43+
{}
44+
)
45+
);
46+
47+
WatchUi.pushView(menu, new MenuNumberSetsDelegate(), WatchUi.SLIDE_BLINK);
2248
}
2349

2450
}

source/delegates/menu/menuNumberSetsDelegate.mc

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import Toybox.Lang;
22
import Toybox.System;
33
import Toybox.WatchUi;
44

5-
class MenuNumberSetsDelegate extends WatchUi.MenuInputDelegate {
5+
class MenuNumberSetsDelegate extends WatchUi.Menu2InputDelegate {
66

77
function initialize() {
8-
MenuInputDelegate.initialize();
8+
Menu2InputDelegate.initialize();
99
}
1010

11-
function onMenuItem(item as Symbol) as Void {
11+
function onSelect(item as MenuItem) as Void {
1212

1313
var nbrSets = MatchConfig.UNLIMITED_SETS;
1414

15-
switch (item) {
15+
switch (item.getId()) {
1616
case :sets_unlimited: {
1717
break;
1818
}
@@ -30,7 +30,33 @@ class MenuNumberSetsDelegate extends WatchUi.MenuInputDelegate {
3030

3131
// if not unlimited sets, lets ask about super tie config
3232
if (nbrSets != MatchConfig.UNLIMITED_SETS) {
33-
WatchUi.pushView(new Rez.Menus.SuperTieMenu(), new MenuSuperTieDelegate(), WatchUi.SLIDE_BLINK);
33+
var menu = new WatchUi.Menu2({:title=>"Super Tie"});
34+
menu.addItem(
35+
new MenuItem(
36+
"Yes",
37+
"",
38+
:super_tie_yes,
39+
{}
40+
)
41+
);
42+
menu.addItem(
43+
new MenuItem(
44+
"No",
45+
"",
46+
:super_tie_no,
47+
{}
48+
)
49+
);
50+
menu.addItem(
51+
new MenuItem(
52+
"5",
53+
"",
54+
:sets_5,
55+
{}
56+
)
57+
);
58+
59+
WatchUi.pushView(menu, new MenuSuperTieDelegate(), WatchUi.SLIDE_BLINK);
3460
} else {
3561
Application.getApp().initMatch();
3662
WatchUi.pushView(new ScoreView(), new ScoreDelegate(), WatchUi.SLIDE_UP);

source/delegates/menu/menuSuperTieDelegate.mc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ import Toybox.Lang;
22
import Toybox.System;
33
import Toybox.WatchUi;
44

5-
class MenuSuperTieDelegate extends WatchUi.MenuInputDelegate {
5+
class MenuSuperTieDelegate extends WatchUi.Menu2InputDelegate {
66

77
function initialize() {
8-
MenuInputDelegate.initialize();
8+
Menu2InputDelegate.initialize();
99
}
1010

11-
function onMenuItem(item as Symbol) as Void {
12-
11+
function onSelect(item as MenuItem) as Void {
1312
var superTie = false;
14-
if (item == :super_tie_yes) {
13+
if (item.getId() == :super_tie_yes) {
1514
superTie = true;
16-
} else if (item == :super_tie_no) {
15+
} else if (item.getId() == :super_tie_no) {
1716
superTie = false;
1817
}
1918

0 commit comments

Comments
 (0)