mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-01 16:21:17 +00:00
Upgraded func_godot to 2025.8.2
This commit is contained in:
parent
ecfd54f3e8
commit
5f4b8c5b4b
82 changed files with 3227 additions and 1939 deletions
|
|
@ -1,8 +1,12 @@
|
|||
@tool
|
||||
@icon("res://addons/func_godot/icons/icon_godot_ranger.svg")
|
||||
## [Resource] file used to express a set of [FuncGodotFGDEntity] definitions. Can be exported as an FGD file for use with a Quake map editor. Used in conjunction with a [FuncGodotMapSetting] resource to generate nodes in a [FuncGodotMap] node.
|
||||
class_name FuncGodotFGDFile
|
||||
extends Resource
|
||||
class_name FuncGodotFGDFile extends Resource
|
||||
## [Resource] file used to express a set of [FuncGodotFGDEntity] definitions.
|
||||
##
|
||||
## Can be exported as an FGD file for use with a Quake or Hammer-based map editor. Used in conjunction with [FuncGodotMapSetting] to generate nodes in a [FuncGodotMap] node.
|
||||
##
|
||||
## @tutorial(Level Design Book FGD Chapter): https://book.leveldesignbook.com/appendix/resources/formats/fgd
|
||||
## @tutorial(Valve Developer Wiki FGD Article): https://developer.valvesoftware.com/wiki/FGD
|
||||
|
||||
## Supported map editors enum, used in conjunction with [member target_map_editor].
|
||||
enum FuncGodotTargetMapEditors {
|
||||
|
|
@ -13,12 +17,10 @@ enum FuncGodotTargetMapEditors {
|
|||
}
|
||||
|
||||
## Builds and exports the FGD file.
|
||||
@export var export_file: bool:
|
||||
get:
|
||||
return export_file # TODO Converter40 Non existent get function
|
||||
set(new_export_file):
|
||||
if new_export_file != export_file:
|
||||
do_export_file(target_map_editor)
|
||||
@export_tool_button("Export FGD") var export_file := export_button
|
||||
|
||||
func export_button() -> void:
|
||||
do_export_file(target_map_editor)
|
||||
|
||||
func do_export_file(target_editor: FuncGodotTargetMapEditors = FuncGodotTargetMapEditors.TRENCHBROOM, fgd_output_folder: String = "") -> void:
|
||||
if not Engine.is_editor_hint():
|
||||
|
|
@ -32,11 +34,20 @@ func do_export_file(target_editor: FuncGodotTargetMapEditors = FuncGodotTargetMa
|
|||
|
||||
if fgd_name == "":
|
||||
print("Skipping export: Empty FGD name")
|
||||
|
||||
if not DirAccess.dir_exists_absolute(fgd_output_folder):
|
||||
if DirAccess.make_dir_recursive_absolute(fgd_output_folder) != OK:
|
||||
print("Skipping export: Failed to create directory")
|
||||
return
|
||||
|
||||
var fgd_file = fgd_output_folder + "/" + fgd_name + ".fgd"
|
||||
|
||||
print("Exporting FGD to ", fgd_file)
|
||||
var fgd_file = fgd_output_folder.path_join(fgd_name + ".fgd")
|
||||
|
||||
var file_obj := FileAccess.open(fgd_file, FileAccess.WRITE)
|
||||
if not file_obj:
|
||||
print("Failed to open file for writing: ", fgd_file)
|
||||
return
|
||||
|
||||
print("Exporting FGD to ", fgd_file)
|
||||
file_obj.store_string(build_class_text(target_editor))
|
||||
file_obj.close()
|
||||
|
||||
|
|
@ -100,8 +111,8 @@ func get_fgd_classes() -> Array:
|
|||
res.append(cur_ent_def)
|
||||
return res
|
||||
|
||||
func get_entity_definitions() -> Dictionary:
|
||||
var res : Dictionary = {}
|
||||
func get_entity_definitions() -> Dictionary[String, FuncGodotFGDEntityClass]:
|
||||
var res: Dictionary[String, FuncGodotFGDEntityClass] = {}
|
||||
|
||||
for base_fgd in base_fgd_files:
|
||||
var fgd_res = base_fgd.get_entity_definitions()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue