mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-27 00:05:37 +00:00
Add Configurator in Godot POC
Merge pull request #531 from WallK/godot-configurator-poc
This commit is contained in:
commit
1527ddc96f
14
tools/configurator/files/Button.gd
Normal file
14
tools/configurator/files/Button.gd
Normal file
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
12
tools/configurator/files/Button2.gd
Normal file
12
tools/configurator/files/Button2.gd
Normal file
|
@ -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)
|
39
tools/configurator/files/export_presets.cfg
Normal file
39
tools/configurator/files/export_presets.cfg
Normal file
|
@ -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}\""
|
18
tools/configurator/files/icon.svg
Normal file
18
tools/configurator/files/icon.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g transform="matrix(1.88235,0,0,1.86861,-7.52941,-5.60584)">
|
||||||
|
<path d="M140,37.25C140,18.347 124.765,3 106,3L38,3C19.235,3 4,18.347 4,37.25L4,105.75C4,124.653 19.235,140 38,140L106,140C124.765,140 140,124.653 140,105.75L140,37.25Z" style="fill:rgb(17,17,17);"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(2.02105,0,0,2.02105,-13.4737,-13.4737)">
|
||||||
|
<g id="D" transform="matrix(-0.674885,8.26495e-17,-8.26495e-17,-0.674885,223.747,109.037)">
|
||||||
|
<path d="M172.54,-2.511C175.786,-5.757 179.378,-8.24 183.315,-9.96C187.251,-11.68 191.533,-12.54 196.16,-12.54L271.855,-12.54L271.855,6.901L196.16,6.901C194.44,6.901 192.823,7.222 191.309,7.864C189.795,8.506 188.475,9.39 187.348,10.517C186.222,11.643 185.337,12.964 184.695,14.478C184.053,15.992 183.732,17.609 183.732,19.329L183.732,96.355C183.732,97.954 184.084,99.498 184.786,100.988C185.489,102.478 186.416,103.798 187.566,104.949C188.717,106.1 190.037,107.027 191.527,107.729C193.017,108.432 194.562,108.783 196.16,108.783L271.855,108.783L271.855,128.224L196.16,128.224C193.859,128.224 191.624,127.982 189.456,127.498C187.288,127.013 185.204,126.329 183.206,125.444C181.207,124.56 179.311,123.5 177.518,122.265C175.726,121.029 174.066,119.673 172.54,118.195C169.366,115.118 166.901,111.575 165.145,107.566C163.389,103.556 162.51,99.226 162.51,94.574L162.51,21.11C162.51,16.458 163.37,12.17 165.09,8.246C166.811,4.321 169.294,0.736 172.54,-2.511Z" style="fill:white;fill-rule:nonzero;"/>
|
||||||
|
</g>
|
||||||
|
<g id="Left-Symbol" serif:id="Left Symbol" transform="matrix(0.494792,-0,-0,0.494792,6.66667,6.66667)">
|
||||||
|
<use xlink:href="#_Image1" x="39.093" y="89.764" width="103.568px" height="78.228px" transform="matrix(0.995844,0,0,0.990223,0,0)"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<image id="_Image1" width="104px" height="79px" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABPCAYAAAAHtY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
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
37
tools/configurator/files/icon.svg.import
Normal file
37
tools/configurator/files/icon.svg.import
Normal file
|
@ -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
|
4
tools/configurator/files/main.gd
Normal file
4
tools/configurator/files/main.gd
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
$VBoxContainerButtons/Button.grab_focus()
|
76
tools/configurator/files/main.tscn
Normal file
76
tools/configurator/files/main.tscn
Normal file
|
@ -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")
|
37
tools/configurator/files/project.godot
Normal file
37
tools/configurator/files/project.godot
Normal file
|
@ -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"
|
3
tools/configurator/files/touch_external.sh
Executable file
3
tools/configurator/files/touch_external.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
touch godot_configurator_external
|
Loading…
Reference in a new issue