V4 updates (#210)

* update pxt.json files

* Fix button event enums

fixes https://github.com/microsoft/pxt-calliope/issues/206

* Fix Safari CSS Rule for iOS app

fixes https://github.com/microsoft/pxt-calliope/issues/205

* aprove preffered repos

should fix https://github.com/microsoft/pxt-calliope/issues/167
This commit is contained in:
Juri Wolf
2023-01-11 18:51:27 +01:00
committed by GitHub
parent 1aaedf1fa0
commit 77ed2ccfb1
62 changed files with 223 additions and 162 deletions

View File

@ -7,7 +7,7 @@ let level: number
let swapSpeed: number
initializeGame()
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
if (ballRevealing) {
index = index + 1
if (index > 2) {
@ -16,7 +16,7 @@ input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
basic.showString(cupSelect[index], 150)
}
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
if (ballRevealing) {
ballRevealing = false
if (correctBall == index) {

View File

@ -18,7 +18,7 @@ counter = 0
pause = 700
led.plot(oneX, oneY)
led.plot(twoX, twoY)
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
if (oneX > 0) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)
@ -28,7 +28,7 @@ input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
led.plot(twoX, twoY)
}
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
if (twoX < 4) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)

View File

@ -107,12 +107,12 @@ basic.forever(() => {
basic.pause(500)
}
})
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
let temp = Math.abs(person.dirX) * (-1)
person.dirX = Math.abs(person.dirY) * (-1)
person.dirY = temp
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
let temp1 = Math.abs(person.dirX)
person.dirX = Math.abs(person.dirY)
person.dirY = temp1

View File

@ -24,13 +24,13 @@ playOneGame(gameTime)
showFinalScores(scoreA, scoreB)
function startIOMonitor() {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
AWasPressed = true
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
BWasPressed = true
})
input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
input.onButtonEvent(Button.AB, input.buttonEventValue(ButtonEvent.Click), () => {
ABWasPressed = true
AWasPressed = false
BWasPressed = false

View File

@ -501,13 +501,13 @@ function convertPenaltyTimeToScore(penaltyTime: number): number {
}
function startIOMonitor() {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
AWasPressed = true
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
BWasPressed = true
})
input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
input.onButtonEvent(Button.AB, input.buttonEventValue(ButtonEvent.Click), () => {
ABWasPressed = true
})
input.onShake(() => {

View File

@ -377,11 +377,11 @@ function beepNTimesFor(times: number, duration: number) {
function startIOMonitor() {
aWasPressed = false
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
aWasPressed = true
})
bWasPressed = false
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
bWasPressed = true
})
wasTweezers = false

View File

@ -476,10 +476,10 @@ function testTiltZ() {
}
function startIOMonitor() {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Click), () => {
AWasPressed = true
})
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Click), () => {
BWasPressed = true
})
input.onShake(() => {