Updated func_godot

This commit is contained in:
MaddoScientisto 2025-12-28 22:53:18 +01:00
commit 01a852de9b
170 changed files with 1705 additions and 2296 deletions

View file

@ -38,6 +38,6 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files)
map_resource.revision += 1
else:
map_resource = QuakeMapFile.new()
map_resource.map_data = FileAccess.open(source_file, FileAccess.READ).get_as_text(true)
map_resource.map_data = FileAccess.open(source_file, FileAccess.READ).get_as_text()
return ResourceSaver.save(map_resource, save_path_str)

View file

@ -34,7 +34,7 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files)
var file = FileAccess.open(source_file, FileAccess.READ)
if file == null:
var err = FileAccess.get_open_error()
print(['Error opening super.lmp file: ', err])
printerr(['Error opening super.lmp file: ', err])
return err
var colors := PackedColorArray()

View file

@ -10,5 +10,5 @@ class_name QuakeWadFile extends Resource
## Collection of [ImageTexture] imported from the WAD file.
@export var textures: Dictionary[String, ImageTexture]
func _init(textures: Dictionary = Dictionary()):
func _init(textures: Dictionary[String, ImageTexture] = {}):
self.textures = textures

View file

@ -70,7 +70,7 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files)
var file = FileAccess.open(source_file, FileAccess.READ)
if file == null:
var err = FileAccess.get_open_error()
print(['Error opening super.wad file: ', err])
printerr(['Error opening super.wad file: ', err])
return err
# Read WAD header
@ -81,13 +81,13 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files)
if magic_string == 'WAD3':
wad_format = WadFormat.HalfLife
elif magic_string != 'WAD2':
print('Error: Invalid WAD magic')
printerr('Error: Invalid WAD magic')
return ERR_INVALID_DATA
var palette_path : String = options['palette_file']
var palette_file : QuakePaletteFile = load(palette_path) as QuakePaletteFile
if wad_format == WadFormat.Quake and not palette_file:
print('Error: Invalid Quake palette file')
printerr('Error: Invalid Quake palette file')
file.close()
return ERR_CANT_ACQUIRE_RESOURCE