public void addEntry(String text, PageData link) { TextData data = new TextData(text); if(link != null) { data.action = ProtocolGoToPage.GO_TO_RTN + ":" + link.parent.name + "." + link.name; } entries.add(data); }
public void addEntry(String text, PageData link) { TextData data = new TextData(text); if(link != null) { data.action = ProtocolGoToPage.GO_TO_RTN + ":" + link.parent.name + "." + link.name; } entries.add(data); }
public ElementListingCentered(int x, int y, int width, int height, TextData... text) { super(x, y, width, height, text); this.originalX = this.x; this.text = Lists.asList(new TextData(), this.text).toArray(new TextData[this.text.length + 2]); this.text[this.text.length - 1] = new TextData(); this.text[0].color = "dark red"; this.text[this.text.length - 1].color = "dark red"; }
public ElementListingLeft(int x, int y, int width, int height, TextData... text) { super(x, y, width, height, text); this.text = Lists.asList(new TextData(), this.text).toArray(new TextData[this.text.length + 1]); this.text[0].color = "dark red"; }
public void addTitle(ArrayList<BookElement> list, String titleText, boolean dropShadow, int y) { TextData title = new TextData(titleText); title.scale = 1.2f; title.underlined = true; title.dropshadow = dropShadow; int w = (int) Math.ceil(parent.parent.parent.fontRenderer.getStringWidth(titleText) * title.scale); int x = (GuiBook.PAGE_WIDTH - w) / 2; list.add(new ElementText(x, y, w, 24, title)); } }
public static List<TextData> getStatLines(IMaterialStats stats) { List<TextData> lineData = new ArrayList<>(); for(int i = 0; i < stats.getLocalizedInfo().size(); i++) { TextData text = new TextData(stats.getLocalizedInfo().get(i)); text.tooltip = LocUtils.convertNewlines(stats.getLocalizedDesc().get(i)).split("\n"); lineData.add(text); lineData.add(new TextData("\n")); } return lineData; }
public static List<TextData> getTraitLines(List<ITrait> traits, Material material) { List<TextData> lineData = new ArrayList<>(); for(ITrait trait : traits) { TextData text = new TextData(trait.getLocalizedName()); text.tooltip = LocUtils.convertNewlines(material.getTextColor() + trait.getLocalizedDesc()).split("\n"); text.color = TextFormatting.DARK_GRAY.getFriendlyName(); text.underlined = true; lineData.add(text); lineData.add(new TextData("\n")); } return lineData; }
TextData head = new TextData(parent.translate("modifier.effect")); head.underlined = true; list.add(new ElementText(10, 20 + h, GuiBook.PAGE_WIDTH / 2 - 5, GuiBook.PAGE_HEIGHT - h - 20, head)); effectData.add(new TextData("\u25CF ")); effectData.add(new TextData(e)); effectData.add(new TextData("\n"));
@Override public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) { addTitle(list, material.getLocalizedNameColored(), true); // the cool tools to the left/right addDisplayItems(list, rightSide ? GuiBook.PAGE_WIDTH - 18 : 0); int col_margin = 22; int top = 15; int left = rightSide ? 0 : col_margin; int y = top + 10; int x = left + 10; int w = GuiBook.PAGE_WIDTH / 2 - 10; LinkedHashSet<ITrait> allTraits = new LinkedHashSet<>(); // head stats addStatsDisplay(x, y, w, list, allTraits, MaterialTypes.HEAD); // handle addStatsDisplay(x + w, y, w - 10, list, allTraits, MaterialTypes.HANDLE); // extra y += 65 + 10 * material.getAllTraitsForStats(MaterialTypes.HEAD).size(); addStatsDisplay(x, y, w, list, allTraits, MaterialTypes.EXTRA); // inspirational quote String flavour = parent.parent.parent.strings.get(String.format("%s.flavour", material.getIdentifier())); //flavour = "How much wood could a woodchuck chuck if a woodchuck could chuck wood?"; if(flavour != null) { TextData flavourData = new TextData("\"" + flavour + "\""); flavourData.italic = true; list.add(new ElementText(x + w, y, w - 16, 60, flavourData)); } }
public ElementText(int x, int y, int width, int height, String text) { this(x, y, width, height, new TextData(text)); }
public void addTitle(ArrayList<BookElement> list, String title) { TextData tdTitle = new TextData(title); tdTitle.underlined = true; addTitle(list, new TextData[]{tdTitle}); }
@Override public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) { addTitle(list, "Error"); TextData[] text = new TextData[1 + (exception != null ? 2 : 0)]; text[0] = new TextData(errorStage); text[0].color = "dark_red"; text[0].underlined = true; if(exception != null) { text[1] = new TextData("The following error has occured: "); text[1].color = "dark_red"; text[1].paragraph = true; text[2] = new TextData(exception.getMessage() != null ? exception.getMessage() : exception.getClass() .getSimpleName()); text[2].color = "dark_red"; text[2].paragraph = true; } list.add(new ElementText(0, TITLE_HEIGHT, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT - TITLE_HEIGHT, text)); } }
@Override public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) { int x = GuiBook.PAGE_WIDTH / 2 - IMG_SMELTING.width / 2; int y = TITLE_HEIGHT; TextData tdTitle = new TextData(title); tdTitle.underlined = true; list.add(new ElementText(0, 0, GuiBook.PAGE_WIDTH, 9, new TextData[]{tdTitle})); list.add(new ElementImage(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.slotColor)); if(input != null && !input.id.equals("")) { list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, input.getItems(), input.action)); } if(result != null && !result.id.equals("")) { list.add(new ElementItem(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, result.getItems(), result.action)); } list.add(new ElementItem(x + FUEL_X, y + FUEL_Y, ITEM_SCALE, getFuelsList())); if(description != null && description.length > 0) { list.add(new ElementText(0, IMG_SMELTING.height + y + 5, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT - y - 5, description)); } }
.getPageCount() - (genPages - 1) * ENTRIES_PER_PAGE]; for(int j = 0; j < text.length; j++) { text[j] = new TextData((i * ENTRIES_PER_PAGE + j + 1) + ". " + section.pages.get(i * ENTRIES_PER_PAGE + j) .getTitle()); text[j].action = "go-to-page-rtn:" + section.name + "." + section.pages.get(i * ENTRIES_PER_PAGE + j).name;
int resultY = 50; TextData tdTitle = new TextData(title); tdTitle.underlined = true; list.add(new ElementText(0, 0, GuiBook.PAGE_WIDTH, 9, new TextData[]{tdTitle}));