mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-01-18 06:45:38 +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
|
||||
signal signal_theme_changed
|
||||
var custom_theme: Theme = $".".theme
|
||||
var emu_select_option: OptionButton
|
||||
var emu_pick_option: OptionButton
|
||||
var log_option: OptionButton
|
||||
var tab_container: TabContainer
|
||||
var anim_logo: AnimatedSprite2D
|
||||
|
@ -24,8 +22,8 @@ func _ready():
|
|||
_connect_signals()
|
||||
_play_main_animations()
|
||||
|
||||
data_handler.add_emaultor()
|
||||
data_handler.modify_emulator_test()
|
||||
#data_handler.add_emulator()
|
||||
#data_handler.modify_emulator_test()
|
||||
|
||||
$Background/locale_option.selected = class_functions.map_locale_id(OS.get_locale_language())
|
||||
"""
|
||||
|
@ -67,8 +65,6 @@ func _ready():
|
|||
func _get_nodes() -> void:
|
||||
status_code_label = get_node("%status_code_label")
|
||||
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")
|
||||
anim_logo = get_node("%logo_animated")
|
||||
log_option = get_node("%logs_button")
|
||||
|
@ -77,22 +73,8 @@ func _connect_signals() -> void:
|
|||
#signal_theme_changed.connect(_conf_theme)
|
||||
theme_option.item_selected.connect(_conf_theme)
|
||||
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)
|
||||
|
||||
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:
|
||||
var log_content:String
|
||||
match index:
|
||||
|
|
|
@ -165,7 +165,7 @@ grow_vertical = 2
|
|||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tab_alignment = 1
|
||||
current_tab = 2
|
||||
current_tab = 5
|
||||
script = ExtResource("3_id6l4")
|
||||
|
||||
[node name="TK_GRAPHICS" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||
|
@ -324,6 +324,7 @@ button_pressed = true
|
|||
text = "TK_HOTKEYSOUND"
|
||||
|
||||
[node name="TK_SYSTEM" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
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"]
|
||||
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"]
|
||||
layout_mode = 2
|
||||
text = "TK_EMUOPEN"
|
||||
|
@ -813,7 +779,6 @@ disabled = true
|
|||
text = "TK_FTPBTN"
|
||||
|
||||
[node name="TK_TROUBLESHOOT" type="MarginContainer" parent="Background/MarginContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
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
|
||||
|
||||
var data_file_path = "res://data_list.json"
|
||||
var data_file_path = "../../config/retrodeck/reference_lists/features.json"
|
||||
var app_data: AppData
|
||||
|
||||
func _ready():
|
||||
|
@ -30,25 +30,19 @@ func load_base_data() -> AppData:
|
|||
about_links[key] = link
|
||||
|
||||
var emulators = {}
|
||||
for key in data_dict["emulators"].keys():
|
||||
var emulator_data = data_dict["emulators"][key]
|
||||
for key in data_dict["emulator"].keys():
|
||||
var emulator_data = data_dict["emulator"][key]
|
||||
var emulator = Emulator.new()
|
||||
|
||||
emulator.name = emulator_data["name"]
|
||||
emulator.description = emulator_data["description"]
|
||||
|
||||
#emulator.options = []
|
||||
#emulator.properties = []
|
||||
for option_data in emulator_data["options"]:
|
||||
var option = EmulatorOption.new()
|
||||
option.resettable = option_data["resettable"]
|
||||
emulator.options.append(option)
|
||||
|
||||
|
||||
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)
|
||||
print (emulator.name)
|
||||
if emulator_data.has("properties"):
|
||||
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
|
||||
|
||||
|
@ -97,12 +91,6 @@ func save_base_data(app_data: AppData):
|
|||
var emulators = {}
|
||||
for key in app_data.emulators.keys():
|
||||
var emulator = app_data.emulators[key]
|
||||
var options = []
|
||||
for option in emulator.options:
|
||||
options.append({
|
||||
"resettable": option.resettable
|
||||
})
|
||||
|
||||
var properties = []
|
||||
for property in emulator.properties:
|
||||
properties.append({
|
||||
|
@ -113,7 +101,6 @@ func save_base_data(app_data: AppData):
|
|||
emulators[key] = {
|
||||
"name": emulator.name,
|
||||
"description": emulator.description,
|
||||
"options": options,
|
||||
"properties": properties
|
||||
}
|
||||
|
||||
|
@ -155,20 +142,13 @@ func modify_link(key: String, new_name: String, new_url: String, new_description
|
|||
print("Link not found")
|
||||
|
||||
# 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()
|
||||
if app_data and app_data.emulators.has(key):
|
||||
var emulator = app_data.emulators[key]
|
||||
emulator.name = new_name
|
||||
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
|
||||
emulator.properties.clear()
|
||||
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")
|
||||
|
||||
|
||||
func add_emaultor() -> void:
|
||||
func add_emulator() -> void:
|
||||
var link = Link.new()
|
||||
link.name = "Example Site"
|
||||
link.url = "https://example.com"
|
||||
|
@ -194,9 +174,6 @@ func add_emaultor() -> void:
|
|||
var emulator = Emulator.new()
|
||||
emulator.name = "Example Emulator"
|
||||
emulator.description = "An example emulator."
|
||||
var option = EmulatorOption.new()
|
||||
option.resettable = true
|
||||
emulator.options.append(option)
|
||||
var property = EmulatorProperty.new()
|
||||
property.standalone = true
|
||||
property.abxy_button_status = false
|
||||
|
@ -207,10 +184,6 @@ func add_emaultor() -> void:
|
|||
func modify_emulator_test() -> void:
|
||||
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_property = EmulatorProperty.new()
|
||||
|
@ -218,7 +191,7 @@ func modify_emulator_test() -> void:
|
|||
new_property.abxy_button_status = true
|
||||
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:
|
||||
|
|
|
@ -3,5 +3,4 @@ extends Resource
|
|||
class_name Emulator
|
||||
@export var name: String
|
||||
@export var description: String
|
||||
@export var options: Array[EmulatorOption]
|
||||
@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:
|
||||
var web_data = app_data.about_links[id]
|
||||
var linkT =Link.new()
|
||||
linkT = app_data.about_links[id]
|
||||
print ("FREEED" + linkT.name)
|
||||
match id:
|
||||
"rd_web":
|
||||
%website_button.tooltip_text = web_data.description
|
||||
|
|
Loading…
Reference in a new issue