Custom Objects are now being saved with Path Presets instead of globally
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user