diff --git a/.github/scripts/godot_ci_cache.py b/.github/scripts/godot_ci_cache.py new file mode 100644 index 0000000..ef77335 --- /dev/null +++ b/.github/scripts/godot_ci_cache.py @@ -0,0 +1,79 @@ +# +# Fixes https://github.com/godotengine/godot/issues/77508 +# original script source: https://gist.github.com/d6e/5ed21c37a8ac294db26532cc6af5c61c +# + +import os +import subprocess +import time +import re +from pathlib import Path + +# Set the path to your Godot project and Godot executable +GODOT_PROJECT_PATH = Path(".") +GODOT_EXECUTABLE = "godot" # or the path to your Godot executable +GODOT_LOG_FILE = Path("artifacts") / "godot_output.log" # Log file to store Godot output + +print("Building godot cache...", flush=True) +start_time = time.time() + +# Step 1: Recursively find all '.import' files and collect the expected imported file paths +expected_imported_files = set() +for import_file in GODOT_PROJECT_PATH.rglob('*.import'): + content = import_file.read_text() + matches = re.findall(r'dest_files=\["(res://\.godot/imported/.+?)"\]', content) + expected_imported_files.update(matches) + +total_imports = len(expected_imported_files) +print(f"Found {total_imports} references to imported files...", flush=True) + +# Step 2: Launch Godot in the background to start the import process +print("Starting Godot to import files...", flush=True) +GODOT_LOG_FILE.parent.mkdir(parents=True, exist_ok=True) +with GODOT_LOG_FILE.open("w") as log_file: + try: + godot_process = subprocess.Popen( + [GODOT_EXECUTABLE, "--path", str(GODOT_PROJECT_PATH), "--editor", "--headless"], + stdout=log_file, + stderr=subprocess.STDOUT + ) + except Exception as e: + print(f"Failed to start Godot: {e}") + exit(1) + +# Step 3: Continually check if the expected imported files exist +imported_folder = GODOT_PROJECT_PATH / ".godot/imported" +while expected_imported_files: + # Wait until the imported directory exists + if not imported_folder.exists(): + print(f"Waiting for the imported directory to be created by Godot...") + time.sleep(1) + continue + + for expected_path in list(expected_imported_files): + imported_file_path = GODOT_PROJECT_PATH / expected_path.replace("res://", "") + if imported_file_path.exists(): + expected_imported_files.remove(expected_path) + imported_count = total_imports - len(expected_imported_files) + print(f"Imported {imported_count} / {total_imports} files...") + time.sleep(1) # Wait for a second before checking again + +elapsed_time = time.time() - start_time +print(f"Imported all files in {elapsed_time:.2f} seconds.", flush=True) + +# Step 4: Once all files have been imported, quit Godot +try: + print("Quitting Godot...", flush=True) + start_time = time.time() + godot_process.terminate() + godot_process.wait(timeout=10) + +except subprocess.TimeoutExpired: + print("Godot did not terminate in a timely manner; killing the process.") + godot_process.kill() +finally: + elapsed_time = time.time() - start_time + print(f"Godot has been closed in {elapsed_time:.2f} seconds.", flush=True) + +print("All files have been imported. Godot has been closed.") + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a82158..5f9b93e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,18 +14,127 @@ jobs: fail-fast: false matrix: build: [macos, windows, linux] + include: + - build: linux + godot-bin: 'godot.linuxbsd.editor.x86_64.mono' + godot-template-bins: 'godot.linuxbsd.template_*' + godot-templates-dir: '/home/runner/.local/share/godot/export_templates/4.2.2.stable.mono' + - build: macos + godot-bin: 'godot.macos.editor.universal' + godot-template-bins: 'godot.macos.template_*' + godot-templates-dir: '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable' + # Windows build runs on Ubuntu + - build: windows + godot-bin: 'godot.linuxbsd.editor.x86_64.mono' + godot-template-bins: 'godot.windows.template_*' + godot-templates-dir: '/home/runner/.local/share/godot/export_templates/4.2.2.stable.mono' steps: - uses: actions/checkout@v3 - uses: chickensoft-games/setup-godot@v1 with: - version: 4.2.1 - use-dotnet: false + version: 4.2.2 + # When running on Linux, we have to use the .NET build, as this is + # the only custom build available from the CI + use-dotnet: ${{ matrix.build == 'linux' || matrix.build == 'windows' }} include-templates: true + - name: Download Godot w/Bitcoin module + uses: robinraju/release-downloader@v1.11 + with: + repository: LayerTwo-Labs/godot-bitcoin-module + tag: v4.2.2-bitcoin + filename: ${{ matrix.godot-bin }} + + - name: Download Godot templates w/Bitcoin module + uses: robinraju/release-downloader@v1.11 + with: + repository: LayerTwo-Labs/godot-bitcoin-module + tag: v4.2.2-bitcoin + filename: ${{ matrix.godot-template-bins }} + + # FIXME: remove + - name: show files (linux / windows) + if: ${{ matrix.build == 'linux' || matrix.build == 'windows' }} + run: | + ls + echo 'TEMPLATES' + ls ${{ matrix.godot-templates-dir }} + echo 'VERSION TXT' + cat "${{ matrix.godot-templates-dir }}/version.txt" + echo $GODOT + + # FIXME: remove + - name: show files (macos) + if: ${{ matrix.build == 'macos' }} + run: | + ls + #echo 'TEMPLATES' + #ls '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable' + #echo 'MACOS TEMPLATES' + #zipinfo -1 '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable/macos.zip' + #echo 'VERSION TXT' + #cat '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable/version.txt' + echo $GODOT + + - name: Replace default templates with custom templates (linux) + if: ${{ matrix.build == 'linux' }} + run: | + rm "${{ matrix.godot-templates-dir }}/linux_debug.x86_64" + mv godot.linuxbsd.template_debug.x86_64.mono "${{ matrix.godot-templates-dir }}/linux_debug.x86_64" + rm "${{ matrix.godot-templates-dir }}/linux_release.x86_64" + mv godot.linuxbsd.template_release.x86_64.mono "${{ matrix.godot-templates-dir }}/linux_release.x86_64" + + - name: Replace default templates with custom templates (macos) + if: ${{ matrix.build == 'macos' }} + run: | + # Temporary directory used to construct the zip file + TMP_ZIP_DIR=$(mktemp -d) + mkdir -p "${TMP_ZIP_DIR}/macos_template.app/Contents/MacOS" + mv "godot.macos.template_debug.universal" "${TMP_ZIP_DIR}/macos_template.app/Contents/MacOS/godot_macos_debug.universal" + mv "godot.macos.template_release.universal" "${TMP_ZIP_DIR}/macos_template.app/Contents/MacOS/godot_macos_release.universal" + zip --delete "${{ matrix.godot-templates-dir }}/macos.zip" "macos_template.app/Contents/MacOS/godot_macos_debug.universal" + zip --delete "${{ matrix.godot-templates-dir }}/macos.zip" "macos_template.app/Contents/MacOS/godot_macos_release.universal" + pushd "${TMP_ZIP_DIR}" + zip "${{ matrix.godot-templates-dir }}/macos.zip" "macos_template.app/Contents/MacOS/godot_macos_debug.universal" + zip "${{ matrix.godot-templates-dir }}/macos.zip" "macos_template.app/Contents/MacOS/godot_macos_release.universal" + popd + + - name: Replace default templates with custom templates (windows) + if: ${{ matrix.build == 'windows' }} + run: | + rm "${{ matrix.godot-templates-dir }}/windows_debug_x86_64.exe" + mv "godot.windows.template_debug.x86_64.exe" "${{ matrix.godot-templates-dir }}/windows_debug_x86_64.exe" + rm "${{ matrix.godot-templates-dir }}/windows_debug_x86_64_console.exe" + mv "godot.windows.template_debug.x86_64.console.exe" "${{ matrix.godot-templates-dir }}/windows_debug_x86_64_console.exe" + rm "${{ matrix.godot-templates-dir }}/windows_release_x86_64.exe" + mv "godot.windows.template_release.x86_64.exe" "${{ matrix.godot-templates-dir }}/windows_release_x86_64.exe" + rm "${{ matrix.godot-templates-dir }}/windows_release_x86_64_console.exe" + mv "godot.windows.template_release.x86_64.console.exe" "${{ matrix.godot-templates-dir }}/windows_release_x86_64_console.exe" + + # FIXME: remove + - name: show files (linux / windows) + if: ${{ matrix.build == 'linux' || matrix.build == 'windows' }} + run: | + ls + echo 'TEMPLATES' + ls ${{ matrix.godot-templates-dir }} + + # FIXME: remove + - name: show files (macos) + if: ${{ matrix.build == 'macos' }} + run: | + ls + echo 'TEMPLATES' + ls '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable' + echo 'MACOS TEMPLATES' + zipinfo -1 '/Users/runner/Library/Application Support/Godot/export_templates/4.2.2.stable/macos.zip' + - name: Verify Setup run: | + chmod +x ${{ matrix.godot-bin }} + mv ${{ matrix.godot-bin }} $GODOT godot --version - name: Import certificate to Keychain @@ -46,11 +155,14 @@ jobs: run: | echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8 + # MUST be run before build + - name: Initialize godot cache + run: python3 .github/scripts/godot_ci_cache.py + - name: Export build run: | name="${{fromJSON('{"windows": "Windows Desktop", "macos": "macOS", "linux": "Linux/X11"}')[matrix.build] }}" godot --headless --export-debug "$name" --verbose 2>&1 | tee build.log - env: GODOT_MACOS_NOTARIZATION_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} diff --git a/.gitignore b/.gitignore index 6be785a..8feffef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ # Built artifacts go here build +.DS_Store +.DS_Store diff --git a/assets/Mediamodifier-Design(2).svg b/assets/Mediamodifier-Design.svg similarity index 100% rename from assets/Mediamodifier-Design(2).svg rename to assets/Mediamodifier-Design.svg diff --git a/assets/Mediamodifier-Design(2).svg.import b/assets/Mediamodifier-Design.svg.import similarity index 72% rename from assets/Mediamodifier-Design(2).svg.import rename to assets/Mediamodifier-Design.svg.import index 4fbae6a..baa6cf4 100644 --- a/assets/Mediamodifier-Design(2).svg.import +++ b/assets/Mediamodifier-Design.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://5d2d4ed2y7p3" -path="res://.godot/imported/Mediamodifier-Design(2).svg-1aef0d334e1742f214effe500d577b0e.ctex" +path="res://.godot/imported/Mediamodifier-Design.svg-9d1e220925b1a876f5e5ee1468b72113.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/Mediamodifier-Design(2).svg" -dest_files=["res://.godot/imported/Mediamodifier-Design(2).svg-1aef0d334e1742f214effe500d577b0e.ctex"] +source_file="res://assets/Mediamodifier-Design.svg" +dest_files=["res://.godot/imported/Mediamodifier-Design.svg-9d1e220925b1a876f5e5ee1468b72113.ctex"] [params] diff --git a/assets/data/quotes.json b/assets/data/quotes.json index 7e0a4b7..20f0bba 100644 --- a/assets/data/quotes.json +++ b/assets/data/quotes.json @@ -12,14 +12,6 @@ "author": "Satoshi Nakamoto" }, { - "quote": "Inflation is taxation without legislation.", - "author": "Milton Friedman" - }, - { - "quote": "Used to the conditions of a capitalistic environment, the average American takes it for granted that every year business makes something new and better accessible to him. Looking backward upon the years of his own life, he realizes that many implements that were totally unknown in the days of his youth and many others which at that time could be enjoyed only by a small minority are now standard equipment of almost every household.", - "author": "Ludwig Von Mises" - }, - { "quote": "Poorly paid labor is inefficient labor, the world over.", "author": "Henry George" }, @@ -32,23 +24,23 @@ "author": "Henry Hazlitt" }, { - "quote": "Nobody ever saw a dog make a fair and deliberate exchange of one bone for another with another dog. Nobody ever saw one animal by its gestures and natural cries signify to another, this is mine, that yours; I am willing to give this for that.", - "author": "Adam Smith" + "quote": "Ambition is common to all men; and those, who are unable to rise to distinction, are at least willing to reduce others to their own standard.", + "author": "William Godwin" }, { - "quote": "Ambition is common to all men; and those, who are unable to rise to distinction, are at least willing to reduce others to their own standard.", - "author": "William Godwin" + "quote": "Organizations are permanently and randomly subject to decline and decay - no matter their institutional framework.", + "author": "Albert Hirschman" }, { - "quote": "Organizations are permanently and randomly subject to decline and decay — no matter their institutional framework.", - "author": "Albert Hirschman" + "quote": "Monopolies don't innovate. The motto of any monopoly is: 'We don't care, because we don't have to'", + "author": "Marc Andreessen" }, { - "quote": "Monopolies don't innovate. The motto of any monopoly is: 'We don't care, because we don't have to.'", - "author": "Marc Andreessen" + "quote": "It is self-deception to think that the status quo is going to be satisfactory for everyone forever. It's already not satisfactory for a lot of people", + "author": "David Deutsch" }, { - "quote": "It is self-deception to think that the status quo is going to be satisfactory for everyone forever. It's already not satisfactory for a lot of people.", - "author": "David Deutsch" - } - ] \ No newline at end of file + "quote": "Ambition is common to all men; and those, who are unable to rise to distinction, are at least willing to reduce others to their own standard", + "author": "William Godwin" + }, +] diff --git a/assets/fonts/Heartbit-Bold.otf b/assets/fonts/Heartbit-Bold.otf new file mode 100644 index 0000000..a6a315c Binary files /dev/null and b/assets/fonts/Heartbit-Bold.otf differ diff --git a/assets/fonts/Heartbit-Bold.otf.import b/assets/fonts/Heartbit-Bold.otf.import new file mode 100644 index 0000000..1b03b3e --- /dev/null +++ b/assets/fonts/Heartbit-Bold.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://4p264ejyt2im" +path="res://.godot/imported/Heartbit-Bold.otf-db3a57664727bf928878560e13701921.fontdata" + +[deps] + +source_file="res://assets/fonts/Heartbit-Bold.otf" +dest_files=["res://.godot/imported/Heartbit-Bold.otf-db3a57664727bf928878560e13701921.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/LEMONMILK-Regular.otf b/assets/fonts/LEMONMILK-Regular.otf new file mode 100644 index 0000000..b186df8 Binary files /dev/null and b/assets/fonts/LEMONMILK-Regular.otf differ diff --git a/assets/fonts/LEMONMILK-Regular.otf.import b/assets/fonts/LEMONMILK-Regular.otf.import new file mode 100644 index 0000000..b9da6b4 --- /dev/null +++ b/assets/fonts/LEMONMILK-Regular.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c33ier0iywrki" +path="res://.godot/imported/LEMONMILK-Regular.otf-5b5c91141d93e3234211516e8b392368.fontdata" + +[deps] + +source_file="res://assets/fonts/LEMONMILK-Regular.otf" +dest_files=["res://.godot/imported/LEMONMILK-Regular.otf-5b5c91141d93e3234211516e8b392368.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/ProRacing-7BZOD.otf b/assets/fonts/ProRacing-7BZOD.otf new file mode 100644 index 0000000..ab06dcb Binary files /dev/null and b/assets/fonts/ProRacing-7BZOD.otf differ diff --git a/assets/fonts/ProRacing-7BZOD.otf.import b/assets/fonts/ProRacing-7BZOD.otf.import new file mode 100644 index 0000000..e977fee --- /dev/null +++ b/assets/fonts/ProRacing-7BZOD.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bsdp6ungr1q72" +path="res://.godot/imported/ProRacing-7BZOD.otf-e389ba13b6d5ae455343399edde171da.fontdata" + +[deps] + +source_file="res://assets/fonts/ProRacing-7BZOD.otf" +dest_files=["res://.godot/imported/ProRacing-7BZOD.otf-e389ba13b6d5ae455343399edde171da.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Black.otf b/assets/fonts/Satoshi-Black.otf new file mode 100644 index 0000000..4f5f852 Binary files /dev/null and b/assets/fonts/Satoshi-Black.otf differ diff --git a/assets/fonts/Satoshi-Black.otf.import b/assets/fonts/Satoshi-Black.otf.import new file mode 100644 index 0000000..79d1d07 --- /dev/null +++ b/assets/fonts/Satoshi-Black.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://ukm4me5g81r7" +path="res://.godot/imported/Satoshi-Black.otf-ee3d689ca9337a19a65c0989589964a2.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Black.otf" +dest_files=["res://.godot/imported/Satoshi-Black.otf-ee3d689ca9337a19a65c0989589964a2.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-BlackItalic.otf b/assets/fonts/Satoshi-BlackItalic.otf new file mode 100644 index 0000000..b105ea4 Binary files /dev/null and b/assets/fonts/Satoshi-BlackItalic.otf differ diff --git a/assets/fonts/Satoshi-BlackItalic.otf.import b/assets/fonts/Satoshi-BlackItalic.otf.import new file mode 100644 index 0000000..4a4d280 --- /dev/null +++ b/assets/fonts/Satoshi-BlackItalic.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://fpiyp1rfebij" +path="res://.godot/imported/Satoshi-BlackItalic.otf-83fad998ef88f1d8a13c5b98e157c296.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-BlackItalic.otf" +dest_files=["res://.godot/imported/Satoshi-BlackItalic.otf-83fad998ef88f1d8a13c5b98e157c296.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Bold.otf b/assets/fonts/Satoshi-Bold.otf new file mode 100644 index 0000000..677ab5f Binary files /dev/null and b/assets/fonts/Satoshi-Bold.otf differ diff --git a/assets/fonts/Satoshi-Bold.otf.import b/assets/fonts/Satoshi-Bold.otf.import new file mode 100644 index 0000000..5aa0b2a --- /dev/null +++ b/assets/fonts/Satoshi-Bold.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://chl6p7bdsk1n8" +path="res://.godot/imported/Satoshi-Bold.otf-be3eb100d42256d5920560af5de82c0c.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Bold.otf" +dest_files=["res://.godot/imported/Satoshi-Bold.otf-be3eb100d42256d5920560af5de82c0c.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-BoldItalic.otf b/assets/fonts/Satoshi-BoldItalic.otf new file mode 100644 index 0000000..cd5b85e Binary files /dev/null and b/assets/fonts/Satoshi-BoldItalic.otf differ diff --git a/assets/fonts/Satoshi-BoldItalic.otf.import b/assets/fonts/Satoshi-BoldItalic.otf.import new file mode 100644 index 0000000..85d7a37 --- /dev/null +++ b/assets/fonts/Satoshi-BoldItalic.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c4b4tocdhaopo" +path="res://.godot/imported/Satoshi-BoldItalic.otf-8111e9700ee08e5122abde173bc35688.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-BoldItalic.otf" +dest_files=["res://.godot/imported/Satoshi-BoldItalic.otf-8111e9700ee08e5122abde173bc35688.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Italic.otf b/assets/fonts/Satoshi-Italic.otf new file mode 100644 index 0000000..d8652b3 Binary files /dev/null and b/assets/fonts/Satoshi-Italic.otf differ diff --git a/assets/fonts/Satoshi-Italic.otf.import b/assets/fonts/Satoshi-Italic.otf.import new file mode 100644 index 0000000..8fdf21f --- /dev/null +++ b/assets/fonts/Satoshi-Italic.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dgfbvdl8u0fqf" +path="res://.godot/imported/Satoshi-Italic.otf-a824462eb163b33fd66db76284186bf5.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Italic.otf" +dest_files=["res://.godot/imported/Satoshi-Italic.otf-a824462eb163b33fd66db76284186bf5.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Light.otf b/assets/fonts/Satoshi-Light.otf new file mode 100644 index 0000000..22cb8bc Binary files /dev/null and b/assets/fonts/Satoshi-Light.otf differ diff --git a/assets/fonts/Satoshi-Light.otf.import b/assets/fonts/Satoshi-Light.otf.import new file mode 100644 index 0000000..ee87c09 --- /dev/null +++ b/assets/fonts/Satoshi-Light.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://jmgw6s50fy7q" +path="res://.godot/imported/Satoshi-Light.otf-597afedff787841f1620439021dbbefc.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Light.otf" +dest_files=["res://.godot/imported/Satoshi-Light.otf-597afedff787841f1620439021dbbefc.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-LightItalic.otf b/assets/fonts/Satoshi-LightItalic.otf new file mode 100644 index 0000000..1cf1a32 Binary files /dev/null and b/assets/fonts/Satoshi-LightItalic.otf differ diff --git a/assets/fonts/Satoshi-LightItalic.otf.import b/assets/fonts/Satoshi-LightItalic.otf.import new file mode 100644 index 0000000..92c07d3 --- /dev/null +++ b/assets/fonts/Satoshi-LightItalic.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bas7xjybwgcma" +path="res://.godot/imported/Satoshi-LightItalic.otf-7eee472a3c594ee3933b2be01e362ac0.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-LightItalic.otf" +dest_files=["res://.godot/imported/Satoshi-LightItalic.otf-7eee472a3c594ee3933b2be01e362ac0.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Medium.otf b/assets/fonts/Satoshi-Medium.otf new file mode 100644 index 0000000..3513a83 Binary files /dev/null and b/assets/fonts/Satoshi-Medium.otf differ diff --git a/assets/fonts/Satoshi-Medium.otf.import b/assets/fonts/Satoshi-Medium.otf.import new file mode 100644 index 0000000..3adf746 --- /dev/null +++ b/assets/fonts/Satoshi-Medium.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b6g71lkh3peug" +path="res://.godot/imported/Satoshi-Medium.otf-e6b1595ba3507054af824aec279d45f3.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Medium.otf" +dest_files=["res://.godot/imported/Satoshi-Medium.otf-e6b1595ba3507054af824aec279d45f3.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-MediumItalic.otf b/assets/fonts/Satoshi-MediumItalic.otf new file mode 100644 index 0000000..105838c Binary files /dev/null and b/assets/fonts/Satoshi-MediumItalic.otf differ diff --git a/assets/fonts/Satoshi-MediumItalic.otf.import b/assets/fonts/Satoshi-MediumItalic.otf.import new file mode 100644 index 0000000..ebb682d --- /dev/null +++ b/assets/fonts/Satoshi-MediumItalic.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dnmuqplugsr5b" +path="res://.godot/imported/Satoshi-MediumItalic.otf-f0f3d95f2f1621e836ce9f54a38ffd53.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-MediumItalic.otf" +dest_files=["res://.godot/imported/Satoshi-MediumItalic.otf-f0f3d95f2f1621e836ce9f54a38ffd53.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Satoshi-Regular.otf b/assets/fonts/Satoshi-Regular.otf new file mode 100644 index 0000000..ddaadc0 Binary files /dev/null and b/assets/fonts/Satoshi-Regular.otf differ diff --git a/assets/fonts/Satoshi-Regular.otf.import b/assets/fonts/Satoshi-Regular.otf.import new file mode 100644 index 0000000..a108fb8 --- /dev/null +++ b/assets/fonts/Satoshi-Regular.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cnorvokrkf44t" +path="res://.godot/imported/Satoshi-Regular.otf-274fea2858693c30bad4f26df1515cb9.fontdata" + +[deps] + +source_file="res://assets/fonts/Satoshi-Regular.otf" +dest_files=["res://.godot/imported/Satoshi-Regular.otf-274fea2858693c30bad4f26df1515cb9.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/Skyer-TrialVersion.otf b/assets/fonts/Skyer-TrialVersion.otf new file mode 100644 index 0000000..42a1593 Binary files /dev/null and b/assets/fonts/Skyer-TrialVersion.otf differ diff --git a/assets/fonts/Skyer-TrialVersion.otf.import b/assets/fonts/Skyer-TrialVersion.otf.import new file mode 100644 index 0000000..1148cf0 --- /dev/null +++ b/assets/fonts/Skyer-TrialVersion.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://4t752vjutth0" +path="res://.godot/imported/Skyer-TrialVersion.otf-265e55d408db5589fa4f5e94e9aad7a8.fontdata" + +[deps] + +source_file="res://assets/fonts/Skyer-TrialVersion.otf" +dest_files=["res://.godot/imported/Skyer-TrialVersion.otf-265e55d408db5589fa4f5e94e9aad7a8.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/download-cloud-svgrepo-com (1).svg b/assets/fonts/download-cloud-svgrepo-com (1).svg new file mode 100644 index 0000000..f5de0d9 --- /dev/null +++ b/assets/fonts/download-cloud-svgrepo-com (1).svg @@ -0,0 +1,7 @@ + + + + + + download-cloud + \ No newline at end of file diff --git a/assets/fonts/download-cloud-svgrepo-com (1).svg.import b/assets/fonts/download-cloud-svgrepo-com (1).svg.import new file mode 100644 index 0000000..28bf823 --- /dev/null +++ b/assets/fonts/download-cloud-svgrepo-com (1).svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6oemy25d708d" +path="res://.godot/imported/download-cloud-svgrepo-com (1).svg-241da0b8a15c58fa4f2488dfd8e9d48e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/fonts/download-cloud-svgrepo-com (1).svg" +dest_files=["res://.godot/imported/download-cloud-svgrepo-com (1).svg-241da0b8a15c58fa4f2488dfd8e9d48e.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/assets/fonts/manolo-mono.ttf b/assets/fonts/manolo-mono.ttf new file mode 100644 index 0000000..fef4d27 Binary files /dev/null and b/assets/fonts/manolo-mono.ttf differ diff --git a/assets/fonts/manolo-mono.ttf.import b/assets/fonts/manolo-mono.ttf.import new file mode 100644 index 0000000..229ca95 --- /dev/null +++ b/assets/fonts/manolo-mono.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b12w46v5buld1" +path="res://.godot/imported/manolo-mono.ttf-2ac8af71b85a5fe18806d3a78b7f7fa4.fontdata" + +[deps] + +source_file="res://assets/fonts/manolo-mono.ttf" +dest_files=["res://.godot/imported/manolo-mono.ttf-2ac8af71b85a5fe18806d3a78b7f7fa4.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/neuropolitical rg.otf b/assets/fonts/neuropolitical rg.otf new file mode 100644 index 0000000..e9e8007 Binary files /dev/null and b/assets/fonts/neuropolitical rg.otf differ diff --git a/assets/fonts/neuropolitical rg.otf.import b/assets/fonts/neuropolitical rg.otf.import new file mode 100644 index 0000000..74c3360 --- /dev/null +++ b/assets/fonts/neuropolitical rg.otf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bvfp60ugkittj" +path="res://.godot/imported/neuropolitical rg.otf-508cd0254d13a84726ba7e8b501587ee.fontdata" + +[deps] + +source_file="res://assets/fonts/neuropolitical rg.otf" +dest_files=["res://.godot/imported/neuropolitical rg.otf-508cd0254d13a84726ba7e8b501587ee.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/play-svgrepo-com.svg b/assets/fonts/play-svgrepo-com.svg new file mode 100644 index 0000000..56d88df --- /dev/null +++ b/assets/fonts/play-svgrepo-com.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/fonts/play-svgrepo-com.svg.import b/assets/fonts/play-svgrepo-com.svg.import new file mode 100644 index 0000000..d4046ab --- /dev/null +++ b/assets/fonts/play-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dtpfsj0bqdttf" +path="res://.godot/imported/play-svgrepo-com.svg-fcbd0184d3a8634b59e166c2a069ec95.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/fonts/play-svgrepo-com.svg" +dest_files=["res://.godot/imported/play-svgrepo-com.svg-fcbd0184d3a8634b59e166c2a069ec95.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/assets/help-circle-outline-svgrepo-com (2).svg b/assets/help-circle-outline-svgrepo-com (2).svg new file mode 100644 index 0000000..2fcd6ec --- /dev/null +++ b/assets/help-circle-outline-svgrepo-com (2).svg @@ -0,0 +1,12 @@ + + + + + + + ionicons-v5-e + + + + + \ No newline at end of file diff --git a/assets/help-circle-outline-svgrepo-com (2).svg.import b/assets/help-circle-outline-svgrepo-com (2).svg.import new file mode 100644 index 0000000..3570f59 --- /dev/null +++ b/assets/help-circle-outline-svgrepo-com (2).svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnp6qtpqtw0ra" +path="res://.godot/imported/help-circle-outline-svgrepo-com (2).svg-743d7b611a9c07d675ea732bdc91b5b9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/help-circle-outline-svgrepo-com (2).svg" +dest_files=["res://.godot/imported/help-circle-outline-svgrepo-com (2).svg-743d7b611a9c07d675ea732bdc91b5b9.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/assets/icons/CheckButton/CheckButton.aseprite b/assets/icons/CheckButton/CheckButton.aseprite new file mode 100644 index 0000000..61551cc Binary files /dev/null and b/assets/icons/CheckButton/CheckButton.aseprite differ diff --git a/assets/icons/CheckButton/CheckButton_Checked.svg b/assets/icons/CheckButton/CheckButton_Checked.svg new file mode 100644 index 0000000..cfba3e5 --- /dev/null +++ b/assets/icons/CheckButton/CheckButton_Checked.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/icons/CheckButton/CheckButton_Checked.svg.import b/assets/icons/CheckButton/CheckButton_Checked.svg.import new file mode 100644 index 0000000..8d0c6d5 --- /dev/null +++ b/assets/icons/CheckButton/CheckButton_Checked.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://savcbaogc6f5" +path="res://.godot/imported/CheckButton_Checked.svg-d3980a55647cad93d9380dc0913c7b26.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CheckButton/CheckButton_Checked.svg" +dest_files=["res://.godot/imported/CheckButton_Checked.svg-d3980a55647cad93d9380dc0913c7b26.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/assets/icons/CheckButton/CheckButton_Unchecked.svg b/assets/icons/CheckButton/CheckButton_Unchecked.svg new file mode 100644 index 0000000..c7e8e7d --- /dev/null +++ b/assets/icons/CheckButton/CheckButton_Unchecked.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/icons/CheckButton/CheckButton_Unchecked.svg.import b/assets/icons/CheckButton/CheckButton_Unchecked.svg.import new file mode 100644 index 0000000..604a12c --- /dev/null +++ b/assets/icons/CheckButton/CheckButton_Unchecked.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://duq4fwwpdhwd2" +path="res://.godot/imported/CheckButton_Unchecked.svg-ddcec58bc0a90e8a587b62be72ca8705.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CheckButton/CheckButton_Unchecked.svg" +dest_files=["res://.godot/imported/CheckButton_Unchecked.svg-ddcec58bc0a90e8a587b62be72ca8705.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/assets/icons/CircularProgressIcon/CircularProgressIcon.aseprite b/assets/icons/CircularProgressIcon/CircularProgressIcon.aseprite new file mode 100644 index 0000000..1fe20ec Binary files /dev/null and b/assets/icons/CircularProgressIcon/CircularProgressIcon.aseprite differ diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png new file mode 100644 index 0000000..f29b4be Binary files /dev/null and b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png differ diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png.import b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png.import new file mode 100644 index 0000000..bd084d9 --- /dev/null +++ b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c61x1yrtx047r" +path="res://.godot/imported/CircularProgressIcon_BottomLeft.png-60b8a55e9f038b94de12d39f8ac4962a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CircularProgressIcon/CircularProgressIcon_BottomLeft.png" +dest_files=["res://.godot/imported/CircularProgressIcon_BottomLeft.png-60b8a55e9f038b94de12d39f8ac4962a.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 diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png new file mode 100644 index 0000000..5bcb066 Binary files /dev/null and b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png differ diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png.import b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png.import new file mode 100644 index 0000000..8bcbb9d --- /dev/null +++ b/assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwjvyq7u1tv84" +path="res://.godot/imported/CircularProgressIcon_BottomRight.png-254943089850961813d0e99e7fb972b5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CircularProgressIcon/CircularProgressIcon_BottomRight.png" +dest_files=["res://.godot/imported/CircularProgressIcon_BottomRight.png-254943089850961813d0e99e7fb972b5.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 diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png new file mode 100644 index 0000000..97bb78d Binary files /dev/null and b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png differ diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png.import b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png.import new file mode 100644 index 0000000..8e5957c --- /dev/null +++ b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://kwp1ulhwpqce" +path="res://.godot/imported/CircularProgressIcon_TopLeft.png-df08708690711d29ada5b9a9f0d68fcc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CircularProgressIcon/CircularProgressIcon_TopLeft.png" +dest_files=["res://.godot/imported/CircularProgressIcon_TopLeft.png-df08708690711d29ada5b9a9f0d68fcc.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 diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png new file mode 100644 index 0000000..522d274 Binary files /dev/null and b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png differ diff --git a/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png.import b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png.import new file mode 100644 index 0000000..f678191 --- /dev/null +++ b/assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://coh311bvogvie" +path="res://.godot/imported/CircularProgressIcon_TopRight.png-23baaad360208ab43f27d2c67311994b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/CircularProgressIcon/CircularProgressIcon_TopRight.png" +dest_files=["res://.godot/imported/CircularProgressIcon_TopRight.png-23baaad360208ab43f27d2c67311994b.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 diff --git a/assets/images/download-cloud-svgrepo-com.svg b/assets/images/download-cloud-svgrepo-com.svg new file mode 100644 index 0000000..5b13316 --- /dev/null +++ b/assets/images/download-cloud-svgrepo-com.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/assets/images/download-cloud-svgrepo-com.svg.import b/assets/images/download-cloud-svgrepo-com.svg.import new file mode 100644 index 0000000..9261c01 --- /dev/null +++ b/assets/images/download-cloud-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c67eg44mfb6tv" +path="res://.godot/imported/download-cloud-svgrepo-com.svg-2d7a4fefa72558e54cc4de950b50fb03.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/download-cloud-svgrepo-com.svg" +dest_files=["res://.godot/imported/download-cloud-svgrepo-com.svg-2d7a4fefa72558e54cc4de950b50fb03.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/assets/images/download-cloud-svgrepo.svg b/assets/images/download-cloud-svgrepo.svg new file mode 100644 index 0000000..f5de0d9 --- /dev/null +++ b/assets/images/download-cloud-svgrepo.svg @@ -0,0 +1,7 @@ + + + + + + download-cloud + \ No newline at end of file diff --git a/assets/images/download-cloud-svgrepo.svg.import b/assets/images/download-cloud-svgrepo.svg.import new file mode 100644 index 0000000..7bb5b9c --- /dev/null +++ b/assets/images/download-cloud-svgrepo.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://sitylibnubgw" +path="res://.godot/imported/download-cloud-svgrepo.svg-5d91d83002443aa7d3d37428d7c35944.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/download-cloud-svgrepo.svg" +dest_files=["res://.godot/imported/download-cloud-svgrepo.svg-5d91d83002443aa7d3d37428d7c35944.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/assets/images/exit-svgrepo-com.svg b/assets/images/exit-svgrepo-com.svg new file mode 100644 index 0000000..f464220 --- /dev/null +++ b/assets/images/exit-svgrepo-com.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/exit-svgrepo-com.svg.import b/assets/images/exit-svgrepo-com.svg.import new file mode 100644 index 0000000..11ee3af --- /dev/null +++ b/assets/images/exit-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgqkqb642nnfx" +path="res://.godot/imported/exit-svgrepo-com.svg-34fc1827decb43bab7fb2d43be045d2f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/exit-svgrepo-com.svg" +dest_files=["res://.godot/imported/exit-svgrepo-com.svg-34fc1827decb43bab7fb2d43be045d2f.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/assets/images/help-circle-outline-svgrepo-com.svg b/assets/images/help-circle-outline-svgrepo-com.svg new file mode 100644 index 0000000..2fcd6ec --- /dev/null +++ b/assets/images/help-circle-outline-svgrepo-com.svg @@ -0,0 +1,12 @@ + + + + + + + ionicons-v5-e + + + + + \ No newline at end of file diff --git a/assets/images/help-circle-outline-svgrepo-com.svg.import b/assets/images/help-circle-outline-svgrepo-com.svg.import new file mode 100644 index 0000000..821e244 --- /dev/null +++ b/assets/images/help-circle-outline-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://itqhnp8fc877" +path="res://.godot/imported/help-circle-outline-svgrepo-com.svg-04db485cefd1fc999c35856643b2deff.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/help-circle-outline-svgrepo-com.svg" +dest_files=["res://.godot/imported/help-circle-outline-svgrepo-com.svg-04db485cefd1fc999c35856643b2deff.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/assets/images/icons8-settings.svg b/assets/images/icons8-settings.svg new file mode 100644 index 0000000..f392459 --- /dev/null +++ b/assets/images/icons8-settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/icons8-settings.svg.import b/assets/images/icons8-settings.svg.import new file mode 100644 index 0000000..3c9a5bb --- /dev/null +++ b/assets/images/icons8-settings.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drrrqh5w6tl8t" +path="res://.godot/imported/icons8-settings.svg-3abab0a1cc1e22f71f96e60e0862595e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/icons8-settings.svg" +dest_files=["res://.godot/imported/icons8-settings.svg-3abab0a1cc1e22f71f96e60e0862595e.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/assets/images/play-svgrepo-com.svg b/assets/images/play-svgrepo-com.svg new file mode 100644 index 0000000..56d88df --- /dev/null +++ b/assets/images/play-svgrepo-com.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/images/play-svgrepo-com.svg.import b/assets/images/play-svgrepo-com.svg.import new file mode 100644 index 0000000..2ddb744 --- /dev/null +++ b/assets/images/play-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://75mcm5m4o56y" +path="res://.godot/imported/play-svgrepo-com.svg-ad919f0e14b70de8bacc2bb95521010c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/play-svgrepo-com.svg" +dest_files=["res://.godot/imported/play-svgrepo-com.svg-ad919f0e14b70de8bacc2bb95521010c.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/assets/images/settings-svgrepo-com.svg b/assets/images/settings-svgrepo-com.svg new file mode 100644 index 0000000..662c5d8 --- /dev/null +++ b/assets/images/settings-svgrepo-com.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/assets/images/settings-svgrepo-com.svg.import b/assets/images/settings-svgrepo-com.svg.import new file mode 100644 index 0000000..5ef6f52 --- /dev/null +++ b/assets/images/settings-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clgheu7bkd1bg" +path="res://.godot/imported/settings-svgrepo-com.svg-83e6bf16288c1cb3e1817702b2284b13.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/settings-svgrepo-com.svg" +dest_files=["res://.godot/imported/settings-svgrepo-com.svg-83e6bf16288c1cb3e1817702b2284b13.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/assets/images/stop-circle-svgrepo-com.svg b/assets/images/stop-circle-svgrepo-com.svg new file mode 100644 index 0000000..ab16964 --- /dev/null +++ b/assets/images/stop-circle-svgrepo-com.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/images/stop-circle-svgrepo-com.svg.import b/assets/images/stop-circle-svgrepo-com.svg.import new file mode 100644 index 0000000..77ec11d --- /dev/null +++ b/assets/images/stop-circle-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ce2puikkj24gp" +path="res://.godot/imported/stop-circle-svgrepo-com.svg-35ae1106268844c1edde3b1fcdcf9a00.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/stop-circle-svgrepo-com.svg" +dest_files=["res://.godot/imported/stop-circle-svgrepo-com.svg-35ae1106268844c1edde3b1fcdcf9a00.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/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png" "b/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png" new file mode 100644 index 0000000..28b12b9 Binary files /dev/null and "b/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png" differ diff --git "a/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png.import" "b/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png.import" new file mode 100644 index 0000000..efc9108 --- /dev/null +++ "b/assets/images/\342\200\224Pngtree\342\200\224hud control panel frame border_6979573.png.import" @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmwwhgsi8btxp" +path="res://.godot/imported/—Pngtree—hud control panel frame border_6979573.png-d449559f680339382dc91e3567c1161e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/—Pngtree—hud control panel frame border_6979573.png" +dest_files=["res://.godot/imported/—Pngtree—hud control panel frame border_6979573.png-d449559f680339382dc91e3567c1161e.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 diff --git a/autoloads/appstate.gd b/autoloads/appstate.gd index b318723..73eb771 100644 --- a/autoloads/appstate.gd +++ b/autoloads/appstate.gd @@ -9,8 +9,8 @@ const VERSION_CONFIG : String = "res://version.cfg" const DRIVENET_NODE : String = "172.105.148.135" -@onready var chain_state : Resource = load("res://models/chain_state.tscn") -@onready var chain_provider_info : Resource = preload("res://ui/components/dashboard/chain_providers_info/chain_provider_info.tscn") +@onready var chain_state : Resource = preload("res://models/chain_state.tscn") +@onready var chain_provider_info : Resource = preload("res://source/nodes/chain_providers_info/chain_provider_info.tscn") #@onready var z_params_modal : Resource = preload("res://ui/components/dashboard/z_params_modal/z_params_modal.tscn") var chain_providers_config : ConfigFile @@ -24,6 +24,11 @@ var ethsail_pid: int = -1 signal chain_providers_changed signal chain_states_changed +signal drivechain_downloaded + +func set_drivechain_downloaded(): + emit_signal("drivechain_downloaded") + func _ready(): if Appstate.get_platform() == platform.UNSUPPORTED: @@ -280,6 +285,7 @@ func load_app_config(): update_display_scale(scale_factor) func update_display_scale(scale_factor: float): + return #returning as this code overrides the project settings scale_factor = clampf(scale_factor, 1, 2) var screen_size = DisplayServer.screen_get_size(0) var new_screen_size = Vector2i(screen_size.x / 2, screen_size.y / 2) @@ -843,7 +849,7 @@ func get_drivechain_provider() -> ChainProvider: func show_chain_provider_info(chain_provider: ChainProvider): var info = chain_provider_info.instantiate() info.name = "chain_provider_info" - get_tree().root.get_node("Main").add_child(info) + get_tree().root.get_node("Application").get_node("ChainProviderInfoLayer").add_child(info) info.setup(chain_provider) diff --git a/models/chain_provider.gd b/models/chain_provider.gd index 3ea0c22..fe92695 100644 --- a/models/chain_provider.gd +++ b/models/chain_provider.gd @@ -201,10 +201,9 @@ func start_chain(): #if dir == null: #print("zcash params not present, showing download modal") #Appstate.show_zparams_modal(self) - +# ## important: return here! once the params are finished downloading, ## the binary will be launched by the params fetched modal. - #return @@ -242,4 +241,3 @@ func get_executable_path() -> String: func get_local_zip_hash() -> String: return FileAccess.get_sha256(ProjectSettings.globalize_path(base_dir + "/" + id + ".zip")) - diff --git a/models/chain_state.gd b/models/chain_state.gd index 9eb5542..7b4cb43 100644 --- a/models/chain_state.gd +++ b/models/chain_state.gd @@ -201,7 +201,7 @@ func find_ethsail_pids() -> Array: if os_name != "Windows": # Command for Unix-like systems to find processes by command-line pattern - var result = OS.execute("pgrep", ["-f", "ethsail --conf=/home/joshua/drivechain_launcher_sidechains/ethsail/ethsail.conf"], output, true) + var result = OS.execute("pgrep", ["-f", "ethsail.*ethsail.conf"], output, true) if result == OK and output.size() > 0: # Handle multiple PIDs var pid_strings = output[0].split("\n") diff --git a/project.godot b/project.godot index bca56c8..db8a91f 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="drivechain_launcher" -run/main_scene="res://ui/main.tscn" +run/main_scene="res://source/application/application.tscn" config/use_custom_user_dir=true config/features=PackedStringArray("4.2", "GL Compatibility") config/icon="res://icon.png" @@ -22,15 +22,19 @@ config/windows_native_icon="res://icon.ico" Appstate="*res://autoloads/appstate.tscn" Net="*res://net.gd" -DashboardPanel="*res://ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn" -chain_state="*res://models/chain_state.tscn" -ResetSidechainWindow="*res://ui/components/dashboard/chain_providers_info/reset_sidechain_window.tscn" +DashboardPanel="*res://ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd" +chain_state="*res://models/chain_state.gd" +ResetSidechainWindow="*res://source/nodes/chain_providers_info/reset_sidechain_window.gd" +GlobalFont="*res://resource/GlobalFont.gd" [display] -window/size/viewport_width=1024 -window/size/viewport_height=640 +window/size/viewport_width=851 +window/size/viewport_height=600 +window/size/resizable=false window/subwindows/embed_subwindows=false +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" [dotnet] @@ -43,10 +47,11 @@ import/blender/enabled=false [gui] theme/custom="res://ui/themes/default_dark.tres" -theme/custom_font="res://assets/fonts/Cantarell-Regular.ttf" -theme/default_font_multichannel_signed_distance_field=true +theme/custom_font="res://assets/fonts/Satoshi-Regular.otf" [rendering] +textures/canvas_textures/default_texture_filter=2 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" +textures/default_filters/use_nearest_mipmap_filter=true diff --git a/resource/GlobalFont.gd b/resource/GlobalFont.gd new file mode 100644 index 0000000..6c9327d --- /dev/null +++ b/resource/GlobalFont.gd @@ -0,0 +1,29 @@ +extends Node + +var default_font: Font + +func _ready(): + # Load your custom font + default_font = load("res://assets/fonts/Satoshi-Regular.otf") + + # Apply the font to all Control nodes + apply_font_override(get_tree().root) + +func apply_font_override(node: Node): + if node is Control: + apply_font_to_control(node) + + for child in node.get_children(): + apply_font_override(child) + +func apply_font_to_control(control: Control): + var font_override = FontVariation.new() + font_override.base_font = default_font + + # Apply to different theme types + for type in ["normal", "bold", "italic", "bold_italic"]: + control.add_theme_font_override(type, font_override) + + # If it's a specific control that needs size adjustment, you can do it here + #if control is Label: + #control.add_theme_font_size_override("font_size", 16) # Adjust size as needed diff --git a/resource/colors.txt b/resource/colors.txt new file mode 100644 index 0000000..b5e740f --- /dev/null +++ b/resource/colors.txt @@ -0,0 +1,6 @@ +theme = sky_blue +main_color = #9ac1dd +#-----------------------------------------------------------# +theme = black +main_color = #474747 +#-----------------------------------------------------------# diff --git a/resource/font/basic.tres b/resource/font/basic.tres new file mode 100644 index 0000000..aed1118 --- /dev/null +++ b/resource/font/basic.tres @@ -0,0 +1,4 @@ +[gd_resource type="SystemFont" format=3 uid="uid://b0nauaa7yuddh"] + +[resource] +font_names = PackedStringArray("Impact", "Cursive") diff --git a/resource/font/kenvector_future.ttf b/resource/font/kenvector_future.ttf new file mode 100644 index 0000000..39ebdfa Binary files /dev/null and b/resource/font/kenvector_future.ttf differ diff --git a/resource/font/kenvector_future.ttf.import b/resource/font/kenvector_future.ttf.import new file mode 100644 index 0000000..3aaf25b --- /dev/null +++ b/resource/font/kenvector_future.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dl8txy7hota0x" +path="res://.godot/imported/kenvector_future.ttf-5b38464af0613ba57dcd18b096364266.fontdata" + +[deps] + +source_file="res://resource/font/kenvector_future.ttf" +dest_files=["res://.godot/imported/kenvector_future.ttf-5b38464af0613ba57dcd18b096364266.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/resource/style_box/nodes/header_panel_style.stylebox b/resource/style_box/nodes/header_panel_style.stylebox new file mode 100644 index 0000000..8483757 Binary files /dev/null and b/resource/style_box/nodes/header_panel_style.stylebox differ diff --git a/resource/theme/CheckButton_Checked.svg b/resource/theme/CheckButton_Checked.svg new file mode 100644 index 0000000..df3eda1 --- /dev/null +++ b/resource/theme/CheckButton_Checked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/resource/theme/CheckButton_Checked.svg.import b/resource/theme/CheckButton_Checked.svg.import new file mode 100644 index 0000000..f42509c --- /dev/null +++ b/resource/theme/CheckButton_Checked.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bsd1utvwg57qb" +path="res://.godot/imported/CheckButton_Checked.svg-939fe6171214ac525d8b5c896f8845b3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/theme/CheckButton_Checked.svg" +dest_files=["res://.godot/imported/CheckButton_Checked.svg-939fe6171214ac525d8b5c896f8845b3.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/resource/theme/CheckButton_Unchecked.svg b/resource/theme/CheckButton_Unchecked.svg new file mode 100644 index 0000000..7f02df6 --- /dev/null +++ b/resource/theme/CheckButton_Unchecked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/resource/theme/CheckButton_Unchecked.svg.import b/resource/theme/CheckButton_Unchecked.svg.import new file mode 100644 index 0000000..c28e9de --- /dev/null +++ b/resource/theme/CheckButton_Unchecked.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cfhuuptqj50pk" +path="res://.godot/imported/CheckButton_Unchecked.svg-5bd2822f53d87e89c509582e9de61bbe.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/theme/CheckButton_Unchecked.svg" +dest_files=["res://.godot/imported/CheckButton_Unchecked.svg-5bd2822f53d87e89c509582e9de61bbe.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/resource/theme/black.theme b/resource/theme/black.theme new file mode 100644 index 0000000..5d01d85 Binary files /dev/null and b/resource/theme/black.theme differ diff --git a/resource/theme/down-arrow-svgrepo-com.svg b/resource/theme/down-arrow-svgrepo-com.svg new file mode 100644 index 0000000..7bcd676 --- /dev/null +++ b/resource/theme/down-arrow-svgrepo-com.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/resource/theme/down-arrow-svgrepo-com.svg.import b/resource/theme/down-arrow-svgrepo-com.svg.import new file mode 100644 index 0000000..a0fc8be --- /dev/null +++ b/resource/theme/down-arrow-svgrepo-com.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmaweifkeixfe" +path="res://.godot/imported/down-arrow-svgrepo-com.svg-cd09e26c2e5b9b89338eda7d165829c7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/theme/down-arrow-svgrepo-com.svg" +dest_files=["res://.godot/imported/down-arrow-svgrepo-com.svg-cd09e26c2e5b9b89338eda7d165829c7.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/sha512.gd b/sha512.gd new file mode 100644 index 0000000..59157d6 --- /dev/null +++ b/sha512.gd @@ -0,0 +1,175 @@ +class_name SHA512 + +const K = [ + [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], + [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], + [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], + [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], + [0xe49b69c1, 0xefbe4786], [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], [0x2de92c6f, 0x592b0275], + [0x4a7484aa, 0x6ea6e483], [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], [0x983e5152, 0xee66dfab], + [0xa831c66d, 0x2db43210], [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], [0xc6e00bf3, 0x3da88fc2], + [0xd5a79147, 0x930aa725], [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], [0x27b70a85, 0x46d22ffc], + [0x2e1b2138, 0x5c26c926], [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], [0x650a7354, 0x8baf63de], + [0x766a0abb, 0x3c77b2a8], [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], [0xa2bfe8a1, 0x4cf10364], + [0xa81a664b, 0xbc423001], [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], [0xd192e819, 0xd6ef5218], + [0xd6990624, 0x5565a910], [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], [0x19a4c116, 0xb8d2d0c8], + [0x1e376c08, 0x5141ab53], [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], [0x391c0cb3, 0xc5c95a63], + [0x4ed8aa4a, 0xe3418acb], [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], [0x748f82ee, 0x5defb2fc], + [0x78a5636f, 0x43172f60], [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], [0x90befffa, 0x23631e28], + [0xa4506ceb, 0xde82bde9], [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], [0xca273ece, 0xea26619c], + [0xd186b8c7, 0x21c0c207], [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], [0x06f067aa, 0x72176fba], + [0x0a637dc5, 0xa2c898a6], [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], [0x28db77f5, 0x23047d84], + [0x32caab7b, 0x40c72493], [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], [0x4cc5d4be, 0xcb3e42b6], + [0x597f299c, 0xfc657e2a], [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] +] + +static func rotr(n: int, x: Array) -> Array: + var a = x[0] + var b = x[1] + if n >= 32: + n -= 32 + var t = a + a = b + b = t + if n == 0: + return [a, b] + return [ + ((a >> n) | (b << (32 - n))) & 0xFFFFFFFF, + ((b >> n) | (a << (32 - n))) & 0xFFFFFFFF + ] + +static func add_modulo(a: Array, b: Array) -> Array: + var lo = (a[1] + b[1]) & 0xFFFFFFFF + var hi = (a[0] + b[0] + (1 if lo < a[1] else 0)) & 0xFFFFFFFF + return [hi, lo] + +static func ch(x: Array, y: Array, z: Array) -> Array: + return [ + (x[0] & y[0]) ^ (~x[0] & z[0]), + (x[1] & y[1]) ^ (~x[1] & z[1]) + ] + +static func maj(x: Array, y: Array, z: Array) -> Array: + return [ + (x[0] & y[0]) ^ (x[0] & z[0]) ^ (y[0] & z[0]), + (x[1] & y[1]) ^ (x[1] & z[1]) ^ (y[1] & z[1]) + ] + +static func sigma0(x: Array) -> Array: + var a = rotr(28, x) + var b = rotr(34, x) + var c = rotr(39, x) + return [a[0] ^ b[0] ^ c[0], a[1] ^ b[1] ^ c[1]] + +static func sigma1(x: Array) -> Array: + var a = rotr(14, x) + var b = rotr(18, x) + var c = rotr(41, x) + return [a[0] ^ b[0] ^ c[0], a[1] ^ b[1] ^ c[1]] + +static func gamma0(x: Array) -> Array: + var a = rotr(1, x) + var b = rotr(8, x) + var c = [x[0] >> 7, (x[1] >> 7) | (x[0] << 25) & 0xFFFFFFFF] + return [a[0] ^ b[0] ^ c[0], a[1] ^ b[1] ^ c[1]] + +static func gamma1(x: Array) -> Array: + var a = rotr(19, x) + var b = rotr(61, x) + var c = [x[0] >> 6, (x[1] >> 6) | (x[0] << 26) & 0xFFFFFFFF] + return [a[0] ^ b[0] ^ c[0], a[1] ^ b[1] ^ c[1]] + +static func sha512(message: PackedByteArray) -> PackedByteArray: + var h = [ + [0x6a09e667, 0xf3bcc908], [0xbb67ae85, 0x84caa73b], + [0x3c6ef372, 0xfe94f82b], [0xa54ff53a, 0x5f1d36f1], + [0x510e527f, 0xade682d1], [0x9b05688c, 0x2b3e6c1f], + [0x1f83d9ab, 0xfb41bd6b], [0x5be0cd19, 0x137e2179] + ] + + var message_len = message.size() + var bit_len = message_len * 8 + message.append(0x80) + while (message.size() % 128) != 112: + message.append(0x00) + + for i in range(16): + message.append((bit_len >> (120 - 8 * i)) & 0xFF) + + for chunk_start in range(0, message.size(), 128): + var w = [] + for i in range(16): + var start = chunk_start + i * 8 + w.append([ + (message[start] << 24) | (message[start + 1] << 16) | (message[start + 2] << 8) | message[start + 3], + (message[start + 4] << 24) | (message[start + 5] << 16) | (message[start + 6] << 8) | message[start + 7] + ]) + + for i in range(16, 80): + var s0 = gamma0(w[i-15]) + var s1 = gamma1(w[i-2]) + var w_i = add_modulo(add_modulo(add_modulo(w[i-16], s0), w[i-7]), s1) + w.append(w_i) + + var a = h[0] + var b = h[1] + var c = h[2] + var d = h[3] + var e = h[4] + var f = h[5] + var g = h[6] + var hh = h[7] + + for i in range(80): + var S1 = sigma1(e) + var ch_efg = ch(e, f, g) + var temp1 = add_modulo(add_modulo(add_modulo(add_modulo(hh, S1), ch_efg), K[i]), w[i]) + var S0 = sigma0(a) + var maj_abc = maj(a, b, c) + var temp2 = add_modulo(S0, maj_abc) + + hh = g + g = f + f = e + e = add_modulo(d, temp1) + d = c + c = b + b = a + a = add_modulo(temp1, temp2) + + h[0] = add_modulo(h[0], a) + h[1] = add_modulo(h[1], b) + h[2] = add_modulo(h[2], c) + h[3] = add_modulo(h[3], d) + h[4] = add_modulo(h[4], e) + h[5] = add_modulo(h[5], f) + h[6] = add_modulo(h[6], g) + h[7] = add_modulo(h[7], hh) + + var result = PackedByteArray() + for i in range(8): + for j in range(8): + result.append((h[i][int(j/4)] >> (24 - 8 * (j % 4))) & 0xFF) + return result + +static func hmac_sha512(key: PackedByteArray, message: PackedByteArray) -> PackedByteArray: + const BLOCK_SIZE = 128 + + if key.size() > BLOCK_SIZE: + key = sha512(key) + + while key.size() < BLOCK_SIZE: + key.append(0) + + var o_key_pad = PackedByteArray() + var i_key_pad = PackedByteArray() + + for i in range(BLOCK_SIZE): + o_key_pad.append(key[i] ^ 0x5c) + i_key_pad.append(key[i] ^ 0x36) + + var inner = i_key_pad + message + var inner_hash = sha512(inner) + + var outer = o_key_pad + inner_hash + return sha512(outer) diff --git a/source/.DS_Store b/source/.DS_Store new file mode 100644 index 0000000..6bd614c Binary files /dev/null and b/source/.DS_Store differ diff --git a/source/application/AddressInfo.gd b/source/application/AddressInfo.gd new file mode 100644 index 0000000..50d7131 --- /dev/null +++ b/source/application/AddressInfo.gd @@ -0,0 +1,56 @@ +extends GridContainer + +var columns_count = 3 +var rows_count = 4 +var font_path = "res://assets/fonts/Satoshi-Regular.otf" + +func _ready(): + columns = columns_count + setup_grid() + get_tree().get_root().connect("size_changed", Callable(self, "_on_window_resize")) + _on_window_resize() # Initial size setup + +func setup_grid(): + for child in get_children(): + child.queue_free() + + var font = load(font_path) + + # Set up the grid + for i in range(rows_count * columns_count): + var label = Label.new() + label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + label.size_flags_horizontal = SIZE_EXPAND_FILL + label.size_flags_vertical = SIZE_EXPAND_FILL + label.autowrap_mode = TextServer.AUTOWRAP_OFF + label.add_theme_font_override("font", font) + label.text = "check" # Empty by default + add_child(label) + + add_theme_constant_override("h_separation", 10) + add_theme_constant_override("v_separation", 5) + +func _on_window_resize(): + var parent_size = get_parent().size + var grid_width = parent_size.x * 0.95 # 95% of parent width + var grid_height = parent_size.y * 0.95 # 95% of parent height + + custom_minimum_size = Vector2(grid_width, grid_height) + size = Vector2(grid_width, grid_height) + + var cell_width = grid_width / columns_count + var cell_height = grid_height / rows_count + + for child in get_children(): + child.custom_minimum_size = Vector2(cell_width, cell_height) + + # Center the grid in its parent + position = Vector2((parent_size.x - grid_width) / 2, (parent_size.y - grid_height) / 2) + + queue_sort() + +func update_cell(row, col, text): + var index = row * columns_count + col + if index < get_child_count(): + get_child(index).text = text diff --git a/source/application/AddressInfoPanel.gd b/source/application/AddressInfoPanel.gd new file mode 100644 index 0000000..f5d7829 --- /dev/null +++ b/source/application/AddressInfoPanel.gd @@ -0,0 +1,33 @@ +extends Panel + +var current_page = 1 +var total_pages = 10 # This can be adjusted based on your needs + +@onready var prev_button: Button = $HBoxContainer/Prev +@onready var next_button: Button = $HBoxContainer/Next +@onready var page_label: Label = $HBoxContainer/Page + +func _ready(): + prev_button.pressed.connect(_on_prev_pressed) + next_button.pressed.connect(_on_next_pressed) + update_navigation() + +func update_navigation(): + prev_button.disabled = current_page == 1 + next_button.disabled = current_page == total_pages + page_label.text = "Page %d of %d" % [current_page, total_pages] + +func _on_prev_pressed(): + if current_page > 1: + current_page -= 1 + update_navigation() + +func _on_next_pressed(): + if current_page < total_pages: + current_page += 1 + update_navigation() + +# Debug function to test the pagination +func _input(event): + if event.is_action_pressed("ui_accept"): + print("Current Page:", current_page) diff --git a/source/application/application.tscn b/source/application/application.tscn new file mode 100644 index 0000000..0c4cb24 --- /dev/null +++ b/source/application/application.tscn @@ -0,0 +1,249 @@ +[gd_scene load_steps=13 format=3 uid="uid://d3umh8q67cxar"] + +[ext_resource type="Theme" uid="uid://h5leavcufiab" path="res://resource/theme/black.theme" id="1_ool8a"] +[ext_resource type="Script" path="res://source/application/tabs_format.gd" id="2_6g70o"] +[ext_resource type="PackedScene" uid="uid://bi3mevmny3dj3" path="res://source/settings/settings.tscn" id="2_qna4f"] +[ext_resource type="PackedScene" uid="uid://3423r8wl8vxb" path="res://source/nodes/nodes.tscn" id="2_xvhh7"] +[ext_resource type="Script" path="res://source/application/wallet_creator.gd" id="3_rk7qs"] +[ext_resource type="Script" path="res://source/nodes/dashboard.gd" id="4_1w6t5"] +[ext_resource type="Texture2D" uid="uid://itqhnp8fc877" path="res://assets/images/help-circle-outline-svgrepo-com.svg" id="4_a3gdc"] +[ext_resource type="Texture2D" uid="uid://dgqkqb642nnfx" path="res://assets/images/exit-svgrepo-com.svg" id="4_ry4n6"] +[ext_resource type="Script" path="res://source/application/mnemonic.gd" id="4_sm74a"] +[ext_resource type="PackedScene" uid="uid://duvvgc45h86gp" path="res://source/fast_withdrawal/fast_withdraw-new.tscn" id="9_al4dm"] +[ext_resource type="PackedScene" uid="uid://dwhtby81ylt3s" path="res://ui/components/left_menu/left_menu.tscn" id="11_x7vrd"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qsl1u"] +bg_color = Color(0, 0, 0, 1) + +[node name="Application" type="Control" groups=["application"]] +texture_filter = 4 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_ool8a") + +[node name="Background" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[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 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="TabContainer" type="TabContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +script = ExtResource("2_6g70o") + +[node name="Wallet" type="TabContainer" parent="MarginContainer/VBoxContainer/TabContainer"] +layout_mode = 2 +current_tab = 1 +tabs_visible = false +script = ExtResource("3_rk7qs") + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet"] +visible = false +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Control3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 40) +layout_mode = 2 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 45) +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "RESTORE WALLET" +horizontal_alignment = 1 + +[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 40) +layout_mode = 2 + +[node name="MnemonicIn" type="TextEdit" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 100) +layout_mode = 2 +placeholder_text = "Enter 12 words separated by a space" +wrap_mode = 1 +autowrap_mode = 2 + +[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 50) +layout_mode = 2 + +[node name="Load" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 60) +layout_mode = 2 +text = "LOAD WALLET" + +[node name="Control" type="Panel" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(8, 2.08165e-12) +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_qsl1u") + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Control3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 40) +layout_mode = 2 + +[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 45) +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "CREATE WALLET" +horizontal_alignment = 1 + +[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 40) +layout_mode = 2 + +[node name="Create" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 220) +layout_mode = 2 +text = "CREATE NEW WALLET" + +[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2"] +layout_mode = 2 + +[node name="BoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +layout_mode = 2 + +[node name="Return" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_ry4n6") + +[node name="LineEdit" type="LineEdit" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Input random string or fast create" +max_length = 64 +expand_to_text_length = true + +[node name="Random" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 50) +layout_mode = 2 +text = "Fast Create" + +[node name="Help" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_a3gdc") + +[node name="Hide" type="CheckButton" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(10, 10) +layout_mode = 2 +text = "Hide" + +[node name="Spacer3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +layout_mode = 2 +script = ExtResource("4_sm74a") + +[node name="Spacer2" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="BIP39" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 + +[node name="Header" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/BIP39"] +layout_mode = 2 +text = "BIP 39 Information" +horizontal_alignment = 1 + +[node name="Spacer" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +layout_mode = 2 + +[node name="Paths" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 + +[node name="Header" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] +layout_mode = 2 +text = "BIP 32 HD Information" +horizontal_alignment = 1 + +[node name="LaunchPopUp" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] +custom_minimum_size = Vector2(2.08165e-12, 50) +layout_mode = 2 +size_flags_vertical = 10 +text = "CREATE WALLET" + +[node name="Nodes" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("2_xvhh7")] +visible = false +layout_mode = 2 +script = ExtResource("4_1w6t5") + +[node name="Fast Withdraw" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("9_al4dm")] +visible = false +layout_mode = 2 + +[node name="Tools" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer"] +visible = false +layout_mode = 2 + +[node name="Settings" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("2_qna4f")] +visible = false +layout_mode = 2 + +[node name="Menu" parent="MarginContainer/VBoxContainer" instance=ExtResource("11_x7vrd")] +custom_minimum_size = Vector2(2.08165e-12, 90) +layout_mode = 2 +size_flags_vertical = 1 + +[node name="ChainProviderInfoLayer" type="CanvasLayer" parent="."] + +[editable path="MarginContainer/VBoxContainer/TabContainer/Nodes"] +[editable path="MarginContainer/VBoxContainer/TabContainer/Nodes/ScrollContainer/Window/NodePanel1"] diff --git a/source/application/hboxresize.gd b/source/application/hboxresize.gd new file mode 100644 index 0000000..67bb5eb --- /dev/null +++ b/source/application/hboxresize.gd @@ -0,0 +1,11 @@ +extends HBoxContainer# Assuming this script is attached to your HBoxContainer + +func _ready(): + # Create a new StyleBoxFlat + var style_box = StyleBoxFlat.new() + + # Set the background color (adjust the color as needed) + style_box.bg_color = Color.BLACK # Dark gray, fully opaque + + # Apply the StyleBoxFlat to the HBoxContainer + self.add_theme_stylebox_override("HBoxContainer", style_box) diff --git a/source/application/mnemonic.gd b/source/application/mnemonic.gd new file mode 100644 index 0000000..51a37ba --- /dev/null +++ b/source/application/mnemonic.gd @@ -0,0 +1,102 @@ +extends GridContainer + +var columns_count = 13 +var rows_count = 3 + +var header_font_path = "res://assets/fonts/Satoshi-Bold.otf" + +func _ready(): + columns = columns_count + setup_grid() + get_tree().get_root().connect("size_changed", Callable(self, "_on_window_resize")) + _on_window_resize() # Initial size setup + +func setup_grid(): + for child in get_children(): + child.queue_free() + + var font = load(header_font_path) + var small_font = font.duplicate() + var default_size = 14 # Set this to your desired default font size + var small_size = int(default_size * 0.7) # Adjust this factor to get the desired size + + # Set up the grid + for i in range(columns_count * rows_count): + var panel = Panel.new() + panel.size_flags_horizontal = SIZE_EXPAND_FILL + panel.size_flags_vertical = SIZE_EXPAND_FILL + + # Create a StyleBoxFlat for the border + var style_box = StyleBoxFlat.new() + style_box.set_border_width_all(1) + style_box.border_color = Color.WHITE + style_box.bg_color = Color(0.2, 0.2, 0.2, 1) # Dark gray background + panel.add_theme_stylebox_override("panel", style_box) + + var label = Label.new() + label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + label.size_flags_horizontal = SIZE_EXPAND_FILL + label.size_flags_vertical = SIZE_EXPAND_FILL + label.autowrap_mode = TextServer.AUTOWRAP_OFF + + # Ensure label takes up full cell size + label.anchor_right = 1 + label.anchor_bottom = 1 + label.offset_left = 0 + label.offset_top = 0 + label.offset_right = 0 + label.offset_bottom = 0 + + # Set the font and font size + if i > 13 and i < 26: # BIN row + label.add_theme_font_override("font", small_font) + label.add_theme_font_size_override("font_size", small_size) + else: + label.add_theme_font_override("font", font) + label.add_theme_font_size_override("font_size", default_size) + + # Set specific text for elements 0, 13, and 26 + if i == 0: + label.text = "WORD" + elif i == 13: + label.text = "BIN" + elif i == 26: + label.text = "INDEX" + else: + label.text = " " + + panel.add_child(label) + add_child(panel) + + columns = columns_count + add_theme_constant_override("h_separation", 0) + add_theme_constant_override("v_separation", 0) + +func _on_window_resize(): + var parent_size = get_parent().size + var max_width = parent_size.x * 0.8 # 80% of parent width + var max_height = parent_size.y * 0.6 # 60% of parent height, adjust as needed + + var cell_width = max_width / columns_count + var cell_height = cell_width * 0.6 # Adjust this factor for desired cell height + + var grid_width = cell_width * columns_count + var grid_height = cell_height * rows_count + + # Ensure the grid doesn't exceed the maximum allowed size + grid_width = min(grid_width, max_width) + grid_height = min(grid_height, max_height) + + # Update the grid size + custom_minimum_size = Vector2(grid_width, grid_height) + size = Vector2(grid_width, grid_height) + + # Update cell sizes + for child in get_children(): + child.custom_minimum_size = Vector2(cell_width, cell_height) + + # Center the grid in its parent + position = Vector2((parent_size.x - grid_width) / 2, (parent_size.y - grid_height) / 2) + + queue_sort() diff --git a/source/application/tabs_format.gd b/source/application/tabs_format.gd new file mode 100644 index 0000000..10ae783 --- /dev/null +++ b/source/application/tabs_format.gd @@ -0,0 +1,14 @@ +extends TabContainer + +func _ready(): + var theme = Theme.new() + set_tab_alignment(TabBar.ALIGNMENT_CENTER) + var font = load("res://assets/fonts/Satoshi-Black.otf") + theme.set_font("font", "TabContainer", font) + theme.set_font_size("font", "TabBar", 28) + theme.set_constant("tab_minimum_width", "TabContainer", 200) # Set minimum tab width + theme.set_constant("tab_height", "TabContainer", 80) # Adjust tab height + theme.set_constant("h_separation", "TabContainer", 6) + theme.set_constant("outline_size", "TabContainer", 5) + theme.set_constant("font_size", "TabContainer", 24) + self.theme = theme diff --git a/source/application/wallet_creator.gd b/source/application/wallet_creator.gd new file mode 100644 index 0000000..8ce2aca --- /dev/null +++ b/source/application/wallet_creator.gd @@ -0,0 +1,596 @@ +extends TabContainer +@onready var blocker = $AdvancedBlocker +@onready var advanced_button = $VBoxContainer/HBoxContainer/Advanced +@onready var create_wallet_button = $MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2/Create +@onready var return_button = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer/Return +@onready var entropy_in = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer/LineEdit +@onready var mnemonic_out = $MarginContainer2/VBoxContainer/BoxContainer/GridContainer +@onready var bip39_panel = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/BIP39 +@onready var launch_panel = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths +@onready var create_pop_up = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths/LaunchPopUp +@onready var popup_window = $PopUp +@onready var popup_vbox = $PopUp/MarginContainer/VBoxContainer +@onready var mnemonic_label = $PopUp/MarginContainer/VBoxContainer/Label +@onready var hide_button = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer/Hide +@onready var mnemonic_in = $MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer/MnemonicIn +@onready var load_button = $MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer/Load +@onready var fast_button = $MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer/Random + +@onready var tabs = get_parent() if get_parent() is TabContainer else null + +var current_wallet_data = {} + +func _ready(): + create_wallet_button.connect("pressed", Callable(self, "_on_create_wallet_button_pressed")) + return_button.connect("pressed", Callable(self, "_on_return_button_pressed")) + entropy_in.connect("text_changed", Callable(self, "_on_entropy_in_changed")) + create_pop_up.connect("pressed", Callable(self, "_on_create_popup_pressed")) + hide_button.connect("toggled", Callable(self, "_on_hide_button_toggled")) + load_button.connect("pressed", Callable(self, "_on_load_button_pressed")) + fast_button.connect("pressed", Callable(self, "_on_fast_button_pressed")) + + if tabs: + tabs.connect("tab_changed", Callable(self, "_on_tab_changed")) + setup_bip39_panel() + setup_launch_panel() + ensure_starters_directory() + +func setup_bip39_panel(): + var bip39_info_label = RichTextLabel.new() + bip39_info_label.name = "BIP39Info" + bip39_info_label.bbcode_enabled = true + bip39_info_label.fit_content = true + bip39_info_label.scroll_active = true + bip39_info_label.size_flags_horizontal = SIZE_EXPAND_FILL + bip39_info_label.size_flags_vertical = SIZE_EXPAND_FILL + bip39_info_label.custom_minimum_size = Vector2(0, 200) + bip39_panel.add_child(bip39_info_label) + + var headers_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + bip39_info_label.text = headers_text + +func setup_launch_panel(): + var vbox = VBoxContainer.new() + vbox.name = "VBoxContainer" + vbox.size_flags_vertical = SIZE_EXPAND_FILL + launch_panel.add_child(vbox) + + var launch_info_label = RichTextLabel.new() + launch_info_label.name = "LaunchInfo" + launch_info_label.bbcode_enabled = true + launch_info_label.fit_content = true + launch_info_label.scroll_active = true + launch_info_label.size_flags_horizontal = SIZE_EXPAND_FILL + launch_info_label.size_flags_vertical = SIZE_EXPAND_FILL + vbox.add_child(launch_info_label) + + var headers_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + launch_info_label.text = headers_text + var existing_button = launch_panel.get_node_or_null("LaunchPopUp") + if existing_button: + launch_panel.remove_child(existing_button) + vbox.add_child(existing_button) + +func _on_create_wallet_button_pressed(): + reset_wallet_tab() + current_tab = 1 + +func _on_return_button_pressed(): + reset_wallet_tab() + current_tab = 0 + clear_all_output() + +func _create_wallet(input: String): + if input.strip_edges().is_empty(): + clear_all_output() + return + var Bitcoin = BitcoinWallet.new() + var output = Bitcoin.generate_wallet(input) + if not output.has("error"): + current_wallet_data = output + populate_grid(output["mnemonic"], output["bip39_bin"], output["bip39_csum"]) + update_bip39_panel(output) + update_launch_panel(output) + _toggle_output_visibility(true) # Ensure output is visible + hide_button.button_pressed = false + else: + clear_all_output() + +func clear_all_output(): + entropy_in.text = "" + for i in range(1, mnemonic_out.get_child_count()): + if i != 13 and i != 26: + var label = mnemonic_out.get_child(i).get_child(0) as Label + if label: + label.text = "" + + var bip39_info_label = bip39_panel.get_node("BIP39Info") + if bip39_info_label: + var headers_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + bip39_info_label.text = headers_text + + var launch_info_label = launch_panel.get_node("VBoxContainer/LaunchInfo") + if launch_info_label: + var headers_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + launch_info_label.text = headers_text + + hide_button.button_pressed = false + current_wallet_data = {} + _toggle_output_visibility(true) + +func _on_entropy_in_changed(new_text: String): + if new_text.is_empty(): + clear_all_output() + else: + _create_wallet(new_text) + +func update_bip39_panel(output: Dictionary): + var bip39_info_label = bip39_panel.get_node("BIP39Info") + if bip39_info_label: + var formatted_bin = "" + var bin_string = output.get("bip39_bin", "") + for i in range(0, bin_string.length(), 4): + formatted_bin += bin_string.substr(i, 4) + " " + formatted_bin = formatted_bin.strip_edges() + + var checksum = output.get("bip39_csum", "") + var formatted_checksum = "" + for i in range(0, checksum.length(), 4): + formatted_checksum += checksum.substr(i, 4) + " " + formatted_checksum = formatted_checksum.strip_edges() + + + var info_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell]{bip39_hex}[/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell]{bip39_bin}[/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][color=green]{bip39_csum}[/color][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][color=green]{bip39_csum_hex}[/color][/cell] +[/table]""".format({ + "bip39_hex": output.get("bip39_hex", ""), + "bip39_bin": formatted_bin, + "bip39_csum": formatted_checksum, + "bip39_csum_hex": output.get("bip39_csum_hex", "") + }) + bip39_info_label.text = info_text + +func update_launch_panel(output: Dictionary): + var launch_info_label = launch_panel.get_node("VBoxContainer/LaunchInfo") + if launch_info_label: + var info_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell]{hd_key_data}[/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell]{master_key}[/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell]{chain_code}[/cell] +[/table]""".format({ + "hd_key_data": output.get("hd_key_data", ""), + "master_key": output.get("master_key", ""), + "chain_code": output.get("chain_code", "") + }) + launch_info_label.text = info_text + +func binary_to_integer(binary: String) -> int: + return ("0b" + binary).bin_to_int() + +func populate_grid(mnemonic: String, bip39_bin: String, bip39_csum: String): + var words = mnemonic.split(" ") + var bin_chunks = [] + for i in range(0, bip39_bin.length(), 11): + bin_chunks.append(bip39_bin.substr(i, 11)) + + for i in range(12): + if i < words.size() and i < bin_chunks.size(): + var word_panel = mnemonic_out.get_child(i + 1) + var bin_panel = mnemonic_out.get_child(i + 14) + var index_panel = mnemonic_out.get_child(i + 27) + + if word_panel and bin_panel and index_panel: + var word_label = word_panel.get_child(0) as Label + var bin_label = bin_panel.get_child(0) as Label + var index_label = index_panel.get_child(0) as Label + + if word_label and bin_label and index_label: + word_label.text = words[i] + if i == 11: + bin_label.text = bin_chunks[i] + bip39_csum + else: + bin_label.text = bin_chunks[i] + index_label.text = str(binary_to_integer(bin_chunks[i])) + else: + print("Labels not found for cell ", i) + else: + print("Panel not found for index ", i) + mnemonic_out.queue_redraw() + +func setup_bip39_headers(): + var bip39_info_label = bip39_panel.get_node("BIP39Info") + if bip39_info_label: + var headers_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + bip39_info_label.text = headers_text + +func setup_launch_panel_headers(): + var vbox = launch_panel.get_node_or_null("VBoxContainer") + if not vbox: + vbox = VBoxContainer.new() + vbox.name = "VBoxContainer" + vbox.size_flags_vertical = Control.SIZE_EXPAND_FILL + launch_panel.add_child(vbox) + + var launch_info_label = vbox.get_node_or_null("LaunchInfo") + if not launch_info_label: + launch_info_label = RichTextLabel.new() + launch_info_label.name = "LaunchInfo" + launch_info_label.bbcode_enabled = true + launch_info_label.fit_content = true + launch_info_label.scroll_active = true + launch_info_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL + launch_info_label.size_flags_vertical = Control.SIZE_EXPAND_FILL + vbox.add_child(launch_info_label) + vbox.move_child(launch_info_label, 0) # Move to top + + var headers_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell][/cell] +""" + launch_info_label.text = headers_text + + +func _on_create_popup_pressed(): + + if entropy_in.text.is_empty(): + return + + if popup_window != null: + _center_popup() + popup_window.show() + return + + popup_window = Control.new() + popup_window.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + + var background = ColorRect.new() + background.color = Color(0, 0, 0, 0.5) + background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + background.connect("gui_input", Callable(self, "_on_background_gui_input")) + popup_window.add_child(background) + + var panel = Panel.new() + panel.custom_minimum_size = Vector2(400, 300) # Adjust size as needed + panel.set_anchors_preset(Control.PRESET_CENTER) + panel.set_anchor_and_offset(SIDE_LEFT, 0.5, -200) + panel.set_anchor_and_offset(SIDE_TOP, 0.5, -150) + panel.set_anchor_and_offset(SIDE_RIGHT, 0.5, 200) + panel.set_anchor_and_offset(SIDE_BOTTOM, 0.5, 150) + popup_window.add_child(panel) + + var stylebox = StyleBoxFlat.new() + stylebox.set_border_width_all(2) + stylebox.border_color = Color.WHITE + stylebox.bg_color = Color(0.15, 0.15, 0.15) + panel.add_theme_stylebox_override("panel", stylebox) + + var main_vbox = VBoxContainer.new() + main_vbox.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT, Control.PRESET_MODE_KEEP_SIZE, 10) + panel.add_child(main_vbox) + + var attention_label = Label.new() + attention_label.text = "**ATTENTION** Write down these 12 words for future wallet recovery and restoration as you will NOT see them again" + attention_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + attention_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + main_vbox.add_child(attention_label) + + var mnemonic_container = PanelContainer.new() + mnemonic_container.size_flags_vertical = Control.SIZE_EXPAND_FILL + main_vbox.add_child(mnemonic_container) + + var mnemonic_label = Label.new() + mnemonic_label.text = current_wallet_data.get("mnemonic", "") + mnemonic_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + mnemonic_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + mnemonic_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + mnemonic_container.add_child(mnemonic_label) + + var bottom_container = VBoxContainer.new() + bottom_container.size_flags_vertical = Control.SIZE_SHRINK_END + main_vbox.add_child(bottom_container) + + var question_label = Label.new() + question_label.text = "Do you want to create this wallet?" + question_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + bottom_container.add_child(question_label) + + var hbox = HBoxContainer.new() + hbox.alignment = BoxContainer.ALIGNMENT_CENTER + bottom_container.add_child(hbox) + + var yes_button = Button.new() + yes_button.text = "Yes" + yes_button.connect("pressed", Callable(self, "_on_popup_yes_pressed")) + + var no_button = Button.new() + no_button.text = "No" + no_button.connect("pressed", Callable(self, "_on_popup_close_pressed")) + + var spacer = Control.new() + spacer.custom_minimum_size.x = 100 + + hbox.add_child(no_button) + hbox.add_child(spacer) + hbox.add_child(yes_button) + + get_tree().root.add_child(popup_window) + + get_tree().root.connect("size_changed", Callable(self, "_center_popup")) + + popup_window.show() + +func _center_popup() -> void: + if popup_window != null: + var panel = popup_window.get_node("Panel") + if panel != null: + var viewport_size = get_viewport().size + panel.set_anchor_and_offset(SIDE_LEFT, 0.5, -panel.custom_minimum_size.x / 2) + panel.set_anchor_and_offset(SIDE_TOP, 0.5, -panel.custom_minimum_size.y / 2) + panel.set_anchor_and_offset(SIDE_RIGHT, 0.5, panel.custom_minimum_size.x / 2) + panel.set_anchor_and_offset(SIDE_BOTTOM, 0.5, panel.custom_minimum_size.y / 2) + +func _on_background_gui_input(event): + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: + _on_popup_close_pressed() + +func save_wallet_data(): + if current_wallet_data.is_empty(): + print("Error: No wallet data to save.") + return + + var seed_data = { + "seed_hex": current_wallet_data.get("seed", ""), + "seed_binary": current_wallet_data.get("bip39_bin", ""), + "mnemonic": current_wallet_data.get("mnemonic", "") + } + + if seed_data["seed_hex"].is_empty() or seed_data["seed_binary"].is_empty() or seed_data["mnemonic"].is_empty(): + print("Error: Incomplete wallet data. Unable to save.") + return + + var user_data_dir = OS.get_user_data_dir() + var file = FileAccess.open(user_data_dir.path_join("starters/wallet_master_seed.txt"), FileAccess.WRITE) + var json_string = JSON.stringify(seed_data) + file.store_string(json_string) + file.close() + print("Wallet data saved successfully.") + +func _on_popup_yes_pressed(): + if current_wallet_data.is_empty(): + print("Error: No wallet data to save.") + _on_popup_close_pressed() + return + + save_wallet_data() + + var Bitcoin = BitcoinWallet.new() + var sidechain_slots = get_sidechain_info() + + if not current_wallet_data.has("seed") or not current_wallet_data.has("mnemonic"): + print("Error: Incomplete wallet data. Unable to generate sidechain starters.") + _on_popup_close_pressed() + return + + var sidechain_data = Bitcoin.generate_sidechain_starters(current_wallet_data["seed"], current_wallet_data["mnemonic"], sidechain_slots) + save_sidechain_info(sidechain_data) + _on_popup_close_pressed() + if tabs: + tabs.current_tab = 1 + print("Wallet and sidechain information saved.") + +func _on_popup_close_pressed() -> void: + if popup_window != null: + popup_window.queue_free() + popup_window = null + get_tree().root.disconnect("size_changed", Callable(self, "_center_popup")) + +func _on_hide_button_toggled(button_pressed: bool): + _toggle_output_visibility(!button_pressed) + +func _toggle_output_visibility(is_visible: bool): + for i in range(1, mnemonic_out.get_child_count()): + if i != 13 and i != 26: + var label = mnemonic_out.get_child(i).get_child(0) as Label + if label: + label.visible = is_visible + + var bip39_info_label = bip39_panel.get_node("BIP39Info") + if bip39_info_label: + if is_visible: + # Restore the full content + update_bip39_panel(current_wallet_data) + else: + # Keep only headers visible + var headers_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + bip39_info_label.text = headers_text + + var launch_info_label = launch_panel.get_node("VBoxContainer/LaunchInfo") + if launch_info_label: + if is_visible: + update_launch_panel(current_wallet_data) + else: + var headers_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + launch_info_label.text = headers_text + +func _on_load_button_pressed(): + var wallet = BitcoinWallet.new() + var mnemonic = mnemonic_in.text.strip_edges().to_lower() + var words = mnemonic.split(" ") + + if words.size() != 12: + print("Error: Mnemonic must contain exactly 12 words.") + return + for word in words: + if not wallet.is_valid_bip39_word(word): + print("Error: '", word, "' is not a valid BIP39 word.") + return + print("All words in the mnemonic are valid.") + var result = wallet.generate_wallet(mnemonic) + + if result.has("error"): + print("Error generating wallet: ", result["error"]) + return + print("Wallet generated successfully:") + + # Save master wallet data in the new format + var seed_data = { + "mnemonic": result["mnemonic"], + "seed_binary": result["bip39_bin"], + "seed_hex": result["seed"] + } + var user_data_dir = OS.get_user_data_dir() + var file = FileAccess.open(user_data_dir.path_join("starters/wallet_master_seed.txt"), FileAccess.WRITE) + var json_string = JSON.stringify(seed_data) + file.store_string(json_string) + file.close() + + # Generate and save sidechain starters + var sidechain_slots = get_sidechain_info() + var sidechain_data = wallet.generate_sidechain_starters(result["seed"], result["mnemonic"], sidechain_slots) + save_sidechain_info(sidechain_data) + if tabs: + tabs.current_tab = 1 + print("Wallet and sidechain information saved.") + +func _on_fast_button_pressed(): + entropy_in.text = "" + var wallet_generator = BitcoinWallet.new() + var entropy = wallet_generator.fast_create() + entropy_in.text = entropy + _on_entropy_in_changed(entropy) + +func get_sidechain_info(): + var sidechain_info = [] + var file = FileAccess.open("res://chain_providers.cfg", FileAccess.READ) + if file: + var current_section = "" + while !file.eof_reached(): + var line = file.get_line().strip_edges() + if line.begins_with("[") and line.ends_with("]"): + current_section = line.substr(1, line.length() - 2) + elif line.begins_with("slot=") and current_section != "drivechain": + var slot = line.split("=")[1].to_int() + if slot != -1: + sidechain_info.append(slot) + return sidechain_info + +func save_sidechain_info(sidechain_data): + for key in sidechain_data.keys(): + if key.begins_with("sidechain_"): + var slot = key.split("_")[1] + var user_data_dir = OS.get_user_data_dir() + var filename = user_data_dir.path_join("starters/sidechain_%s_starter.txt" % slot) + var file = FileAccess.open(filename, FileAccess.WRITE) + if file: + file.store_string(JSON.stringify(sidechain_data[key])) + file.close() + else: + print("Failed to save sidechain starter information for slot ", slot) + +func reset_wallet_tab(): + + clear_all_output() + entropy_in.text = "" + mnemonic_in.text = "" + current_wallet_data = {} + hide_button.button_pressed = false + _toggle_output_visibility(true) + mnemonic_out.setup_grid() + current_tab = 0 + +func _on_tab_changed(tab): + if tab != get_index(): + reset_wallet_tab() + +func ensure_starters_directory(): + var user_data_dir = OS.get_user_data_dir() + var starters_dir = user_data_dir.path_join("starters") + var dir = DirAccess.open(user_data_dir) + if not dir.dir_exists("starters"): + dir.make_dir("starters") diff --git a/source/application/walletwarning.gd b/source/application/walletwarning.gd new file mode 100644 index 0000000..1f8bba3 --- /dev/null +++ b/source/application/walletwarning.gd @@ -0,0 +1,5 @@ +extends Window + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass diff --git a/source/create_wallet/AddressesOut.gd b/source/create_wallet/AddressesOut.gd new file mode 100644 index 0000000..a45b387 --- /dev/null +++ b/source/create_wallet/AddressesOut.gd @@ -0,0 +1,54 @@ +extends GridContainer + +var address_data = [ + {"Path": "m/0'/0'/0'", "PrivKey": "L5S8FnQHDM...", "Address": "1c3EpB13nVYafgYGLCVBA8gsKsAjTzRzV"}, + {"Path": "m/0'/0'/1'", "PrivKey": "KzDne4jYyB...", "Address": "13sVRT6SdTSGfWWgLWiWg4JjLHoI54rzp89gX"}, + {"Path": "m/0'/0'/2'", "PrivKey": "Ks0Q3vRo3v...", "Address": "1AnLzkCsBb5uzik8hwsj8Ymfw6dgybXhHv"}, + {"Path": "m/0'/0'/3'", "PrivKey": "LzciFh7taa...", "Address": "1Fqam1rJdjsGybKbhYol2d2aiqQqhbDLDRf"}, + {"Path": "m/0'/0'/4'", "PrivKey": "KywrRC6B71...", "Address": "1ASgCjWVCnV9ewHseLsoIdzkMpjQHTcR9cRgv"}, + {"Path": "m/0'/0'/5'", "PrivKey": "L3ighBr5vN...", "Address": "1MzXoxv35T7f9AoYHmcquhXrPoFmLT7EN9"}, + {"Path": "m/0'/0'/6'", "PrivKey": "K2X5fUw8uN...", "Address": "1B06B7Jw2VzXrthrMQzuUXoQUFWqQCHJ"}, + {"Path": "m/0'/0'/7'", "PrivKey": "LW4J3z4djR...", "Address": "1A8obBffmYsuXuJxabUryo3exNYh5kJ4SLm"}, + {"Path": "m/0'/0'/8'", "PrivKey": "KSwoxK4wtF...", "Address": "15XLVfGk67MmV5xaYSbfHbfeA9UVy9B44"}, + {"Path": "m/0'/0'/9'", "PrivKey": "K2HgQdGwvA...", "Address": "1mwdEAD4K8VDxBsMAKbfU1PursAt4tGGB81"}, + {"Path": "m/0'/0'/10'", "PrivKey": "Kc9fA73uHE...", "Address": "1Mj0w0ZEKRRf3mLhCnr9nRt5tbNCYKfMKNk"}, + {"Path": "m/0'/0'/11'", "PrivKey": "L4oV4K1QGK...", "Address": "1hWrbZDiV8fkNahn5w8a5n5tgSoBz7Hjei"}, + {"Path": "m/0'/0'/12'", "PrivKey": "Kp4vUfySZS...", "Address": "13rsDVltJgftR8V3oh42Wfcdug4p5Aj"}, + {"Path": "m/0'/0'/13'", "PrivKey": "L1XqOwsSwg...", "Address": "17hKX5rFM7zSVG4AVjPGH9J96NfMmgdGM"}, + {"Path": "m/0'/0'/14'", "PrivKey": "KzGn4utrow...", "Address": "1NgLSE3YM4wCm4NCanSzDfyRkiaKMcZazZh"}, + {"Path": "m/0'/0'/15'", "PrivKey": "L3pAEFRfQo...", "Address": "1Nic5SmKufth421r9CjxG8C8nuPGFTSmXJ"}, + {"Path": "m/0'/0'/16'", "PrivKey": "KyAq5Ktjqg...", "Address": "1SFfwRYmWy7tdRiLxrDrs8Q2aUAWsmMpM"}, + {"Path": "m/0'/0'/17'", "PrivKey": "L2mQXwq4Bd...", "Address": "18LwMd83Wf3eV8spNj1pYYF7XS5z2rS3"}, + {"Path": "m/0'/0'/18'", "PrivKey": "KwmS6R8wzG...", "Address": "17jCsKExwW3buv2Apx5zN2G6H8M5qKqxL7"}, + {"Path": "m/0'/0'/19'", "PrivKey": "LXVq8Nswg...", "Address": "1hK5PXFrM7zSVG4AVjPGH9J96NfMmgdGM"}, + {"Path": "m/0'/0'/20'", "PrivKey": "L4ZgAn5RTE...", "Address": "1BAz7CyzYyPxpBqJ4Ax4YwHf8B9gUXY"}, + {"Path": "m/0'/0'/21'", "PrivKey": "L2Gy4LqCNE...", "Address": "1BJkTSy3NQpfHTytHn6j1PKfNEFnDtmvTA"}, + {"Path": "m/0'/0'/22'", "PrivKey": "K2GyJt4wBz...", "Address": "14M5NwZL4WANc5zAMV4CnmPzT5W4MdC4"}, + {"Path": "m/0'/0'/23'", "PrivKey": "L3ijXRyED6...", "Address": "1pBkkfdFkUWAAfwboQ13PSmTn9tRyaHyWN"}, + {"Path": "m/0'/0'/24'", "PrivKey": "LXVVx2Mgp...", "Address": "1JHf6NLJ3iwbXYTbKehMja6Z9bKnBAmntXSo"}, + {"Path": "m/0'/0'/25'", "PrivKey": "L2Qk0LApm...", "Address": "15JvNGSNaZyUq4F8Fh1Nuzo4gfCHHXSDo"}, + {"Path": "m/0'/0'/26'", "PrivKey": "LZK1ggn5Rp...", "Address": "1Ak8YsbTxeARnb8Whb4aHckbuwwF1XFL"}, + {"Path": "m/0'/0'/27'", "PrivKey": "L2MsQdT8Ek...", "Address": "1Hj5neIJoobDxmXyz1XpXaAysF8exue3y9"}, + {"Path": "m/0'/0'/28'", "PrivKey": "KxMgeAQFhx...", "Address": "1Kv5tEkdA7DHqM4rW6ypE8AnPLDMSdCpDc"}, + {"Path": "m/0'/0'/29'", "PrivKey": "L2XysnSMoW...", "Address": "18TFHNsQ3OtzYuzyjGNUTn4J6WMaSdQ3dKE"} +] + +func _ready(): + # Add header labels + add_label("Path", true) + add_label("PrivKey", true) + add_label("Address", true) + + # Add data labels + for data in address_data: + add_label(data["Path"], false) + add_label(data["PrivKey"], false) + add_label(data["Address"], false) + +func add_label(text: String, is_header: bool): + var label = Label.new() + label.text = text + if is_header: + label.add_theme_color_override("font_color", Color(1, 1, 1)) # White color for header + label.add_theme_color_override("font_color", Color(0.8, 0.8, 0.8)) # Light gray color for data + add_child(label) diff --git a/source/create_wallet/BIP39Out.gd b/source/create_wallet/BIP39Out.gd new file mode 100644 index 0000000..e45558b --- /dev/null +++ b/source/create_wallet/BIP39Out.gd @@ -0,0 +1,16 @@ +extends RichTextLabel + +func _ready(): + clear() + append_text("bip39 hex: 1998a88b5f37913e6dd468330fdeb8b3\n") + append_text("bip39 dec: 34023347504116446333364760405602121907\n") + append_text("bip39 bin: 0001 1001 1000 1010 1000 1000 0101 1111 0011 1001 0001 0011 1110 0110 1101 1101 0100 0110 1000 0011 0011 0000 1111 1101 1110 1011 1000 1011 0011 ") + push_color(Color(1, .5, 0)) # Set color to blue + append_text("1110\n") + pop() # Revert to previous color + append_text("bip39 csum: 'e' ") + push_color(Color(1, .5, 0)) # Set color to blue + append_text("1110\n") + pop() + append_text("HD key data: e6242ece817a1aed46ae3cda9a78bdfa6652a9b7cb5690849b6b442ad0d478c4\n\n") + append_text("BIP39 Mnemonic Words: ") diff --git a/source/create_wallet/GridContainer.gd b/source/create_wallet/GridContainer.gd new file mode 100644 index 0000000..9cda1a5 --- /dev/null +++ b/source/create_wallet/GridContainer.gd @@ -0,0 +1,48 @@ +extends GridContainer + +# Example data +var mnemonic_data = [ + {"bitstream": "000 1100 1100", "index": "204", "word": "book"}, + {"bitstream": "110 0010 1010", "index": "1578", "word": "shed"}, + {"bitstream": "001 0001 0110", "index": "278", "word": "carpet"}, + {"bitstream": "101 1111 0011", "index": "1523", "word": "salmon"}, + {"bitstream": "011 1100 1000", "index": "968", "word": "jungle"}, + {"bitstream": "100 1111 1001", "index": "1273", "word": "palace"}, + {"bitstream": "101 1011 1010", "index": "1466", "word": "resemble"}, + {"bitstream": "100 0110 1000", "index": "1128", "word": "minimum"}, + {"bitstream": "001 1001 1000", "index": "408", "word": "credit"}, + {"bitstream": "101 1111 0111", "index": "1015", "word": "leave"}, + {"bitstream": "101 0111 0001", "index": "1393", "word": "purchase"}, + {"bitstream": "011 0011 1110", "index": "830", "word": "guitar"}, +] + +func _ready(): + # Load necessary headers using relative paths + + add_label("Bitstream", true) + add_empty_label() + add_label("Index", true) + add_empty_label() + add_label("Word", true) + + # Add data labels with empty columns + for data in mnemonic_data: + add_label(data["bitstream"], false) + add_empty_label() + add_label(data["index"], false) + add_empty_label() + add_label(data["word"], false) + +func add_label(text: String, is_header: bool): + var label = Label.new() + label.text = text + if is_header: + label.add_theme_color_override("font_color", Color(1, 1, 1)) # White color for header + else: + label.add_theme_color_override("font_color", Color(0.8, 0.8, 0.8)) # Light gray color for data + add_child(label) + +func add_empty_label(): + var empty_label = Label.new() + empty_label.text = "" # Add an empty string to create a blank column + add_child(empty_label) diff --git a/source/create_wallet/GridLines.gd b/source/create_wallet/GridLines.gd new file mode 100644 index 0000000..e69de29 diff --git a/source/create_wallet/create_wallet.gd b/source/create_wallet/create_wallet.gd new file mode 100644 index 0000000..d2af206 --- /dev/null +++ b/source/create_wallet/create_wallet.gd @@ -0,0 +1,15 @@ +extends Node + +const PBKDF2_ROUNDS = 2048 +const MASTER_KEY_DERIVATION_PATH = "m/44'/0'/0'/0" +const HARDENED_OFFSET = 0x80000000 +const CHAIN_CODE_SIZE = 32 # Size of the chain code in bytes + +@onready var input = $VBoxContainer/HBoxContainer/TextIn +@onready var bin_out = $VBoxContainer/HBoxContainer2/VBoxContainer/BIP39Out +@onready var words_out = $VBoxContainer/HBoxContainer2/VBoxContainer/WordList +@onready var xpriv_out = $VBoxContainer/HBoxContainer2/VBoxContainer2/HBoxContainer/XprivOut +@onready var addr_out = $VBoxContainer/HBoxContainer2/VBoxContainer2/AddressesOut + +func _ready(): + pass diff --git a/source/create_wallet/create_wallet.tscn b/source/create_wallet/create_wallet.tscn new file mode 100644 index 0000000..e17fca7 --- /dev/null +++ b/source/create_wallet/create_wallet.tscn @@ -0,0 +1,193 @@ +[gd_scene load_steps=5 format=3 uid="uid://cc78xth4uud1q"] + +[ext_resource type="Script" path="res://ui/components/create_wallet/create_wallet.gd" id="1_d07s6"] +[ext_resource type="Script" path="res://ui/components/create_wallet/BIP39Out.gd" id="2_lfssg"] +[ext_resource type="Script" path="res://ui/components/create_wallet/GridContainer.gd" id="3_jhb0n"] +[ext_resource type="Script" path="res://ui/components/create_wallet/AddressesOut.gd" id="4_8qpfl"] + +[node name="CreateWallet" type="MarginContainer"] +clip_contents = true +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -75.0 +offset_top = 4.0 +offset_right = 76.0 +offset_bottom = 2.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_d07s6") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 1 + +[node name="Control" type="Control" parent="VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 60) +layout_mode = 2 +size_flags_stretch_ratio = 0.25 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +clip_contents = true +layout_mode = 2 +size_flags_vertical = 2 +alignment = 1 + +[node name="Spacer" type="Control" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(50, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="TextIn" type="LineEdit" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(600, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +placeholder_text = "Enter plain text to generate 256 bit entropy hash" +alignment = 1 + +[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_stretch_ratio = 0.0 +text = "Random" + +[node name="Spacer3" type="Control" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(50, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +bbcode_enabled = true +text = "[center] Basic" +fit_content = true + +[node name="CheckButton" type="CheckButton" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 + +[node name="RichTextLabel3" type="RichTextLabel" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(70, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +bbcode_enabled = true +text = "[center] Advanced" +fit_content = true + +[node name="Spacer5" type="Control" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(40, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="Spacer3" type="Control" parent="VBoxContainer"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +alignment = 1 + +[node name="Spacer1" type="Control" parent="VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(30, 2.08165e-12) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(500, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 1 +alignment = 1 + +[node name="BIP39Out" type="RichTextLabel" parent="VBoxContainer/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +bbcode_enabled = true +fit_content = true +scroll_active = false +script = ExtResource("2_lfssg") + +[node name="WordList" type="GridContainer" parent="VBoxContainer/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 5 +script = ExtResource("3_jhb0n") + +[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer2/VBoxContainer"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(30, 2.08165e-12) +layout_mode = 2 + +[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +alignment = 1 + +[node name="Spacer1" type="Control" parent="VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="WalletHeader" type="RichTextLabel" parent="VBoxContainer/HBoxContainer2/VBoxContainer2"] +layout_mode = 2 +text = "Wallet Addresses: +" +fit_content = true + +[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/VBoxContainer2"] +clip_contents = true +layout_mode = 2 +size_flags_vertical = 2 + +[node name="XprivHeader" type="RichTextLabel" parent="VBoxContainer/HBoxContainer2/VBoxContainer2/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +text = "xpriv (Do not share):" +fit_content = true + +[node name="XprivOut" type="RichTextLabel" parent="VBoxContainer/HBoxContainer2/VBoxContainer2/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +fit_content = true + +[node name="AddressesOut" type="GridContainer" parent="VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 250) +layout_mode = 2 +size_flags_vertical = 3 +columns = 3 +script = ExtResource("4_8qpfl") diff --git a/source/fast_withdrawal/fast_withdraw-new.gd b/source/fast_withdrawal/fast_withdraw-new.gd new file mode 100644 index 0000000..e22540f --- /dev/null +++ b/source/fast_withdrawal/fast_withdraw-new.gd @@ -0,0 +1,133 @@ +extends Control + +const SERVER_LOCALHOST : String = "127.0.0.1" +const SERVER_L2L_GA : String = "172.105.148.135" +const PORT : int = 8382 + +var invoice_address : String = "" +var connected_to_server : bool = false +var selected_chain : String = "" + +signal fast_withdraw_server_connection_status_changed + +func _ready() -> void: + $LabelConnectionStatus.visible = false + + selected_chain = $"/root/Net".FAST_WITHDRAW_CHAIN_TESTCHAIN + + multiplayer.connected_to_server.connect(_on_connected_to_withdrawal_server) + multiplayer.connection_failed.connect(_on_failed_connect_to_withdrawal_server) + multiplayer.server_disconnected.connect(_on_disconnected_from_withdrawal_server) + + $"/root/Net".fast_withdraw_invoice.connect(_on_fast_withdraw_invoice) + $"/root/Net".fast_withdraw_complete.connect(_on_fast_withdraw_complete) + + +func _on_connected_to_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Connected to fast withdraw server") + + $LabelConnectionStatus.text = "Connected" + + connected_to_server = true + fast_withdraw_server_connection_status_changed.emit() + + +func _on_disconnected_from_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Disonnected from fast withdraw server") + + $LabelConnectionStatus.text = "Disconnected" + $LabelInvoice.text = "" + connected_to_server = false + fast_withdraw_server_connection_status_changed.emit() + + +func _on_failed_connect_to_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Failed to connect to fast withdraw server") + + $LabelConnectionStatus.text = "Not Connected" + + connected_to_server = false + fast_withdraw_server_connection_status_changed.emit() + + +func connect_to_withdrawal_server() -> void: + # Create fast withdraw client + var peer = ENetMultiplayerPeer.new() + if $CheckButtonLocalhost.is_pressed(): + if $"/root/Net".print_debug_net: + print("Using fast withdraw server: localhost") + + var error = peer.create_client(SERVER_LOCALHOST, PORT) + if error and $"/root/Net".print_debug_net: + print_debug("Error: ", error) + else: + if $"/root/Net".print_debug_net: + print("Using fast withdraw server: L2L-GA") + var error = peer.create_client(SERVER_L2L_GA, PORT) + if error and $"/root/Net".print_debug_net: + print_debug("Error: ", error) + + $LabelConnectionStatus.text = "Connecting..." + + multiplayer.multiplayer_peer = peer + + +func _on_fast_withdraw_invoice(amount : float, destination: String) -> void: + if $"/root/Net".print_debug_net: + print("Received fast withdraw invoice!") + print("Amount: ", amount) + print("Destination: ", destination) + + var invoice_text = "Fast withdraw request received! Invoice created:\n" + invoice_text += str("Send ", amount, " L2 coins to ", destination, "\n") + invoice_text += "Once you have paid enter the L2 txid and hit invoice paid" + + invoice_address = destination + + $LabelInvoice.text = invoice_text + + +func _on_fast_withdraw_complete(txid: String, amount : float, destination: String) -> void: + if $"/root/Net".print_debug_net: + print("Fast withdraw complete!") + print("TxID: ", txid) + print("Amount: ", amount) + print("Destination: ", destination) + + var output : String = "Withdraw complete!\n" + output += "Mainchain payout txid:\n" + txid + "\n" + output += "Amount: " + str(amount) + "\n" + output += "Destination: " + destination + "\n" + $LabelComplete.text = output + + if multiplayer.multiplayer_peer: + multiplayer.multiplayer_peer.close() + + +func _on_button_copy_address_pressed() -> void: + DisplayServer.clipboard_set(invoice_address) + + +func _on_button_invoice_paid_pressed() -> void: + # Tell the server we paid + var txid : String = $LineEditTXID.text + $"/root/Net".invoice_paid.rpc_id(1, selected_chain, txid, $SpinBoxAmount.value, $LineEditMainchainAddress.text) + + +func _on_button_request_invoice_pressed() -> void: + # Establish connection with fast withdraw server + connect_to_withdrawal_server() + $LabelConnectionStatus.visible = true + + await fast_withdraw_server_connection_status_changed + + # Send fast withdraw request only to server + $"/root/Net".request_fast_withdraw.rpc_id(1, $SpinBoxAmount.value, selected_chain, $LineEditMainchainAddress.text) + + +func _on_chain_selection_button_item_selected(index): + var selection_index = $ChainSelectionButton.get_selected() + selected_chain = $ChainSelectionButton.get_item_text(selection_index) diff --git a/source/fast_withdrawal/fast_withdraw-new.tscn b/source/fast_withdrawal/fast_withdraw-new.tscn new file mode 100644 index 0000000..658b501 --- /dev/null +++ b/source/fast_withdrawal/fast_withdraw-new.tscn @@ -0,0 +1,180 @@ +[gd_scene load_steps=2 format=3 uid="uid://duvvgc45h86gp"] + +[ext_resource type="Script" path="res://ui/components/fast_withdraw/fast_withdraw.gd" id="1_4itd0"] + +[node name="FastWithdraw" type="VBoxContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_4itd0") + +[node name="Control2" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(10, 2.08165e-12) +layout_mode = 2 + +[node name="LineEditMainchainAddress" type="LineEdit" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Enter mainchain address" +expand_to_text_length = true + +[node name="Control2" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 + +[node name="Label" type="Label" parent="HBoxContainer"] +layout_mode = 2 +text = "Amount to withdraw: +" + +[node name="Control3" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 + +[node name="SpinBoxAmount" type="SpinBox" parent="HBoxContainer"] +layout_mode = 2 +min_value = 1.0 +value = 1.0 +suffix = "BTC" + +[node name="Control4" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(10, 2.08165e-12) +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="Control" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 10) +layout_mode = 2 + +[node name="Label2" type="Label" parent="."] +layout_mode = 2 +text = " Sidechain to withdraw from: +" + +[node name="Control6" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control2" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(25, 2.08165e-12) +layout_mode = 2 + +[node name="ChainSelectionButton" type="OptionButton" parent="HBoxContainer2"] +layout_mode = 2 +item_count = 3 +selected = 0 +popup/item_0/text = "Testchain" +popup/item_0/id = 0 +popup/item_1/text = "Thunder" +popup/item_1/id = 1 +popup/item_2/text = "ZSide" +popup/item_2/id = 2 + +[node name="Control3" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="ButtonRequestInvoice" type="Button" parent="HBoxContainer2"] +layout_mode = 2 +text = "Request fast withdrawal test invoice" + +[node name="Control4" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="LabelConnectionStatus" type="Label" parent="HBoxContainer2"] +layout_mode = 2 +text = "Not Connected" + +[node name="Control5" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="LabelInvoice" type="Label" parent="."] +layout_mode = 2 + +[node name="LabelComplete" type="Label" parent="."] +layout_mode = 2 + +[node name="ButtonCopyAddress" type="Button" parent="."] +custom_minimum_size = Vector2(200, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 4 +text = "Copy Address +" + +[node name="Control3" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="Control4" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer4"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="LineEditTXID" type="LineEdit" parent="HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Enter L2 payment txid" +expand_to_text_length = true + +[node name="Control6" type="Control" parent="HBoxContainer4"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="Control5" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="ButtonInvoicePaid" type="Button" parent="HBoxContainer3"] +layout_mode = 2 +text = "Invoice Paid" + +[node name="Control6" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="CheckButtonLocalhost" type="CheckButton" parent="HBoxContainer3"] +custom_minimum_size = Vector2(200, 2.08165e-12) +layout_mode = 2 +text = "Debug server" + +[node name="Control7" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[connection signal="pressed" from="HBoxContainer2/ButtonRequestInvoice" to="." method="_on_button_request_invoice_pressed"] +[connection signal="pressed" from="ButtonCopyAddress" to="." method="_on_button_copy_address_pressed"] +[connection signal="pressed" from="HBoxContainer3/ButtonInvoicePaid" to="." method="_on_button_invoice_paid_pressed"] diff --git a/source/fast_withdrawal/fast_withdrawal.tscn b/source/fast_withdrawal/fast_withdrawal.tscn new file mode 100644 index 0000000..f6d4744 --- /dev/null +++ b/source/fast_withdrawal/fast_withdrawal.tscn @@ -0,0 +1,90 @@ +[gd_scene format=3 uid="uid://e2rdtqaxmy0a"] + +[node name="Wallet" type="MarginContainer"] +custom_minimum_size = Vector2(835, 553) + +[node name="TabContainer" type="TabContainer" parent="."] +layout_mode = 2 +tabs_visible = false + +[node name="Window" type="VBoxContainer" parent="TabContainer"] +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="Panel" type="Panel" parent="TabContainer/Window"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="BoxContainer" type="BoxContainer" parent="TabContainer/Window/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 3 +theme_override_constants/separation = 16 + +[node name="Control" type="Control" parent="TabContainer/Window/Panel/BoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="LineEdit" type="TextEdit" parent="TabContainer/Window/Panel/BoxContainer"] +custom_minimum_size = Vector2(300, 30) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 + +[node name="ColorRect" type="ColorRect" parent="TabContainer/Window/Panel"] +layout_mode = 2 +offset_right = 833.0 +offset_bottom = 424.0 +size_flags_horizontal = 3 +color = Color(0.278431, 0.278431, 0.278431, 1) + +[node name="RichTextLabel" type="Label" parent="TabContainer/Window/Panel/ColorRect"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 44 +text = "Click the button +to create wallet or choose advanced + mode for further customization." +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ConnectionContainer" type="HBoxContainer" parent="TabContainer/Window"] +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="LabelConnectionStatus" type="Label" parent="TabContainer/Window/ConnectionContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 20 +horizontal_alignment = 1 + +[node name="Create" type="Button" parent="TabContainer/Window/ConnectionContainer"] +custom_minimum_size = Vector2(107, 40) +layout_mode = 2 +focus_mode = 0 +text = "Create Wallet +" + +[node name="Advanced" type="CheckButton" parent="TabContainer/Window/ConnectionContainer"] +custom_minimum_size = Vector2(319, 0) +layout_mode = 2 +focus_mode = 0 +text = "Advanced Mode" +flat = true +alignment = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="TabContainer/Window"] +custom_minimum_size = Vector2(2.08165e-12, 50) +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="Spacer" type="Control" parent="TabContainer/Window/HBoxContainer2"] +layout_mode = 2 diff --git a/ui/components/dashboard/chain_providers_info/chain_provider_info.gd b/source/nodes/chain_providers_info/chain_provider_info.gd similarity index 93% rename from ui/components/dashboard/chain_providers_info/chain_provider_info.gd rename to source/nodes/chain_providers_info/chain_provider_info.gd index fafb01a..2c3819d 100644 --- a/ui/components/dashboard/chain_providers_info/chain_provider_info.gd +++ b/source/nodes/chain_providers_info/chain_provider_info.gd @@ -5,7 +5,7 @@ extends ColorRect @onready var remote_hash = $Center/Panel/Margin/VBox/RemoteHash/Hash @onready var directory = $Center/Panel/Margin/VBox/SidechainDirectory/Value @onready var local_hash = $Center/Panel/Margin/VBox/LocalHash/Hash -@onready var reset_sidechain_window_scene = load("res://ui/components/dashboard/chain_providers_info/reset_sidechain_window.tscn") +@onready var reset_sidechain_window_scene = load("res://source/nodes/chain_providers_info/reset_sidechain_window.tscn") var chain_provider: ChainProvider func setup(_chain_provider: ChainProvider): @@ -46,5 +46,3 @@ func _on_reset_button_pressed() -> void: var reset_sidechain_window = reset_sidechain_window_scene.instantiate() reset_sidechain_window.setup(chain_provider) # Pass the existing chain_provider to the new window get_tree().root.get_node("Main").add_child(reset_sidechain_window) - - diff --git a/ui/components/dashboard/chain_providers_info/chain_provider_info.tscn b/source/nodes/chain_providers_info/chain_provider_info.tscn similarity index 92% rename from ui/components/dashboard/chain_providers_info/chain_provider_info.tscn rename to source/nodes/chain_providers_info/chain_provider_info.tscn index bb91d84..9dd55be 100644 --- a/ui/components/dashboard/chain_providers_info/chain_provider_info.tscn +++ b/source/nodes/chain_providers_info/chain_provider_info.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://cafws02qn1h2f"] -[ext_resource type="FontFile" uid="uid://b1w37357tl3er" path="res://assets/fonts/Cantarell-Bold.ttf" id="1_a0rcy"] -[ext_resource type="Script" path="res://ui/components/dashboard/chain_providers_info/chain_provider_info.gd" id="1_mqwgc"] -[ext_resource type="Texture2D" uid="uid://hcq0d87vm0xk" path="res://assets/images/folder-open-symbolic 1.svg" id="2_x056b"] +[ext_resource type="Script" path="res://source/nodes/chain_providers_info/chain_provider_info.gd" id="1_0uufu"] +[ext_resource type="FontFile" uid="uid://b1w37357tl3er" path="res://assets/fonts/Cantarell-Bold.ttf" id="2_jumpv"] +[ext_resource type="Texture2D" uid="uid://hcq0d87vm0xk" path="res://assets/images/folder-open-symbolic 1.svg" id="3_3cbqg"] [node name="ChainProviderInfo" type="ColorRect"] anchors_preset = 15 @@ -13,7 +13,7 @@ grow_vertical = 2 size_flags_horizontal = 3 size_flags_vertical = 3 color = Color(0, 0, 0, 0.721569) -script = ExtResource("1_mqwgc") +script = ExtResource("1_0uufu") [node name="Center" type="CenterContainer" parent="."] layout_mode = 1 @@ -43,7 +43,7 @@ size_flags_vertical = 4 [node name="Title" type="Label" parent="Center/Panel/Margin/VBox/Titlebar"] layout_mode = 2 -theme_override_fonts/font = ExtResource("1_a0rcy") +theme_override_fonts/font = ExtResource("2_jumpv") theme_override_font_sizes/font_size = 24 text = "Settings" vertical_alignment = 1 @@ -103,7 +103,7 @@ expand_to_text_length = true [node name="Button" type="Button" parent="Center/Panel/Margin/VBox/SidechainDirectory"] layout_mode = 2 -icon = ExtResource("2_x056b") +icon = ExtResource("3_3cbqg") [node name="LocalHash" type="HBoxContainer" parent="Center/Panel/Margin/VBox"] layout_mode = 2 diff --git a/ui/components/dashboard/chain_providers_info/reset_sidechain_window.gd b/source/nodes/chain_providers_info/reset_sidechain_window.gd similarity index 100% rename from ui/components/dashboard/chain_providers_info/reset_sidechain_window.gd rename to source/nodes/chain_providers_info/reset_sidechain_window.gd diff --git a/ui/components/dashboard/chain_providers_info/reset_sidechain_window.tscn b/source/nodes/chain_providers_info/reset_sidechain_window.tscn similarity index 92% rename from ui/components/dashboard/chain_providers_info/reset_sidechain_window.tscn rename to source/nodes/chain_providers_info/reset_sidechain_window.tscn index 44a0a36..e7df166 100644 --- a/ui/components/dashboard/chain_providers_info/reset_sidechain_window.tscn +++ b/source/nodes/chain_providers_info/reset_sidechain_window.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=3 format=3 uid="uid://cpud5qbwgtucx"] -[ext_resource type="Script" path="res://ui/components/dashboard/chain_providers_info/reset_sidechain_window.gd" id="1_eqo5x"] +[ext_resource type="Script" path="res://source/nodes/chain_providers_info/reset_sidechain_window.gd" id="1_eqo5x"] [ext_resource type="Theme" uid="uid://b730juygqetth" path="res://ui/themes/dangerous_button.tres" id="2_jkg3p"] [node name="ResetSidechainWindow" type="ColorRect"] +texture_filter = 4 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -39,15 +40,15 @@ size_flags_vertical = 4 theme_override_constants/separation = 10 [node name="Label" type="Label" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"] +texture_filter = 4 custom_minimum_size = Vector2(500, 0) layout_mode = 2 -text = "fsafasdfdfasf -" horizontal_alignment = 1 vertical_alignment = 3 autowrap_mode = 2 [node name="Button" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"] +texture_filter = 4 layout_mode = 2 size_flags_horizontal = 4 text = "Reset and backup wallets @@ -58,6 +59,7 @@ custom_minimum_size = Vector2(0, 8) layout_mode = 2 [node name="Label2" type="Label" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"] +texture_filter = 4 custom_minimum_size = Vector2(500, 0) layout_mode = 2 text = "Choose \"Reset everything\" to get a fresh install of the Launcher and to delete all sidechains and all wallets." @@ -66,6 +68,7 @@ vertical_alignment = 3 autowrap_mode = 2 [node name="Button2" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"] +texture_filter = 4 layout_mode = 2 size_flags_horizontal = 4 theme = ExtResource("2_jkg3p") diff --git a/source/nodes/dashboard.gd b/source/nodes/dashboard.gd new file mode 100644 index 0000000..20cfc19 --- /dev/null +++ b/source/nodes/dashboard.gd @@ -0,0 +1,70 @@ +extends MarginContainer + +@onready var scroll_container = $ScrollContainer +@onready var window = scroll_container.get_node("Window") +var panel = preload("res://source/nodes/node_panel/node_panel.tscn") +const CUSTOM_FONT_PATH = "res://assets/fonts/Satoshi-Bold.otf" + +@export var panel_vertical_spacing: float = 6 # Adjust this value to increase/decrease spacing + +func _ready(): + Appstate.connect("chain_providers_changed", self._on_chain_providers_changed) + Appstate.connect("drivechain_downloaded", Callable(self, "_on_drivechain_downloaded")) + _on_chain_providers_changed() + +func _on_drivechain_downloaded(): + for panel in get_node_panels(): + panel.update_view() + +func get_node_panels(): + return get_tree().get_nodes_in_group("node_panels") + +func _on_chain_providers_changed(): + # Remove all existing children from window + var current_panels = window.get_children() + for p in current_panels: + window.remove_child(p) + p.queue_free() + + var chain_providers = Appstate.chain_providers + var chain_states = Appstate.chain_states + + # Add available providers first + add_providers(chain_providers, chain_states, true) + + # Add unavailable providers + add_providers(chain_providers, chain_states, false) + +func add_providers(chain_providers, chain_states, available: bool): + for k in chain_providers: + var cp = chain_providers[k] + if cp.available_for_platform() == available: + if chain_states.has(k): + var cs = chain_states[k] + var p = panel.instantiate() + p.name = "panel_" + cp.id + window.add_child(p) + p.setup(cp, cs) + + # Apply custom font to the panel + apply_custom_font(p) + + # Add vertical spacing + var spacer = Control.new() + spacer.custom_minimum_size.y = panel_vertical_spacing + window.add_child(spacer) + +func set_panel_spacing(spacing: float): + panel_vertical_spacing = spacing + _on_chain_providers_changed() + +func apply_custom_font(node: Node): + var custom_font = load(CUSTOM_FONT_PATH) + if custom_font: + apply_font_recursive(node, custom_font) + +func apply_font_recursive(node: Node, font: Font): + if node is Label or node is Button or node is LineEdit or node is TextEdit: + node.add_theme_font_override("font", font) + for child in node.get_children(): + apply_font_recursive(child, font) diff --git a/source/nodes/node_panel/ActionButton.gd b/source/nodes/node_panel/ActionButton.gd new file mode 100644 index 0000000..8731066 --- /dev/null +++ b/source/nodes/node_panel/ActionButton.gd @@ -0,0 +1,36 @@ +extends Button +class_name ActionButton + +enum { + DOWNLOAD, + RUN, + STOP +} + +const state_name : Array[String] = [ + "Download", + "Run", + "Stop" +] + +@export_enum("Download", "Run", "Stop") var state : int = DOWNLOAD +@export var show_icon : bool = true +@export_file("*.svg", "*.png") var Download_Icon : String +@export_color_no_alpha var Download_Color : Color = Color.RED +@export_file("*.svg", "*.png") var Run_Icon : String +@export_color_no_alpha var Run_Color : Color = Color.BLUE +@export_file("*.svg", "*.png") var Stop_Icon : String +@export_color_no_alpha var Stop_Color : Color = Color.GREEN + +@onready var Context_Color : Array[Color] = [Download_Color, Run_Color, Stop_Color] + + +func _ready(): + set_state(state) + + +func set_state(new_state:int): + if new_state == state: return + state = new_state + set_text(state_name[state]) + theme diff --git a/source/nodes/node_panel/download.gd b/source/nodes/node_panel/download.gd new file mode 100644 index 0000000..0966ebe --- /dev/null +++ b/source/nodes/node_panel/download.gd @@ -0,0 +1,63 @@ +class_name DownloadButton extends Button + +signal action_requested(action) + +const DOWNLOAD_ICON = preload("res://assets/images/download-cloud-svgrepo.svg") +const RUN_ICON = preload("res://assets/images/play-svgrepo-com.svg") +const STOP_ICON = preload("res://assets/images/stop-circle-svgrepo-com.svg") +const CUSTOM_FONT = preload("res://assets/fonts/Satoshi-Regular.otf") + +enum STATE { NOT_DOWNLOADED, DOWNLOADING, NOT_RUNNING, RUNNING } + +var current_state = STATE.NOT_DOWNLOADED + +@onready var label: Label = $MarginContainer/HBoxContainer/Label +@onready var icon_box: TextureRect = $MarginContainer/HBoxContainer/IconBox +@onready var background_color: Panel = $BackgroundColor +@onready var progress_bar: ProgressBar = $ProgressBar + +func _ready(): + pressed.connect(_on_pressed) + + # Set the custom font for the label + var font_variation = FontVariation.new() + font_variation.set_base_font(CUSTOM_FONT) + label.add_theme_font_override("font", font_variation) + +func set_state(new_state: STATE): + current_state = new_state + match current_state: + STATE.NOT_DOWNLOADED: + label.text = "DOWNLOAD" + icon_box.texture = DOWNLOAD_ICON + background_color.self_modulate = Color.DARK_ORANGE + disabled = false + STATE.DOWNLOADING: + label.text = "DOWNLOADING" + disabled = true + background_color.hide() + progress_bar.show() + STATE.NOT_RUNNING: + label.text = "RUN" + icon_box.texture = RUN_ICON + background_color.self_modulate = Color.DODGER_BLUE + background_color.show() + progress_bar.hide() + disabled = false + STATE.RUNNING: + label.text = "RUNNING" + icon_box.texture = STOP_ICON + background_color.self_modulate = Color.FOREST_GREEN + disabled = false + +func update_enabled_state(is_drivechain: bool, drivechain_downloaded: bool): + disabled = not (is_drivechain or drivechain_downloaded) + +func _on_pressed(): + match current_state: + STATE.NOT_DOWNLOADED: + emit_signal("action_requested", "download") + STATE.NOT_RUNNING: + emit_signal("action_requested", "run") + STATE.RUNNING: + emit_signal("action_requested", "stop") diff --git a/source/nodes/node_panel/download.tscn b/source/nodes/node_panel/download.tscn new file mode 100644 index 0000000..1a5467c --- /dev/null +++ b/source/nodes/node_panel/download.tscn @@ -0,0 +1,133 @@ +[gd_scene load_steps=9 format=3 uid="uid://cjfcxi77d8pjt"] + +[ext_resource type="Script" path="res://source/nodes/node_panel/download.gd" id="1_no5dn"] +[ext_resource type="Texture2D" uid="uid://sitylibnubgw" path="res://assets/images/download-cloud-svgrepo.svg" id="2_g8yfn"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2befl"] +bg_color = Color(1, 1, 1, 1) +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wv7kr"] +bg_color = Color(0.329412, 0.329412, 0.329412, 1) +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y51ws"] +bg_color = Color(0.133333, 0.545098, 0.133333, 1) +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 + +[sub_resource type="Animation" id="Animation_rsgv1"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("BackgroundColor:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 0, 0, 1)] +} + +[sub_resource type="Animation" id="Animation_cyqiw"] +resource_name = "shimmer" +loop_mode = 1 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("BackgroundColor:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.5, 1), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Color(1, 0, 0, 1), Color(0.8, 0, 0, 1), Color(1, 0, 0, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_gnfrs"] +_data = { +"RESET": SubResource("Animation_rsgv1"), +"shimmer": SubResource("Animation_cyqiw") +} + +[node name="Download" type="Button"] +custom_minimum_size = Vector2(160, 32) +size_flags_vertical = 4 +focus_mode = 0 +script = ExtResource("1_no5dn") + +[node name="BackgroundColor" type="Panel" parent="."] +self_modulate = Color(1, 0, 0, 1) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_2befl") + +[node name="ProgressBar" type="ProgressBar" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_wv7kr") +theme_override_styles/fill = SubResource("StyleBoxFlat_y51ws") +show_percentage = false + +[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 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="IconBox" type="TextureRect" parent="MarginContainer/HBoxContainer"] +texture_filter = 4 +custom_minimum_size = Vector2(24, 24) +layout_mode = 2 +texture = ExtResource("2_g8yfn") +expand_mode = 1 +stretch_mode = 5 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer"] +texture_filter = 4 +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 15 +text = "DOWNLOAD" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Timer" type="Timer" parent="."] +wait_time = 5.0 +one_shot = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_gnfrs") +} diff --git a/source/nodes/node_panel/node_panel.gd b/source/nodes/node_panel/node_panel.gd new file mode 100644 index 0000000..119e538 --- /dev/null +++ b/source/nodes/node_panel/node_panel.gd @@ -0,0 +1,408 @@ +class_name NodePanel extends Control + +var chain_provider: ChainProvider +var chain_state: ChainState + +const HEADER_PANEL_STYLE_BOX = preload("res://resource/style_box/nodes/header_panel_style.stylebox") + +@export var drivechain_title_font_size : int = 32 +@export var drivechain_descr_font_size : int = 16 +@export var drivechain_minimum_height : int = 100 +@export var subchain_title_font_size : int = 20 +@export var subchain_descr_font_size : int = 16 +@export var subchain_minimum_height : int = 70 +@onready var overlay: ColorRect = $Overlay + +@onready var download_button: DownloadButton = $MarginContainer/Container/Header/Download +@onready var heading_label: Label = $MarginContainer/Container/Header/Heading +@onready var description_label: Label = $MarginContainer/Container/Description +@onready var shimmer_effect: TextureRect = $ShimmerEffect +@onready var panel: Panel = $MarginContainer/Panel +@onready var progress_bar: ProgressBar = $MarginContainer/Container/Header/Download/ProgressBar +@onready var delete_button: Button = $MarginContainer/Container/Header/Delete +@onready var settings_button: Button = $MarginContainer/Container/Header/Settings + +var download_req: HTTPRequest +var progress_timer: Timer +var cooldown_timer: Timer + +const BACKUP_DIR_NAME := "wallets_backup" +const WALLET_INFO_PATH := "user://wallets_backup/wallet_info.json" + +var is_drivechain: bool = false + +func _ready(): + cooldown_timer = Timer.new() + add_child(cooldown_timer) + cooldown_timer.wait_time = 2.0 + cooldown_timer.one_shot = true + cooldown_timer.connect("timeout", Callable(self, "_on_cooldown_timer_timeout")) + + delete_button.connect("pressed", Callable(self, "_on_delete_node_button_pressed")) + settings_button.connect("pressed", Callable(self, "_on_settings_button_pressed")) + + download_button.action_requested.connect(_on_action_requested) + + Appstate.connect("chain_states_changed", Callable(self, "update_view")) + if not is_drivechain: + Appstate.connect("drivechain_downloaded", Callable(self, "update_overlay")) + overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE + var font_variation = load("res://assets/fonts/Satoshi-Regular.otf") + heading_label.add_theme_font_override("font", font_variation) + description_label.add_theme_font_override("font", font_variation) + +func setup(_chain_provider: ChainProvider, _chain_state: ChainState): + chain_provider = _chain_provider + chain_state = _chain_state + + is_drivechain = chain_provider.chain_type == ChainProvider.c_type.MAIN + + if is_drivechain: + heading_label.add_theme_font_size_override("font_size", drivechain_title_font_size) + description_label.add_theme_font_size_override("font_size", drivechain_descr_font_size) + custom_minimum_size.y = drivechain_minimum_height + shimmer_effect.show() + panel.set("theme_override_styles/panel", HEADER_PANEL_STYLE_BOX) + else: + heading_label.add_theme_font_size_override("font_size", subchain_title_font_size) + description_label.add_theme_font_size_override("font_size", subchain_descr_font_size) + custom_minimum_size.y = subchain_minimum_height + size.y = subchain_minimum_height + + heading_label.text = chain_provider.display_name + description_label.text = chain_provider.description + download_button.text = str(int(chain_provider.binary_zip_size * 0.000001)) + " mb" + + update_view() + is_drivechain = chain_provider.chain_type == ChainProvider.c_type.MAIN + + if is_drivechain: + overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE + else: + overlay.mouse_filter = Control.MOUSE_FILTER_STOP + + update_overlay() + +func update_view(): + if is_drivechain: + update_drivechain_view() + else: + update_sidechain_view() + update_overlay() + +func update_drivechain_view(): + update_button_state() + overlay.color = Color(1, 1, 1, 0) # Always fully transparent for L1 + +func update_sidechain_view(): + var drivechain_provider = Appstate.get_drivechain_provider() + download_button.disabled = not drivechain_provider.is_ready_for_execution() + update_button_state() + +func update_overlay(): + if is_drivechain: + overlay.color = Color(1, 1, 1, 0) + else: + var drivechain_provider = Appstate.get_drivechain_provider() + if drivechain_provider.is_ready_for_execution(): + overlay.color = Color(1, 1, 1, 0) + overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE + else: + overlay.color = Color(1, 1, 1, 0.5) # Semi-transparent white + overlay.mouse_filter = Control.MOUSE_FILTER_STOP + +func update_button_state(): + if not chain_provider.is_ready_for_execution(): + download_button.set_state(DownloadButton.STATE.NOT_DOWNLOADED) + elif chain_provider.is_ready_for_execution() and chain_state.state != ChainState.c_state.RUNNING: + download_button.set_state(DownloadButton.STATE.NOT_RUNNING) + else: + download_button.set_state(DownloadButton.STATE.RUNNING) + +func _on_action_requested(action: String): + if is_drivechain or Appstate.get_drivechain_provider().is_ready_for_execution(): + if cooldown_timer.is_stopped(): + match action: + "download": + download() + "run": + _on_start_button_pressed() + "stop": + _on_stop_button_pressed() + if action == "run": + start_cooldown() + else: + print("Action is on cooldown. Please wait.") + else: + print("Cannot perform action. Drivechain is not downloaded.") + +func start_cooldown(): + cooldown_timer.start() + download_button.disabled = true + +func _on_cooldown_timer_timeout(): + download_button.disabled = false + +func download(): + print("\nStarting download process for: ", chain_provider.id, "\n") + download_button.set_state(DownloadButton.STATE.DOWNLOADING) + + setup_download_requirements() + initiate_download_process() + +func setup_download_requirements(): + if download_req != null: + remove_child(download_req) + + if progress_timer != null: + progress_timer.stop() + remove_child(progress_timer) + +func initiate_download_process(): + print("Downloading ", chain_provider.display_name, " from ", chain_provider.download_url) + download_req = HTTPRequest.new() + add_child(download_req) + download_req.request_completed.connect(self._on_download_complete) + + var err = download_req.request(chain_provider.download_url) + if err != OK: + push_error("An error occurred during download request.") + return + + progress_timer = Timer.new() + add_child(progress_timer) + progress_timer.wait_time = 0.1 + progress_timer.timeout.connect(self._on_download_progress) + progress_timer.start() + progress_bar.visible = true + +func _on_download_progress(): + if download_req != null: + var bodySize: float = download_req.get_body_size() + var downloadedBytes: float = download_req.get_downloaded_bytes() + progress_bar.value = downloadedBytes * 100 / bodySize + +func _on_download_complete(result, response_code, _headers, body): + reset_download() + if result != 0 or response_code != 200: + print("Could not download ", chain_provider.display_name, ": ", response_code) + return + + print("Downloading ", chain_provider.display_name, ": OK" ) + var path = chain_provider.base_dir + "/" + chain_provider.id + ".zip" + var save_game = FileAccess.open(path, FileAccess.WRITE) + save_game.store_buffer(body) + save_game.close() + + unzip_file_and_setup_binary(chain_provider.base_dir, path) + download_button.set_state(DownloadButton.STATE.NOT_RUNNING) + +func reset_download(): + if download_req: + remove_child(download_req) + download_req.queue_free() + if progress_timer: + progress_timer.stop() + remove_child(progress_timer) + progress_timer.queue_free() + progress_bar.visible = false + update_view() + +func unzip_file_and_setup_binary(base_dir: String, zip_path: String): + var prog = "unzip" + var args = [zip_path, "-d", base_dir] + if Appstate.get_platform() == Appstate.platform.WIN: + prog = "powershell.exe" + args = ["-Command", 'Expand-Archive -Force ' + zip_path + ' ' + base_dir] + + print("Unzipping ", zip_path, ": ", prog, " ", args) + + OS.execute(prog, args) + + chain_provider.write_start_script() + if Appstate.get_platform() != Appstate.platform.WIN: + var start_path = ProjectSettings.globalize_path(chain_provider.get_start_path()) + print("chmodding start path: ", start_path) + + var bin_path = ProjectSettings.globalize_path(chain_provider.base_dir + "/" + chain_provider.binary_zip_path) + print("chmodding bin path: ", bin_path) + + OS.execute("chmod", ["+x", start_path]) + OS.execute("chmod", ["+x", bin_path]) + + update_view() + +func _on_start_button_pressed(): + print("Starting chain: ", chain_provider.id) + chain_provider.start_chain() + download_button.set_state(DownloadButton.STATE.RUNNING) + update_view() + +func _on_stop_button_pressed(): + print("Stopping chain: ", chain_provider.id) + chain_state.stop_chain() + download_button.set_state(DownloadButton.STATE.NOT_RUNNING) + update_view() + +func _on_settings_button_pressed(): + Appstate.show_chain_provider_info(chain_provider) + +func _on_delete_node_button_pressed(): + var confirmation_dialog = ConfirmationDialog.new() + confirmation_dialog.dialog_text = "Are you sure you want to delete your node AND wallet?" + confirmation_dialog.min_size = Vector2(400, 100) + add_child(confirmation_dialog) + confirmation_dialog.popup_centered() + + confirmation_dialog.connect("confirmed", Callable(self, "_on_confirm_delete_and_purge")) + confirmation_dialog.connect("popup_hide", Callable(confirmation_dialog, "queue_free")) + +func _on_confirm_delete_and_purge(): + print("User has confirmed the action.") + delete_backup() + purge() + +func delete_backup(): + print("Starting deletion process for provider: ", chain_provider.id, "\n") + var backup_dir_path = Appstate.setup_wallets_backup_directory() + var target_backup_path = "%s/%s" % [backup_dir_path, chain_provider.id.replace("/", "_")] + var dir_separator = "\\" if OS.get_name() == "Windows" else "/" + target_backup_path = target_backup_path.replace("/", dir_separator).replace("\\", dir_separator) + + print("Target backup path for deletion: ", target_backup_path, "\n") + + var command: String + var arguments: PackedStringArray + var output: Array = [] + + match OS.get_name(): + "Windows": + command = "cmd" + arguments = PackedStringArray(["/c", "rd", "/s", "/q", target_backup_path]) + "Linux", "macOS", "FreeBSD": + command = "rm" + arguments = PackedStringArray(["-rf", target_backup_path]) + _: + print("OS not supported for direct folder deletion.\n") + return + + print("Executing deletion command: ", command, " with arguments: ", arguments, "\n") + var result = OS.execute(command, arguments, output, false, false) + if result == OK: + print("Successfully deleted backup for '", chain_provider.id, "' at: ", target_backup_path, "\n") + var wallet_paths_info = load_existing_wallet_paths_info() + wallet_paths_info.erase(chain_provider.id) + save_wallet_paths_info(wallet_paths_info) + print("Successfully removed '", chain_provider.id, "' from wallet paths info.\n") + else: + var output_str = Appstate.array_to_string(output) + print("Failed to delete backup for ", chain_provider.id, "\n") + +func purge(): + print("Purging chain provider: ", chain_provider.id) + stop_and_cleanup_chain() + + await get_tree().create_timer(1.0).timeout + queue_free() + purge_directory() + + print("Loading version configuration...") + Appstate.load_version_config() + + print("Loading configuration...") + Appstate.load_config() + + print("Saving configuration...") + Appstate.save_config() + + Appstate.load_app_config() + + print("Setting up directories...") + Appstate.setup_directories() + + print("Setting up configurations...") + Appstate.setup_confs() + + print("Setting up chain states...") + Appstate.setup_chain_states() + + Appstate.chain_providers_changed.emit() + + Appstate.start_chain_states() + +func stop_and_cleanup_chain(): + if chain_provider: + print("Attempting to stop and clean up the chain for provider: ", chain_provider.id) + if chain_provider.id in Appstate.chain_states: + var chain_state = Appstate.chain_states[chain_provider.id] + if chain_state: + chain_state.stop_chain() + await get_tree().create_timer(1.0).timeout + if is_instance_valid(chain_state): + remove_child(chain_state) + chain_state.cleanup() + print("Chain stopped and node removed for provider:", chain_provider.display_name) + else: + print("Chain state is no longer valid after stopping.") + else: + print("Chain state not found in AppState.chain_states for id: ", chain_provider.id) + else: + print("Chain provider id not found in AppState.chain_states: ", chain_provider.id) + else: + print("stop_and_cleanup_chain called but no chain provider available.") + +func purge_directory(): + if chain_provider.id == "ethsail": + Appstate.delete_ethereum_directory() + elif chain_provider.id == "zsail": + Appstate.delete_zcash_directory() + + print("Preparing to purge directory for provider: ", chain_provider.display_name) + var directory_text = ProjectSettings.globalize_path(chain_provider.base_dir) + print(directory_text + " is the directory txt") + + if OS.get_name() == "Windows": + directory_text = directory_text.replace("/", "\\") + + Appstate.purge(directory_text) + print("Directory purged: " + directory_text) + +func load_existing_wallet_paths_info() -> Dictionary: + var wallet_paths_info = {} + var file = FileAccess.open(WALLET_INFO_PATH, FileAccess.ModeFlags.READ) + if file != null: + var json_text = file.get_as_text() + file.close() + var json = JSON.new() + var error = json.parse(json_text) + if error == OK: + wallet_paths_info = json.data + else: + print("Failed to parse existing wallet paths JSON. Error: ", error) + else: + print("No existing wallet paths JSON file found. Starting with an empty dictionary.") + return wallet_paths_info + +func save_wallet_paths_info(wallet_paths_info: Dictionary) -> void: + var json_text := JSON.stringify(wallet_paths_info) + var file := FileAccess.open(WALLET_INFO_PATH, FileAccess.ModeFlags.WRITE) + if file != null: + file.store_string(json_text) + file.flush() + file.close() + else: + print("Failed to open JSON file for writing: ", WALLET_INFO_PATH) + +func is_sidechain() -> bool: + return not is_drivechain + +func get_current_state() -> int: + if chain_state == null: + return -1 # or some other value to indicate an invalid state + return chain_state.state + +func refresh_chain_data(): + if chain_provider and chain_state: + chain_provider.refresh() + chain_state.refresh() + update_view() diff --git a/source/nodes/node_panel/node_panel.tscn b/source/nodes/node_panel/node_panel.tscn new file mode 100644 index 0000000..59dec68 --- /dev/null +++ b/source/nodes/node_panel/node_panel.tscn @@ -0,0 +1,123 @@ +[gd_scene load_steps=9 format=3 uid="uid://cq65ocurdi7c1"] + +[ext_resource type="Script" path="res://source/nodes/node_panel/node_panel.gd" id="1_ijj0w"] +[ext_resource type="Texture2D" uid="uid://2xouba13q8q7" path="res://assets/images/pattern_33.png" id="2_lb2fn"] +[ext_resource type="PackedScene" uid="uid://cjfcxi77d8pjt" path="res://source/nodes/node_panel/download.tscn" id="2_ubul7"] +[ext_resource type="Texture2D" uid="uid://drrrqh5w6tl8t" path="res://assets/images/icons8-settings.svg" id="4_8w22k"] +[ext_resource type="FontFile" uid="uid://b1w37357tl3er" path="res://assets/fonts/Cantarell-Bold.ttf" id="4_h86ci"] +[ext_resource type="Texture2D" uid="uid://jpde6uqywmlg" path="res://assets/images/trash-svgrepo-com(1).svg" id="8_8l4af"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dqqs8"] +bg_color = Color(0.6, 0.6, 0.6, 0) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0.42, 0.42, 0.42, 1) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 +expand_margin_left = 8.0 +expand_margin_top = 8.0 +expand_margin_right = 8.0 +expand_margin_bottom = 8.0 + +[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_cnrh3"] + +[node name="NodePanel" type="Control"] +texture_filter = 4 +custom_minimum_size = Vector2(403, 90) +layout_mode = 3 +anchors_preset = 0 +offset_right = 403.0 +offset_bottom = 90.0 +size_flags_horizontal = 3 +script = ExtResource("1_ijj0w") + +[node name="ShimmerEffect" type="TextureRect" parent="."] +visible = false +self_modulate = Color(1, 1, 1, 0.0156863) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -8.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_lb2fn") +expand_mode = 1 +stretch_mode = 1 + +[node name="MarginContainer" type="MarginContainer" parent="."] +custom_minimum_size = Vector2(403, 84) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 6.0 +offset_bottom = -6.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 16 +theme_override_constants/margin_bottom = 8 + +[node name="Panel" type="Panel" parent="MarginContainer"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_dqqs8") + +[node name="Container" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="Header" type="HBoxContainer" parent="MarginContainer/Container"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 + +[node name="Download" parent="MarginContainer/Container/Header" instance=ExtResource("2_ubul7")] +layout_mode = 2 + +[node name="Heading" type="Label" parent="MarginContainer/Container/Header"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_fonts/font = ExtResource("4_h86ci") +theme_override_font_sizes/font_size = 28 +text = "NodePanel" + +[node name="Settings" type="Button" parent="MarginContainer/Container/Header"] +texture_filter = 4 +custom_minimum_size = Vector2(0, 32) +layout_mode = 2 +size_flags_vertical = 4 +focus_mode = 0 +icon = ExtResource("4_8w22k") + +[node name="Delete" type="Button" parent="MarginContainer/Container/Header"] +texture_filter = 4 +custom_minimum_size = Vector2(0, 32) +layout_mode = 2 +size_flags_vertical = 4 +focus_mode = 0 +icon = ExtResource("8_8l4af") + +[node name="Description" type="Label" parent="MarginContainer/Container"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 18 +text = "Description" +text_overrun_behavior = 3 + +[node name="Overlay" type="ColorRect" parent="."] +visible = false +modulate = Color(0, 0, 0, 0.541176) +material = SubResource("CanvasItemMaterial_cnrh3") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -11.0 +grow_horizontal = 2 +grow_vertical = 2 diff --git a/source/nodes/node_panel/overlay_format.gd b/source/nodes/node_panel/overlay_format.gd new file mode 100644 index 0000000..00be723 --- /dev/null +++ b/source/nodes/node_panel/overlay_format.gd @@ -0,0 +1,29 @@ +extends ColorRect + +@export var corner_radius: int = 90 # Adjust this value to match your panel's corner radius +@export var overlay_color: Color = Color(1, 1, 1, 0.5) # Semi-transparent white + +func _ready(): + # Create a new StyleBoxFlat for the overlay + var style = StyleBoxFlat.new() + + # Set the corner radius + style.set_corner_radius_all(1000) + + # Set the background color + style.bg_color = overlay_color + + # Apply the style to this ColorRect + add_theme_stylebox_override("panel", style) + + # Ensure the ColorRect fills its parent container + anchor_right = 1 + anchor_bottom = 1 + offset_right = 0 + offset_bottom = 0 + +func set_overlay_opacity(opacity: float): + overlay_color.a = opacity + var style = get_theme_stylebox("panel") + if style is StyleBoxFlat: + style.bg_color = overlay_color diff --git a/source/nodes/nodes.tscn b/source/nodes/nodes.tscn new file mode 100644 index 0000000..bbeff2b --- /dev/null +++ b/source/nodes/nodes.tscn @@ -0,0 +1,44 @@ +[gd_scene load_steps=2 format=3 uid="uid://3423r8wl8vxb"] + +[ext_resource type="PackedScene" uid="uid://cq65ocurdi7c1" path="res://source/nodes/node_panel/node_panel.tscn" id="1_qsgf1"] + +[node name="Nodes" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +layout_mode = 2 + +[node name="Window" type="VBoxContainer" parent="ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 8 + +[node name="NodePanel1" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel2" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel3" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel4" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel5" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel6" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel7" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 + +[node name="NodePanel8" parent="ScrollContainer/Window" instance=ExtResource("1_qsgf1")] +layout_mode = 2 diff --git a/source/nodes/z_params_modal/z_params_modal.gd b/source/nodes/z_params_modal/z_params_modal.gd new file mode 100644 index 0000000..d6bcfd0 --- /dev/null +++ b/source/nodes/z_params_modal/z_params_modal.gd @@ -0,0 +1,44 @@ +#extends ColorRect +# +#var chain_provider: ChainProvider +#var zside_thread: Thread +#var spinner_chars = ["|", "/", "-", "\\", "|", "/", "-", "\\"] +#var cursor_index = 0 +#var frames = 0 +#var output +# +#@onready var label = $Center/Panel/Margin/Label +# +#func setup(_chain_provider: ChainProvider): + #chain_provider = _chain_provider + ##if chain_provider.id == "zside" || chain_provider.id == "zsail": + ##zside_thread = Thread.new() + ##zside_thread.start(_zside_fetch_params_thread) + ##while zside_thread != null and zside_thread.is_alive(): + ##await Appstate.get_tree().process_frame + ## + ##zside_thread.wait_to_finish() + ##zside_thread = null + ##chain_provider.start_chain() + ##queue_free() + ##else: + #queue_free() + # +#func _zside_fetch_params_thread(): + #var script = ProjectSettings.globalize_path("res://zside-fetch-params.sh") + #print("executing zcash params fetch script: ", script) + #var exit_code = OS.execute(script, [], []) + # + #assert(exit_code == OK, "Unable to execute params fetch script") + #print("successfully downnloaded zcash params")/ + # + # + # +#func _process(_delta): + #frames += 1 + #if frames % 8 == 0: + #var c = spinner_chars[cursor_index] + #cursor_index += 1 + #if cursor_index == spinner_chars.size(): + #cursor_index = 0 + #label.text = "Downloading zparams " + c diff --git a/ui/components/dashboard/z_params_modal/z_params_modal.tscn b/source/nodes/z_params_modal/z_params_modal.tscn similarity index 88% rename from ui/components/dashboard/z_params_modal/z_params_modal.tscn rename to source/nodes/z_params_modal/z_params_modal.tscn index 153200b..67518f5 100644 --- a/ui/components/dashboard/z_params_modal/z_params_modal.tscn +++ b/source/nodes/z_params_modal/z_params_modal.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://b3a4mpyl881ep"] -[ext_resource type="Script" path="res://ui/components/dashboard/z_params_modal/z_params_modal.gd" id="1_7bjbv"] +[ext_resource type="Script" path="res://source/nodes/z_params_modal/z_params_modal.gd" id="1_7bjbv"] [node name="ChainProviderInfo" type="ColorRect"] anchors_preset = 15 diff --git a/source/settings/data_directories/data_directories.tscn b/source/settings/data_directories/data_directories.tscn new file mode 100644 index 0000000..a4be96f --- /dev/null +++ b/source/settings/data_directories/data_directories.tscn @@ -0,0 +1,69 @@ +[gd_scene load_steps=2 format=3 uid="uid://csx4lnf3n6r84"] + +[ext_resource type="FontFile" uid="uid://ccfr6y00w3tjf" path="res://assets/fonts/Cantarell-Regular.ttf" id="1_17r3w"] + +[node name="DataDirectories" type="VBoxContainer"] + +[node name="Heading" type="Label" parent="."] +layout_mode = 2 +theme_override_font_sizes/font_size = 28 +text = "DATA DIRECTORIES" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Options" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Labels" type="VBoxContainer" parent="Options"] +custom_minimum_size = Vector2(296, 0) +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="ApplicationDataDirectory" type="Label" parent="Options/Labels"] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +text = "APPLICATION DATA DIRECTORY" +vertical_alignment = 1 + +[node name="DriveChainDataDirectory" type="Label" parent="Options/Labels"] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +text = "DRIVECHAIN DATA DIRECTORY" +vertical_alignment = 1 + +[node name="Inputs" type="VBoxContainer" parent="Options"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 16 + +[node name="ApplicationDataDirectory" type="LineEdit" parent="Options/Inputs"] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +focus_mode = 0 +theme_override_fonts/font = ExtResource("1_17r3w") +editable = false + +[node name="DriveChainDataDirectory" type="LineEdit" parent="Options/Inputs"] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +focus_mode = 0 +theme_override_fonts/font = ExtResource("1_17r3w") +editable = false + +[node name="BrowseButtons" type="VBoxContainer" parent="Options"] +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="ApplicationDataDirectory" type="Button" parent="Options/BrowseButtons"] +custom_minimum_size = Vector2(40, 36) +layout_mode = 2 +size_flags_vertical = 4 +focus_mode = 0 +text = "..." + +[node name="DriveChainDataDirectory" type="Button" parent="Options/BrowseButtons"] +custom_minimum_size = Vector2(40, 36) +layout_mode = 2 +size_flags_vertical = 4 +focus_mode = 0 +text = "..." diff --git a/source/settings/display_settings/display_settings.tscn b/source/settings/display_settings/display_settings.tscn new file mode 100644 index 0000000..e3c8052 --- /dev/null +++ b/source/settings/display_settings/display_settings.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=5 format=3 uid="uid://bcajgwunu16on"] + +[ext_resource type="FontFile" uid="uid://ccfr6y00w3tjf" path="res://assets/fonts/Cantarell-Regular.ttf" id="1_bbx5e"] +[ext_resource type="PackedScene" uid="uid://c0x1u7g3b58iw" path="res://source/settings/display_settings/theme_options/theme_options.tscn" id="2_syh1q"] +[ext_resource type="PackedScene" uid="uid://bdvk0ut5ley18" path="res://source/settings/display_settings/screen_options/screen_options.tscn" id="3_8e0yi"] +[ext_resource type="Theme" uid="uid://h5leavcufiab" path="res://resource/theme/black.theme" id="3_kp2a4"] + +[node name="DisplaySettings" type="VBoxContainer"] +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Heading" type="Label" parent="."] +layout_mode = 2 +theme_override_fonts/font = ExtResource("1_bbx5e") +theme_override_font_sizes/font_size = 28 +text = "DISPLAY SETTINGS" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Options" type="VBoxContainer" parent="."] +layout_mode = 2 +theme_override_constants/separation = 16 + +[node name="ScreenOptions" parent="Options" instance=ExtResource("3_8e0yi")] +layout_mode = 2 +theme = ExtResource("3_kp2a4") + +[node name="ThemeOptions" parent="Options" instance=ExtResource("2_syh1q")] +layout_mode = 2 diff --git a/source/settings/display_settings/screen_options/screen_mode/screen_mode.gd b/source/settings/display_settings/screen_options/screen_mode/screen_mode.gd new file mode 100644 index 0000000..76981f1 --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_mode/screen_mode.gd @@ -0,0 +1,15 @@ +class_name ScreenMode extends HBoxContainer + +@onready var toggle: CheckButton = $Toggle + +signal screen_mode_updated + +func _ready(): + toggle.toggled.connect(_on_toggled) + +func _on_toggled(toggled_on: bool): + if toggled_on: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + else: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + screen_mode_updated.emit(toggled_on) diff --git a/source/settings/display_settings/screen_options/screen_mode/screen_mode.tscn b/source/settings/display_settings/screen_options/screen_mode/screen_mode.tscn new file mode 100644 index 0000000..004fb59 --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_mode/screen_mode.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=3 format=3 uid="uid://o2ty0o4fho1f"] + +[ext_resource type="Script" path="res://source/settings/display_settings/screen_options/screen_mode/screen_mode.gd" id="1_c16cl"] +[ext_resource type="FontFile" uid="uid://c33ier0iywrki" path="res://assets/fonts/LEMONMILK-Regular.otf" id="2_wu5q6"] + +[node name="ScreenMode" type="HBoxContainer"] +size_flags_horizontal = 3 +script = ExtResource("1_c16cl") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_fonts/font = ExtResource("2_wu5q6") +text = "FULLSCREEN" +vertical_alignment = 1 + +[node name="Toggle" type="CheckButton" parent="."] +custom_minimum_size = Vector2(0, 36) +layout_mode = 2 +size_flags_horizontal = 8 +focus_mode = 0 +flat = true diff --git a/source/settings/display_settings/screen_options/screen_options.gd b/source/settings/display_settings/screen_options/screen_options.gd new file mode 100644 index 0000000..650ecf2 --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_options.gd @@ -0,0 +1,6 @@ +extends HBoxContainer + +@onready var screen_mode: ScreenMode = $ScreenMode + +func _ready(): + pass diff --git a/source/settings/display_settings/screen_options/screen_options.tscn b/source/settings/display_settings/screen_options/screen_options.tscn new file mode 100644 index 0000000..c1746c8 --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_options.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=3 format=3 uid="uid://bdvk0ut5ley18"] + +[ext_resource type="Script" path="res://source/settings/display_settings/screen_options/screen_options.gd" id="1_fia8e"] +[ext_resource type="PackedScene" uid="uid://mq0u80atvvee" path="res://source/settings/display_settings/screen_options/screen_resolution/screen_resolution.tscn" id="2_3q763"] + +[node name="ScreenOptions" type="HBoxContainer"] +offset_right = 289.0 +offset_bottom = 36.0 +theme_override_constants/separation = 16 +script = ExtResource("1_fia8e") + +[node name="ScreenResolution" parent="." instance=ExtResource("2_3q763")] +layout_mode = 2 diff --git a/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd new file mode 100644 index 0000000..0fd08c7 --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd @@ -0,0 +1,60 @@ +extends HBoxContainer + +@onready var resolution_list_button: OptionButton = $List + +func _ready(): + resolution_list_button.item_selected.connect(_on_resolution_selected) + populate_resolution_list() + set_default_resolution() + +func populate_resolution_list(): + resolution_list_button.clear() + var fullscreen_resolution = get_fullscreen_resolution_text() + resolution_list_button.add_item(fullscreen_resolution) + + var resolutions = ["1920 x 1080", "1600 x 900", "1366 x 768", "1280 x 720", "1024 x 576"] + for res in resolutions: + resolution_list_button.add_item(res) + +func set_default_resolution(): + var default_resolution = "1920 x 1080" + var index = resolution_list_button.get_item_index(1) # 1920x1080 is the second item (index 1) + + apply_resolution(index) + resolution_list_button.select(index) + +func _on_resolution_selected(index: int): + var resolution = apply_resolution(index) + reposition_window_to_screen_center(resolution) + +func apply_resolution(index): + if index == 0: # Full screen option + return apply_fullscreen_resolution() + else: + var resolution_text = resolution_list_button.get_item_text(index).split(" x ") + var resolution = Vector2i(int(resolution_text[0]), int(resolution_text[1])) + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + DisplayServer.window_set_size(resolution) + return resolution + +func apply_fullscreen_resolution(): + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + return DisplayServer.screen_get_size() + +func get_fullscreen_resolution_text(): + var screen_size = DisplayServer.screen_get_size() + return str(screen_size.x) + " x " + str(screen_size.y) + " (Fullscreen)" + +func reposition_window_to_screen_center(resolution): + if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED: + var window_position = DisplayServer.screen_get_size() / 2 - resolution / 2 + DisplayServer.window_set_position(window_position) + +func refresh_window(): + var current_mode = DisplayServer.window_get_mode() + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + await get_tree().process_frame + DisplayServer.window_set_mode(current_mode) + +func _on_screen_mode_updated(fullscreen: bool): + resolution_list_button.disabled = fullscreen diff --git a/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.tscn b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.tscn new file mode 100644 index 0000000..59103cc --- /dev/null +++ b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=3 format=3 uid="uid://mq0u80atvvee"] + +[ext_resource type="Script" path="res://source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd" id="1_5rgnv"] +[ext_resource type="Theme" uid="uid://iix53v175t6k" path="res://ui/themes/default_dark.tres" id="2_7js7k"] + +[node name="ScreenResolution" type="HBoxContainer"] +size_flags_horizontal = 3 +script = ExtResource("1_5rgnv") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +size_flags_horizontal = 3 +text = "RESOLUTION" +vertical_alignment = 1 + +[node name="List" type="OptionButton" parent="."] +custom_minimum_size = Vector2(192, 36) +layout_mode = 2 +size_flags_horizontal = 8 +theme = ExtResource("2_7js7k") +alignment = 1 +item_count = 8 +selected = 1 +popup/item_0/text = "800 x 600" +popup/item_0/id = 4 +popup/item_1/text = "851 x 600" +popup/item_1/id = 1 +popup/item_2/text = "1024 x 640" +popup/item_2/id = 1 +popup/item_3/text = "1152 x 648" +popup/item_3/id = 2 +popup/item_4/text = "1024 x 768" +popup/item_4/id = 3 +popup/item_5/text = "1280 x 720" +popup/item_5/id = 5 +popup/item_6/text = "1600 x 900" +popup/item_6/id = 6 +popup/item_7/text = "1920 x 1080" +popup/item_7/id = 7 diff --git a/source/settings/display_settings/theme_options/theme_options.gd b/source/settings/display_settings/theme_options/theme_options.gd new file mode 100644 index 0000000..05b0527 --- /dev/null +++ b/source/settings/display_settings/theme_options/theme_options.gd @@ -0,0 +1,33 @@ +class_name ThemeOptions extends HBoxContainer + +const theme_directory = "res://resource/theme/" +const unchecked_icon = preload("res://assets/icons/CheckButton/CheckButton_Unchecked.svg") +const checked_icon = preload("res://assets/icons/CheckButton/CheckButton_Checked.svg") + +@onready var options: GridContainer = $Options +var active_option: Button + +func _ready(): + for option: Button in options.get_children(): + if option.name.to_lower() == "blue": + _disable_blue_option(option) + else: + option.toggled.connect(_on_option_toggled.bind(option)) + option.icon = unchecked_icon + if option.button_pressed: + active_option = option + option.icon = checked_icon + +func _disable_blue_option(option: Button): + option.disabled = true + option.modulate = Color(1, 1, 1, 0.5) # This greys out the button + option.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + option.tooltip_text = "Blue theme is not currently supported" + +func _on_option_toggled(toggled_on: bool, option: Button): + if option.name.to_lower() != "blue": + var application = get_tree().get_first_node_in_group("application") + application.set("theme", load(theme_directory + option.name.to_lower() + ".theme")) + active_option.icon = unchecked_icon + active_option = option + active_option.icon = checked_icon diff --git a/source/settings/display_settings/theme_options/theme_options.tscn b/source/settings/display_settings/theme_options/theme_options.tscn new file mode 100644 index 0000000..c6a37a4 --- /dev/null +++ b/source/settings/display_settings/theme_options/theme_options.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=3 format=3 uid="uid://c0x1u7g3b58iw"] + +[ext_resource type="Script" path="res://source/settings/display_settings/theme_options/theme_options.gd" id="1_yvg0j"] + +[sub_resource type="ButtonGroup" id="ButtonGroup_8b16r"] + +[node name="ThemeOptions" type="HBoxContainer"] +theme_override_constants/separation = 16 +script = ExtResource("1_yvg0j") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +size_flags_horizontal = 3 +text = "THEME" + +[node name="Options" type="GridContainer" parent="."] +layout_mode = 2 +theme_override_constants/h_separation = 8 +theme_override_constants/v_separation = 8 +columns = 2 + +[node name="Blue" type="Button" parent="Options"] +custom_minimum_size = Vector2(136, 0) +layout_mode = 2 +focus_mode = 0 +toggle_mode = true +action_mode = 0 +button_group = SubResource("ButtonGroup_8b16r") +text = "BLUE" + +[node name="Black" type="Button" parent="Options"] +custom_minimum_size = Vector2(136, 0) +layout_mode = 2 +focus_mode = 0 +toggle_mode = true +button_pressed = true +action_mode = 0 +button_group = SubResource("ButtonGroup_8b16r") +text = "BLACK" diff --git a/source/settings/settings.tscn b/source/settings/settings.tscn new file mode 100644 index 0000000..100bab9 --- /dev/null +++ b/source/settings/settings.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=4 format=3 uid="uid://bi3mevmny3dj3"] + +[ext_resource type="Script" path="res://ui/components/settings/settings.gd" id="1_folyo"] +[ext_resource type="PackedScene" uid="uid://csx4lnf3n6r84" path="res://source/settings/data_directories/data_directories.tscn" id="1_iwxd0"] +[ext_resource type="PackedScene" uid="uid://bcajgwunu16on" path="res://source/settings/display_settings/display_settings.tscn" id="2_bic18"] + +[node name="Settings" type="MarginContainer"] +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_folyo") + +[node name="Window" type="VBoxContainer" parent="."] +layout_mode = 2 + +[node name="Container" type="VBoxContainer" parent="Window"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/separation = 16 + +[node name="DataDirectories" parent="Window/Container" instance=ExtResource("1_iwxd0")] +layout_mode = 2 + +[node name="DisplaySettings" parent="Window/Container" instance=ExtResource("2_bic18")] +layout_mode = 2 + +[node name="Reset" type="Button" parent="Window"] +custom_minimum_size = Vector2(128, 48) +layout_mode = 2 +size_flags_horizontal = 4 +focus_mode = 0 +text = "RESET" diff --git a/starters/.DS_Store b/starters/.DS_Store new file mode 100644 index 0000000..5f69335 Binary files /dev/null and b/starters/.DS_Store differ diff --git a/starters/STARTERS.md b/starters/STARTERS.md new file mode 100644 index 0000000..1c7faf6 --- /dev/null +++ b/starters/STARTERS.md @@ -0,0 +1 @@ +Folder that contains starter files based on master seed diff --git a/ui/components/create_wallet.tscn b/ui/components/create_wallet.tscn new file mode 100644 index 0000000..cab0978 --- /dev/null +++ b/ui/components/create_wallet.tscn @@ -0,0 +1,189 @@ +[gd_scene format=3 uid="uid://brwo7wbx8ib06"] + +[node name="CreateWallet" type="Control"] +clip_contents = true +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 1 + +[node name="Control" type="Control" parent="ScrollContainer/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 60) +layout_mode = 2 +size_flags_stretch_ratio = 0.25 + +[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/VBoxContainer"] +clip_contents = true +layout_mode = 2 +size_flags_vertical = 2 +alignment = 1 + +[node name="Spacer" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(50, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="TextIn" type="LineEdit" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(600, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +placeholder_text = "Enter plain text to generate 256 bit entropy hash" +alignment = 1 + +[node name="Spacer2" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="Button" type="Button" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_stretch_ratio = 0.0 +text = "Random" + +[node name="Spacer3" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="RichTextLabel" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(50, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +bbcode_enabled = true +text = "[center] Basic" +fit_content = true + +[node name="CheckButton" type="CheckButton" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 + +[node name="RichTextLabel3" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(70, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 0.0 +bbcode_enabled = true +text = "[center] Advanced" +fit_content = true + +[node name="Spacer5" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(40, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.0 + +[node name="Spacer3" type="Control" parent="ScrollContainer/VBoxContainer"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="ScrollContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +alignment = 1 + +[node name="Spacer1" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(30, 2.08165e-12) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(500, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/separation = 1 +alignment = 1 + +[node name="BIP39Out" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +bbcode_enabled = true +fit_content = true +scroll_active = false + +[node name="WordList" type="GridContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 5 + +[node name="Spacer2" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="Spacer2" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(30, 2.08165e-12) +layout_mode = 2 + +[node name="VBoxContainer2" type="VBoxContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +alignment = 1 + +[node name="Spacer1" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="WalletHeader" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +layout_mode = 2 +text = "Wallet Addresses: +" +fit_content = true + +[node name="Spacer2" type="Control" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 2 +size_flags_stretch_ratio = 0.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +clip_contents = true +layout_mode = 2 +size_flags_vertical = 2 + +[node name="XprivHeader" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +text = "xpriv (Do not share):" +fit_content = true + +[node name="XprivOut" type="RichTextLabel" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +fit_content = true + +[node name="AddressesOut" type="GridContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 250) +layout_mode = 2 +size_flags_vertical = 3 +columns = 3 diff --git a/ui/components/dashboard/base_dashboard_panel/ActionButton.gd b/ui/components/dashboard/base_dashboard_panel/ActionButton.gd deleted file mode 100644 index 09500f6..0000000 --- a/ui/components/dashboard/base_dashboard_panel/ActionButton.gd +++ /dev/null @@ -1,61 +0,0 @@ -extends Button -class_name ActionButton - -enum { - DOWNLOAD, - RUN, - STOP -} -var prev_state : int = -1 - -const state_name : Array[String] = [ - "Download", - "Run", - "Stop" -] - -var is_drivechain : bool = false -var shimmer_tween : Tween - -@export_enum("Download", "Run", "Stop") var state : int = DOWNLOAD -@export var show_icon : bool = true -@export var download_icon : Texture2D -@export_color_no_alpha var download_color : Color = Color.RED -@export var download_theme : Theme -@export var run_icon : Texture2D -@export_color_no_alpha var run_color : Color = Color.BLUE -@export var run_theme : Theme -@export var stop_icon : Texture2D -@export_color_no_alpha var stop_color : Color = Color.GREEN -@export var stop_theme : Theme -@onready var state_icon : Array[Texture2D] = [download_icon, run_icon, stop_icon] -@onready var state_Color : Array[Color] = [download_color, run_color, stop_color] -@onready var state_theme : Array[Theme] = [download_theme, run_theme, stop_theme] - - -func _ready(): - set_state(state) - -func set_state(new_state:int): - prev_state = state - state = new_state - set_text(state_name[state]) - set_button_icon(state_icon[state]) - set_theme(state_theme[state]) - shimmer() - disabled = false - -func check_state(): - if state == DOWNLOAD and is_drivechain: - shimmer() - pass - -func shimmer(): - if !(state == DOWNLOAD and is_drivechain): - if shimmer_tween: shimmer_tween.stop() - return - shimmer_tween = create_tween() - shimmer_tween.tween_property(self, "modulate", Color(1.0,1.0,1.0,0.5),0.5) - shimmer_tween.tween_property(self, "modulate", Color(1.0,1.0,1.0,1.5),0.5) - shimmer_tween.tween_callback(shimmer).set_delay(0.75) - diff --git a/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd b/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd index b4abd7e..9cafa23 100644 --- a/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd +++ b/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd @@ -151,13 +151,7 @@ func show_download_state(): func show_unsupported_state(): - settings_button.disabled = true - action_button.hide() -# auto_mine_button.visible = false - refresh_bmm_button.visible = false - secondary_desc.visible = true - secondary_desc.text = "[i]This sidechain is currently not available for this platform -- try Linux instead.[/i]" - modulate = disabled_modulate + pass diff --git a/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn b/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn index 4027663..d2b98d7 100644 --- a/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn +++ b/ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=3 uid="uid://yhgodesyh1pt"] +[gd_scene load_steps=19 format=3 uid="uid://yhgodesyh1pt"] [ext_resource type="Texture2D" uid="uid://2xouba13q8q7" path="res://assets/images/pattern_33.png" id="1_13ux5"] [ext_resource type="Script" path="res://ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.gd" id="1_6647v"] @@ -6,15 +6,15 @@ [ext_resource type="Texture2D" uid="uid://bd7416ly17qhn" path="res://assets/images/play-symbolic.svg" id="4_a5xlm"] [ext_resource type="FontFile" uid="uid://ciu7chyqqs4k7" path="res://assets/fonts/Saira_Expanded-Bold.ttf" id="4_njapg"] [ext_resource type="FontFile" uid="uid://dgxbgdcr3s84u" path="res://assets/fonts/Saira_Expanded-Regular.ttf" id="6_kg3t2"] -[ext_resource type="Texture2D" uid="uid://u6al2fx1l7ia" path="res://assets/images/download-cloud-line.svg" id="6_qglv3"] [ext_resource type="Theme" uid="uid://b4iussektjaa5" path="res://ui/components/dashboard/base_dashboard_panel/drivechain_btn_downloaded.tres" id="7_1bvyp"] [ext_resource type="Theme" uid="uid://crnt3bsai3744" path="res://ui/components/dashboard/base_dashboard_panel/drivechain_btn_undownloaded.tres" id="7_bihi7"] +[ext_resource type="Script" path="res://source/nodes/node_panel/ActionButton.gd" id="8_8xxdw"] [ext_resource type="Texture2D" uid="uid://u2c8qj3wcgro" path="res://assets/images/stop-symbolic.svg" id="8_sf64t"] -[ext_resource type="Script" path="res://ui/components/dashboard/base_dashboard_panel/ActionButton.gd" id="9_53my3"] [ext_resource type="Theme" uid="uid://bcvi5ljrnn8t4" path="res://ui/components/dashboard/base_dashboard_panel/drivechain_btn_running.tres" id="11_c7v3q"] -[ext_resource type="Texture2D" uid="uid://cx6bbyd1qg3u8" path="res://ui/geariconfinal2.png" id="13_5ideu"] -[ext_resource type="Texture2D" uid="uid://dirsvxtym10jq" path="res://ui/trashpropersize.png" id="14_1jmio"] -[ext_resource type="Texture2D" uid="uid://dldqmh6vyfrx8" path="res://ui/trash delete wallet.png" id="15_y34su"] +[ext_resource type="Texture2D" uid="uid://vfwftvcbvob6" path="res://assets/images/info-symbolic 1.svg" id="13_bierr"] +[ext_resource type="Texture2D" uid="uid://btvncw88xfvn" path="res://assets/images/info-settings.svg" id="13_cajt3"] +[ext_resource type="Texture2D" uid="uid://jpde6uqywmlg" path="res://assets/images/trash-svgrepo-com(1).svg" id="14_xvgjr"] +[ext_resource type="Texture2D" uid="uid://cdnb6d7o25ctt" path="res://assets/images/trashwalleticon.svg" id="15_1jbx2"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0u1v5"] bg_color = Color(0.188235, 0.188235, 0.188235, 1) @@ -31,17 +31,18 @@ corner_radius_bottom_left = 6 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2fadl"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sxh2k"] + [node name="BaseChainDashboardPanel" type="PanelContainer"] clip_children = 2 clip_contents = true -custom_minimum_size = Vector2(1000, 0) -offset_right = 1025.0 -offset_bottom = 79.0 +custom_minimum_size = Vector2(819, 0) +offset_right = 819.0 +offset_bottom = 63.0 size_flags_horizontal = 3 size_flags_vertical = 4 theme_override_styles/panel = SubResource("StyleBoxFlat_0u1v5") script = ExtResource("1_6647v") -drivechain_title_font_size = 28 [node name="BackgroundPattern" type="TextureRect" parent="."] modulate = Color(1, 1, 1, 0.0156863) @@ -54,32 +55,16 @@ stretch_mode = 1 [node name="Margin" type="MarginContainer" parent="."] layout_mode = 2 size_flags_vertical = 4 -theme_override_constants/margin_left = 16 -theme_override_constants/margin_top = 16 -theme_override_constants/margin_right = 16 -theme_override_constants/margin_bottom = 16 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 [node name="Footer" type="HBoxContainer" parent="Margin"] layout_mode = 2 size_flags_vertical = 4 theme_override_constants/separation = 6 -[node name="ActionButton" type="Button" parent="Margin/Footer"] -custom_minimum_size = Vector2(100, 25) -layout_mode = 2 -size_flags_vertical = 4 -focus_mode = 0 -theme = ExtResource("7_1bvyp") -icon = ExtResource("4_a5xlm") -expand_icon = true -script = ExtResource("9_53my3") -download_icon = ExtResource("6_qglv3") -download_theme = ExtResource("7_bihi7") -run_icon = ExtResource("4_a5xlm") -run_theme = ExtResource("7_1bvyp") -stop_icon = ExtResource("8_sf64t") -stop_theme = ExtResource("11_c7v3q") - [node name="RefreshBMM" type="CheckButton" parent="Margin/Footer"] visible = false layout_mode = 2 @@ -111,6 +96,7 @@ stretch_mode = 5 [node name="Title" type="Label" parent="Margin/Footer"] layout_mode = 2 +size_flags_horizontal = 3 theme_override_colors/font_color = Color(1, 1, 1, 1) theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) theme_override_constants/shadow_offset_x = 1 @@ -121,12 +107,14 @@ text = "Testchain" vertical_alignment = 1 [node name="VSeparator" type="VSeparator" parent="Margin/Footer"] +visible = false modulate = Color(1, 1, 1, 0) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 [node name="VBox" type="VBoxContainer" parent="Margin/Footer"] +visible = false custom_minimum_size = Vector2(425, 0) layout_mode = 2 size_flags_horizontal = 8 @@ -139,38 +127,100 @@ theme_override_font_sizes/font_size = 16 text = "A blank sidechain based on Bitcoin Core 16.99" autowrap_mode = 2 -[node name="SecondaryDescription" type="RichTextLabel" parent="Margin/Footer/VBox"] +[node name="SecondaryDescription" type="RichTextLabel" parent="Margin/VBox/Content"] +layout_mode = 2 +size_flags_vertical = 4 +theme_override_colors/default_color = Color(0.639216, 0.639216, 0.639216, 1) +theme_override_font_sizes/normal_font_size = 13 +theme_override_font_sizes/bold_font_size = 13 +theme_override_font_sizes/italics_font_size = 13 +theme_override_font_sizes/bold_italics_font_size = 13 +theme_override_font_sizes/mono_font_size = 13 +bbcode_enabled = true +fit_content = true +scroll_following = true +autowrap_mode = 2 + +[node name="Footer" type="HBoxContainer" parent="Margin/VBox"] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_constants/separation = 6 + +[node name="ActionButton" type="Button" parent="Margin/VBox/Footer"] +layout_mode = 2 +focus_mode = 0 +theme = ExtResource("7_1bvyp") +icon = ExtResource("4_a5xlm") +script = ExtResource("9_53my3") +Download_Icon = "res://assets/images/download-cloud-line.svg" +Run_Icon = "res://assets/images/play-symbolic.svg" +Stop_Icon = "res://assets/images/stop-symbolic.svg" + +[node name="RefreshBMM" type="CheckButton" parent="Margin/VBox/Footer"] +layout_mode = 2 +size_flags_vertical = 8 +focus_mode = 0 +disabled = true +text = "Refresh BMM" + +[node name="BlockHeight" type="Label" parent="Margin/VBox/Footer"] visible = false layout_mode = 2 +theme_override_fonts/font = ExtResource("6_kg3t2") +theme_override_styles/normal = SubResource("StyleBoxEmpty_2fadl") + +[node name="ActionButton" type="Button" parent="Margin/Footer"] +custom_minimum_size = Vector2(100, 36) +layout_mode = 2 +size_flags_vertical = 4 +focus_mode = 0 +theme = ExtResource("7_1bvyp") +icon = ExtResource("4_a5xlm") +expand_icon = true +script = ExtResource("8_8xxdw") +download_icon = ExtResource("6_qglv3") +download_theme = ExtResource("7_bihi7") +run_icon = ExtResource("4_a5xlm") +run_theme = ExtResource("7_1bvyp") +stop_icon = ExtResource("8_sf64t") +stop_theme = ExtResource("11_c7v3q") + +[node name="DescriptionButton" type="Button" parent="Margin/Footer"] +custom_minimum_size = Vector2(36, 36) +layout_mode = 2 size_flags_horizontal = 8 +size_flags_vertical = 4 +icon = ExtResource("13_bierr") +icon_alignment = 1 [node name="SettingsButton" type="Button" parent="Margin/Footer"] -custom_minimum_size = Vector2(45, 45) +custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 4 -icon = ExtResource("13_5ideu") -text_overrun_behavior = 4 +icon = ExtResource("13_cajt3") icon_alignment = 1 [node name="SettingsButton2" type="Button" parent="Margin/Footer"] -custom_minimum_size = Vector2(45, 45) +custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 4 tooltip_text = "Delete node, keep wallet " theme_override_colors/font_color = Color(1, 1, 1, 1) -icon = ExtResource("14_1jmio") +icon = ExtResource("14_xvgjr") +text_overrun_behavior = 1 +clip_text = true icon_alignment = 1 [node name="SettingsButton3" type="Button" parent="Margin/Footer"] -custom_minimum_size = Vector2(45, 45) +custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 4 tooltip_text = "Delete node, delete wallet" -icon = ExtResource("15_y34su") +icon = ExtResource("15_1jbx2") icon_alignment = 1 [node name="LeftColor" type="ColorRect" parent="."] @@ -181,6 +231,54 @@ color = Color(0.207843, 0.517647, 0.894118, 1) [node name="Timer" type="Timer" parent="."] +[node name="DescriptionDialog" type="AcceptDialog" parent="."] +title = "DESCRIPTION" +initial_position = 2 +size = Vector2i(512, 192) +unresizable = true +content_scale_mode = 1 +content_scale_aspect = 4 +ok_button_text = "CLOSE" + +[node name="Box" type="VBoxContainer" parent="DescriptionDialog"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 8.0 +offset_top = 8.0 +offset_right = -8.0 +offset_bottom = -53.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Title" type="Label" parent="DescriptionDialog/Box"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 2 +theme_override_fonts/font = ExtResource("4_njapg") +theme_override_font_sizes/font_size = 28 +text = "Testchain" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Margin" type="ColorRect" parent="DescriptionDialog/Box"] +custom_minimum_size = Vector2(0, 1) +layout_mode = 2 + +[node name="Description" type="Label" parent="DescriptionDialog/Box"] +custom_minimum_size = Vector2(496, 0) +layout_mode = 2 +size_flags_vertical = 3 +theme_override_fonts/font = ExtResource("6_kg3t2") +theme_override_font_sizes/font_size = 16 +text = "A blank sidechain based on Bitcoin Core 16.99" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 2 + [connection signal="pressed" from="Margin/Footer/ActionButton" to="." method="_on_action_button_pressed"] [connection signal="pressed" from="Margin/Footer/SettingsButton" to="." method="_on_settings_button_pressed"] [connection signal="pressed" from="Margin/Footer/SettingsButton2" to="." method="_on_settings_button_2_pressed"] diff --git a/ui/components/dashboard/base_dashboard_panel/drivechain_btn_undownloaded.tres b/ui/components/dashboard/base_dashboard_panel/drivechain_btn_undownloaded.tres index 69add73..9dfb97b 100644 --- a/ui/components/dashboard/base_dashboard_panel/drivechain_btn_undownloaded.tres +++ b/ui/components/dashboard/base_dashboard_panel/drivechain_btn_undownloaded.tres @@ -5,7 +5,7 @@ content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 content_margin_bottom = 4.0 -bg_color = Color(0.890196, 0.490196, 0.203922, 0.196078) +bg_color = Color(0.207843, 0.517647, 0.894118, 0.196078) corner_radius_top_left = 4 corner_radius_top_right = 4 corner_radius_bottom_right = 4 @@ -21,7 +21,7 @@ content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 content_margin_bottom = 4.0 -bg_color = Color(1, 0.533333, 0, 1) +bg_color = Color(0.282353, 0.568627, 0.937255, 1) corner_radius_top_left = 4 corner_radius_top_right = 4 corner_radius_bottom_right = 4 diff --git a/ui/components/dashboard/dashboard.gd b/ui/components/dashboard/dashboard.gd deleted file mode 100644 index ad95810..0000000 --- a/ui/components/dashboard/dashboard.gd +++ /dev/null @@ -1,50 +0,0 @@ -extends ScrollContainer - -@onready var drivechain = $VBox/Drivechain -@onready var grid = $VBox/Grid/HBox/VBox - -var panel = preload("res://ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn") - - -# Called when the node enters the scene tree for the first time. -func _ready(): - Appstate.connect("chain_providers_changed", self._on_chain_providers_changed) - _on_chain_providers_changed() - - -func _on_chain_providers_changed(): - var current_panels = grid.get_children() - for p in current_panels: - grid.remove_child(p) - p.queue_free() - - for p in drivechain.get_children(): - drivechain.remove_child(p) - p.queue_free() - - - var chain_providers = Appstate.chain_providers - var chain_states = Appstate.chain_states - # add available providers first - for k in chain_providers: - var cp = chain_providers[k] - if cp.available_for_platform(): - if chain_states.has(k): - var cs = chain_states[k] - var p = panel.instantiate() - p.name = "panel_" + cp.id - if cp.id == "drivechain": - drivechain.add_child(p) - else: - grid.add_child(p) - p.setup(cp, cs) - - for k in chain_providers: - var cp = chain_providers[k] - if not cp.available_for_platform(): - if chain_states.has(k): - var cs = chain_states[k] - var p = panel.instantiate() - p.name = "panel_" + cp.id - grid.add_child(p) - p.setup(cp, cs) diff --git a/ui/components/dashboard/dashboard.tscn b/ui/components/dashboard/dashboard.tscn index 63619a0..7b4d819 100644 --- a/ui/components/dashboard/dashboard.tscn +++ b/ui/components/dashboard/dashboard.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=3 uid="uid://bwg823t4rnqpy"] [ext_resource type="PackedScene" uid="uid://yhgodesyh1pt" path="res://ui/components/dashboard/base_dashboard_panel/base_chain_dashboard_panel.tscn" id="1_vxcbl"] -[ext_resource type="Script" path="res://ui/components/dashboard/dashboard.gd" id="1_xkw7t"] +[ext_resource type="Script" path="res://source/nodes/dashboard.gd" id="1_xkw7t"] [ext_resource type="FontFile" uid="uid://bsnq76qepjdu4" path="res://assets/fonts/Saira_Expanded-Italic.ttf" id="3_enw07"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1mjr6"] @@ -35,6 +35,7 @@ layout_mode = 2 [node name="Label" type="Label" parent="VBox"] layout_mode = 2 theme_override_fonts/font = ExtResource("3_enw07") +theme_override_font_sizes/font_size = 12 text = "The following services are dependent upon the above drivechain being running. Please install and run that first before continuing." autowrap_mode = 3 @@ -46,6 +47,7 @@ size_flags_vertical = 3 layout_mode = 2 [node name="Panel" type="Panel" parent="VBox/Grid/HBox"] +visible = false custom_minimum_size = Vector2(50, 0) layout_mode = 2 size_flags_horizontal = 0 diff --git a/ui/components/dashboard/z_params_modal/z_params_modal.gd b/ui/components/dashboard/z_params_modal/z_params_modal.gd deleted file mode 100644 index 31debce..0000000 --- a/ui/components/dashboard/z_params_modal/z_params_modal.gd +++ /dev/null @@ -1,45 +0,0 @@ -extends ColorRect - -var chain_provider: ChainProvider -var zside_thread: Thread -var spinner_chars = ["|", "/", "-", "\\", "|", "/", "-", "\\"] -var cursor_index = 0 -var frames = 0 -var output - -@onready var label = $Center/Panel/Margin/Label - -func setup(_chain_provider: ChainProvider): - chain_provider = _chain_provider - #if chain_provider.id == "zside" || chain_provider.id == "zsail": - #zside_thread = Thread.new() - #zside_thread.start(_zside_fetch_params_thread) - #while zside_thread != null and zside_thread.is_alive(): - #await Appstate.get_tree().process_frame - # - #zside_thread.wait_to_finish() - #zside_thread = null - #chain_provider.start_chain() - #queue_free() - #else: - queue_free() - - -#func _zside_fetch_params_thread(): - #var script = ProjectSettings.globalize_path("res://zside-fetch-params.sh") - #print("executing zcash params fetch script: ", script) - #var exit_code = OS.execute(script, [], []) - # - #assert(exit_code == OK, "Unable to execute params fetch script") - #print("successfully downnloaded zcash params")/ - # - # - # -#func _process(_delta): - #frames += 1 - #if frames % 8 == 0: - #var c = spinner_chars[cursor_index] - #cursor_index += 1 - #if cursor_index == spinner_chars.size(): - #cursor_index = 0 - #label.text = "Downloading zparams " + c diff --git a/ui/components/fast_withdraw/fast_withdraw.gd b/ui/components/fast_withdraw/fast_withdraw.gd index c4d379b..c8cf295 100644 --- a/ui/components/fast_withdraw/fast_withdraw.gd +++ b/ui/components/fast_withdraw/fast_withdraw.gd @@ -106,7 +106,7 @@ func _on_button_copy_address_pressed() -> void: func _on_button_invoice_paid_pressed() -> void: # Tell the server we paid - var txid : String = $LineEditTXID.text + var txid : String = $HBoxContainer4/LineEditTXID.text $"/root/Net".invoice_paid.rpc_id(1, txid, $SpinBoxAmount.value, $LineEditMainchainAddress.text) diff --git a/ui/components/fast_withdraw/fast_withdraw.tscn b/ui/components/fast_withdraw/fast_withdraw.tscn index 8ba350d..16f952c 100644 --- a/ui/components/fast_withdraw/fast_withdraw.tscn +++ b/ui/components/fast_withdraw/fast_withdraw.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://ui/components/fast_withdraw/fast_withdraw.gd" id="1_4itd0"] -[node name="FastWithdraw" type="Control"] +[node name="FastWithdraw2" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -59,10 +59,10 @@ offset_bottom = 344.0 [node name="SpinBoxAmount" type="SpinBox" parent="."] layout_mode = 0 -offset_left = 620.0 -offset_top = 66.0 -offset_right = 776.0 -offset_bottom = 97.0 +offset_left = 669.0 +offset_top = 64.0 +offset_right = 825.0 +offset_bottom = 95.0 min_value = 1.0 value = 1.0 suffix = "BTC" @@ -110,9 +110,9 @@ offset_right = 216.0 offset_bottom = 50.0 text = "Not Connected" -[connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_request_invoice_pressed"] [connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_test_pressed"] -[connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_invoice_paid_pressed"] +[connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_request_invoice_pressed"] [connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_test_complete_pressed"] +[connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_invoice_paid_pressed"] [connection signal="pressed" from="ButtonCopyAddress" to="." method="_on_button_copy_address_pressed"] [connection signal="pressed" from="ButtonConnect" to="." method="_on_button_connect_pressed"] diff --git a/ui/components/fast_withdraw/fast_withdrawal.tscn b/ui/components/fast_withdraw/fast_withdrawal.tscn new file mode 100644 index 0000000..b40c2fe --- /dev/null +++ b/ui/components/fast_withdraw/fast_withdrawal.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=3 uid="uid://bm4wk2nic02cm"] + +[ext_resource type="PackedScene" uid="uid://duvvgc45h86gp" path="res://source/fast_withdrawal/fast_withdraw-new.tscn" id="1_5d7sy"] + +[node name="Fast Withdrawal" type="MarginContainer"] +custom_minimum_size = Vector2(835, 553) +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="FastWithdraw" parent="." instance=ExtResource("1_5d7sy")] +layout_mode = 2 diff --git a/ui/components/fast_withdraw/fast_withdrawal_format.gd b/ui/components/fast_withdraw/fast_withdrawal_format.gd new file mode 100644 index 0000000..49b2741 --- /dev/null +++ b/ui/components/fast_withdraw/fast_withdrawal_format.gd @@ -0,0 +1,17 @@ +extends MarginContainer + +const CUSTOM_FONT_PATH = "res://assets/fonts/Satoshi-Bold.otf" + +func _ready(): + apply_custom_font() + +func apply_custom_font(): + var custom_font = load(CUSTOM_FONT_PATH) + if custom_font: + apply_font_recursive(self, custom_font) + +func apply_font_recursive(node: Node, font: Font): + if node is Label or node is Button or node is LineEdit or node is TextEdit: + node.add_theme_font_override("font", font) + for child in node.get_children(): + apply_font_recursive(child, font) diff --git a/ui/components/left_menu/Quotes.gd b/ui/components/left_menu/Quotes.gd index 20085dc..663ceb8 100644 --- a/ui/components/left_menu/Quotes.gd +++ b/ui/components/left_menu/Quotes.gd @@ -1,5 +1,7 @@ extends Label +@export var author_label: Label + var quotes : Array[String] var current_quote_index : int = 0 @@ -44,7 +46,9 @@ func load_quotes(): func change_quote( index : int ): text = quotes[index] - pass + if author_label: + text = quotes[index].split("\n\t- ")[0] + author_label.text = quotes[index].split("- ")[-1] func fade_quote( index : int ): var fade_tween : Tween = create_tween() diff --git a/ui/components/left_menu/left_menu.gd b/ui/components/left_menu/left_menu.gd index ea35db7..baa5ecf 100644 --- a/ui/components/left_menu/left_menu.gd +++ b/ui/components/left_menu/left_menu.gd @@ -1,33 +1,90 @@ extends PanelContainer -var settings_shown : int = 0 - -@onready var dashboard_button : Node = $MarginContainer/HBox/DashboardButton -@onready var playground_button : Node = $MarginContainer/HBox/PlaygroundButton -@onready var settings_button : Node = $MarginContainer/HBox/SettingsButton - -signal left_menu_button_pressed(v: int) +@onready var quotes_label: Label = $MarginContainer/HBox/Quotes +@onready var author_label: Label = $MarginContainer/HBox/Author +@onready var next_button: Button = $MarginContainer/HBox/NextButton +@onready var prev_button: Button = $MarginContainer/HBox/PrevButton +var quotes: Array = [] +var current_quote_index: int = 0 +var quote_timer: Timer func _ready() -> void: - $FastWithdrawWindow.hide() - - -func _on_left_menu_button_toggled(button_pressed, v): + load_quotes() + change_quote(0) + next_button.pressed.connect(self._on_next_button_pressed) + prev_button.pressed.connect(self._on_prev_button_pressed) - settings_shown = 1-settings_shown - - left_menu_button_pressed.emit(settings_shown) + quote_timer = Timer.new() + quote_timer.timeout.connect(self._on_quote_timer_timeout) + quote_timer.set_wait_time(10) + add_child(quote_timer) + quote_timer.start() + +func load_quotes(): + var file_path = "res://assets/data/quotes.json" + if FileAccess.file_exists(file_path): + var file = FileAccess.open(file_path, FileAccess.READ) + if file: + var content = file.get_as_text() + file.close() + + var json = JSON.new() + var error_parse = json.parse(content) + if error_parse == OK: + var data = json.get_data() + if data is Array: + quotes = data + else: + push_error("JSON data is not an array") + else: + push_error("Failed to parse JSON with error: " + str(error_parse)) + else: + push_error("JSON file does not exist at path: " + file_path) + +func change_quote(index: int): + if quotes.is_empty(): + return + var quote_data = quotes[index] + if quote_data is Dictionary and quote_data.has("quote") and quote_data.has("author"): + var quote_text = quote_data["quote"] + quotes_label.text = "\"" + quote_text + "\"" + author_label.text = "- " + quote_data["author"] + + var word_count = quote_text.split(" ").size() + if word_count < 30: + quotes_label.add_theme_font_size_override("font_size", 17) + elif word_count < 50: + quotes_label.add_theme_font_size_override("font_size", 14) + else: + quotes_label.add_theme_font_size_override("font_size", 13) + else: + push_error("Invalid quote data format") -func _on_close_button_pressed(): - var shutter_tween : Tween = create_tween() - shutter_tween.parallel().tween_property( $MarginContainer, "scale", Vector2(1.0,0.0), 0.5 ) - shutter_tween.parallel().tween_property( self, "size/y", 0.0, 0.5 ) +func fade_quote(index: int): + var fade_tween: Tween = create_tween() + fade_tween.tween_property(quotes_label, "modulate", Color(1,1,1,0), 0.25) + fade_tween.parallel().tween_property(author_label, "modulate", Color(1,1,1,0), 0.25) + await fade_tween.finished + change_quote(index) + fade_tween = create_tween() + fade_tween.tween_property(quotes_label, "modulate", Color(1,1,1,1), 0.25) + fade_tween.parallel().tween_property(author_label, "modulate", Color(1,1,1,1), 0.25) +func _on_next_button_pressed(): + current_quote_index = (current_quote_index + 1) % quotes.size() + fade_quote(current_quote_index) + reset_quote_timer() -func _on_fast_withdraw_button_pressed() -> void: - $FastWithdrawWindow.show() +func _on_prev_button_pressed(): + current_quote_index = (current_quote_index - 1 + quotes.size()) % quotes.size() + fade_quote(current_quote_index) + reset_quote_timer() +func _on_quote_timer_timeout(): + current_quote_index = (current_quote_index + 1) % quotes.size() + fade_quote(current_quote_index) -func _on_fast_withdraw_window_close_requested() -> void: - $FastWithdrawWindow.hide() +func reset_quote_timer(): + quote_timer.stop() + quote_timer.start() diff --git a/ui/components/left_menu/left_menu.tscn b/ui/components/left_menu/left_menu.tscn index 51ad577..ead1a98 100644 --- a/ui/components/left_menu/left_menu.tscn +++ b/ui/components/left_menu/left_menu.tscn @@ -1,137 +1,125 @@ -[gd_scene load_steps=12 format=3 uid="uid://dwhtby81ylt3s"] +[gd_scene load_steps=8 format=3 uid="uid://dwhtby81ylt3s"] -[ext_resource type="Theme" uid="uid://deiietf7bytje" path="res://ui/components/left_menu/left_menu_button.tres" id="1_vs06l"] [ext_resource type="Script" path="res://ui/components/left_menu/left_menu.gd" id="1_yja75"] -[ext_resource type="Texture2D" uid="uid://b3cf3lw2nhpjs" path="res://assets/images/close.svg" id="2_ahqh1"] [ext_resource type="Texture2D" uid="uid://blq6pvspmkcbj" path="res://assets/images/prev.svg" id="3_3lhq3"] -[ext_resource type="Texture2D" uid="uid://djtv7qiy8hkat" path="res://assets/images/dashboard-3-line.svg" id="3_rgc2b"] -[ext_resource type="Texture2D" uid="uid://srldhyvbmy57" path="res://assets/images/settings-4-line.svg" id="4_cr7m3"] -[ext_resource type="Texture2D" uid="uid://drsftlr0wcb3m" path="res://assets/images/chain.svg" id="4_v0or6"] [ext_resource type="Texture2D" uid="uid://c5ddyq86urmmy" path="res://assets/images/next.svg" id="7_k0tsh"] [ext_resource type="Script" path="res://ui/components/left_menu/Quotes.gd" id="7_kx1k8"] -[ext_resource type="PackedScene" uid="uid://b5wmjp1psgsvr" path="res://ui/components/fast_withdraw/fast_withdraw.tscn" id="10_kuvno"] +[ext_resource type="FontFile" uid="uid://ciu7chyqqs4k7" path="res://assets/fonts/Saira_Expanded-Bold.ttf" id="11_6qy05"] +[ext_resource type="FontFile" uid="uid://dgxbgdcr3s84u" path="res://assets/fonts/Saira_Expanded-Regular.ttf" id="12_nwgc3"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c8gs8"] bg_color = Color(0.141176, 0.141176, 0.141176, 1) -[node name="LeftMenu" type="PanelContainer"] +[node name="Menu" type="PanelContainer"] clip_contents = true anchors_preset = 12 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = -79.0 +offset_top = -123.0 grow_horizontal = 2 grow_vertical = 0 size_flags_horizontal = 3 -size_flags_vertical = 8 +size_flags_vertical = 6 theme_override_styles/panel = SubResource("StyleBoxFlat_c8gs8") script = ExtResource("1_yja75") [node name="MarginContainer" type="MarginContainer" parent="."] layout_mode = 2 -theme_override_constants/margin_left = 10 -theme_override_constants/margin_top = 5 -theme_override_constants/margin_right = 10 -theme_override_constants/margin_bottom = 5 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 [node name="HBox" type="HBoxContainer" parent="MarginContainer"] -custom_minimum_size = Vector2(200, 0) layout_mode = 2 -size_flags_vertical = 8 size_flags_stretch_ratio = 0.0 -theme_override_constants/separation = 0 +theme_override_constants/separation = 8 -[node name="SettingsButton" type="Button" parent="MarginContainer/HBox"] +[node name="PrevButton" type="Button" parent="MarginContainer/HBox"] layout_mode = 2 -focus_mode = 0 -theme = ExtResource("1_vs06l") -toggle_mode = true -icon = ExtResource("4_cr7m3") -alignment = 0 +text = "Prev" -[node name="FastWithdrawButton" type="Button" parent="MarginContainer/HBox"] +[node name="Quotes" type="Label" parent="MarginContainer/HBox"] +custom_minimum_size = Vector2(250, 0) layout_mode = 2 -text = "Fast Withdraw" -icon = ExtResource("4_v0or6") +size_flags_horizontal = 3 +size_flags_vertical = 1 +theme_override_font_sizes/font_size = 13 +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 2 -[node name="DashboardButton" type="Button" parent="MarginContainer/HBox"] -visible = false -custom_minimum_size = Vector2(0, 40) +[node name="Author" type="Label" parent="MarginContainer/HBox"] layout_mode = 2 -size_flags_vertical = 4 -focus_mode = 0 -theme = ExtResource("1_vs06l") -toggle_mode = true -button_pressed = true -text = "DASHBOARD" -icon = ExtResource("3_rgc2b") -alignment = 0 +theme_override_font_sizes/font_size = 16 -[node name="PrevButton" type="Button" parent="MarginContainer/HBox"] +[node name="NextButton" type="Button" parent="MarginContainer/HBox"] layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -icon = ExtResource("3_3lhq3") -flat = true +text = "Next" -[node name="Spacer" type="Control" parent="MarginContainer/HBox"] -custom_minimum_size = Vector2(10, 50) +[node name="QuotesDialog" type="AcceptDialog" parent="."] +title = "QUOTES" +initial_position = 2 +size = Vector2i(512, 384) +unresizable = true +content_scale_mode = 1 +content_scale_aspect = 4 +ok_button_text = "CLOSE" + +[node name="Box" type="VBoxContainer" parent="QuotesDialog"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Header" type="HBoxContainer" parent="QuotesDialog/Box"] layout_mode = 2 -[node name="PlaygroundButton" type="Button" parent="MarginContainer/HBox"] -visible = false -custom_minimum_size = Vector2(0, 40) +[node name="PrevButton" type="Button" parent="QuotesDialog/Box/Header"] layout_mode = 2 +size_flags_horizontal = 4 size_flags_vertical = 4 -focus_mode = 0 -theme = ExtResource("1_vs06l") -toggle_mode = true -text = "PLAYGROUND" -alignment = 0 +icon = ExtResource("3_3lhq3") +flat = true -[node name="Quotes" type="Label" parent="MarginContainer/HBox"] -custom_minimum_size = Vector2(250, 0) +[node name="Author" type="Label" parent="QuotesDialog/Box/Header"] layout_mode = 2 size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 10 -text = "\"Used to the conditions of a capitalistic environment, the average American takes it for granted that every year business makes something new and better accessible to him. Looking backward upon the years of his own life, he realizes that many implements that were totally unknown in the days of his youth and many others which at that time could be enjoyed only by a small minority are now standard equipment of almost every household.\" ---Ludwig von Mises" -horizontal_alignment = 2 -autowrap_mode = 2 -script = ExtResource("7_kx1k8") - -[node name="Spacer2" type="Control" parent="MarginContainer/HBox"] -custom_minimum_size = Vector2(10, 50) -layout_mode = 2 - -[node name="NextButton" type="Button" parent="MarginContainer/HBox"] +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 2 +theme_override_fonts/font = ExtResource("11_6qy05") +theme_override_font_sizes/font_size = 28 +text = "Name" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="NextButton" type="Button" parent="QuotesDialog/Box/Header"] layout_mode = 2 -size_flags_horizontal = 4 +size_flags_horizontal = 8 size_flags_vertical = 4 icon = ExtResource("7_k0tsh") flat = true -[node name="CloseButton" type="Button" parent="MarginContainer/HBox"] -visible = false +[node name="Margin" type="ColorRect" parent="QuotesDialog/Box"] +custom_minimum_size = Vector2(0, 1) layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -icon = ExtResource("2_ahqh1") -flat = true -[node name="FastWithdrawWindow" type="Window" parent="."] -title = "Drivechain Launcher Fast Withdrawal" -initial_position = 2 -size = Vector2i(800, 500) - -[node name="FastWithdraw" parent="FastWithdrawWindow" instance=ExtResource("10_kuvno")] - -[connection signal="toggled" from="MarginContainer/HBox/SettingsButton" to="." method="_on_left_menu_button_toggled" binds= [1]] -[connection signal="pressed" from="MarginContainer/HBox/FastWithdrawButton" to="." method="_on_fast_withdraw_button_pressed"] -[connection signal="toggled" from="MarginContainer/HBox/DashboardButton" to="." method="_on_left_menu_button_toggled" binds= [0]] -[connection signal="pressed" from="MarginContainer/HBox/PrevButton" to="MarginContainer/HBox/Quotes" method="_on_prev_button_pressed"] -[connection signal="toggled" from="MarginContainer/HBox/PlaygroundButton" to="." method="_on_left_menu_button_toggled" binds= [1]] -[connection signal="pressed" from="MarginContainer/HBox/NextButton" to="MarginContainer/HBox/Quotes" method="_on_next_button_pressed"] -[connection signal="pressed" from="MarginContainer/HBox/CloseButton" to="." method="_on_close_button_pressed"] -[connection signal="close_requested" from="FastWithdrawWindow" to="." method="_on_fast_withdraw_window_close_requested"] +[node name="Quotes" type="Label" parent="QuotesDialog/Box" node_paths=PackedStringArray("author_label")] +custom_minimum_size = Vector2(496, 0) +layout_mode = 2 +size_flags_vertical = 3 +theme_override_fonts/font = ExtResource("12_nwgc3") +theme_override_font_sizes/font_size = 16 +text = "Quote" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 2 +script = ExtResource("7_kx1k8") +author_label = NodePath("../Header/Author") + +[connection signal="pressed" from="QuotesDialog/Box/Header/PrevButton" to="QuotesDialog/Box/Quotes" method="_on_prev_button_pressed"] +[connection signal="pressed" from="QuotesDialog/Box/Header/NextButton" to="QuotesDialog/Box/Quotes" method="_on_next_button_pressed"] diff --git a/ui/components/left_menu/loadquotes.gd b/ui/components/left_menu/loadquotes.gd new file mode 100644 index 0000000..e69de29 diff --git a/ui/components/settings/reset_everything_window.gd b/ui/components/settings/reset_everything_window.gd index 96ff51d..5c01d8a 100644 --- a/ui/components/settings/reset_everything_window.gd +++ b/ui/components/settings/reset_everything_window.gd @@ -1,13 +1,58 @@ extends ColorRect -# Called when the node enters the scene tree for the first time. +@onready var button1: Button = $CenterContainer/Panel/MarginContainer/VBoxContainer/Button +@onready var button2: Button = $CenterContainer/Panel/MarginContainer/VBoxContainer/Button2 + +var cooldown_time = 5.0 +var button1_cooldown = 0.0 +var button2_cooldown = 0.0 + +var normal_style: StyleBoxFlat +var cooldown_style: StyleBoxFlat +var button2_normal_style: StyleBoxFlat + func _ready(): - pass # Replace with function body. + normal_style = StyleBoxFlat.new() + normal_style.bg_color = Color(0.2, 0.2, 0.2) # Dark grey + + cooldown_style = StyleBoxFlat.new() + cooldown_style.bg_color = Color(0.5, 0.5, 0.5) # Light grey + + button2_normal_style = StyleBoxFlat.new() + button2_normal_style.bg_color = Color(0.8, 0.2, 0.2) # Softer red + + # Increase button size + var bigger_size = Vector2(200, 50) # Adjust these values as needed + + if button1: + button1.add_theme_stylebox_override("normal", normal_style.duplicate()) + button1.custom_minimum_size = bigger_size + if button2: + button2.add_theme_stylebox_override("normal", button2_normal_style.duplicate()) + button2.custom_minimum_size = bigger_size -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta): - pass + # Add some padding to the styles + var padding = 10 + for style in [normal_style, cooldown_style, button2_normal_style]: + style.content_margin_left = padding + style.content_margin_right = padding + style.content_margin_top = padding + style.content_margin_bottom = padding +func _process(delta): + if button1: + if button1_cooldown > 0: + button1_cooldown -= delta + if button1_cooldown <= 0: + button1.add_theme_stylebox_override("normal", normal_style.duplicate()) + button1.disabled = false + + if button2: + if button2_cooldown > 0: + button2_cooldown -= delta + if button2_cooldown <= 0: + button2.add_theme_stylebox_override("normal", button2_normal_style.duplicate()) + button2.disabled = false func _on_center_container_gui_input(event): if event is InputEventMouseButton: @@ -15,12 +60,16 @@ func _on_center_container_gui_input(event): if event.pressed: queue_free() - func _on_button_pressed(): - - Appstate.reset_everything(true) - + if button1 and button1_cooldown <= 0: + Appstate.reset_everything(true) + button1.add_theme_stylebox_override("normal", cooldown_style.duplicate()) + button1.disabled = true + button1_cooldown = cooldown_time func _on_button_2_pressed(): - - Appstate.reset_everything(false) # Replace with function body. + if button2 and button2_cooldown <= 0: + Appstate.reset_everything(false) + button2.add_theme_stylebox_override("normal", cooldown_style.duplicate()) + button2.disabled = true + button2_cooldown = cooldown_time diff --git a/ui/components/settings/settings.gd b/ui/components/settings/settings.gd index 6a6a787..ebdc54f 100644 --- a/ui/components/settings/settings.gd +++ b/ui/components/settings/settings.gd @@ -1,11 +1,20 @@ -extends ScrollContainer +extends MarginContainer -@onready var app_dir = $VBox/DirectoriesSettings/AppDataDir/Value -@onready var drivechain_dir = $VBox/DirectoriesSettings/DrivechainDataDir/Value +@onready var app_dir = $Window/Container/DataDirectories/Options/Inputs/ApplicationDataDirectory +@onready var drivechain_dir = $Window/Container/DataDirectories/Options/Inputs/DriveChainDataDirectory @onready var scale_spin = $VBox/AppSettings/HBox/ScaleSpin +@onready var app_dir_buttton: Button = $Window/Container/DataDirectories/Options/BrowseButtons/ApplicationDataDirectory +@onready var drivechain_dir_button: Button = $Window/Container/DataDirectories/Options/BrowseButtons/DriveChainDataDirectory +@onready var reset_button: Button = $Window/Reset @onready var reset_everything_scene = preload("res://ui/components/settings/reset_everything_window.tscn") + +const CUSTOM_FONT_PATH = "res://assets/fonts/Satoshi-Bold.otf" + signal hide_settings +var base_size: Vector2 +var reset_popup: Control = null + func _ready(): var user_data_dir : String = ProjectSettings.globalize_path(OS.get_user_data_dir()) var user_drivechain_dir : String = ProjectSettings.globalize_path(Appstate.get_drivechain_dir()) @@ -13,49 +22,99 @@ func _ready(): app_dir.placeholder_text = "\\".join(user_data_dir.split("/")) drivechain_dir.placeholder_text = "\\".join(user_drivechain_dir.split("/")) else: - app_dir.placeholder_text = user_data_dir + app_dir.placeholder_text = user_data_dir drivechain_dir.placeholder_text = user_drivechain_dir - var scale_factor = get_tree().root.get_content_scale_factor() - scale_spin.value = scale_factor - + app_dir_buttton.connect("pressed",Callable(self, "_on_app_data_open_pressed")) + drivechain_dir_button.connect("pressed",Callable(self, "_on_drivechain_data_open_pressed")) + reset_button.connect("pressed", Callable(self, "_on_reset_button_pressed")) + apply_custom_font() + +func apply_custom_font(): + var custom_font = load(CUSTOM_FONT_PATH) + if custom_font: + apply_font_recursive(self, custom_font) + +func apply_font_recursive(node: Node, font: Font): + if node is Label or node is Button or node is LineEdit or node is TextEdit: + node.add_theme_font_override("font", font) + for child in node.get_children(): + apply_font_recursive(child, font) func _on_reset_button_pressed() -> void: - print("button pressed") - var reset_window = reset_everything_scene.instantiate() - get_tree().root.get_node("Main").add_child(reset_window) - reset_window.show() # Call this method if the window is not set to automatically show upon being added to the scene tree. - print("Reset window opened") - -func _on_reset_everything_window_close_requested() -> void: - reset_everything_scene.queue_free() # This removes the window from the scene tree and frees it - print("Reset window closed") - -## This method is called when the confirmation dialog is confirmed -#func _on_confirmation_confirmed(): - #Appstate.reset_everything() + if reset_popup != null: + _center_reset_popup() + reset_popup.show() + return + + reset_popup = Control.new() + reset_popup.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + + var background = ColorRect.new() + background.color = Color(0, 0, 0, 0.5) + background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + background.connect("gui_input", Callable(self, "_on_background_gui_input")) + reset_popup.add_child(background) + + var panel = Panel.new() + panel.custom_minimum_size = Vector2(400, 200) + panel.set_anchors_preset(Control.PRESET_CENTER) + panel.set_anchor_and_offset(SIDE_LEFT, 0.5, -200) + panel.set_anchor_and_offset(SIDE_TOP, 0.5, -100) + panel.set_anchor_and_offset(SIDE_RIGHT, 0.5, 200) + panel.set_anchor_and_offset(SIDE_BOTTOM, 0.5, 100) + reset_popup.add_child(panel) + + var stylebox = StyleBoxFlat.new() + stylebox.set_border_width_all(2) + stylebox.border_color = Color.WHITE + stylebox.bg_color = Color(0.15, 0.15, 0.15) + panel.add_theme_stylebox_override("panel", stylebox) + + var reset_content = reset_everything_scene.instantiate() + reset_content.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT, Control.PRESET_MODE_KEEP_SIZE, 10) + panel.add_child(reset_content) + + for child in reset_content.get_children(): + if child is Button: + child.connect("pressed", Callable(self, "_on_reset_popup_close_pressed")) + + get_tree().root.add_child(reset_popup) + + get_tree().root.connect("size_changed", Callable(self, "_center_reset_popup")) + + reset_popup.show() + +func _center_reset_popup() -> void: + if reset_popup != null: + var panel = reset_popup.get_node("Panel") + if panel != null: + var viewport_size = get_viewport().size + panel.set_anchor_and_offset(SIDE_LEFT, 0.5, -panel.custom_minimum_size.x / 2) + panel.set_anchor_and_offset(SIDE_TOP, 0.5, -panel.custom_minimum_size.y / 2) + panel.set_anchor_and_offset(SIDE_RIGHT, 0.5, panel.custom_minimum_size.x / 2) + panel.set_anchor_and_offset(SIDE_BOTTOM, 0.5, panel.custom_minimum_size.y / 2) + +func _on_background_gui_input(event): + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: + _on_reset_popup_close_pressed() + +func _on_reset_popup_close_pressed() -> void: + if reset_popup != null: + reset_popup.queue_free() + reset_popup = null + get_tree().root.disconnect("size_changed", Callable(self, "_center_reset_popup")) func _on_app_data_open_pressed(): open_file(OS.get_user_data_dir()) - func _on_drivechain_data_open_pressed(): open_file(Appstate.get_drivechain_dir()) - func open_file(value: String): var globalized = ProjectSettings.globalize_path(value) - - # macOS expects file paths to start with file://. Without - # this, shell_open tries to execute the path as a program. if Appstate.get_platform() == Appstate.platform.MAC: globalized = "file://" + globalized - OS.shell_open(globalized) - -func _on_scale_spin_value_changed(value): - Appstate.update_display_scale(value) - - func _on_hide_button_pressed(): hide_settings.emit(0) diff --git a/ui/components/settings/settings.tscn b/ui/components/settings/settings.tscn index 2d98d74..51cb170 100644 --- a/ui/components/settings/settings.tscn +++ b/ui/components/settings/settings.tscn @@ -121,27 +121,11 @@ max_value = 2.0 step = 0.1 value = 1.0 -[node name="Footer" type="VBoxContainer" parent="VBox"] -layout_mode = 2 -size_flags_vertical = 10 - -[node name="Border" type="HSeparator" parent="VBox/Footer"] -layout_mode = 2 -size_flags_vertical = 10 - -[node name="HBoxContainer" type="HBoxContainer" parent="VBox/Footer"] -layout_mode = 2 - -[node name="GoBackButton" type="Button" parent="VBox/Footer/HBoxContainer"] -layout_mode = 2 -text = "Hide Settings" - -[node name="VSeparator" type="VSeparator" parent="VBox/Footer/HBoxContainer"] -modulate = Color(1, 1, 1, 0) +[node name="Spacer" type="Control" parent="VBox/AppSettings/HBox"] layout_mode = 2 size_flags_horizontal = 3 -[node name="ResetButton" type="Button" parent="VBox/Footer/HBoxContainer"] +[node name="ResetButton" type="Button" parent="VBox/AppSettings/HBox"] layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 2 @@ -151,5 +135,4 @@ text = "Reset [connection signal="pressed" from="VBox/DirectoriesSettings/AppDataDir/Open" to="." method="_on_app_data_open_pressed"] [connection signal="pressed" from="VBox/DirectoriesSettings/DrivechainDataDir/Open" to="." method="_on_drivechain_data_open_pressed"] [connection signal="value_changed" from="VBox/AppSettings/HBox/ScaleSpin" to="." method="_on_scale_spin_value_changed"] -[connection signal="pressed" from="VBox/Footer/HBoxContainer/GoBackButton" to="." method="_on_hide_button_pressed"] -[connection signal="pressed" from="VBox/Footer/HBoxContainer/ResetButton" to="." method="_on_reset_button_pressed"] +[connection signal="pressed" from="VBox/AppSettings/HBox/ResetButton" to="." method="_on_reset_button_pressed"] diff --git a/ui/main.gd b/ui/main.gd index d09b85e..226e53b 100644 --- a/ui/main.gd +++ b/ui/main.gd @@ -1,17 +1,11 @@ -extends CanvasLayer +extends Node -@onready var tab_container = $VBox/Content/TabContainer -@onready var left_menu = $VBox/LeftMenu -@onready var settings_tab = $VBox/Content/TabContainer/Settings - - -# Called when the node enters the scene tree for the first time. func _ready(): - left_menu.left_menu_button_pressed.connect(self._on_left_menu_button_pressed) - settings_tab.hide_settings.connect(self._on_left_menu_button_pressed) - - get_tree().root.title += " | " + Appstate.app_config.get_value("", "version") - -func _on_left_menu_button_pressed(v: int): - tab_container.current_tab = v - if v == 0: left_menu.settings_shown = 0 + # Load and instantiate the scene + var application_scene = load("res://source/application/application.tscn") + if application_scene: + var application_instance = application_scene.instantiate() + # Add the scene to the current tree + add_child(application_instance) + else: + print("Failed to load the application scene.") diff --git a/ui/main.tscn b/ui/main.tscn index d1f1ec3..3e68b86 100644 --- a/ui/main.tscn +++ b/ui/main.tscn @@ -1,36 +1,75 @@ -[gd_scene load_steps=5 format=3 uid="uid://dscucqwnoepb1"] +[gd_scene load_steps=8 format=3 uid="uid://dscucqwnoepb1"] [ext_resource type="Script" path="res://ui/main.gd" id="1_ur5w6"] [ext_resource type="PackedScene" uid="uid://dwhtby81ylt3s" path="res://ui/components/left_menu/left_menu.tscn" id="2_0lj2k"] +[ext_resource type="Script" path="res://ui/tabs.gd" id="2_usfcd"] [ext_resource type="PackedScene" uid="uid://bwg823t4rnqpy" path="res://ui/components/dashboard/dashboard.tscn" id="3_3v44j"] +[ext_resource type="PackedScene" uid="uid://dm660sh0nt05c" path="res://ui/components/create_wallet/create_wallet.tscn" id="3_nvymr"] [ext_resource type="PackedScene" uid="uid://bommmvy1qyobc" path="res://ui/components/settings/settings.tscn" id="4_3j67w"] +[ext_resource type="PackedScene" uid="uid://b5wmjp1psgsvr" path="res://ui/components/fast_withdraw/fast_withdraw.tscn" id="5_34lsw"] -[node name="Main" type="CanvasLayer"] -script = ExtResource("1_ur5w6") - -[node name="VBox" type="VBoxContainer" parent="."] +[node name="Main" type="VBoxContainer"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 theme_override_constants/separation = 0 +script = ExtResource("1_ur5w6") -[node name="Content" type="MarginContainer" parent="VBox"] +[node name="Background" type="Panel" parent="."] layout_mode = 2 +size_flags_vertical = 3 + +[node name="Content" type="MarginContainer" parent="Background"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="TabContainer" type="TabContainer" parent="VBox/Content"] +[node name="TabContainer" type="TabContainer" parent="Background/Content"] layout_mode = 2 -tabs_visible = false +current_tab = 4 +clip_tabs = false +all_tabs_in_front = true +script = ExtResource("2_usfcd") -[node name="Dashboard" parent="VBox/Content/TabContainer" instance=ExtResource("3_3v44j")] +[node name="Wallet" type="Control" parent="Background/Content/TabContainer"] +visible = false layout_mode = 2 -[node name="Settings" parent="VBox/Content/TabContainer" instance=ExtResource("4_3j67w")] +[node name="CreateWallet" parent="Background/Content/TabContainer/Wallet" instance=ExtResource("3_nvymr")] +layout_mode = 1 + +[node name="Nodes" parent="Background/Content/TabContainer" instance=ExtResource("3_3v44j")] visible = false layout_mode = 2 -[node name="LeftMenu" parent="VBox" instance=ExtResource("2_0lj2k")] +[node name="Fast Withdrawal" type="Control" parent="Background/Content/TabContainer"] +visible = false layout_mode = 2 + +[node name="FastWithdraw" parent="Background/Content/TabContainer/Fast Withdrawal" instance=ExtResource("5_34lsw")] +layout_mode = 1 + +[node name="Tools" type="Control" parent="Background/Content/TabContainer"] +visible = false +layout_mode = 2 + +[node name="Settings" parent="Background/Content/TabContainer" instance=ExtResource("4_3j67w")] +layout_mode = 2 + +[node name="Menu" parent="." instance=ExtResource("2_0lj2k")] +layout_mode = 2 + +[node name="VBox" type="VBoxContainer" parent="."] +visible = false +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/separation = 0 + +[node name="ChainProviderInfoLayer" type="CanvasLayer" parent="."] diff --git a/ui/tabs.gd b/ui/tabs.gd new file mode 100644 index 0000000..9385310 --- /dev/null +++ b/ui/tabs.gd @@ -0,0 +1,47 @@ +extends TabContainer + +func _ready(): + size_flags_horizontal = SIZE_EXPAND_FILL + var theme = Theme.new() + var tab_count = get_tab_count() + var container_width = get_viewport().size.x + var tab_width = container_width / tab_count + + theme.set_constant("tab_minimum_width", "TabContainer", tab_width) + theme.set_constant("tab_height", "TabContainer", 100) + theme.set_constant("hseparation", "TabContainer", 0) # No separation between tabs + + # Set alignment to fill + set_tab_alignment(TabBar.ALIGNMENT_MAX) + + theme.set_color("font_selected_color", "TabContainer", Color(1, 1, 1, 1)) + theme.set_color("font_unselected_color", "TabContainer", Color(0.7, 0.7, 0.7, 1)) + theme.set_color("font_hovered_color", "TabContainer", Color(1, 1, 1, 1)) + + var base_stylebox = StyleBoxFlat.new() + base_stylebox.set_corner_radius_all(0) # No rounded corners + base_stylebox.set_content_margin_all(0) # No content margin + + var selected_stylebox = base_stylebox.duplicate() + selected_stylebox.set_bg_color(Color(0.2, 0.2, 0.2, 1)) + + var unselected_stylebox = base_stylebox.duplicate() + unselected_stylebox.set_bg_color(Color(0.1, 0.1, 0.1, 1)) + + var hover_stylebox = base_stylebox.duplicate() + hover_stylebox.set_bg_color(Color(0.15, 0.15, 0.15, 1)) + + theme.set_stylebox("tab_selected", "TabContainer", selected_stylebox) + theme.set_stylebox("tab_unselected", "TabContainer", unselected_stylebox) + theme.set_stylebox("tab_selected_hover", "TabContainer", selected_stylebox) + theme.set_stylebox("tab_unselected_hover", "TabContainer", hover_stylebox) + + # Remove the panel behind the tabs + var empty_stylebox = StyleBoxEmpty.new() + theme.set_stylebox("panel", "TabContainer", empty_stylebox) + + # Apply the theme to this TabContainer + self.theme = theme + + # Apply global font override + GlobalFont.apply_font_override(self)