larsiusprime / polymod

Atomic modding framework for Haxe
MIT License
161 stars 62 forks source link

[ENHANCEMENT] Add lua for assets library #115

Closed AltronMaxX closed 2 years ago

AltronMaxX commented 2 years ago

Polymod wont replace properly lua files, that makes game not finding this lua files.

EliteMasterEric commented 2 years ago

This is interesting, replacement shouldn't depend on file type.

What does your setup look like? Can you create a minimal reproduction I can work with?

AltronMaxX commented 2 years ago

Well, I have this code ;)

`import flixel.FlxG; import polymod.Polymod;

if FEATURE_MODCORE

import polymod.backends.OpenFLBackend; import polymod.backends.PolymodAssets.PolymodAssetType; import polymod.format.ParseRules.LinesParseFormat; import polymod.format.ParseRules.TextFileFormat; import polymod.Polymod;

end

/**

if FEATURE_MODCORE

class ModCoreBackend extends OpenFLBackend { public function new() { super(); Debug.logTrace('Initialized custom asset loader backend.'); }

public override function clearCache()
{
    super.clearCache();
    Debug.logWarn('Custom asset cache has been cleared.');
}

public override function exists(id:String):Bool
{
    Debug.logTrace('Call to ModCoreBackend: exists($id)');
    return super.exists(id);
}

public override function getBytes(id:String):lime.utils.Bytes
{
    Debug.logTrace('Call to ModCoreBackend: getBytes($id)');
    return super.getBytes(id);
}

public override function getText(id:String):String
{
    Debug.logTrace('Call to ModCoreBackend: getText($id)');
    return super.getText(id);
}

public override function list(type:PolymodAssetType = null):Array<String>
{
    Debug.logTrace('Listing assets in custom asset cache ($type).');
    return super.list(type);
}

}

end`

AltronMaxX commented 2 years ago

Console tells, that polymode trying to replace every type of file to lua

EliteMasterEric commented 2 years ago

That looks like... Old code copied from Enigma?

Can you copy and paste the message the console says?

AltronMaxX commented 2 years ago

Yes, this code from Enigma ;)

Concole says this about replacing lua 0:16.58 [INFO ] (ModCore/loadModsById#144): Mod loading complete. We loaded 1 / 1 mods. 0:16.58 [INFO ] (ModCore/loadModsById#152): Installed mods have replaced 3 images. 0:16.59 [TRACE] (ModCore/loadModsById#154): images/manifest/floorManifest.png 0:16.59 [TRACE] (ModCore/loadModsById#154): stages/manifest.lua 0:16.59 [TRACE] (ModCore/loadModsById#154): images/manifest/bg_manifest.png 0:16.59 [INFO ] (ModCore/loadModsById#157): Installed mods have replaced 3 text files. 0:16.60 [TRACE] (ModCore/loadModsById#159): images/manifest/bg_manifest.xml 0:16.60 [TRACE] (ModCore/loadModsById#159): stages/manifest.lua 0:16.60 [TRACE] (ModCore/loadModsById#159): images/manifest/floorManifest.xml 0:16.61 [INFO ] (ModCore/loadModsById#162): Installed mods have replaced 1 music files. 0:16.61 [TRACE] (ModCore/loadModsById#164): stages/manifest.lua 0:16.61 [INFO ] (ModCore/loadModsById#167): Installed mods have replaced 1 sound files. 0:16.62 [TRACE] (ModCore/loadModsById#169): stages/manifest.lua

AltronMaxX commented 2 years ago

I have noticed that on Polymod init I can make custom extension map.

AltronMaxX commented 2 years ago

Fixed this "fun" by using OpenFl Assets instead of FileSystem