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:
@@ -4,7 +4,7 @@ import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.gui.elements.GuiArrowButton;
|
||||
import eu.crushedpixel.replaymod.gui.elements.GuiNumberInput;
|
||||
import eu.crushedpixel.replaymod.holders.Keyframe;
|
||||
import eu.crushedpixel.replaymod.holders.Position;
|
||||
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
||||
import eu.crushedpixel.replaymod.holders.TimestampValue;
|
||||
import eu.crushedpixel.replaymod.interpolation.KeyframeList;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
@@ -54,12 +54,12 @@ public class GuiEditKeyframe extends GuiScreen {
|
||||
public GuiEditKeyframe(Keyframe keyframe) {
|
||||
this.keyframe = keyframe;
|
||||
this.keyframeBackup = keyframe.copy();
|
||||
this.posKeyframe = keyframe.getValue() instanceof Position;
|
||||
this.posKeyframe = keyframe.getValue() instanceof AdvancedPosition;
|
||||
boolean timeKeyframe = keyframe.getValue() instanceof TimestampValue;
|
||||
|
||||
ReplayHandler.selectKeyframe(null);
|
||||
|
||||
KeyframeList<Position> positionKeyframes = ReplayHandler.getPositionKeyframes();
|
||||
KeyframeList<AdvancedPosition> positionKeyframes = ReplayHandler.getPositionKeyframes();
|
||||
KeyframeList<TimestampValue> timeKeyframes = ReplayHandler.getTimeKeyframes();
|
||||
|
||||
if(posKeyframe) {
|
||||
@@ -107,7 +107,7 @@ public class GuiEditKeyframe extends GuiScreen {
|
||||
|
||||
//Position/Virtual Time Input
|
||||
if(posKeyframe) {
|
||||
Position pos = ((Keyframe<Position>)keyframe).getValue();
|
||||
AdvancedPosition pos = ((Keyframe<AdvancedPosition>)keyframe).getValue();
|
||||
xCoord = new GuiNumberInput(fontRendererObj, 0, 0, 100, null, null, RoundUtils.round2Decimals(pos.getX()), true);
|
||||
yCoord = new GuiNumberInput(fontRendererObj, 0, 0, 100, null, null, RoundUtils.round2Decimals(pos.getY()), true);
|
||||
zCoord = new GuiNumberInput(fontRendererObj, 0, 0, 100, null, null, RoundUtils.round2Decimals(pos.getZ()), true);
|
||||
@@ -190,7 +190,7 @@ public class GuiEditKeyframe extends GuiScreen {
|
||||
} else {
|
||||
keyframe.setRealTimestamp(TimestampUtils.calculateTimestamp(min.getIntValue(), sec.getIntValue(), ms.getIntValue()));
|
||||
if(posKeyframe) {
|
||||
((Keyframe<Position>)keyframe).setValue(new Position(xCoord.getPreciseValue(), yCoord.getPreciseValue(),
|
||||
((Keyframe<AdvancedPosition>)keyframe).setValue(new AdvancedPosition(xCoord.getPreciseValue(), yCoord.getPreciseValue(),
|
||||
zCoord.getPreciseValue(), new Float(pitch.getPreciseValue()), (float) yaw.getPreciseValue(),
|
||||
(float) roll.getPreciseValue(), null));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import eu.crushedpixel.replaymod.gui.elements.*;
|
||||
import eu.crushedpixel.replaymod.gui.elements.listeners.SelectionListener;
|
||||
import eu.crushedpixel.replaymod.gui.elements.timelines.GuiTimeline;
|
||||
import eu.crushedpixel.replaymod.gui.overlay.GuiReplayOverlay;
|
||||
import eu.crushedpixel.replaymod.holders.GuiEntryListValueEntry;
|
||||
import eu.crushedpixel.replaymod.interpolation.KeyframeList;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
import eu.crushedpixel.replaymod.utils.MouseUtils;
|
||||
@@ -17,6 +18,7 @@ import org.lwjgl.util.Point;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GuiObjectManager extends GuiScreen {
|
||||
|
||||
@@ -30,7 +32,7 @@ public class GuiObjectManager extends GuiScreen {
|
||||
private GuiAdvancedTextField nameInput;
|
||||
|
||||
private GuiString dropdownLabel;
|
||||
private GuiDropdown<String> assetDropdown;
|
||||
private GuiDropdown<GuiEntryListValueEntry<UUID>> assetDropdown;
|
||||
|
||||
private GuiDraggingNumberInput anchorXInput, anchorYInput, anchorZInput;
|
||||
private GuiDraggingNumberInput positionXInput, positionYInput, positionZInput;
|
||||
@@ -123,12 +125,13 @@ public class GuiObjectManager extends GuiScreen {
|
||||
opacityInput = new GuiDraggingNumberInput(fontRendererObj, 0, 0, 50, 0d, 100d, 100d, true, "%");
|
||||
|
||||
dropdownLabel = new GuiString(0, 0, Color.WHITE, I18n.format("replaymod.gui.assets.filechooser")+": ");
|
||||
assetDropdown = new GuiDropdown<String>(fontRendererObj, 0, 0, 0, 5);
|
||||
assetDropdown = new GuiDropdown<GuiEntryListValueEntry<UUID>>(fontRendererObj, 0, 0, 0, 5);
|
||||
if(ReplayHandler.getAssetRepository().getCopyOfReplayAssets().isEmpty()) {
|
||||
assetDropdown.addElement(I18n.format("replaymod.gui.assets.emptylist"));
|
||||
assetDropdown.addElement(new GuiEntryListValueEntry<UUID>(I18n.format("replaymod.gui.assets.emptylist"), null));
|
||||
} else {
|
||||
for(ReplayAsset asset : ReplayHandler.getAssetRepository().getCopyOfReplayAssets()) {
|
||||
assetDropdown.addElement(asset.getDisplayString());
|
||||
assetDropdown.addElement(new GuiEntryListValueEntry<UUID>(
|
||||
asset.getDisplayString(), ReplayHandler.getAssetRepository().getUUIDForAsset(asset)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,14 +141,16 @@ public class GuiObjectManager extends GuiScreen {
|
||||
addButton = new GuiAdvancedButton(0, 0, 0, 20, I18n.format("replaymod.gui.add"), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
CustomImageObject customImageObject = new CustomImageObject(I18n.format("replaymod.gui.objects.defaultname"), null);
|
||||
objectList.addElement(customImageObject);
|
||||
}
|
||||
}, null);
|
||||
|
||||
removeButton = new GuiAdvancedButton(0, 0, 0, 20, I18n.format("replaymod.gui.remove"), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if(objectList.getElement(objectList.getSelectionIndex()) != null)
|
||||
objectList.removeElement(objectList.getSelectionIndex());
|
||||
}
|
||||
}, null);
|
||||
|
||||
@@ -288,7 +293,7 @@ public class GuiObjectManager extends GuiScreen {
|
||||
addButton.yPosition = removeButton.yPosition = objectList.yPosition+objectList.height-20;
|
||||
|
||||
allElements.addPart(addButton);
|
||||
allElements.addPart(removeButton);
|
||||
disableElements.addPart(removeButton);
|
||||
|
||||
allElements.addPart(disableElements);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.crushedpixel.replaymod.gui;
|
||||
import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.gui.elements.*;
|
||||
import eu.crushedpixel.replaymod.gui.elements.listeners.SelectionListener;
|
||||
import eu.crushedpixel.replaymod.holders.GuiEntryListEntry;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
import eu.crushedpixel.replaymod.settings.RenderOptions;
|
||||
import eu.crushedpixel.replaymod.utils.StringUtils;
|
||||
@@ -391,7 +392,7 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
private enum RendererSettings {
|
||||
private enum RendererSettings implements GuiEntryListEntry {
|
||||
DEFAULT("default"),
|
||||
STEREOSCOPIC("stereoscopic"),
|
||||
CUBIC("cubic"),
|
||||
@@ -410,6 +411,11 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
}
|
||||
|
||||
public String getDescription() { return I18n.format(desc); }
|
||||
|
||||
@Override
|
||||
public String getDisplayString() {
|
||||
return toString();
|
||||
}
|
||||
}
|
||||
|
||||
private void startRendering() {
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.crushedpixel.replaymod.gui.elements;
|
||||
|
||||
import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.gui.elements.listeners.SelectionListener;
|
||||
import eu.crushedpixel.replaymod.holders.GuiEntryListEntry;
|
||||
import eu.crushedpixel.replaymod.utils.MouseUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -13,7 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiDropdown<T> extends GuiAdvancedTextField {
|
||||
public class GuiDropdown<T extends GuiEntryListEntry> extends GuiAdvancedTextField {
|
||||
|
||||
private final int visibleDropout;
|
||||
private final int dropoutElementHeight = 14;
|
||||
@@ -38,7 +39,7 @@ public class GuiDropdown<T> extends GuiAdvancedTextField {
|
||||
public void drawTextBox() {
|
||||
if(elements.size() > selectionIndex && selectionIndex >= 0) {
|
||||
setText(mc.fontRendererObj.trimStringToWidth(
|
||||
elements.get(selectionIndex).toString(), width - 8));
|
||||
elements.get(selectionIndex).getDisplayString(), width - 8));
|
||||
} else {
|
||||
setText("");
|
||||
}
|
||||
@@ -83,7 +84,7 @@ public class GuiDropdown<T> extends GuiAdvancedTextField {
|
||||
continue;
|
||||
}
|
||||
drawHorizontalLine(xPosition, xPosition + width, yPosition + height + y, -6250336);
|
||||
String toWrite = mc.fontRendererObj.trimStringToWidth(obj.toString(), width - 8);
|
||||
String toWrite = mc.fontRendererObj.trimStringToWidth(obj.getDisplayString(), width - 8);
|
||||
drawString(mc.fontRendererObj, toWrite, xPosition + 4, yPosition + height + y + 4, Color.WHITE.getRGB());
|
||||
|
||||
if(MouseUtils.isMouseWithinBounds(xPosition, yPosition + height + y, width, dropoutElementHeight)) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package eu.crushedpixel.replaymod.gui.elements.timelines;
|
||||
|
||||
import eu.crushedpixel.replaymod.gui.GuiEditKeyframe;
|
||||
import eu.crushedpixel.replaymod.holders.Keyframe;
|
||||
import eu.crushedpixel.replaymod.holders.Position;
|
||||
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
||||
import eu.crushedpixel.replaymod.holders.TimestampValue;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -113,9 +113,9 @@ public class GuiKeyframeTimeline extends GuiTimeline {
|
||||
|
||||
//iterate over keyframes to find spectator segments
|
||||
if(placeKeyframes) {
|
||||
ListIterator<Keyframe<Position>> iterator = ReplayHandler.getPositionKeyframes().listIterator();
|
||||
ListIterator<Keyframe<AdvancedPosition>> iterator = ReplayHandler.getPositionKeyframes().listIterator();
|
||||
while(iterator.hasNext()) {
|
||||
Keyframe<Position> kf = iterator.next();
|
||||
Keyframe<AdvancedPosition> kf = iterator.next();
|
||||
|
||||
if(kf.getValue().getSpectatedEntityID() == null)
|
||||
continue;
|
||||
@@ -124,7 +124,7 @@ public class GuiKeyframeTimeline extends GuiTimeline {
|
||||
int nextSpectatorKeyframeRealTime = -1;
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
Keyframe<Position> kf2 = iterator.next();
|
||||
Keyframe<AdvancedPosition> kf2 = iterator.next();
|
||||
if(kf.getValue().getSpectatedEntityID()
|
||||
.equals(kf2.getValue().getSpectatedEntityID())) {
|
||||
|
||||
@@ -177,14 +177,14 @@ public class GuiKeyframeTimeline extends GuiTimeline {
|
||||
|
||||
int keyframeX = getKeyframeX(kf.getRealTimestamp(), leftTime, bodyWidth, segmentLength);
|
||||
|
||||
if(kf.getValue() instanceof Position) {
|
||||
if(kf.getValue() instanceof AdvancedPosition) {
|
||||
if(!placeKeyframes) return;
|
||||
textureX = KEYFRAME_PLACE_X;
|
||||
textureY = KEYFRAME_PLACE_Y;
|
||||
y += 0;
|
||||
|
||||
//If Spectator Keyframe, use different texture
|
||||
if(((Keyframe<Position>) kf).getValue().getSpectatedEntityID() != null) {
|
||||
if(((Keyframe<AdvancedPosition>) kf).getValue().getSpectatedEntityID() != null) {
|
||||
textureX = KEYFRAME_SPEC_X;
|
||||
textureY = KEYFRAME_SPEC_Y;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import eu.crushedpixel.replaymod.api.replay.pagination.SearchPagination;
|
||||
import eu.crushedpixel.replaymod.gui.GuiConstants;
|
||||
import eu.crushedpixel.replaymod.gui.elements.*;
|
||||
import eu.crushedpixel.replaymod.gui.replayviewer.GuiReplayViewer;
|
||||
import eu.crushedpixel.replaymod.holders.GuiEntryListStringEntry;
|
||||
import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
import net.minecraft.client.gui.*;
|
||||
@@ -37,7 +38,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
|
||||
private List<GuiButton> replayButtonBar, bottomBar, topBar;
|
||||
|
||||
private GuiToggleButton searchGametypeToggle, searchSortToggle;
|
||||
private GuiDropdown<String> searchCategoryDropdown, searchVersionDropdown;
|
||||
private GuiDropdown<GuiEntryListStringEntry> searchCategoryDropdown, searchVersionDropdown;
|
||||
private GuiAdvancedTextField searchNameInput, searchServerInput;
|
||||
private GuiButton searchActionButton;
|
||||
|
||||
@@ -116,22 +117,22 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
|
||||
new String[]{I18n.format("options.particles.all"), I18n.format("menu.singleplayer"), I18n.format("menu.multiplayer")});
|
||||
searchSortToggle = new GuiToggleButton(GuiConstants.CENTER_SEARCH_ORDER_TOGGLE, 0, 0, I18n.format("replaymod.gui.center.search.order")+": ",
|
||||
new String[]{I18n.format("replaymod.gui.center.search.order.best"), I18n.format("replaymod.gui.center.search.order.recent")});
|
||||
searchCategoryDropdown = new GuiDropdown<String>(fontRendererObj, 0, 0, 0, Category.values().length+1);
|
||||
searchVersionDropdown = new GuiDropdown<String>(fontRendererObj, 0, 0, 0, 5);
|
||||
searchCategoryDropdown = new GuiDropdown<GuiEntryListStringEntry>(fontRendererObj, 0, 0, 0, Category.values().length+1);
|
||||
searchVersionDropdown = new GuiDropdown<GuiEntryListStringEntry>(fontRendererObj, 0, 0, 0, 5);
|
||||
searchNameInput = new GuiAdvancedTextField(fontRendererObj, 0, 0, 50, 20);
|
||||
searchServerInput = new GuiAdvancedTextField(fontRendererObj, 0, 0, 50, 20);
|
||||
|
||||
searchNameInput.hint = I18n.format("replaymod.gui.center.search.name");
|
||||
searchServerInput.hint = I18n.format("replaymod.gui.center.search.server");
|
||||
|
||||
searchCategoryDropdown.addElement(I18n.format("replaymod.gui.center.search.category"));
|
||||
searchCategoryDropdown.addElement(new GuiEntryListStringEntry(I18n.format("replaymod.gui.center.search.category")));
|
||||
for(Category c : Category.values()) {
|
||||
searchCategoryDropdown.addElement(c.toNiceString());
|
||||
searchCategoryDropdown.addElement(new GuiEntryListStringEntry(c.toNiceString()));
|
||||
}
|
||||
|
||||
searchVersionDropdown.addElement(I18n.format("replaymod.gui.center.search.version"));
|
||||
searchVersionDropdown.addElement(new GuiEntryListStringEntry(I18n.format("replaymod.gui.center.search.version")));
|
||||
for(MinecraftVersion v : MinecraftVersion.values()) {
|
||||
searchVersionDropdown.addElement(v.toNiceName());
|
||||
searchVersionDropdown.addElement(new GuiEntryListStringEntry(v.toNiceName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import eu.crushedpixel.replaymod.gui.elements.*;
|
||||
import eu.crushedpixel.replaymod.gui.elements.timelines.GuiKeyframeTimeline;
|
||||
import eu.crushedpixel.replaymod.gui.elements.timelines.GuiMarkerTimeline;
|
||||
import eu.crushedpixel.replaymod.holders.Keyframe;
|
||||
import eu.crushedpixel.replaymod.holders.Position;
|
||||
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
||||
import eu.crushedpixel.replaymod.holders.TimestampValue;
|
||||
import eu.crushedpixel.replaymod.registry.ReplayGuiRegistry;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
@@ -137,13 +137,13 @@ public class GuiReplayOverlay extends Gui {
|
||||
public void run() {
|
||||
Entity cam = mc.getRenderViewEntity();
|
||||
if (cam != null) {
|
||||
Position position = new Position(cam.posX, cam.posY, cam.posZ, cam.rotationPitch,
|
||||
AdvancedPosition position = new AdvancedPosition(cam.posX, cam.posY, cam.posZ, cam.rotationPitch,
|
||||
cam.rotationYaw % 360, ReplayHandler.getCameraTilt(), null);
|
||||
|
||||
if (ReplayHandler.isCamera())
|
||||
ReplayHandler.addKeyframe(new Keyframe<Position>(ReplayHandler.getRealTimelineCursor(), position));
|
||||
ReplayHandler.addKeyframe(new Keyframe<AdvancedPosition>(ReplayHandler.getRealTimelineCursor(), position));
|
||||
else
|
||||
ReplayHandler.addKeyframe(new Keyframe<Position>(ReplayHandler.getRealTimelineCursor(), new Position(cam.getEntityId(), true)));
|
||||
ReplayHandler.addKeyframe(new Keyframe<AdvancedPosition>(ReplayHandler.getRealTimelineCursor(), new AdvancedPosition(cam.getEntityId(), true)));
|
||||
}
|
||||
}
|
||||
}, "replaymod.gui.ingame.menu.addposkeyframe");
|
||||
@@ -160,13 +160,13 @@ public class GuiReplayOverlay extends Gui {
|
||||
public void run() {
|
||||
Entity cam = mc.getRenderViewEntity();
|
||||
if (cam != null) {
|
||||
Position position = new Position(cam.posX, cam.posY, cam.posZ, cam.rotationPitch,
|
||||
AdvancedPosition position = new AdvancedPosition(cam.posX, cam.posY, cam.posZ, cam.rotationPitch,
|
||||
cam.rotationYaw % 360, ReplayHandler.getCameraTilt(), null);
|
||||
|
||||
if (ReplayHandler.isCamera())
|
||||
ReplayHandler.addKeyframe(new Keyframe<Position>(ReplayHandler.getRealTimelineCursor(), position));
|
||||
ReplayHandler.addKeyframe(new Keyframe<AdvancedPosition>(ReplayHandler.getRealTimelineCursor(), position));
|
||||
else
|
||||
ReplayHandler.addKeyframe(new Keyframe<Position>(ReplayHandler.getRealTimelineCursor(), new Position(cam.getEntityId(), true)));
|
||||
ReplayHandler.addKeyframe(new Keyframe<AdvancedPosition>(ReplayHandler.getRealTimelineCursor(), new AdvancedPosition(cam.getEntityId(), true)));
|
||||
}
|
||||
}
|
||||
}, "replaymod.gui.ingame.menu.addspeckeyframe");
|
||||
@@ -180,10 +180,10 @@ public class GuiReplayOverlay extends Gui {
|
||||
|
||||
@Override
|
||||
public GuiElement delegate() {
|
||||
boolean selected = ReplayHandler.getSelectedKeyframe() != null && ReplayHandler.getSelectedKeyframe().getValue() instanceof Position;
|
||||
boolean selected = ReplayHandler.getSelectedKeyframe() != null && ReplayHandler.getSelectedKeyframe().getValue() instanceof AdvancedPosition;
|
||||
boolean camera;
|
||||
if(selected) {
|
||||
camera = ((Keyframe<Position>)ReplayHandler.getSelectedKeyframe()).getValue().getSpectatedEntityID() == null;
|
||||
camera = ((Keyframe<AdvancedPosition>)ReplayHandler.getSelectedKeyframe()).getValue().getSpectatedEntityID() == null;
|
||||
} else {
|
||||
camera = ReplayHandler.isCamera();
|
||||
}
|
||||
@@ -348,7 +348,7 @@ public class GuiReplayOverlay extends Gui {
|
||||
|
||||
CameraEntity cam = ReplayHandler.getCameraEntity();
|
||||
if(cam != null) {
|
||||
ReplayHandler.setLastPosition(new Position(cam.posX, cam.posY, cam.posZ, cam.rotationPitch, cam.rotationYaw));
|
||||
ReplayHandler.setLastPosition(new AdvancedPosition(cam.posX, cam.posY, cam.posZ, cam.rotationPitch, cam.rotationYaw));
|
||||
} else {
|
||||
ReplayHandler.setLastPosition(null);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.crushedpixel.replaymod.gui.replayeditor;
|
||||
import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.gui.GuiConstants;
|
||||
import eu.crushedpixel.replaymod.gui.elements.GuiDropdown;
|
||||
import eu.crushedpixel.replaymod.holders.GuiEntryListStringEntry;
|
||||
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
||||
import eu.crushedpixel.replaymod.utils.StringUtils;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -22,7 +23,7 @@ public class GuiReplayEditor extends GuiScreen {
|
||||
private static final int tabYPos = 110;
|
||||
public static GuiReplayEditor instance = null;
|
||||
private StudioTab currentTab = StudioTab.TRIM;
|
||||
private GuiDropdown<String> replayDropdown;
|
||||
private GuiDropdown<GuiEntryListStringEntry> replayDropdown;
|
||||
private GuiButton saveModeButton;
|
||||
private boolean overrideSave = false;
|
||||
private boolean initialized = false;
|
||||
@@ -50,7 +51,7 @@ public class GuiReplayEditor extends GuiScreen {
|
||||
}
|
||||
for(File file : replayFiles) {
|
||||
String name = FilenameUtils.getBaseName(file.getAbsolutePath());
|
||||
replayDropdown.addElement(name);
|
||||
replayDropdown.addElement(new GuiEntryListStringEntry(name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +82,7 @@ public class GuiReplayEditor extends GuiScreen {
|
||||
int modeWidth = tabButtons.get(0).width;
|
||||
|
||||
if(!initialized) {
|
||||
replayDropdown = new GuiDropdown<String>(fontRendererObj, 15 + 2 + 1 + 80, 60, this.width - 30 - 8 - 80 - modeWidth - 4, 5);
|
||||
replayDropdown = new GuiDropdown<GuiEntryListStringEntry>(fontRendererObj, 15 + 2 + 1 + 80, 60, this.width - 30 - 8 - 80 - modeWidth - 4, 5);
|
||||
refreshReplayDropdown();
|
||||
} else {
|
||||
replayDropdown.width = this.width - 30 - 8 - 80 - modeWidth - 4;
|
||||
|
||||
Reference in New Issue
Block a user