@@ -72,7 +72,8 @@ internal void UpdateParent( float X, float Y)
72
72
73
73
internal async void Functions ( )
74
74
{
75
- if ( ScreenTools . IsMouseInBounds ( new PointF ( Grid . Position . X + 20f , Grid . Position . Y + 20f ) , new SizeF ( Grid . Size . Width - 40f , Grid . Size . Height - 40f ) ) )
75
+ Point safezoneOffset = ScreenTools . SafezoneBounds ;
76
+ if ( ScreenTools . IsMouseInBounds ( new PointF ( Grid . Position . X + 20f + safezoneOffset . X , Grid . Position . Y + 20f + safezoneOffset . Y ) , new SizeF ( Grid . Size . Width - 40f , Grid . Size . Height - 40f ) ) )
76
77
{
77
78
if ( API . IsDisabledControlPressed ( 0 , 24 ) )
78
79
{
@@ -81,18 +82,18 @@ internal async void Functions()
81
82
Pressed = true ;
82
83
Audio . Id = API . GetSoundId ( ) ;
83
84
API . PlaySoundFrontend ( Audio . Id , Audio . Slider , Audio . Library , true ) ;
84
- while ( API . IsDisabledControlPressed ( 0 , 24 ) && ScreenTools . IsMouseInBounds ( new PointF ( Grid . Position . X + 20f , Grid . Position . Y + 20f ) , new SizeF ( Grid . Size . Width - 40f , Grid . Size . Height - 40f ) ) )
85
+ while ( API . IsDisabledControlPressed ( 0 , 24 ) && ScreenTools . IsMouseInBounds ( new PointF ( Grid . Position . X + 20f + safezoneOffset . X , Grid . Position . Y + 20f + safezoneOffset . Y ) , new SizeF ( Grid . Size . Width - 40f , Grid . Size . Height - 40f ) ) )
85
86
{
86
87
await BaseScript . Delay ( 0 ) ;
87
88
var res = ScreenTools . ResolutionMaintainRatio ;
88
89
float mouseX = API . GetDisabledControlNormal ( 0 , 239 ) * res . Width ;
89
90
float mouseY = API . GetDisabledControlNormal ( 0 , 240 ) * res . Height ;
90
- mouseX -= ( Circle . Size . Width / 2 ) ;
91
- mouseY -= ( Circle . Size . Height / 2 ) ;
92
- PointF Position = new PointF ( mouseX > ( Grid . Position . X + 10 + Grid . Size . Width - 40 ) ? ( Grid . Position . X + 10 + Grid . Size . Width - 40 ) : ( ( mouseX < ( Grid . Position . X + 20 - ( Circle . Size . Width / 2 ) ) ) ? ( Grid . Position . X + 20 - ( Circle . Size . Width / 2 ) ) : mouseX ) , mouseY > ( Grid . Position . Y + 10 + Grid . Size . Height - 40 ) ? ( Grid . Position . Y + 10 + Grid . Size . Height - 40 ) : ( ( mouseY < ( Grid . Position . Y + 20 - ( Circle . Size . Height / 2 ) ) ) ? ( Grid . Position . Y + 20 - ( Circle . Size . Height / 2 ) ) : mouseY ) ) ;
91
+ mouseX -= ( Circle . Size . Width / 2 ) + safezoneOffset . X ;
92
+ mouseY -= ( Circle . Size . Height / 2 ) + safezoneOffset . Y ;
93
+ PointF Position = new PointF ( mouseX > ( Grid . Position . X + 10 + Grid . Size . Width - 40 ) ? ( Grid . Position . X + 10 + Grid . Size . Width - 40 ) : ( ( mouseX < ( Grid . Position . X + 20 - ( Circle . Size . Width / 2 ) ) ) ? ( Grid . Position . X + 20 - ( Circle . Size . Width / 2 ) ) : mouseX ) , mouseY > ( Grid . Position . Y + 10 + safezoneOffset . Y + Grid . Size . Height - 40 ) ? ( Grid . Position . Y + 10 + Grid . Size . Height - 40 ) : ( ( mouseY < ( Grid . Position . Y + 20 - ( Circle . Size . Height / 2 ) ) ) ? ( Grid . Position . Y + 20 - ( Circle . Size . Height / 2 ) ) : mouseY ) ) ;
93
94
Circle . Position = Position ;
94
- var resultX = ( float ) Math . Round ( ( Circle . Position . X - ( Grid . Position . X + 20 ) + ( Circle . Size . Width + 20 ) ) / ( Grid . Size . Width - 40 ) , 2 ) ;
95
- var resultY = ( float ) Math . Round ( ( Circle . Position . Y - ( Grid . Position . Y + 20 ) + ( Circle . Size . Height + 20 ) ) / ( Grid . Size . Height - 40 ) , 2 ) ;
95
+ var resultX = ( float ) Math . Round ( ( Circle . Position . X - ( Grid . Position . X + 20 ) + ( Circle . Size . Width + 20 ) ) / ( Grid . Size . Width - 40 ) , 2 ) + safezoneOffset . X ;
96
+ var resultY = ( float ) Math . Round ( ( Circle . Position . Y - ( Grid . Position . Y + 20 ) + ( Circle . Size . Height + 20 ) ) / ( Grid . Size . Height - 40 ) , 2 ) + safezoneOffset . Y ;
96
97
UpdateParent ( ( ( resultX >= 0.0f && resultX <= 1.0f ) ? resultX : ( ( resultX <= 0f ) ? 0.0f : 1.0f ) * 2f ) - 1f , ( ( resultY >= 0.0f && resultY <= 1.0f ) ? resultY : ( ( resultY <= 0f ) ? 0.0f : 1.0f ) * 2f ) - 1f ) ;
97
98
}
98
99
API . StopSound ( Audio . Id ) ;
0 commit comments