Updated build.gradle to automatically build fat jars with the dependencies in the /libs folder. This utilizes the shade.sh shell script. Use ./gradlew without explicitely invoking the build task, as this will automatically build a fat jar.
Sorry for this painful commit, but git somehow f'd up and sees changes in files where there aren't any.
This commit is contained in:
94
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java
Normal file → Executable file
94
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java
Normal file → Executable file
@@ -2,6 +2,7 @@ package eu.crushedpixel.replaymod.gui.replaystudio;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -24,13 +25,13 @@ public class GuiConnectPart extends GuiStudioPart {
|
||||
private static final String TITLE = "Connect Replays";
|
||||
|
||||
private boolean initialized = false;
|
||||
|
||||
|
||||
private GuiEntryList<String> concatList;
|
||||
private GuiDropdown<String> replayDropdown;
|
||||
|
||||
|
||||
private GuiButton removeButton, addButton;
|
||||
private GuiArrowButton upButton, downButton;
|
||||
|
||||
|
||||
private List<File> replayFiles;
|
||||
private List<String> filesToConcat;
|
||||
|
||||
@@ -65,9 +66,9 @@ public class GuiConnectPart extends GuiStudioPart {
|
||||
concatList.setElements(filesToConcat);
|
||||
|
||||
concatList.setSelectionIndex(0);
|
||||
|
||||
|
||||
replayDropdown = new GuiDropdown(1, fontRendererObj, 250, yPos+5, 0, 4);
|
||||
|
||||
|
||||
replayDropdown.clearElements();
|
||||
replayFiles = ReplayFileIO.getAllReplayFiles();
|
||||
int index = -1;
|
||||
@@ -80,19 +81,20 @@ public class GuiConnectPart extends GuiStudioPart {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
replayDropdown.setSelectionPos(index);
|
||||
|
||||
|
||||
replayDropdown.addSelectionListener(new SelectionListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onSelectionChanged(int selectionIndex) {
|
||||
filesToConcat.set(concatList.getSelectionIndex(), (String)replayDropdown.getElement(selectionIndex));
|
||||
concatList.setElements(filesToConcat);
|
||||
|
||||
try {
|
||||
filesToConcat.set(concatList.getSelectionIndex(), (String)replayDropdown.getElement(selectionIndex));
|
||||
concatList.setElements(filesToConcat);
|
||||
} catch(Exception e) {} //Sorry, too lazy to properly avoid this Exception here
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
concatList.addSelectionListener(new SelectionListener() {
|
||||
@Override
|
||||
public void onSelectionChanged(int selectionIndex) {
|
||||
@@ -106,54 +108,58 @@ public class GuiConnectPart extends GuiStudioPart {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
removeButton.enabled = upButton.enabled = downButton.enabled = !(selectionIndex < 0 || selectionIndex >= filesToConcat.size());
|
||||
if(upButton.enabled && selectionIndex == 0) upButton.enabled = false;
|
||||
if(downButton.enabled && selectionIndex == filesToConcat.size()-1) downButton.enabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
upButton = new GuiArrowButton(GuiConstants.REPLAY_EDITOR_UP_BUTTON, 195, yPos+40, "", true);
|
||||
buttonList.add(upButton);
|
||||
|
||||
|
||||
downButton = new GuiArrowButton(GuiConstants.REPLAY_EDITOR_DOWN_BUTTON, 219, yPos+40, "", false);
|
||||
buttonList.add(downButton);
|
||||
|
||||
|
||||
int w = GuiReplayStudio.instance.width-243-20-4;
|
||||
|
||||
removeButton = new GuiButton(1, 243, yPos+40, "Remove");
|
||||
|
||||
removeButton = new GuiButton(GuiConstants.REPLAY_EDITOR_REMOVE_BUTTON, 249, yPos+40, "Remove");
|
||||
buttonList.add(removeButton);
|
||||
|
||||
addButton = new GuiButton(1, 0, yPos+40, "Add");
|
||||
|
||||
addButton = new GuiButton(GuiConstants.REPLAY_EDITOR_ADD_BUTTON, 0, yPos+40, "Add");
|
||||
buttonList.add(addButton);
|
||||
|
||||
|
||||
concatList.setSelectionIndex(0);
|
||||
}
|
||||
|
||||
int w = GuiReplayStudio.instance.width-243-20-4;
|
||||
addButton.xPosition = 243+6+(w/2);
|
||||
|
||||
|
||||
int w = GuiReplayStudio.instance.width-249-20-4;
|
||||
addButton.xPosition = 249+6+(w/2);
|
||||
|
||||
addButton.width = w/2+2;
|
||||
removeButton.width = w/2+2;
|
||||
|
||||
replayDropdown.width = GuiReplayStudio.instance.width-250-20;
|
||||
|
||||
|
||||
replayDropdown.width = GuiReplayStudio.instance.width-250-18;
|
||||
|
||||
int h = GuiReplayStudio.instance.height-yPos-20;
|
||||
int rows = (int)(h / (float)GuiEntryList.elementHeight);
|
||||
concatList.setVisibleElements(rows);
|
||||
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton); //call this first to ensure the dropdown is still open
|
||||
concatList.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
replayDropdown.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
concatList.drawTextBox();
|
||||
replayDropdown.drawTextBox();
|
||||
|
||||
|
||||
drawString(fontRendererObj, "Replay:", 200, yPos+5+7, Color.WHITE.getRGB());
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -165,4 +171,28 @@ public class GuiConnectPart extends GuiStudioPart {
|
||||
public void keyTyped(char typedChar, int keyCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if(!button.enabled || replayDropdown.isExpanded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(button.id == GuiConstants.REPLAY_EDITOR_ADD_BUTTON) {
|
||||
filesToConcat.add(FilenameUtils.getBaseName(replayFiles.get(0).getAbsolutePath()));
|
||||
concatList.setElements(filesToConcat);
|
||||
concatList.setSelectionIndex(filesToConcat.size()-1);
|
||||
} else if(button.id == GuiConstants.REPLAY_EDITOR_REMOVE_BUTTON) {
|
||||
int indexBefore = concatList.getSelectionIndex();
|
||||
if(indexBefore >= 0 && indexBefore < filesToConcat.size()) {
|
||||
filesToConcat.remove(indexBefore);
|
||||
concatList.setElements(filesToConcat);
|
||||
if(filesToConcat.size() <= indexBefore) {
|
||||
concatList.setSelectionIndex(filesToConcat.size()-1);
|
||||
} else {
|
||||
concatList.setSelectionIndex(indexBefore);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayStudio.java
Normal file → Executable file
0
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayStudio.java
Normal file → Executable file
6
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiStudioPart.java
Normal file → Executable file
6
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiStudioPart.java
Normal file → Executable file
@@ -1,5 +1,7 @@
|
||||
package eu.crushedpixel.replaymod.gui.replaystudio;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public abstract class GuiStudioPart extends GuiScreen {
|
||||
@@ -20,5 +22,7 @@ public abstract class GuiStudioPart extends GuiScreen {
|
||||
public abstract void keyTyped(char typedChar, int keyCode);
|
||||
|
||||
@Override
|
||||
public abstract void mouseClicked(int mouseX, int mouseY, int mouseButton);
|
||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
}
|
||||
|
||||
0
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java
Normal file → Executable file
0
src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java
Normal file → Executable file
Reference in New Issue
Block a user