Selaa lähdekoodia

Fixed android std.permissions.

Mark Sibly 6 vuotta sitten
vanhempi
commit
963222e877
4 muutettua tiedostoa jossa 11 lisäystä ja 127 poistoa
  1. 11 11
      modules/std/permissions/permissions.monkey2
  2. 0 26
      scripts/rebuildted2.bat
  3. 0 45
      scripts/rebuildted2.sh
  4. 0 45
      scripts/updateted2.sh

+ 11 - 11
modules/std/permissions/permissions.monkey2

@@ -42,9 +42,9 @@ End
 Class Request
 
 	Field permissions:String
-	Field finished:void( result:int[] )
+	Field finished:Void( result:ResultType[] )
 
-	Method New( permissions:String[],finished:Void( result:Int[] ) )
+	Method New( permissions:String[],finished:Void( result:ResultType[] ) )
 	
 		Self.permissions=";".Join( permissions )
 	
@@ -75,9 +75,9 @@ Class Request
 		
 		Local sresult:=result.Split( ";" )
 		
-		Local iresult:=New Int[sresult.Length]
+		Local iresult:=New ResultType[sresult.Length]
 		For Local i:=0 Until iresult.Length
-			iresult[i]=int( sresult[i] )
+			iresult[i]=Cast<UInt>( sresult[i] )
 		Next
 		
 		finished( iresult )
@@ -92,7 +92,7 @@ End
 
 Public
 
-#end
+#Endif
 
 #rem monkeydoc Check an android permission.
 
@@ -105,7 +105,7 @@ The permission string should be in android manifest form, eg: "android.permissio
 #end
 Function CheckPermission:Int( permission:String )
  
- #If __TARGET__="android"
+#If __TARGET__="android"
  
 	Init()
 
@@ -113,15 +113,15 @@ Function CheckPermission:Int( permission:String )
 	
 	Return env.CallIntMethod( _instance,_checkPermission,New Variant[]( permission ) )
 	
-#else
+#Else
 
 	Return -1
 	
-#endif
+#Endif
 
 End
 
-Alias ResultType:uInt
+Alias ResultType:UInt
 
 #rem monkeydoc Request android permissions.
 
@@ -146,10 +146,10 @@ Function RequestPermissions( permissions:String[],finished:Void( results:ResultT
 
 	Init()
 
-'	_requests.AddLast( New Request( permissions,finished ) )
+	_requests.AddLast( New Request( permissions,finished ) )
 	
 	StartNextRequest()
 	
-#endif
+#Endif
 
 End

+ 0 - 26
scripts/rebuildted2.bat

@@ -1,26 +0,0 @@
-
-echo off
-
-call common.bat
-
-echo.
-echo ***** Rebuilding ted2 *****
-echo.
-
-%mx2cc% makeapp -clean -apptype=gui -build -config=release -product=scripts/ted2.products/windows/ted2.exe ../src/ted2/ted2.monkey2
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-xcopy ted2.products\windows\assets ..\bin\ted2_windows\assets /Q /I /S /Y
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-xcopy ted2.products\windows\*.dll ..\bin\ted2_windows /Q /I /S /Y
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-xcopy ted2.products\windows\*.exe ..\bin\ted2_windows /Q /I /S /Y
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-%mx2cc% makeapp -clean -apptype=gui -build -config=release -product=scripts/launcher.products/launcher_windows.exe ../src/launcher/launcher.monkey2
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-copy launcher.products\launcher_windows.exe "..\Monkey2 (Windows).exe"
-if %errorlevel% neq 0 exit /b %errorlevel%

+ 0 - 45
scripts/rebuildted2.sh

@@ -1,45 +0,0 @@
-
-source common.sh
-
-echo ""
-echo "***** Rebuilding ted2 *****"
-echo ""
-
-$mx2cc makeapp -clean -apptype=gui -build -config=release -product=scripts/ted2.products/$host/ted2 ../src/ted2/ted2.monkey2
-
-$mx2cc makeapp -clean -apptype=gui -build -config=release -product=scripts/launcher.products/$host/launcher ../src/launcher/launcher.monkey2
-
-if [ "$OSTYPE" = "linux-gnu" ]
-then
-
-	rm -r -f $ted2
-	mkdir $ted2
-	cp -R ./ted2.products/$host/assets $ted2/assets
-	cp ./ted2.products/$host/ted2 $ted2/ted2
-	
-	rm -r -f "$launcher"
-	cp ./launcher.products/$host/launcher "$launcher"
-
-elif [ "$OSTYPE" = "linux-gnueabihf" ]
-then
-
-	rm -r -f $ted2
-	mkdir $ted2
-	cp -R ./ted2.products/$host/assets $ted2/assets
-	cp ./ted2.products/$host/ted2 $ted2/ted2
-	
-	rm -r -f "$launcher"
-	cp ./launcher.products/$host/launcher "$launcher"
-
-else
-
-	rm -r -f $ted2
-	cp -R ./ted2.products/macos/ted2.app $ted2
-	
-	rm -r -f "$launcher"
-	cp -R ./launcher.products/macos/Launcher.app "$launcher"
-	
-	cp ../src/launcher/info.plist "$launcher/Contents"
-	cp ../src/launcher/Monkey2logo.icns "$launcher/Contents/Resources"
-
-fi

+ 0 - 45
scripts/updateted2.sh

@@ -1,45 +0,0 @@
-
-source common.sh
-
-echo ""
-echo "***** Updating ted2 *****"
-echo ""
-
-$mx2cc makeapp -apptype=gui -build -config=release -product=scripts/ted2.products/$host/ted2 ../src/ted2/ted2.monkey2
-
-$mx2cc makeapp -apptype=gui -build -config=release -product=scripts/launcher.products/$host/launcher ../src/launcher/launcher.monkey2
-
-if [ "$OSTYPE" = "linux-gnu" ]
-then
-
-	rm -r -f $ted2
-	mkdir $ted2
-	cp -R ./ted2.products/$host/assets $ted2/assets
-	cp ./ted2.products/$host/ted2 $ted2/ted2
-	
-	rm -r -f "$launcher"
-	cp ./launcher.products/$host/launcher "$launcher"
-
-elif [ "$OSTYPE" = "linux-gnueabihf" ]
-then
-
-	rm -r -f $ted2
-	mkdir $ted2
-	cp -R ./ted2.products/$host/assets $ted2/assets
-	cp ./ted2.products/$host/ted2 $ted2/ted2
-	
-	rm -r -f "$launcher"
-	cp ./launcher.products/$host/launcher "$launcher"
-
-else
-
-	rm -r -f $ted2
-	cp -R ./ted2.products/macos/ted2.app $ted2
-	
-	rm -r -f "$launcher"
-	cp -R ./launcher.products/macos/Launcher.app "$launcher"
-	
-	cp ../src/launcher/info.plist "$launcher/Contents"
-	cp ../src/launcher/Monkey2logo.icns "$launcher/Contents/Resources"
-
-fi