diff --git a/.gitignore b/.gitignore index 226d13a..2a213cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -android/*.keystore +/android/*.keystore +/godot-addons/godot-sqlite/bin diff --git a/godot-addons/godot-sqlite/LICENSE.md b/godot-addons/godot-sqlite/LICENSE.md new file mode 100644 index 0000000..4bce6d2 --- /dev/null +++ b/godot-addons/godot-sqlite/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019-2023 Piet Bronders & Jeroen De Geeter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/godot-addons/godot-sqlite/gdsqlite.gdextension b/godot-addons/godot-sqlite/gdsqlite.gdextension new file mode 100644 index 0000000..1a52792 --- /dev/null +++ b/godot-addons/godot-sqlite/gdsqlite.gdextension @@ -0,0 +1,30 @@ +[configuration] + +entry_symbol = "sqlite_library_init" +compatibility_minimum = 4.1 + +[libraries] + +macos = "res://addons/godot-sqlite/bin/libgdsqlite.macos.template_debug.framework" +macos.template_release = "res://addons/godot-sqlite/bin/libgdsqlite.macos.template_release.framework" +windows.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.windows.template_debug.x86_64.dll" +windows.template_release.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.windows.template_release.x86_64.dll" +linux.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.linux.template_debug.x86_64.so" +linux.template_release.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.linux.template_release.x86_64.so" +android.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.arm64.so" +android.template_release.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.arm64.so" +android.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.x86_64.so" +android.template_release.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.x86_64.so" + +[dependencies] + +macos = {} +macos.template_release = {} +windows.x86_64 = {} +windows.template_release.x86_64 = {} +linux.x86_64 = {} +linux.template_release.x86_64 = {} +android.arm64 = {} +android.template_release.arm64 = {} +android.x86_64 = {} +android.template_release.x86_64 = {} \ No newline at end of file diff --git a/godot-addons/godot-sqlite/gdsqlite.gdextension.uid b/godot-addons/godot-sqlite/gdsqlite.gdextension.uid new file mode 100644 index 0000000..76811d1 --- /dev/null +++ b/godot-addons/godot-sqlite/gdsqlite.gdextension.uid @@ -0,0 +1 @@ +uid://dn3c8fc8slh6j diff --git a/godot-addons/godot-sqlite/godot-sqlite.gd b/godot-addons/godot-sqlite/godot-sqlite.gd new file mode 100644 index 0000000..8118c38 --- /dev/null +++ b/godot-addons/godot-sqlite/godot-sqlite.gd @@ -0,0 +1,14 @@ +# ############################################################################ # +# Copyright © 2019-2023 Piet Bronders & Jeroen De Geeter +# Licensed under the MIT License. +# See LICENSE in the project root for license information. +# ############################################################################ # + +@tool +extends EditorPlugin + +func _enter_tree(): + pass + +func _exit_tree(): + pass diff --git a/godot-addons/godot-sqlite/godot-sqlite.gd.uid b/godot-addons/godot-sqlite/godot-sqlite.gd.uid new file mode 100644 index 0000000..db2e89a --- /dev/null +++ b/godot-addons/godot-sqlite/godot-sqlite.gd.uid @@ -0,0 +1 @@ +uid://dhcttsh3tto23 diff --git a/godot-addons/godot-sqlite/plugin.cfg b/godot-addons/godot-sqlite/plugin.cfg new file mode 100644 index 0000000..d98fca2 --- /dev/null +++ b/godot-addons/godot-sqlite/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Godot SQLite" +description="GDNative wrapper for SQLite (Godot 4.X+), making it possible to use SQLite databases as data storage in all your future games." +author="Piet Bronders & Jeroen De Geeter" +version="4.2" +script="godot-sqlite.gd" diff --git a/justfile b/justfile index ba80eda..669b7d8 100644 --- a/justfile +++ b/justfile @@ -5,6 +5,9 @@ alias e := edit edit: godot4 --editor --quiet godot/project.godot +todos: + godot4 --editor --quiet todos/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 diff --git a/todos/.gitattributes b/todos/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/todos/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/todos/.gitignore b/todos/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/todos/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/todos/NewEntry.tscn b/todos/NewEntry.tscn new file mode 100644 index 0000000..0403c45 --- /dev/null +++ b/todos/NewEntry.tscn @@ -0,0 +1,57 @@ +[gd_scene format=3 uid="uid://dutnsmmhm8px6"] + +[node name="PopupPanel" type="PopupPanel" unique_id=1480508047] +oversampling_override = 1.0 +size = Vector2i(100, 389) +visible = true + +[node name="GridContainer" type="GridContainer" parent="." unique_id=545204867] +offset_left = 4.0 +offset_top = 4.0 +offset_right = 96.0 +offset_bottom = 385.0 +columns = 3 + +[node name="0" type="Button" parent="GridContainer" unique_id=1587740652] +layout_mode = 2 +text = "0" + +[node name="1" type="Button" parent="GridContainer" unique_id=196215655] +layout_mode = 2 +text = "1" + +[node name="2" type="Button" parent="GridContainer" unique_id=1297712196] +layout_mode = 2 +text = "2" + +[node name="3" type="Button" parent="GridContainer" unique_id=1489651124] +layout_mode = 2 +text = "3" + +[node name="4" type="Button" parent="GridContainer" unique_id=122086073] +layout_mode = 2 +text = "4" + +[node name="5" type="Button" parent="GridContainer" unique_id=1573844743] +layout_mode = 2 +text = "5" + +[node name="6" type="Button" parent="GridContainer" unique_id=2138965382] +layout_mode = 2 +text = "6" + +[node name="7" type="Button" parent="GridContainer" unique_id=144644283] +layout_mode = 2 +text = "7" + +[node name="8" type="Button" parent="GridContainer" unique_id=763780230] +layout_mode = 2 +text = "8" + +[node name="9" type="Button" parent="GridContainer" unique_id=1318253977] +layout_mode = 2 +text = "9" + +[node name="dot" type="Button" parent="GridContainer" unique_id=985510428] +layout_mode = 2 +text = "." diff --git a/todos/addons b/todos/addons new file mode 120000 index 0000000..6e44e13 --- /dev/null +++ b/todos/addons @@ -0,0 +1 @@ +../godot-addons \ No newline at end of file diff --git a/todos/export_presets.cfg b/todos/export_presets.cfg new file mode 100644 index 0000000..cb14a5d --- /dev/null +++ b/todos/export_presets.cfg @@ -0,0 +1,201 @@ +[preset.0] + +name="Android" +platform="Android" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +gradle_build/use_gradle_build=false +gradle_build/export_format=0 +gradle_build/min_sdk="" +gradle_build/target_sdk="" +architectures/armeabi-v7a=false +architectures/arm64-v8a=true +architectures/x86=false +architectures/x86_64=false +version/code=1 +version/name="" +package/unique_name="com.example.$genname" +package/name="" +package/signed=true +package/app_category=6 +package/retain_data_on_uninstall=false +package/exclude_from_recents=false +package/show_in_android_tv=false +package/show_in_app_library=true +package/show_as_launcher_app=false +launcher_icons/main_192x192="" +launcher_icons/adaptive_foreground_432x432="" +launcher_icons/adaptive_background_432x432="" +graphics/opengl_debug=false +xr_features/xr_mode=0 +screen/immersive_mode=true +screen/support_small=true +screen/support_normal=true +screen/support_large=true +screen/support_xlarge=true +user_data_backup/allow=false +command_line/extra_args="" +apk_expansion/enable=false +apk_expansion/SALT="" +apk_expansion/public_key="" +permissions/custom_permissions=PackedStringArray() +permissions/access_checkin_properties=false +permissions/access_coarse_location=false +permissions/access_fine_location=false +permissions/access_location_extra_commands=false +permissions/access_mock_location=false +permissions/access_network_state=false +permissions/access_surface_flinger=false +permissions/access_wifi_state=false +permissions/account_manager=false +permissions/add_voicemail=false +permissions/authenticate_accounts=false +permissions/battery_stats=false +permissions/bind_accessibility_service=false +permissions/bind_appwidget=false +permissions/bind_device_admin=false +permissions/bind_input_method=false +permissions/bind_nfc_service=false +permissions/bind_notification_listener_service=false +permissions/bind_print_service=false +permissions/bind_remoteviews=false +permissions/bind_text_service=false +permissions/bind_vpn_service=false +permissions/bind_wallpaper=false +permissions/bluetooth=false +permissions/bluetooth_admin=false +permissions/bluetooth_privileged=false +permissions/brick=false +permissions/broadcast_package_removed=false +permissions/broadcast_sms=false +permissions/broadcast_sticky=false +permissions/broadcast_wap_push=false +permissions/call_phone=false +permissions/call_privileged=false +permissions/camera=false +permissions/capture_audio_output=false +permissions/capture_secure_video_output=false +permissions/capture_video_output=false +permissions/change_component_enabled_state=false +permissions/change_configuration=false +permissions/change_network_state=false +permissions/change_wifi_multicast_state=false +permissions/change_wifi_state=false +permissions/clear_app_cache=false +permissions/clear_app_user_data=false +permissions/control_location_updates=false +permissions/delete_cache_files=false +permissions/delete_packages=false +permissions/device_power=false +permissions/diagnostic=false +permissions/disable_keyguard=false +permissions/dump=false +permissions/expand_status_bar=false +permissions/factory_test=false +permissions/flashlight=false +permissions/force_back=false +permissions/get_accounts=false +permissions/get_package_size=false +permissions/get_tasks=false +permissions/get_top_activity_info=false +permissions/global_search=false +permissions/hardware_test=false +permissions/inject_events=false +permissions/install_location_provider=false +permissions/install_packages=false +permissions/install_shortcut=false +permissions/internal_system_window=false +permissions/internet=false +permissions/kill_background_processes=false +permissions/location_hardware=false +permissions/manage_accounts=false +permissions/manage_app_tokens=false +permissions/manage_documents=false +permissions/manage_external_storage=true +permissions/master_clear=false +permissions/media_content_control=false +permissions/modify_audio_settings=false +permissions/modify_phone_state=false +permissions/mount_format_filesystems=false +permissions/mount_unmount_filesystems=false +permissions/nfc=false +permissions/persistent_activity=false +permissions/process_outgoing_calls=false +permissions/read_calendar=false +permissions/read_call_log=false +permissions/read_contacts=false +permissions/read_external_storage=false +permissions/read_frame_buffer=false +permissions/read_history_bookmarks=false +permissions/read_input_state=false +permissions/read_logs=false +permissions/read_phone_state=false +permissions/read_profile=false +permissions/read_sms=false +permissions/read_social_stream=false +permissions/read_sync_settings=false +permissions/read_sync_stats=false +permissions/read_user_dictionary=false +permissions/reboot=false +permissions/receive_boot_completed=false +permissions/receive_mms=false +permissions/receive_sms=false +permissions/receive_wap_push=false +permissions/record_audio=false +permissions/reorder_tasks=false +permissions/restart_packages=false +permissions/send_respond_via_message=false +permissions/send_sms=false +permissions/set_activity_watcher=false +permissions/set_alarm=false +permissions/set_always_finish=false +permissions/set_animation_scale=false +permissions/set_debug_app=false +permissions/set_orientation=true +permissions/set_pointer_speed=false +permissions/set_preferred_applications=false +permissions/set_process_limit=false +permissions/set_time=false +permissions/set_time_zone=false +permissions/set_wallpaper=false +permissions/set_wallpaper_hints=false +permissions/signal_persistent_processes=false +permissions/status_bar=false +permissions/subscribed_feeds_read=false +permissions/subscribed_feeds_write=false +permissions/system_alert_window=false +permissions/transmit_ir=false +permissions/uninstall_shortcut=false +permissions/update_device_stats=false +permissions/use_credentials=false +permissions/use_sip=false +permissions/vibrate=false +permissions/wake_lock=false +permissions/write_apn_settings=false +permissions/write_calendar=false +permissions/write_call_log=false +permissions/write_contacts=false +permissions/write_external_storage=false +permissions/write_gservices=false +permissions/write_history_bookmarks=false +permissions/write_profile=false +permissions/write_secure_settings=false +permissions/write_settings=false +permissions/write_sms=false +permissions/write_social_stream=false +permissions/write_sync_settings=false +permissions/write_user_dictionary=false diff --git a/todos/global.gd b/todos/global.gd new file mode 100644 index 0000000..ee74620 --- /dev/null +++ b/todos/global.gd @@ -0,0 +1,72 @@ +extends Node +# https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html + +signal state_changed(previous, new) + +enum State {UNLOADED, LOADED} + +const config_path = "user://logue.cfg" + +var config = ConfigFile.new() +var db = SQLite.new() +var current_scene = null +var current_state = State.UNLOADED + +func _ready(): + var root = get_tree().root + current_scene = root.get_child(root.get_child_count() - 1) + + db.verbosity_level = SQLite.VERBOSE + + var err = config.load(config_path) + if err == OK: + var db_path = config.get_value("general", "db_path") + var db_success = load_db(db_path) + if not db_success: + # HACK: File picker on Android is broken + const possible_cfg_paths = ["/foo/bar/logue.cfg"] + for possible_path in possible_cfg_paths: + if FileAccess.file_exists(possible_path): + db_success = load_db(possible_path) + if db_success: + break + + +func switch_state(new: State): + var old = current_state + if old == new: + return + + current_state = new + emit_signal("state_changed", old, new) + #signal state_changed(old, new) + +func load_db(path: String): + db.path = path + var success = db.open_db() + if success: + config.set_value("general", "db_path", path) + config.save(config_path) + switch_state(State.LOADED) + else: + db.path = "" + switch_state(State.UNLOADED) + +func goto_scene(path): + call_deferred("_deferred_goto_scene", path) + +func _deferred_goto_scene(path): + # It is now safe to remove the current scene. + current_scene.free() + + # Load the new scene. + var s = ResourceLoader.load(path) + + # Instance the new scene. + current_scene = s.instantiate() + + # Add it to the active scene, as child of root. + get_tree().root.add_child(current_scene) + + # Optionally, to make it compatible with the SceneTree.change_scene_to_file() API. + get_tree().current_scene = current_scene diff --git a/todos/global.gd.uid b/todos/global.gd.uid new file mode 100644 index 0000000..aebc40f --- /dev/null +++ b/todos/global.gd.uid @@ -0,0 +1 @@ +uid://capir2jpo8qoj diff --git a/todos/icon.svg b/todos/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/todos/icon.svg @@ -0,0 +1 @@ + diff --git a/todos/icon.svg.import b/todos/icon.svg.import new file mode 100644 index 0000000..3a8237f --- /dev/null +++ b/todos/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bt8enetdrugnl" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/todos/loaded.gd b/todos/loaded.gd new file mode 100644 index 0000000..48ab559 --- /dev/null +++ b/todos/loaded.gd @@ -0,0 +1,9 @@ +extends VBoxContainer + +func _on_button_2_pressed(): + var p = ResourceLoader.load("res://NewEntry.tscn") + var pop_up: PopupPanel = p.instantiate() + add_child(pop_up) + #pop_up.transient = true + #pop_up.exclusive = true + pop_up.show() diff --git a/todos/loaded.gd.uid b/todos/loaded.gd.uid new file mode 100644 index 0000000..f64382a --- /dev/null +++ b/todos/loaded.gd.uid @@ -0,0 +1 @@ +uid://bis23k16mjft3 diff --git a/todos/loaded.tscn b/todos/loaded.tscn new file mode 100644 index 0000000..02c9acd --- /dev/null +++ b/todos/loaded.tscn @@ -0,0 +1,60 @@ +[gd_scene load_steps=3 format=3 uid="uid://h1sdn3cjclqi"] + +[ext_resource type="Script" path="res://loaded.gd" id="1_ntmjw"] +[ext_resource type="Theme" uid="uid://bgc6fej502w0h" path="res://theme.tres" id="2_bnfav"] + +[node name="VBoxContainer" type="VBoxContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_ntmjw") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +text = "Loaded !" + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Label" type="Label" parent="PanelContainer/HBoxContainer"] +layout_mode = 2 +text = "Foobar" + +[node name="Label2" type="Label" parent="PanelContainer/HBoxContainer"] +layout_mode = 2 +text = "another one" + +[node name="CheckBox" type="CheckBox" parent="PanelContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 +theme_override_font_sizes/font_size = 1 + +[node name="PanelContainer2" type="PanelContainer" parent="."] +layout_mode = 2 +theme = ExtResource("2_bnfav") + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer2"] +layout_mode = 2 +alignment = 1 + +[node name="TextureButton" type="TextureButton" parent="PanelContainer2/HBoxContainer"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +size_flags_horizontal = 0 + +[node name="Label" type="Label" parent="PanelContainer2/HBoxContainer"] +layout_mode = 2 +text = "Foobar" + +[node name="Button2" type="Button" parent="PanelContainer2/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 +text = "+ NEW" + +[connection signal="pressed" from="PanelContainer2/HBoxContainer/Button2" to="." method="_on_button_2_pressed"] diff --git a/todos/main.gd b/todos/main.gd new file mode 100644 index 0000000..17ea103 --- /dev/null +++ b/todos/main.gd @@ -0,0 +1,21 @@ +extends Control + +# Called when the node enters the scene tree for the first time. +func _ready(): + const margin_value = 25 + $MarginContainer.add_theme_constant_override("margin_top", margin_value) + $MarginContainer.add_theme_constant_override("margin_left", margin_value) + $MarginContainer.add_theme_constant_override("margin_bottom", margin_value) + $MarginContainer.add_theme_constant_override("margin_right", margin_value) + + Global.state_changed.connect(_update_state) + if Global.current_state == Global.State.UNLOADED: + pass + elif Global.current_state == Global.State.LOADED: + $MarginContainer.remove_child($MarginContainer/Unloaded) + var s = ResourceLoader.load("res://loaded.tscn") + var current_scene = s.instantiate() + $MarginContainer.add_child(current_scene) + +func _update_state(_old: Global.State, _new: Global.State): + print("updated state") diff --git a/todos/main.gd.uid b/todos/main.gd.uid new file mode 100644 index 0000000..c792883 --- /dev/null +++ b/todos/main.gd.uid @@ -0,0 +1 @@ +uid://bc6fmmhbe0ebm diff --git a/todos/main.tscn b/todos/main.tscn new file mode 100644 index 0000000..791e64e --- /dev/null +++ b/todos/main.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=3 format=3 uid="uid://y5v0kmse8n10"] + +[ext_resource type="Script" path="res://main.gd" id="1_2tuu3"] +[ext_resource type="PackedScene" uid="uid://b71wpb1vts86r" path="res://unloaded.tscn" id="2_diny5"] + +[node name="Control" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 1.0 +offset_top = 1.0 +offset_right = 1.0 +offset_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_2tuu3") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +metadata/_edit_use_anchors_ = true + +[node name="Unloaded" parent="MarginContainer" instance=ExtResource("2_diny5")] +layout_mode = 2 diff --git a/todos/project.godot b/todos/project.godot new file mode 100644 index 0000000..a824d0c --- /dev/null +++ b/todos/project.godot @@ -0,0 +1,42 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[animation] + +compatibility/default_parent_skeleton_in_mesh_instance_3d=true + +[application] + +config/name="Todos" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.6", "GL Compatibility") +config/icon="res://icon.svg" + +[autoload] + +Global="*res://global.gd" + +[display] + +window/size/viewport_width=600 +window/size/viewport_height=900 +window/stretch/mode="canvas_items" +window/handheld/orientation=1 + +[editor_plugins] + +enabled=PackedStringArray() + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" +textures/vram_compression/import_etc2_astc=true +environment/defaults/default_clear_color=Color(0.941176, 0.964706, 0.909804, 1) diff --git a/todos/theme.tres b/todos/theme.tres new file mode 100644 index 0000000..8f710d2 --- /dev/null +++ b/todos/theme.tres @@ -0,0 +1,3 @@ +[gd_resource type="Theme" format=3 uid="uid://bgc6fej502w0h"] + +[resource] diff --git a/todos/unloaded.gd b/todos/unloaded.gd new file mode 100644 index 0000000..1930725 --- /dev/null +++ b/todos/unloaded.gd @@ -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) diff --git a/todos/unloaded.gd.uid b/todos/unloaded.gd.uid new file mode 100644 index 0000000..cda7f8c --- /dev/null +++ b/todos/unloaded.gd.uid @@ -0,0 +1 @@ +uid://vgg3y5l0sxkp diff --git a/todos/unloaded.tscn b/todos/unloaded.tscn new file mode 100644 index 0000000..87f4a0c --- /dev/null +++ b/todos/unloaded.tscn @@ -0,0 +1,16 @@ +[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"]