I tend to like to put section headers etc into my posts and this forum seems to have the syntax to support that. However; I’m finding that quite often new lines are swallowed after the formatting. How can I use formatting correctly without losing new lines. For example the following input
<strong>Current implementation</strong>
As is <a href="https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:development">documented</a> the assetmanager takes only the path seperator "/" irrespective of the system.
While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:
[java]
public static final String PATHSEPERATOR=System.getProperty("file.separator");
location=directory + PATHSEPERATOR + "fileName.png";
[/java]
Obviously this works fine on any system where the local path seperator is "/" but on windows it breaks the assetmanager because on windows the path seperator is "\". The result is a somewhat confusing exception:
[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]
When I first started out this exception confused me no end since the file mentioned clearly exists.
<strong>
Request</strong>
<em>Either</em>
Could the assetmanager be altered to accept either the standard "/" file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it
[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty("file.separator");
public static String reprocessFileLocationForAssetLoader(String in){
return in.replace(LOCAL_PATH_SEPERATOR , "/");
}
[/java]
<em>Or:</em>
Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of "/"
Gives this output:
Current implementation
As is documented the assetmanager takes only the path seperator “/” irrespective of the system.
While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:
[java]
public static final String PATHSEPERATOR=System.getProperty(“file.separator”);
location=directory + PATHSEPERATOR + “fileName.png”;
[/java]
Obviously this works fine on any system where the local path seperator is “/” but on windows it breaks the assetmanager because on windows the path seperator is “”. The result is a somewhat confusing exception:
When I first started out this exception confused me no end since the file mentioned clearly exists.
Request
Either
Could the assetmanager be altered to accept either the standard “/” file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it
[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty(“file.separator”);
public static String reprocessFileLocationForAssetLoader(String in){
return in.replace(LOCAL_PATH_SEPERATOR , "/");
}
[/java]
Or:
Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of “/”
I’ve managed to trick the forum into giving me new lines by inserting HTML to make an empty bullet list. It’s painful but it works. I don’t know if that’s restricted for normal users, though.
<strong>Current implementation</strong>
As is <a href="https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:development">documented</a> the assetmanager takes only the path seperator "/" irrespective of the system.
While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:
[java]
public static final String PATHSEPERATOR=System.getProperty("file.separator");
location=directory + PATHSEPERATOR + "fileName.png";
[/java]
Obviously this works fine on any system where the local path seperator is "/" but on windows it breaks the assetmanager because on windows the path seperator is "\". The result is a somewhat confusing exception:
[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]
When I first started out this exception confused me no end since the file mentioned clearly exists.
<ul></ul>
<strong>
Request</strong>
<ul></ul>
<em>Either</em>
<ul></ul>
Could the assetmanager be altered to accept either the standard "/" file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it
[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty("file.separator");
public static String reprocessFileLocationForAssetLoader(String in){
return in.replace(LOCAL_PATH_SEPERATOR , "/");
}
[/java]
<em>Or:</em>
Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of "/"
produces
Current implementation
As is documented the assetmanager takes only the path seperator “/” irrespective of the system.
While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:
[java]
public static final String PATHSEPERATOR=System.getProperty(“file.separator”);
location=directory + PATHSEPERATOR + “fileName.png”;
[/java]
Obviously this works fine on any system where the local path seperator is “/” but on windows it breaks the assetmanager because on windows the path seperator is “”. The result is a somewhat confusing exception:
When I first started out this exception confused me no end since the file mentioned clearly exists.
Request
Either
Could the assetmanager be altered to accept either the standard “/” file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it
[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty(“file.separator”);
public static String reprocessFileLocationForAssetLoader(String in){
return in.replace(LOCAL_PATH_SEPERATOR , "/");
}
[/java]
Or:
Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of “/”