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

@@ -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()));
}
}