Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ changelog:
- title: SDK
labels:
- "Topic: SDK"
- title: Modifications
labels:
- "Topic: Modifications"
- title: Linux
labels:
- "OS: Linux"
Expand Down
9 changes: 6 additions & 3 deletions Scripts/Globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ func scan_and_load_modifications_cfg():
tmp["author"] = cfg.get_value("mod_info", "author", "author")
tmp["description"] = cfg.get_value("mod_info", "description")
tmp["pck_files"] = cfg.get_value("mod_info", "pck_files")
tmp["supported_game_versions"] = cfg.get_value("game_info", "supported_versions")
tmp["enabled"] = "True" #cfg.get_value("mod_info", "enabled", "True")
tmp["sdk_version"] = cfg.get_value("sdk_info", "version")
tmp["main_script_file"] = cfg.get_value("mod_info", "main_script_file")
Expand All @@ -409,22 +410,24 @@ func load_modification(mod_name):
if mod["enabled"] == "True":
print(mod["sdk_version"])
print(str(supported_sdk_versions.has(int(mod["sdk_version"]))))
if supported_sdk_versions.has(int(mod["sdk_version"])):
var f = File.new()
f.open("res://version.dat", File.READ)
if supported_sdk_versions.has(int(mod["sdk_version"])) and Array(mod["supported_game_versions"]).has(f.get_line()):
for i in mod["pck_files"]:
print("Loading: " + OS.get_system_dir(OS.SYSTEM_DIR_DOCUMENTS) + "/New DEV/Foxy Adventure/Mods/" + i)
ProjectSettings.load_resource_pack(OS.get_system_dir(OS.SYSTEM_DIR_DOCUMENTS) + "/New DEV/Foxy Adventure/Mods/" + i)
var main_script = load(mod["main_script_file"]).new()
print("Loading mod")
main_script.init_mod()
dir_contents('res://more_music/')
else:
print(mod["name"] + " - " + "That modification uses unsupported SDK version")
OS.alert(mod["name"] + " - " + "That modification uses unsupported SDK version", "Warning")

func load_stage_from_editor(stage_name:String, character:String):
pass


func _check_mod_game_version_support(mod_cfg_path):
pass


func load_dlcs():
Expand Down
19 changes: 17 additions & 2 deletions addons/foxyadventure_modcreator/Dock.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ extends Control
onready var sdk = preload("res://bin/sdk/sdk.gdns").new()

# Called when the node enters the scene tree for the first time.
func _init():
_ready()
func _ready():
pass # Replace with function body.
var f = File.new()
f.open("res://version.dat", File.READ)
$VBoxContainer/game_versions.text = "[" + f.get_line() + "]"


# Called every frame. 'delta' is the elapsed time since the previous frame.
Expand All @@ -27,7 +31,10 @@ func _on_Generate_pressed():
if not $VBoxContainer/pck_files.text.length() == 0:
cfg.set_value("mod_info", "pck_files", $VBoxContainer/pck_files.text)
cfg.set_value("mod_info", 'enabled', str(false))
cfg.set_value("mod_info", "main_script_file", $VBoxContainer/main_script_file.text)
cfg.set_value("mod_info", "main_script_file", $VBoxContainer/HBoxContainer/main_script_file.text)
cfg.set_value("game_info", "supported_versions", $VBoxContainer/game_versions.text)
cfg.set_value("game_info", "support_lover_versions", str($VBoxContainer/l_v_support.pressed))
cfg.set_value("game_info", "support_higher_versions", str($VBoxContainer/h_v_support.pressed))
cfg.set_value("sdk_info", "version", sdk.get_version())
print("Generating " + "res://" + mod_name.to_lower().replace(' ', '_') + ".cfg" + "...")
cfg.save("res://" + mod_name.to_lower().replace(' ', '_') + ".cfg")
Expand All @@ -36,3 +43,11 @@ func _on_Generate_pressed():
file.store_line(mod_name.to_lower().replace(' ', '_') + ".cfg")
print("Generated!")
file.close()


func _on_SelectMainScriptFile_pressed():
$GdDialog.popup_centered()


func _on_GdDialog_file_selected(path):
$VBoxContainer/HBoxContainer/main_script_file.text = path
75 changes: 61 additions & 14 deletions addons/foxyadventure_modcreator/Dock.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,89 @@ anchor_bottom = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="name" type="LineEdit" parent="VBoxContainer"]
margin_top = 220.0
margin_top = 206.0
margin_right = 1024.0
margin_bottom = 244.0
margin_bottom = 230.0
placeholder_text = "Name"

[node name="author" type="LineEdit" parent="VBoxContainer"]
margin_top = 248.0
margin_top = 234.0
margin_right = 1024.0
margin_bottom = 272.0
margin_bottom = 258.0
placeholder_text = "Author"

[node name="description" type="LineEdit" parent="VBoxContainer"]
margin_top = 276.0
margin_top = 262.0
margin_right = 1024.0
margin_bottom = 300.0
margin_bottom = 286.0
placeholder_text = "Description"

[node name="main_script_file" type="LineEdit" parent="VBoxContainer"]
margin_top = 304.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 290.0
margin_right = 1024.0
margin_bottom = 328.0
margin_bottom = 314.0

[node name="main_script_file" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
margin_right = 945.0
margin_bottom = 24.0
size_flags_horizontal = 3
placeholder_text = "Main Script File"

[node name="SelectMainScriptFile" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 949.0
margin_right = 1024.0
margin_bottom = 24.0
text = "Select file"

[node name="pck_files" type="LineEdit" parent="VBoxContainer"]
margin_top = 332.0
margin_top = 318.0
margin_right = 1024.0
margin_bottom = 342.0
placeholder_text = "PCK Files (will be autogenerated if blank)"

[node name="game_versions" type="LineEdit" parent="VBoxContainer"]
margin_top = 346.0
margin_right = 1024.0
margin_bottom = 356.0
placeholder_text = "PCK Files"
margin_bottom = 370.0
text = "[v0.2.3]"
placeholder_text = "Supported game version(s)"

[node name="l_v_support" type="CheckBox" parent="VBoxContainer"]
visible = false
margin_top = 346.0
margin_right = 1024.0
margin_bottom = 370.0
text = "Support lover versions"

[node name="h_v_support" type="CheckBox" parent="VBoxContainer"]
visible = false
margin_top = 360.0
margin_right = 1024.0
margin_bottom = 384.0
text = "Support higher versions"

[node name="Generate" type="Button" parent="VBoxContainer"]
pause_mode = 2
margin_top = 360.0
margin_top = 374.0
margin_right = 1024.0
margin_bottom = 380.0
margin_bottom = 394.0
text = "Generate .cfg file"

[node name="GdDialog" type="FileDialog" parent="."]
visible = true
margin_right = 767.0
margin_bottom = 460.0
rect_min_size = Vector2( 150, 52.5 )
window_title = "Otwórz plik"
mode = 0
filters = PoolStringArray( "*.gd ; GDScript Script", "*.py; Python Script" )
show_hidden_files = true

[connection signal="pressed" from="VBoxContainer/HBoxContainer/SelectMainScriptFile" to="." method="_on_SelectMainScriptFile_pressed"]
[connection signal="pressed" from="VBoxContainer/Generate" to="." method="_on_Generate_pressed"]
[connection signal="file_selected" from="GdDialog" to="." method="_on_GdDialog_file_selected"]
17 changes: 17 additions & 0 deletions name.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[mod_info]

author="dd"
name="name"
description="dd"
enabled="False"
main_script_file="res://markdown_processor/markdown_processor.gd"

[game_info]

supported_versions="[v0.2.3]"
support_lover_versions="False"
support_higher_versions="True"

[sdk_info]

version=121
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ window/per_pixel_transparency/enabled=true

[editor_plugins]

enabled=PoolStringArray( "res://addons/github_issues_bugtracker/plugin.cfg", "res://addons/godot-firebase/plugin.cfg", "res://addons/quentincaffeino-console/plugin.cfg", "res://addons/rpg_text_boxes/plugin.cfg", "res://addons/terminal/plugin.cfg" )
enabled=PoolStringArray( "res://addons/foxyadventure_modcreator/plugin.cfg", "res://addons/github_issues_bugtracker/plugin.cfg", "res://addons/godot-firebase/plugin.cfg", "res://addons/quentincaffeino-console/plugin.cfg", "res://addons/rpg_text_boxes/plugin.cfg", "res://addons/terminal/plugin.cfg" )

[editors]

Expand Down
2 changes: 1 addition & 1 deletion version.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.2.3
v0.2.3.1