Compare commits
3 commits
8b1fe0a9be
...
e0677263d6
Author | SHA1 | Date | |
---|---|---|---|
|
e0677263d6 | ||
|
aa9f7d997c | ||
|
b2c9bbf9a2 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
android/*.keystore
|
24
flake.nix
24
flake.nix
|
@ -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 ];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
12
godot/unloaded.gd
Normal 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)
|
|
@ -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"]
|
||||
|
|
7
justfile
7
justfile
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue