android fixes
|
|
@ -5,7 +5,7 @@
|
||||||
package="com.randomityguy.mbhaxe.mbg"
|
package="com.randomityguy.mbhaxe.mbg"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.1.8">
|
||||||
|
|
||||||
<!-- Tell the system this app requires OpenGL ES 3.0. -->
|
<!-- Tell the system this app requires OpenGL ES 3.0. -->
|
||||||
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
|
<uses-feature android:glEsVersion="0x00030000" android:required="true" />
|
||||||
|
|
@ -13,12 +13,15 @@
|
||||||
<application android:label="@string/app_name"
|
<application android:label="@string/app_name"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
android:hardwareAccelerated="true">
|
android:hardwareAccelerated="true"
|
||||||
|
android:debuggable="true">
|
||||||
|
|
||||||
<activity android:name="org.haxe.HashLinkActivity"
|
<activity android:name="org.haxe.HashLinkActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:screenOrientation="sensorLandscape"
|
||||||
>
|
>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
||||||
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
|
@ -162,6 +162,23 @@ class Settings {
|
||||||
public static var settingsDir = ".";
|
public static var settingsDir = ".";
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
#if android
|
||||||
|
@:hlNative("Java_org_haxe_HashLinkActivity")
|
||||||
|
static function saveAndroid(name:String, data:String) {}
|
||||||
|
#end
|
||||||
|
|
||||||
|
#if android
|
||||||
|
@:hlNative("Java_org_haxe_HashLinkActivity")
|
||||||
|
static function loadAndroid(name:String):hl.Bytes {
|
||||||
|
var i = 4;
|
||||||
|
return hl.Bytes.fromValue("null", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@:hlNative static function get_storage_path():hl.Bytes {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
#if hl
|
#if hl
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
|
|
@ -225,6 +242,9 @@ class Settings {
|
||||||
}
|
}
|
||||||
File.saveContent(Path.join([settingsDir, "settings.json"]), json);
|
File.saveContent(Path.join([settingsDir, "settings.json"]), json);
|
||||||
#end
|
#end
|
||||||
|
#if android
|
||||||
|
saveAndroid('settings', json);
|
||||||
|
#end
|
||||||
#if js
|
#if js
|
||||||
var localStorage = js.Browser.getLocalStorage();
|
var localStorage = js.Browser.getLocalStorage();
|
||||||
if (localStorage != null) {
|
if (localStorage != null) {
|
||||||
|
|
@ -235,20 +255,32 @@ class Settings {
|
||||||
|
|
||||||
public static function load() {
|
public static function load() {
|
||||||
var settingsExists = false;
|
var settingsExists = false;
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
settingsExists = FileSystem.exists(Path.join([settingsDir, "settings.json"]));
|
settingsExists = FileSystem.exists(Path.join([settingsDir, "settings.json"]));
|
||||||
#end
|
#end
|
||||||
|
#if android
|
||||||
|
settingsDir = @:privateAccess String.fromUTF8(get_storage_path());
|
||||||
|
#end
|
||||||
#if js
|
#if js
|
||||||
var localStorage = js.Browser.getLocalStorage();
|
var localStorage = js.Browser.getLocalStorage();
|
||||||
if (localStorage != null) {
|
if (localStorage != null) {
|
||||||
settingsExists = localStorage.getItem("MBHaxeSettings") != null;
|
settingsExists = localStorage.getItem("MBHaxeSettings") != null;
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
#if android
|
||||||
|
settingsExists = true;
|
||||||
|
var rawJson = @:privateAccess String.fromUTF8(loadAndroid('settings'));
|
||||||
|
if (rawJson == null || rawJson == "")
|
||||||
|
settingsExists = false;
|
||||||
|
#end
|
||||||
|
|
||||||
if (settingsExists) {
|
if (settingsExists) {
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
var json = Json.parse(File.getContent(Path.join([settingsDir, "settings.json"])));
|
var json = Json.parse(File.getContent(Path.join([settingsDir, "settings.json"])));
|
||||||
#end
|
#end
|
||||||
|
#if android
|
||||||
|
var json = Json.parse(rawJson);
|
||||||
|
#end
|
||||||
#if js
|
#if js
|
||||||
var json = Json.parse(localStorage.getItem("MBHaxeSettings"));
|
var json = Json.parse(localStorage.getItem("MBHaxeSettings"));
|
||||||
#end
|
#end
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,7 @@ class HelpCreditsGui extends GuiImage {
|
||||||
dtsObj.init(null, () -> {}); // The lambda is not gonna run async anyway
|
dtsObj.init(null, () -> {}); // The lambda is not gonna run async anyway
|
||||||
for (mat in dtsObj.materials) {
|
for (mat in dtsObj.materials) {
|
||||||
mat.mainPass.enableLights = false;
|
mat.mainPass.enableLights = false;
|
||||||
|
mat.mainPass.culling = Front;
|
||||||
if (mat.blendMode != Alpha && mat.blendMode != Add)
|
if (mat.blendMode != Alpha && mat.blendMode != Add)
|
||||||
mat.mainPass.addShader(new AlphaChannel());
|
mat.mainPass.addShader(new AlphaChannel());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ class PlayMissionGui extends GuiImage {
|
||||||
var filt = new ColorMatrix(Matrix.I());
|
var filt = new ColorMatrix(Matrix.I());
|
||||||
pmPreview.bmp.filter = filt;
|
pmPreview.bmp.filter = filt;
|
||||||
|
|
||||||
|
#if (!android)
|
||||||
var replayPlayButton = new GuiImage(ResourceLoader.getResource("data/ui/play/playback.png", ResourceLoader.getImage, this.imageResources).toTile());
|
var replayPlayButton = new GuiImage(ResourceLoader.getResource("data/ui/play/playback.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
replayPlayButton.position = new Vector(38, 315);
|
replayPlayButton.position = new Vector(38, 315);
|
||||||
replayPlayButton.extent = new Vector(18, 18);
|
replayPlayButton.extent = new Vector(18, 18);
|
||||||
|
|
@ -172,6 +173,7 @@ class PlayMissionGui extends GuiImage {
|
||||||
cast(this.parent, Canvas).pushDialog(new MessageBoxOkDlg("The next mission you play will be recorded."));
|
cast(this.parent, Canvas).pushDialog(new MessageBoxOkDlg("The next mission you play will be recorded."));
|
||||||
};
|
};
|
||||||
pmBox.addChild(replayRecordButton);
|
pmBox.addChild(replayRecordButton);
|
||||||
|
#end
|
||||||
|
|
||||||
var levelWnd = new GuiImage(ResourceLoader.getResource("data/ui/play/level_window.png", ResourceLoader.getImage, this.imageResources).toTile());
|
var levelWnd = new GuiImage(ResourceLoader.getResource("data/ui/play/level_window.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
levelWnd.position = new Vector();
|
levelWnd.position = new Vector();
|
||||||
|
|
|
||||||