A way to include my "licenses" folder into the game exports?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By petr0m

Since I am using Google Fonts and some plugins which are licensed under MIT/SIL licenses I have created a licenses folder to collect all of these.

My idea was to include them into my game exports and ship them with the game. Is there a possibility to include this folder with .txt files unpacked/ uncompressed automatically into my game exports so that its readable for users?

Is that even neccessary to have it shipped in an unpacked format?

Thanks in advance for your ideas/ advice.

:bust_in_silhouette: Reply From: MRimmer

You can export .txt files in your packed game by simply adding them to the resource section when exporting:

including *.txt in the export resource window

This will include them in your .pck files, and if opened with an archive manager they will appear there.

If you want them included in your application, in an about section or something similar, you could place all the .txt liscences in a folder and read them into a series of labels with something like this:

func load_files(path):
    var dir = Directory.new()
    dir.open(path)
    dir.list_dir_begin()

    while true:
        var filePath = dir.get_next()
        if filePath == "":
            break
        elif filePath.ends_with(".txt"):
            var file = File.new()
            file.open(filePath, File.READ)
            var content = file.get_as_text()
            # Assign string #
            file.close()