Custom Objects are now being saved with Path Presets instead of globally

This commit is contained in:
CrushedPixel
2015-08-16 18:30:00 +02:00
parent c95c2f0e4c
commit f2752f2790
10 changed files with 59 additions and 61 deletions

View File

@@ -83,7 +83,7 @@ public class AssetRepository {
try {
String filepath = ReplayFile.ENTRY_ASSET_FOLDER + uuid.toString()+ "_" + asset.getDisplayString() + "." + asset.getSavedFileExtension();
File toAdd = File.createTempFile(asset.getDisplayString(), asset.getSavedFileExtension());
File toAdd = File.createTempFile("ASSET_"+asset.getDisplayString(), asset.getSavedFileExtension());
FileOutputStream fos = new FileOutputStream(toAdd);
asset.writeToStream(fos);

View File

@@ -51,6 +51,15 @@ public class CustomImageObject implements GuiEntryListEntry {
@Getter private Transformations transformations = new Transformations();
public void setLinkedAsset(UUID assetUUID) throws IOException {
if(assetUUID == null) return;
//if no asset repository available, simply accept the UUID and it will load the image later
//when calling getResourceLocation for the first time
if(ReplayHandler.getAssetRepository() == null) {
this.linkedAsset = assetUUID;
return;
}
ReplayAsset asset = ReplayHandler.getAssetRepository().getAssetByUUID(assetUUID);
if(asset instanceof ReplayImageAsset) {