Search in sources :

Example 1 with StrPathBuilder

use of main.system.auxiliary.StrPathBuilder in project Eidolons by IDemiurge.

the class AttackAnim method findWeaponSprite.

protected String findWeaponSprite(DC_WeaponObj weapon) {
    if (weapon == null) {
        return "";
    }
    String path = PathFinder.getImagePath();
    StrPathBuilder builder = new StrPathBuilder(PathFinder.getSpritesPath(), "weapons");
    builder.append(weapon.isNatural() ? "natural" : null);
    builder.append(weapon.isRanged() ? "ranged" : null);
    builder.append(weapon.isAmmo() ? "ammo" : null);
    builder.append(TestMasterContent.isArtifact(weapon) ? "artifact" : null);
    path += builder.toString();
    String file = findWeaponSprite(path, weapon);
    if (file == null) {
        if (TestMasterContent.isArtifact(weapon))
            file = findWeaponSprite(StringMaster.cropLastPathSegment(path), weapon);
        if (file == null) {
            file = findWeaponSprite(path, weapon, false);
            if (file == null)
                file = findWeaponSprite(StringMaster.cropLastPathSegment(path), weapon, false);
        }
    }
    return path + file;
}
Also used : StrPathBuilder(main.system.auxiliary.StrPathBuilder)

Example 2 with StrPathBuilder

use of main.system.auxiliary.StrPathBuilder in project Eidolons by IDemiurge.

the class AnimMaster3d method getAtlasPath.

public static String getAtlasPath(DC_WeaponObj weapon, String name) {
    String groupName = weapon.getWeaponGroup().toString().replace("_", " ");
    StrPathBuilder s = new StrPathBuilder(PathFinder.getWeaponAnimPath(), "atlas", weapon.getWeaponType().toString().replace("_", " "), groupName, name + TexturePackerLaunch.ATLAS_EXTENSION);
    return s.toString();
}
Also used : StrPathBuilder(main.system.auxiliary.StrPathBuilder)

Aggregations

StrPathBuilder (main.system.auxiliary.StrPathBuilder)2