Compare commits

...

3 Commits

Author SHA1 Message Date
Fabien Freling e0677263d6 generate android/debug.keystore 2023-12-20 22:59:58 +01:00
Fabien Freling aa9f7d997c add android sdk 2023-12-20 22:48:17 +01:00
Fabien Freling b2c9bbf9a2 move file dialog to unloaded scene 2023-12-20 22:41:41 +01:00
8 changed files with 49 additions and 30 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
android/*.keystore

View File

@ -22,17 +22,31 @@
# NOTE: zig overlay triggers issues with X11/GL libraries
# This might be misconfiguration on my end
overlays = [ ];
config = { };
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};
formatter = pkgs.nixfmt;
devShells.default = with pkgs;
mkShell {
LD_LIBRARY_PATH = lib.makeLibraryPath [ stdenv.cc.cc ]; # For libstdc++.so.6
ANDROID_HOME = "foo/bar";
nativeBuildInputs = [ clang just android-tools godot_4 ];
LD_LIBRARY_PATH =
lib.makeLibraryPath [ stdenv.cc.cc ]; # For libstdc++.so.6
ANDROID_HOME = "${androidenv.androidPkgs_9_0.androidsdk}/libexec/android-sdk";
nativeBuildInputs = [
clang
just
godot_4
android-tools
androidenv.androidPkgs_9_0.androidsdk
androidenv.androidPkgs_9_0.platform-tools
jre_headless
];
buildInputs = [ sqlite ];
};
};

View File

@ -31,7 +31,7 @@ version/name=""
package/unique_name="com.example.$genname"
package/name=""
package/signed=true
package/app_category=2
package/app_category=6
package/retain_data_on_uninstall=false
package/exclude_from_recents=false
package/show_in_android_tv=false

View File

@ -2,12 +2,6 @@ extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
$FileDialog.mode = FileDialog.FILE_MODE_OPEN_FILE
$FileDialog.access = FileDialog.ACCESS_FILESYSTEM
$FileDialog.use_native_dialog = true
$MarginContainer/Unloaded/Button.pressed.connect(_on_button_pressed)
Global.state_changed.connect(_update_state)
if Global.current_state == Global.State.UNLOADED:
pass
@ -17,17 +11,6 @@ func _ready():
var current_scene = s.instantiate()
$MarginContainer.add_child(current_scene)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_pressed():
$FileDialog.show()
print("button pressed")
func _on_file_dialog_file_selected(path):
Global.load_db(path)
func _update_state(old: Global.State, new: Global.State):
print("updated state")
pass

View File

@ -27,7 +27,3 @@ metadata/_edit_use_anchors_ = true
[node name="Unloaded" parent="MarginContainer" instance=ExtResource("2_diny5")]
layout_mode = 2
[node name="FileDialog" type="FileDialog" parent="."]
[connection signal="file_selected" from="FileDialog" to="." method="_on_file_dialog_file_selected"]

12
godot/unloaded.gd Normal file
View File

@ -0,0 +1,12 @@
extends CenterContainer
func _ready():
$FileDialog.mode = FileDialog.FILE_MODE_OPEN_FILE
$FileDialog.access = FileDialog.ACCESS_FILESYSTEM
$FileDialog.use_native_dialog = true
func _on_button_pressed():
$FileDialog.show()
func _on_file_dialog_file_selected(path):
Global.load_db(path)

View File

@ -1,8 +1,16 @@
[gd_scene format=3 uid="uid://b71wpb1vts86r"]
[gd_scene load_steps=2 format=3 uid="uid://b71wpb1vts86r"]
[ext_resource type="Script" path="res://unloaded.gd" id="1_ibvef"]
[node name="CenterContainer" type="CenterContainer"]
script = ExtResource("1_ibvef")
[node name="Button" type="Button" parent="."]
custom_minimum_size = Vector2(200, 200)
layout_mode = 2
text = "Load database"
[node name="FileDialog" type="FileDialog" parent="."]
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
[connection signal="file_selected" from="FileDialog" to="." method="_on_file_dialog_file_selected"]

View File

@ -4,7 +4,12 @@ alias t := test
alias fmt := format
edit:
godot4 --editor godot/project.godot
godot4 --editor --quiet godot/project.godot
android-keystore:
mkdir -p android
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore android/debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12
keytool -v -genkey -keystore logue.keystore -alias logue -keyalg RSA -validity 10000
pre-build:
git submodule update --init --recursive