Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Mods having their own Libraries #79

Open
DotWith opened this issue Dec 24, 2021 · 7 comments
Open

[ENHANCEMENT] Mods having their own Libraries #79

DotWith opened this issue Dec 24, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@DotWith
Copy link
Contributor

DotWith commented Dec 24, 2021

Mod(s) Libraries would be hard to make due to manifests. Unless you were able to make it automatic, or making the assetLibraryPaths editable in runtime.

@EliteMasterEric
Copy link
Collaborator

From what I see, the ability to preload all the assets in a given library is the primary reason to even separate assets into libraries in the first place.

What exactly would a custom asset library look like? How would a mod declare an asset library, and how would the host application know when to preload its assets?

@DotWith
Copy link
Contributor Author

DotWith commented Dec 24, 2021

Maybe something like _polymod_libraries.xml? And this xml would be very similar to a project.xml.

@Cheemsandfriends
Copy link
Contributor

Cheemsandfriends commented Dec 24, 2021

Mod(s) Libraries would be hard to make due to manifests. Unless you were able to make it automatic, or making the assetLibraryPaths editable in runtime.

I think that all files/ folders that inside the mods folder and the mods folder is in manifest, I don't think you should have a problem imo (Or I'm not understanding the suggestion?)

@EliteMasterEric
Copy link
Collaborator

@Cheemsandfriends I think the issue is that the exact behavior of asset libraries in Lime and OpenFL isn't well documented and the exact use case that DotWith wants this feature for isn't fully clear.

@DotWith What are you looking to achieve that Polymod can't currently do?

@Cheemsandfriends
Copy link
Contributor

@mastereric Oh, So he wants like a project.xml modifier to have the same syntaxis as the lime projects and that it replaces?
My brain just exploded

imagen

Isn't that like changing the executable or something like that?

@DotWith
Copy link
Contributor Author

DotWith commented Dec 28, 2021

@Cheemsandfriends I think the issue is that the exact behavior of asset libraries in Lime and OpenFL isn't well documented and the exact use case that DotWith wants this feature for isn't fully clear.

@DotWith What are you looking to achieve that Polymod can't currently do?

Add a folder in my mod. Example week8.

@EliteMasterEric
Copy link
Collaborator

EliteMasterEric commented Dec 29, 2021

Being able to maintain customized separate asset libraries is really convenient, since it allows you to precisely control how assets are loaded and organized.

However, defining them in XML doesn't seem appropriate since the only thing we're doing is defining a target path for the library.

Thus, I think the best way of implementing this feature is by adding an additional json file, like _polymod_config.json with the following contents:

{
  // Define additional asset libraries here.
  "assetLibraries": [
    {
        "name": "week7",
        "path": "./weeks/week7"
    },
  ]
}

With this, a mod file at the path weeks/week7/images/bg.png would be available in the week7 library at the path images/bg.png. This would have the same effect as adding "week7" => "./weeks/week7" to frameworkParams.assetLibraryPaths.

@EliteMasterEric EliteMasterEric added the enhancement New feature or request label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants