diff --git a/tools/configurator/files/Button.gd b/tools/configurator/files/Button.gd new file mode 100644 index 00000000..7d329d49 --- /dev/null +++ b/tools/configurator/files/Button.gd @@ -0,0 +1,14 @@ +extends Button + +func _ready(): + self.pressed.connect(self._button_pressed) + +func _button_pressed(): + var output = [] +# var exit_code = OS.execute("ls", ["-l", "/"], output, true) + var exit_code = OS.execute("touch", ["godot_configurator_hardcoded"], output) + print("exit code: ", exit_code) + print("output: ", output) + + + diff --git a/tools/configurator/files/Button2.gd b/tools/configurator/files/Button2.gd new file mode 100644 index 00000000..9476e0a0 --- /dev/null +++ b/tools/configurator/files/Button2.gd @@ -0,0 +1,12 @@ +extends Button + +func _ready(): + self.pressed.connect(self._button_pressed) + +func _button_pressed(): + var output = [] +# var exit_code = OS.execute("ls", ["-l", "/"], output, true) + var exit_code = OS.execute("bash", ["touch_external.sh"], output) + print("exit code: ", exit_code) + print("output: ", + output) diff --git a/tools/configurator/files/export_presets.cfg b/tools/configurator/files/export_presets.cfg new file mode 100644 index 00000000..9b878423 --- /dev/null +++ b/tools/configurator/files/export_presets.cfg @@ -0,0 +1,39 @@ +[preset.0] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="export/configurator.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" diff --git a/tools/configurator/files/icon.svg b/tools/configurator/files/icon.svg new file mode 100644 index 00000000..98563325 --- /dev/null +++ b/tools/configurator/files/icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/tools/configurator/files/icon.svg.import b/tools/configurator/files/icon.svg.import new file mode 100644 index 00000000..800fa157 --- /dev/null +++ b/tools/configurator/files/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bv6vh33cnfaw4" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/tools/configurator/files/main.gd b/tools/configurator/files/main.gd new file mode 100644 index 00000000..40eb1fbb --- /dev/null +++ b/tools/configurator/files/main.gd @@ -0,0 +1,4 @@ +extends Control + +func _ready(): + $VBoxContainerButtons/Button.grab_focus() diff --git a/tools/configurator/files/main.tscn b/tools/configurator/files/main.tscn new file mode 100644 index 00000000..bb0a8bbc --- /dev/null +++ b/tools/configurator/files/main.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=6 format=3 uid="uid://qk2gw74anwlq"] + +[ext_resource type="Texture2D" uid="uid://bv6vh33cnfaw4" path="res://icon.svg" id="1_axfei"] +[ext_resource type="Script" path="res://main.gd" id="1_obpq7"] +[ext_resource type="Script" path="res://Button.gd" id="3_aenvv"] +[ext_resource type="Script" path="res://Button2.gd" id="4_u2f14"] + +[sub_resource type="LabelSettings" id="LabelSettings_b77hh"] +font_size = 24 + +[node name="Control" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_obpq7") + +[node name="Background" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.20871, 0.20871, 0.20871, 1) + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(76, 66) +scale = Vector2(0.25, 0.25) +texture = ExtResource("1_axfei") + +[node name="TitleText" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -208.5 +offset_top = 50.0 +offset_right = 208.5 +offset_bottom = 87.0 +grow_horizontal = 2 +text = "Welcome to RetroDECK configurator" +label_settings = SubResource("LabelSettings_b77hh") +horizontal_alignment = 1 + +[node name="VBoxContainerButtons" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -70.5 +offset_top = -33.0 +offset_right = 70.5 +offset_bottom = 33.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Button" type="Button" parent="VBoxContainerButtons"] +layout_mode = 2 +size_flags_horizontal = 4 +focus_neighbor_top = NodePath("../Button2") +focus_neighbor_bottom = NodePath("../Button2") +text = "Hardcoded script" +script = ExtResource("3_aenvv") + +[node name="Button2" type="Button" parent="VBoxContainerButtons"] +layout_mode = 2 +size_flags_horizontal = 4 +focus_neighbor_top = NodePath("../Button") +focus_neighbor_bottom = NodePath("../Button") +text = "External script" +script = ExtResource("4_u2f14") diff --git a/tools/configurator/files/project.godot b/tools/configurator/files/project.godot new file mode 100644 index 00000000..ea158325 --- /dev/null +++ b/tools/configurator/files/project.godot @@ -0,0 +1,37 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="RetroDECK_Configurator_Godot" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.1", "GL Compatibility") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=960 +window/size/viewport_height=540 + +[input] + +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +] +} + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" diff --git a/tools/configurator/files/touch_external.sh b/tools/configurator/files/touch_external.sh new file mode 100755 index 00000000..dac7ac41 --- /dev/null +++ b/tools/configurator/files/touch_external.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +touch godot_configurator_external