mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-01-30 03:55:39 +00:00
Came back to fix the original version!
On branch godot-data-demo Changes to be committed: modified: config/retrodeck/reference_lists/features.json modified: tools/configurator/main.gd modified: tools/configurator/main.tscn modified: tools/configurator/res/pixel_ui_theme/RetroDECKTheme.tres modified: tools/configurator/scripts/data_handler.gd modified: tools/configurator/scripts/emulator.gd deleted: tools/configurator/scripts/emulator_option.gd modified: tools/configurator/tk_about.gd
This commit is contained in:
parent
0308896940
commit
342b1ea56f
File diff suppressed because it is too large
Load diff
|
@ -9,8 +9,6 @@ var log_results: Dictionary
|
||||||
var theme_option: OptionButton
|
var theme_option: OptionButton
|
||||||
signal signal_theme_changed
|
signal signal_theme_changed
|
||||||
var custom_theme: Theme = $".".theme
|
var custom_theme: Theme = $".".theme
|
||||||
var emu_select_option: OptionButton
|
|
||||||
var emu_pick_option: OptionButton
|
|
||||||
var log_option: OptionButton
|
var log_option: OptionButton
|
||||||
var tab_container: TabContainer
|
var tab_container: TabContainer
|
||||||
var anim_logo: AnimatedSprite2D
|
var anim_logo: AnimatedSprite2D
|
||||||
|
@ -24,8 +22,8 @@ func _ready():
|
||||||
_connect_signals()
|
_connect_signals()
|
||||||
_play_main_animations()
|
_play_main_animations()
|
||||||
|
|
||||||
data_handler.add_emaultor()
|
#data_handler.add_emulator()
|
||||||
data_handler.modify_emulator_test()
|
#data_handler.modify_emulator_test()
|
||||||
|
|
||||||
$Background/locale_option.selected = class_functions.map_locale_id(OS.get_locale_language())
|
$Background/locale_option.selected = class_functions.map_locale_id(OS.get_locale_language())
|
||||||
"""
|
"""
|
||||||
|
@ -67,8 +65,6 @@ func _ready():
|
||||||
func _get_nodes() -> void:
|
func _get_nodes() -> void:
|
||||||
status_code_label = get_node("%status_code_label")
|
status_code_label = get_node("%status_code_label")
|
||||||
theme_option = get_node("%theme_optionbutton")
|
theme_option = get_node("%theme_optionbutton")
|
||||||
emu_select_option = get_node("%emu_select_option")
|
|
||||||
emu_pick_option = get_node("%emu_pick_option")
|
|
||||||
tab_container = get_node("%TabContainer")
|
tab_container = get_node("%TabContainer")
|
||||||
anim_logo = get_node("%logo_animated")
|
anim_logo = get_node("%logo_animated")
|
||||||
log_option = get_node("%logs_button")
|
log_option = get_node("%logs_button")
|
||||||
|
@ -77,22 +73,8 @@ func _connect_signals() -> void:
|
||||||
#signal_theme_changed.connect(_conf_theme)
|
#signal_theme_changed.connect(_conf_theme)
|
||||||
theme_option.item_selected.connect(_conf_theme)
|
theme_option.item_selected.connect(_conf_theme)
|
||||||
signal_theme_changed.emit(theme_option.item_selected)
|
signal_theme_changed.emit(theme_option.item_selected)
|
||||||
emu_select_option.item_selected.connect(_emu_select)
|
|
||||||
emu_pick_option.item_selected.connect(_emu_pick)
|
|
||||||
log_option.item_selected.connect(_load_log)
|
log_option.item_selected.connect(_load_log)
|
||||||
|
|
||||||
func _emu_select(index: int) -> void:
|
|
||||||
emu_pick_option.visible = true
|
|
||||||
#change to radio button select
|
|
||||||
_play_main_animations()
|
|
||||||
if (index == 3): # make function and pass start and end
|
|
||||||
emu_pick_option.set_item_disabled(1, true)
|
|
||||||
emu_pick_option.set_item_disabled(2, true)
|
|
||||||
|
|
||||||
func _emu_pick(index: int) -> void:
|
|
||||||
emu_pick_option.visible = true
|
|
||||||
_play_main_animations()
|
|
||||||
|
|
||||||
func _load_log(index: int) -> void:
|
func _load_log(index: int) -> void:
|
||||||
var log_content:String
|
var log_content:String
|
||||||
match index:
|
match index:
|
||||||
|
|
|
@ -165,7 +165,7 @@ grow_vertical = 2
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
tab_alignment = 1
|
tab_alignment = 1
|
||||||
current_tab = 2
|
current_tab = 5
|
||||||
script = ExtResource("3_id6l4")
|
script = ExtResource("3_id6l4")
|
||||||
|
|
||||||
[node name="TK_GRAPHICS" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
[node name="TK_GRAPHICS" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||||
|
@ -324,6 +324,7 @@ button_pressed = true
|
||||||
text = "TK_HOTKEYSOUND"
|
text = "TK_HOTKEYSOUND"
|
||||||
|
|
||||||
[node name="TK_SYSTEM" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
[node name="TK_SYSTEM" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_constants/margin_right = 240
|
theme_override_constants/margin_right = 240
|
||||||
|
|
||||||
|
@ -576,41 +577,6 @@ text = "TK_GENTOOLS"
|
||||||
[node name="tools_separator" type="HSeparator" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
[node name="tools_separator" type="HSeparator" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="emu_select_option" type="OptionButton" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
item_count = 4
|
|
||||||
selected = 0
|
|
||||||
popup/item_0/text = "TK_SELECT_EMU"
|
|
||||||
popup/item_0/id = 0
|
|
||||||
popup/item_0/disabled = true
|
|
||||||
popup/item_0/separator = true
|
|
||||||
popup/item_1/text = "RetroArch"
|
|
||||||
popup/item_1/id = 1
|
|
||||||
popup/item_2/text = "MAME"
|
|
||||||
popup/item_2/id = 2
|
|
||||||
popup/item_3/text = ""
|
|
||||||
popup/item_3/id = 3
|
|
||||||
|
|
||||||
[node name="emu_pick_option" type="OptionButton" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
item_count = 4
|
|
||||||
selected = 0
|
|
||||||
popup/item_0/text = "TK_ACTION_EMU"
|
|
||||||
popup/item_0/id = 0
|
|
||||||
popup/item_0/disabled = true
|
|
||||||
popup/item_0/separator = true
|
|
||||||
popup/item_1/text = "HELP"
|
|
||||||
popup/item_1/id = 1
|
|
||||||
popup/item_2/text = "LAUNCH"
|
|
||||||
popup/item_2/id = 2
|
|
||||||
popup/item_3/text = "RESET"
|
|
||||||
popup/item_3/id = 3
|
|
||||||
|
|
||||||
[node name="emu_open_button" type="Button" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
[node name="emu_open_button" type="Button" parent="Background/MarginContainer/TabContainer/TK_TOOLS/ScrollContainer/VBoxContainer/tools_container"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "TK_EMUOPEN"
|
text = "TK_EMUOPEN"
|
||||||
|
@ -813,7 +779,6 @@ disabled = true
|
||||||
text = "TK_FTPBTN"
|
text = "TK_FTPBTN"
|
||||||
|
|
||||||
[node name="TK_TROUBLESHOOT" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
[node name="TK_TROUBLESHOOT" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_constants/margin_right = 240
|
theme_override_constants/margin_right = 240
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@ extends Node
|
||||||
|
|
||||||
class_name DataHandler
|
class_name DataHandler
|
||||||
|
|
||||||
var data_file_path = "res://data_list.json"
|
var data_file_path = "../../config/retrodeck/reference_lists/features.json"
|
||||||
var app_data: AppData
|
var app_data: AppData
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
@ -30,25 +30,19 @@ func load_base_data() -> AppData:
|
||||||
about_links[key] = link
|
about_links[key] = link
|
||||||
|
|
||||||
var emulators = {}
|
var emulators = {}
|
||||||
for key in data_dict["emulators"].keys():
|
for key in data_dict["emulator"].keys():
|
||||||
var emulator_data = data_dict["emulators"][key]
|
var emulator_data = data_dict["emulator"][key]
|
||||||
var emulator = Emulator.new()
|
var emulator = Emulator.new()
|
||||||
|
|
||||||
emulator.name = emulator_data["name"]
|
emulator.name = emulator_data["name"]
|
||||||
emulator.description = emulator_data["description"]
|
emulator.description = emulator_data["description"]
|
||||||
|
print (emulator.name)
|
||||||
#emulator.options = []
|
if emulator_data.has("properties"):
|
||||||
#emulator.properties = []
|
for property_data in emulator_data["properties"]:
|
||||||
for option_data in emulator_data["options"]:
|
var property = EmulatorProperty.new()
|
||||||
var option = EmulatorOption.new()
|
property.standalone = property_data.get("standalone", false)
|
||||||
option.resettable = option_data["resettable"]
|
# property.abxy_button_status = property_data.get("abxy_button", {}).get("status", false)
|
||||||
emulator.options.append(option)
|
emulator.properties.append(property)
|
||||||
|
|
||||||
|
|
||||||
for property_data in emulator_data["properties"]:
|
|
||||||
var property = EmulatorProperty.new()
|
|
||||||
property.standalone = property_data.get("standalone", false)
|
|
||||||
property.abxy_button_status = property_data.get("abxy_button", {}).get("status", false)
|
|
||||||
emulator.properties.append(property)
|
|
||||||
|
|
||||||
emulators[key] = emulator
|
emulators[key] = emulator
|
||||||
|
|
||||||
|
@ -97,12 +91,6 @@ func save_base_data(app_data: AppData):
|
||||||
var emulators = {}
|
var emulators = {}
|
||||||
for key in app_data.emulators.keys():
|
for key in app_data.emulators.keys():
|
||||||
var emulator = app_data.emulators[key]
|
var emulator = app_data.emulators[key]
|
||||||
var options = []
|
|
||||||
for option in emulator.options:
|
|
||||||
options.append({
|
|
||||||
"resettable": option.resettable
|
|
||||||
})
|
|
||||||
|
|
||||||
var properties = []
|
var properties = []
|
||||||
for property in emulator.properties:
|
for property in emulator.properties:
|
||||||
properties.append({
|
properties.append({
|
||||||
|
@ -113,7 +101,6 @@ func save_base_data(app_data: AppData):
|
||||||
emulators[key] = {
|
emulators[key] = {
|
||||||
"name": emulator.name,
|
"name": emulator.name,
|
||||||
"description": emulator.description,
|
"description": emulator.description,
|
||||||
"options": options,
|
|
||||||
"properties": properties
|
"properties": properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,20 +142,13 @@ func modify_link(key: String, new_name: String, new_url: String, new_description
|
||||||
print("Link not found")
|
print("Link not found")
|
||||||
|
|
||||||
# Function to modify an existing emulator
|
# Function to modify an existing emulator
|
||||||
func modify_emulator(key: String, new_name: String, new_description: String, new_options: Array, new_properties: Array):
|
func modify_emulator(key: String, new_name: String, new_description: String, new_properties: Array):
|
||||||
var app_data = load_base_data()
|
var app_data = load_base_data()
|
||||||
if app_data and app_data.emulators.has(key):
|
if app_data and app_data.emulators.has(key):
|
||||||
var emulator = app_data.emulators[key]
|
var emulator = app_data.emulators[key]
|
||||||
emulator.name = new_name
|
emulator.name = new_name
|
||||||
emulator.description = new_description
|
emulator.description = new_description
|
||||||
|
|
||||||
# Update options
|
|
||||||
emulator.options.clear()
|
|
||||||
for option in new_options:
|
|
||||||
var new_option = EmulatorOption.new()
|
|
||||||
new_option.resettable = option.resettable
|
|
||||||
emulator.options.append(new_option)
|
|
||||||
|
|
||||||
# Update properties
|
# Update properties
|
||||||
emulator.properties.clear()
|
emulator.properties.clear()
|
||||||
for property in new_properties:
|
for property in new_properties:
|
||||||
|
@ -184,7 +164,7 @@ func modify_emulator(key: String, new_name: String, new_description: String, new
|
||||||
print("Emulator not found")
|
print("Emulator not found")
|
||||||
|
|
||||||
|
|
||||||
func add_emaultor() -> void:
|
func add_emulator() -> void:
|
||||||
var link = Link.new()
|
var link = Link.new()
|
||||||
link.name = "Example Site"
|
link.name = "Example Site"
|
||||||
link.url = "https://example.com"
|
link.url = "https://example.com"
|
||||||
|
@ -194,9 +174,6 @@ func add_emaultor() -> void:
|
||||||
var emulator = Emulator.new()
|
var emulator = Emulator.new()
|
||||||
emulator.name = "Example Emulator"
|
emulator.name = "Example Emulator"
|
||||||
emulator.description = "An example emulator."
|
emulator.description = "An example emulator."
|
||||||
var option = EmulatorOption.new()
|
|
||||||
option.resettable = true
|
|
||||||
emulator.options.append(option)
|
|
||||||
var property = EmulatorProperty.new()
|
var property = EmulatorProperty.new()
|
||||||
property.standalone = true
|
property.standalone = true
|
||||||
property.abxy_button_status = false
|
property.abxy_button_status = false
|
||||||
|
@ -207,10 +184,6 @@ func add_emaultor() -> void:
|
||||||
func modify_emulator_test() -> void:
|
func modify_emulator_test() -> void:
|
||||||
data_handler.modify_link("example_site", "Updated Site", "https://updated-example.com", "Updated description.")
|
data_handler.modify_link("example_site", "Updated Site", "https://updated-example.com", "Updated description.")
|
||||||
|
|
||||||
var new_options = []
|
|
||||||
var new_option = EmulatorOption.new()
|
|
||||||
new_option.resettable = false
|
|
||||||
new_options.append(new_option)
|
|
||||||
|
|
||||||
var new_properties = []
|
var new_properties = []
|
||||||
var new_property = EmulatorProperty.new()
|
var new_property = EmulatorProperty.new()
|
||||||
|
@ -218,7 +191,7 @@ func modify_emulator_test() -> void:
|
||||||
new_property.abxy_button_status = true
|
new_property.abxy_button_status = true
|
||||||
new_properties.append(new_property)
|
new_properties.append(new_property)
|
||||||
|
|
||||||
data_handler.modify_emulator("example_emulator", "Updated Emulator", "Updated description", new_options, new_properties)
|
data_handler.modify_emulator("example_emulator", "Updated Emulator", "Updated description", new_properties)
|
||||||
|
|
||||||
|
|
||||||
func parse_config_to_json(file_path: String) -> Dictionary:
|
func parse_config_to_json(file_path: String) -> Dictionary:
|
||||||
|
|
|
@ -3,5 +3,4 @@ extends Resource
|
||||||
class_name Emulator
|
class_name Emulator
|
||||||
@export var name: String
|
@export var name: String
|
||||||
@export var description: String
|
@export var description: String
|
||||||
@export var options: Array[EmulatorOption]
|
|
||||||
@export var properties: Array[EmulatorProperty]
|
@export var properties: Array[EmulatorProperty]
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
extends Resource
|
|
||||||
|
|
||||||
class_name EmulatorOption
|
|
||||||
@export var resettable: bool
|
|
|
@ -21,6 +21,9 @@ func _ready():
|
||||||
|
|
||||||
for id in app_data.about_links:
|
for id in app_data.about_links:
|
||||||
var web_data = app_data.about_links[id]
|
var web_data = app_data.about_links[id]
|
||||||
|
var linkT =Link.new()
|
||||||
|
linkT = app_data.about_links[id]
|
||||||
|
print ("FREEED" + linkT.name)
|
||||||
match id:
|
match id:
|
||||||
"rd_web":
|
"rd_web":
|
||||||
%website_button.tooltip_text = web_data.description
|
%website_button.tooltip_text = web_data.description
|
||||||
|
|
Loading…
Reference in a new issue