Skip to content

Commit

Permalink
Fix ProjectSettings-related issues. Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
willnationsdev committed Aug 7, 2019
1 parent 252c9d8 commit d07df11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
8 changes: 0 additions & 8 deletions README.md
Expand Up @@ -78,12 +78,4 @@ The F# source file is now added to the F# project!

---

# Known Issues

ProjectSettings.add_property_info triggers an error the first time the settings are defined. It's supposed to check if the name of the custom property you are making already exists and then give you a warning if it does. Instead, it issues a warning when it DOESN'T exist.

As such, the first time you try to set up F# script auto-generation, you will see 3 errors about an invalid `pinfo.name` or something. Just ignore it. I've already submitted a PR to fix it, but it won't be there until 3.2 at the earliest.

---

If you like the project, please give it a star and consider donating to my [Kofi](https://ko-fi.com/willnationsdev). If you have any problems whatsoever, do not hesitate to open an Issue.
20 changes: 3 additions & 17 deletions addons/godot-fsharp-tools/plugin.gd
Expand Up @@ -92,6 +92,9 @@ func _enter_tree() -> void:
fs.connect("filesystem_changed", self, "_on_filesystem_changed")

func _exit_tree() -> void:
ProjectSettings.set_setting(SETTINGS_FSHARP_AUTOGEN, null)
ProjectSettings.set_setting(SETTINGS_FSHARP_DEFAULT_NAMESPACE, null)
ProjectSettings.set_setting(SETTINGS_FSHARP_DEFAULT_OUTPUT_DIR, null)
remove_tool_menu_item(MENU_FSHARP_GENERATE_SCRIPT)
remove_tool_menu_item(MENU_FSHARP_SETUP)

Expand Down Expand Up @@ -236,29 +239,12 @@ func _setup_create_fsharp_script_dialog() -> void:

func _setup_fsharp_settings() -> void:
if not ProjectSettings.has_setting(SETTINGS_FSHARP_AUTOGEN):
ProjectSettings.add_property_info({
"name": SETTINGS_FSHARP_AUTOGEN,
"tooltip": "If true, when a user creates a C# script, Godot creates a corresponding F# script and makes the C# script derive it.",
"type": TYPE_BOOL
})
ProjectSettings.set_setting(SETTINGS_FSHARP_AUTOGEN, false)

if not ProjectSettings.has_setting(SETTINGS_FSHARP_DEFAULT_OUTPUT_DIR):
ProjectSettings.add_property_info({
"name": SETTINGS_FSHARP_DEFAULT_OUTPUT_DIR,
"tooltip": "The directory in which the plugin should auto-generate F# scripts.",
"type": TYPE_STRING,
"hint": PROPERTY_HINT_DIR
})
ProjectSettings.set_setting(SETTINGS_FSHARP_DEFAULT_OUTPUT_DIR, "")

if not ProjectSettings.has_setting(SETTINGS_FSHARP_DEFAULT_NAMESPACE):
ProjectSettings.add_property_info({
"name": SETTINGS_FSHARP_DEFAULT_NAMESPACE,
"tooltip": "The namespace in which the plugin should auto-generate F# scripts..",
"type": TYPE_STRING,
"hint": PROPERTY_HINT_DIR
})
ProjectSettings.set_setting(SETTINGS_FSHARP_DEFAULT_NAMESPACE, "")

func _print_and_clear_output(var p_output: Array) -> void:
Expand Down

0 comments on commit d07df11

Please sign in to comment.