diff --git a/src/pregmod/FCTV/FCTV.js b/src/pregmod/FCTV/FCTV.js index 6766ecd0aa1236eadf6dd2ad16e6728cc27b1cf1..57c4bcfe1067bbdc039b1c50cecb7560bb1b6276 100644 --- a/src/pregmod/FCTV/FCTV.js +++ b/src/pregmod/FCTV/FCTV.js @@ -38,14 +38,14 @@ globalThis.FCTV = (function() { } } - function showChannel(i) { + function showChannel(i, {usedRemote = 0, seeAll = 0} = {}) { let x = { canSelect: 1, text: `A notification is shown: ` }; switch (i) { case 3: case 4: - if (V.usedRemote && (!V.cheatMode || !V.debugMode)) { + if (usedRemote && (!V.cheatMode || !V.debugMode)) { x.canSelect = -1; } break; @@ -95,7 +95,7 @@ globalThis.FCTV = (function() { break; } - if (V.all) { x.canSelect = 1; } + if (seeAll) { x.canSelect = 1; } return x; } @@ -289,14 +289,14 @@ globalThis.FCTV = (function() { // CHange to push each button to an array, then make the array into a grid - for (let _i = 0; _i < _possibleChannels.length; _i++) { - if (FCTV.showChannel(_i).canSelect > 0) { - if (V.FCTV.channel.selected !== _i) { + for (let i = 0; i < _possibleChannels.length; i++) { + if (FCTV.showChannel(i, {usedRemote: usedRemote, seeAll: seeAll}).canSelect > 0) { + if (V.FCTV.channel.selected !== i) { buttons.push( App.UI.DOM.link( - _i, + i, () => { - V.FCTV.channel.selected = _i; + V.FCTV.channel.selected = i; FCTV.watch({usedRemote: 1}); } ) @@ -307,9 +307,9 @@ globalThis.FCTV = (function() { span.style.fontWeight = "bold"; span.append( App.UI.DOM.link( - _i, + i, () => { - V.FCTV.channel.selected = _i; + V.FCTV.channel.selected = i; FCTV.watch({usedRemote: 1, seeAll: seeAll}); } ) @@ -317,12 +317,12 @@ globalThis.FCTV = (function() { buttons.push(span); } } else { - if (![3, 4].includes(_i)) { + if (![3, 4].includes(i)) { buttons.push( - App.UI.DOM.disabledLink(_i, [FCTV.showChannel(_i).text]) + App.UI.DOM.disabledLink(i, [FCTV.showChannel(i).text]) ); } else { - buttons.push(App.UI.DOM.makeElement("span", _i)); + buttons.push(App.UI.DOM.makeElement("span", i)); } } } @@ -340,7 +340,6 @@ globalThis.FCTV = (function() { App.UI.DOM.link( `Toggle inappropriate`, () => { - V.FCTV.channel.selected = _i; if (seeAll) { seeAll = 0; } else { @@ -355,7 +354,6 @@ globalThis.FCTV = (function() { App.UI.DOM.link( `Randomise channel selection`, () => { - V.FCTV.channel.selected = _i; FCTV.watch({usedRemote: 0, seeAll: seeAll}); } )