diff --git a/assets/js/views/xoi/main.js b/assets/js/views/xoi/main.js index 3d11aae..c00c43c 100644 --- a/assets/js/views/xoi/main.js +++ b/assets/js/views/xoi/main.js @@ -311,7 +311,10 @@ const gameinput = { } else if (e.key == "F4" || e.keyCode == 115) { e.preventDefault(); context.emit('resolve', "26"); - } + } else if (e.key == "/" || e.keyCode == 111 || e.key == "r") { + e.preventDefault(); + context.emit('resolve', -1*parseFloat(e.target.value)); + } } return { check_remove, keyhandler } @@ -594,8 +597,12 @@ const gameStateMachine = (gamestack, stack, page, computedProps) => { 1: async (input, reGet) => { // Normal Game Loop // Get Game Input - const [visit, error] = await overlayAndPop("d-gameinput", { input: input }, gamestack); - // back/delete last throw + let [visit, error] = await overlayAndPop("d-gameinput", { input: input }, gamestack); + + if (parseFloat(visit) < 0 ){ + visit = ""+(computedProps.current_toGo.value[computedProps.current_player.value * 1] - parseFloat(visit)*-1); + } + // back/delete last throw if (error != undefined) { const val = removeLastVisit(page); saveGame(page);