Skip to content

Commit

Permalink
Added listAssets to IndigoGenerators
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Sep 12, 2023
1 parent 187b542 commit fbd6b82
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package indigoplugin
import indigoplugin.generators.EmbedText
import java.io.File
import indigoplugin.generators.EmbedGLSLShaderPair
import indigoplugin.generators.AssetListing

/** Assists with setting up source code generators for Indigo projects
*
Expand Down Expand Up @@ -185,6 +186,28 @@ final case class IndigoGenerators(outDirectory: os.Path, fullyQualifiedPackageNa
)
)

/** Generate a module that conveniently lists all of your assets with some helper / pre-constructed instances ready
* for use in your game.
*
* @param moduleName
* The name for the Scala module, e.g. 'MyModule' would be `object MyModule {}`
* @param indigoAssets
* The IndigoAssets config object, used to locate and fitler your assets.
*/
def listAssets(
moduleName: String,
indigoAssets: IndigoAssets
): IndigoGenerators =
this.copy(
sources = sources ++
AssetListing.generate(
outDirectory,
moduleName,
fullyQualifiedPackageName,
indigoAssets
)
)

}

object IndigoGenerators {
Expand Down

0 comments on commit fbd6b82

Please sign in to comment.