@@ -83,23 +83,22 @@ class GridMenu {
83
83
}
84
84
85
85
public selectRow ( dir : number ) {
86
-
87
86
if ( this . position . y == 2 && dir == - 1 ) {
88
87
// als we van paging naar games gaan, dan altijd column 4 selecteren
89
88
this . position . x = 4
90
89
this . position . y = 1
91
90
} else if ( this . position . y == 1 && this . position . x < 4 && dir == 1 ) {
92
91
// the game grid really has 8 columns - but they are displayed as two rows with 4 columns in a grid
93
92
// this if statement adds the ability to switch vertically between columns
94
- this . position . x += 4
93
+ this . position . x += 4
95
94
} else if ( this . position . y == 1 && this . position . x > 3 && dir == - 1 ) {
96
- this . position . x -= 4
95
+ this . position . x -= 4
97
96
} else {
98
97
// selecteer nieuwe row binnen min en max aantal rows
99
98
this . position . x = 0
100
99
this . position . y = Math . min ( Math . max ( this . position . y + dir , 0 ) , this . menu . length - 1 )
101
100
}
102
- // als we naar de paging row zijn gegaan, dan is de column de huidige page
101
+ // // als we naar de paging row zijn gegaan, dan is de column de huidige page
103
102
if ( this . position . y == 2 ) {
104
103
this . position . x = this . page
105
104
}
@@ -108,19 +107,23 @@ class GridMenu {
108
107
}
109
108
110
109
public selectColumn ( dir : number ) {
111
- // als we in de games row zijn, dan kan je met links/rechts ook naar een nieuwe page gaan
110
+ // todo rewrite the whole paging / row selection
111
+
112
+ // links - vorige pagina
112
113
if ( this . position . y == 1 && this . position . x == 0 && dir == - 1 && this . page > 0 ) {
113
114
this . generateGamePage ( dir )
114
115
this . showPageNumber ( )
115
116
this . position . x = 8
116
- } else if ( this . position . y == 1 && this . position . x == 7 && dir == 1 && this . page < this . numpages - 1 ) {
117
+ }
118
+
119
+ // rechts - volgende pagina
120
+ if ( this . position . y == 1 && this . position . x == 7 && dir == 1 && this . page < this . numpages - 1 ) {
117
121
this . generateGamePage ( dir )
118
122
this . showPageNumber ( )
119
123
this . position . x = - 1
120
124
}
121
125
122
126
123
-
124
127
let maxColumn = this . menu [ this . position . y ] . length - 1
125
128
this . position . x = Math . min ( Math . max ( this . position . x + dir , 0 ) , maxColumn )
126
129
0 commit comments