Renamed the commonly used Position POJO into AdvancedPosition, as it also hold pitch, yaw and roll

Made GuiDropdown only accept instances of GuiEntryListEntry to avoid unneccessary toString() methods returning the name
Added GuiEntryListValueEntry which holds a Value and a Name to be displayed
Continued work on GuiObjectManager
This commit is contained in:
CrushedPixel
2015-07-10 04:27:15 +02:00
parent 30ebfe96bd
commit ef39c7466d
28 changed files with 260 additions and 164 deletions

View File

@@ -105,4 +105,14 @@ public class AssetRepository {
return replayAssets.get(uuid);
}
public UUID getUUIDForAsset(ReplayAsset asset) {
for(Map.Entry<UUID, ReplayAsset> e : replayAssets.entrySet()) {
if(e.getValue().equals(asset)) {
return e.getKey();
}
}
return null;
}
}

View File

@@ -1,7 +1,7 @@
package eu.crushedpixel.replaymod.assets;
import eu.crushedpixel.replaymod.holders.*;
import eu.crushedpixel.replaymod.interpolation.KeyframeList;
import eu.crushedpixel.replaymod.holders.GuiEntryListEntry;
import eu.crushedpixel.replaymod.holders.Transformations;
import eu.crushedpixel.replaymod.registry.ResourceHelper;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import lombok.Getter;
@@ -16,10 +16,14 @@ import java.util.UUID;
public class CustomImageObject implements GuiEntryListEntry {
public CustomImageObject(String name, UUID assetUUID) throws IOException {
public CustomImageObject(String name, UUID assetUUID) {
this.name = name;
setLinkedAsset(assetUUID);
try {
setLinkedAsset(assetUUID);
} catch(Exception e) {
e.printStackTrace();
}
}
@Getter @Setter private String name;
@@ -27,6 +31,13 @@ public class CustomImageObject implements GuiEntryListEntry {
@Getter @Setter private float width, height;
private ResourceLocation resourceLocation;
private DynamicTexture dynamicTexture;
@Getter private float textureWidth, textureHeight;
@Getter private Transformations transformations;
public void setLinkedAsset(UUID assetUUID) throws IOException {
ReplayAsset asset = ReplayHandler.getAssetRepository().getAssetByUUID(assetUUID);
@@ -65,11 +76,6 @@ public class CustomImageObject implements GuiEntryListEntry {
});
}
private ResourceLocation resourceLocation;
private DynamicTexture dynamicTexture;
@Getter private float textureWidth, textureHeight;
public ResourceLocation getResourceLocation() {
if(!ResourceHelper.isRegistered(resourceLocation)) {
ResourceHelper.registerResource(resourceLocation);
@@ -85,16 +91,4 @@ public class CustomImageObject implements GuiEntryListEntry {
return name;
}
/**
* Keyframing Code
*/
private KeyframeList<Position> anchorPointKeyframes, positionKeyframes, orientationKeyframes;
private KeyframeList<Point> scaleKeyframes;
private KeyframeList<TimestampValue> opacityKeyframes;
public Transformations getTransformationsForTimestamp(int timestamp) {
return null; //TODO
}
}