Guard native world taps and zoom larger counting boards through real touch
This commit is contained in:
@@ -34,7 +34,12 @@ function BallPoint($Board,[string]$Id) {
|
||||
$scale=($height/2)/([Math]::Tan(31*[Math]::PI/180)*$local.Z)
|
||||
return @([int][Math]::Round(($width/2)+$local.X*$scale),[int][Math]::Round(($height/2)-$local.Y*$scale))
|
||||
}
|
||||
function TapBall([string]$Name,$Board,[string]$Id) { $point=BallPoint $Board $Id; Step $Name @('shell','input','tap',"$($point[0])","$($point[1])") }
|
||||
function WorldSafe($Point) { return $Point[0]-ge530-and$Point[0]-le1900-and$Point[1]-ge280-and$Point[1]-le750 }
|
||||
function TapBall([string]$Name,$Board,[string]$Id) {
|
||||
$point=BallPoint $Board $Id
|
||||
if(!(WorldSafe $point)){throw "Refused unsafe native ball tap $Id at $($point-join',')"}
|
||||
Step $Name @('shell','input','tap',"$($point[0])","$($point[1])")
|
||||
}
|
||||
function StagePoint([int]$Id) { $index=$Id-1; return @([int][Math]::Round((.12+($index%6)*.152)*2400),[int][Math]::Round((1-(.76-[Math]::Floor($index/6)*.123))*1080)) }
|
||||
function SelectStage([string]$Name,[int]$Id) {
|
||||
Step "$Name-selection" @('shell','input','tap','1200','616')
|
||||
|
||||
Reference in New Issue
Block a user