jonathaneeckhout / jdungeon

An opensource 2d morpg game based on the Godot engine in a medieval inspired fantasy world
https://jdungeon.org
BSD 2-Clause "Simplified" License
130 stars 23 forks source link

Bug: Dialogues are not properly loaded in an exported build #175

Closed jonathaneeckhout closed 9 months ago

jonathaneeckhout commented 9 months ago

Currently the dialogues are loaded with this function:

## There'll be a LOT of dialogue, so loading each manually could not only dramatically increase load times, but it could also make errors more likely.
func register_dialogue_all(dialogue_folder: String):
    for file: String in DirAccess.get_files_at(dialogue_folder):
        #Ignore non resources, if they happened to be in the folder
        if file.get_extension() != "tres":
            continue

        var res: Resource = load(dialogue_folder + file)

        #Ignore non dialogues, if they happened to be in the folder
        if not res is DialogueResource:
            continue

        dialogue_resources[res.dialogue_identifier] = res

Which is called with this argument:

register_dialogue_all("res://scenes/ui/dialogue/Dialogues/")

However when you export this project, the client wont have this project, thus this resource will not be registered, failing the milklady's shop to load.

For now I will remove the registering of the dialogue in the Milklady's script to revert the symptom of not be able to open the shop.