Skip to content

Commit

Permalink
Separate ES-DE from EmulationStation due to new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsubtil committed Mar 18, 2024
1 parent 6b4d7e5 commit 667ad7f
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 2 deletions.
Binary file added assets/frontends/es-de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/frontends/es-de.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://brcysvslcwqvj"
path="res://.godot/imported/es-de.png-f40dfe159042114e6fbccbf90db56b01.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/frontends/es-de.png"
dest_files=["res://.godot/imported/es-de.png-f40dfe159042114e6fbccbf90db56b01.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
Binary file modified assets/frontends/es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scenes/popups/first_time/ImportSettingsSection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ signal advance_section

@onready var importers := [
EmulationStationImporter.new(),
ESDEImporter.new(),
RetroArchImporter.new()
]

Expand Down
47 changes: 47 additions & 0 deletions source/importers/ESDEImporter.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
extends EmulationStationImporter

class_name ESDEImporter

func _init():
config_path = FileUtils.get_home_dir() + "/ES-DE"
media_path = config_path + "/downloaded_media"
gamelists_path = config_path + "/gamelists"
config_file_path = config_path + "/settings/es_settings.xml"

# Returns this importer name
func get_importer_name() -> String:
return "ES-DE"

# Return this importer icon
func get_icon() -> Texture2D:
return preload("res://assets/frontends/es-de.png")

# Returns the compatibility level regarding existing game metadata.
# This one in particular must offer SUPPORTED or PARTIAL support.
# This is run after `is_available()`, so this method doesn't need to be
# static, and can change level depending on the existing configuration/version.
func get_metadata_compatibility_level() -> int:
return CompatibilityLevel.SUPPORTED

# Returns the compatibility level regarding existing game media
func get_media_compatibility_level() -> int:
return CompatibilityLevel.SUPPORTED

# Returns the compatibility level regarding existing themes
func get_theme_compatibility_level() -> int:
return CompatibilityLevel.UNSUPPORTED

# Returns a description/note to give more information about the
# game metadata compatibility level
func get_metadata_compatibility_level_description() -> String:
return "Age ratings will have to be scraped from RetroHub."

# Returns a description/note to give more information about the
# game media compatibility level
func get_media_compatibility_level_description() -> String:
return "Game box and physical support textures, used in 3D models, will have to be scraped from RetroHub."

# Returns a description/note to give more information about the
# theme compatibility level
func get_theme_compatibility_level_description() -> String:
return "ES-DE themes are not supported."
5 changes: 3 additions & 2 deletions source/importers/EmulationStationImporter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const MAXIMUM_SUPPORTED_CONFIG_LEVEL = 7
var config_path := FileUtils.get_home_dir() + "/.emulationstation"
var media_path := config_path + "/downloaded_media"
var gamelists_path := config_path + "/gamelists"
var config_file_path := config_path + "/es_settings.xml"
var folder_size : int = -1

var game_datas := {}
Expand All @@ -28,7 +29,7 @@ const RH_MEDIA_NAMES := [

# Returns this importer name
func get_importer_name() -> String:
return "EmulationStation / EmulationStation-DE"
return "EmulationStation (and derivatives)"

# Return this importer icon
func get_icon() -> Texture2D:
Expand Down Expand Up @@ -194,7 +195,7 @@ func begin_import(copy: bool):
func import_config():
reset_minor(1)
progress_minor("Reading game directory...")
var config := XML2JSON.parse(config_path + "/es_settings.xml")
var config := XML2JSON.parse(config_file_path)
if config.has("string"):
for child in config["string"]:
if child.has("#attributes") and child["#attributes"]["name"] == "ROMDirectory":
Expand Down

0 comments on commit 667ad7f

Please sign in to comment.