Fancier searchbar! (Also had to remove the amount of bookmarks to 8 so it fits)

This commit is contained in:
Lizbeth Rika committed 2014-10-17 22:09:19 +01:00
1 parent 8b6da67314
commit dd49ff68f9
2 files changed
+6 -5

No files matched your search

@@ -116,7 +116,7 @@ public class GuiLexicon extends GuiScreen {
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
boolean unicode = font.getUnicodeFlag();
font.setUnicodeFlag(true);
int l = font.getStringWidth(s.trim());
int l = font.getStringWidth(s);
int fontOff = 0;
if(!drawLeft) {
@@ -242,7 +242,7 @@ public class GuiLexicon extends GuiScreen {
if(lex.getTitle().equals(getTitle()))
thisExists = true;
boolean addEnabled = len < 10 && this instanceof IParented && !thisExists;
boolean addEnabled = len < 8 && this instanceof IParented && !thisExists;
for(int i = 0; i < len + (addEnabled ? 1 : 0); i++) {
boolean isAdd = i == bookmarks.size();
GuiLexicon gui = isAdd ? null : bookmarks.get(i);
@@ -21,6 +21,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.ILexicon;
@@ -106,10 +107,10 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
super.drawScreen(par1, par2, par3);
if(!searchField.getText().isEmpty()) {
drawBookmark(left + 138, top + guiHeight - 24, " " + searchField.getText(), false);
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(searchField.xPosition - 13, searchField.yPosition - 3, 86, 180, 12, 12);
searchField.drawTextBox();
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(left + 134, top + guiHeight - 26, 86, 180, 12, 12);
}
}