mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-20 20:12:28 +00:00
Perform some renames of Screen elements, Element* => *Element along with the Widgets: Widget* => *Widget
This commit is contained in:
1 parent
ff36f316c2
commit
40b75b9865
27 files changed
+126
-128
No files matched your search
+7
-7
@@ -6,9 +6,9 @@ import slimeknights.mantle.client.book.data.element.ItemStackData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementItem;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ItemElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -44,18 +44,18 @@ public class ContentBlockInteraction extends PageContent {
|
||||
this.addTitle(list, this.title);
|
||||
}
|
||||
|
||||
list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));
|
||||
list.add(new ImageElement(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));
|
||||
|
||||
if (this.input != null && !this.input.getItems().isEmpty()) {
|
||||
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
list.add(new ItemElement(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
}
|
||||
|
||||
if (this.block != null && !this.block.getItems().isEmpty()) {
|
||||
list.add(new ElementItem(x + BLOCK_X, y + BLOCK_Y, BLOCK_SCALE, this.block.getItems(), this.block.action));
|
||||
list.add(new ItemElement(x + BLOCK_X, y + BLOCK_Y, BLOCK_SCALE, this.block.getItems(), this.block.action));
|
||||
}
|
||||
|
||||
if (this.description != null && this.description.length > 0) {
|
||||
list.add(new ElementText(0, IMG_SMITHING.height + y + 50, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - IMG_SMITHING.height - y - 50, this.description));
|
||||
list.add(new TextElement(0, IMG_SMITHING.height + y + 50, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - IMG_SMITHING.height - y - 50, this.description));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,9 +16,9 @@ import slimeknights.mantle.client.book.data.element.ItemStackData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementItem;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ItemElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -56,19 +56,19 @@ public class ContentCrafting extends PageContent {
|
||||
|
||||
TextData tdTitle = new TextData(this.title);
|
||||
tdTitle.underlined = true;
|
||||
list.add(new ElementText(0, 0, BookScreen.PAGE_WIDTH, 9, tdTitle));
|
||||
list.add(new TextElement(0, 0, BookScreen.PAGE_WIDTH, 9, tdTitle));
|
||||
|
||||
if (this.grid_size.equalsIgnoreCase("small")) {
|
||||
x = BookScreen.PAGE_WIDTH / 2 - IMG_CRAFTING_SMALL.width / 2;
|
||||
height = y + IMG_CRAFTING_SMALL.height;
|
||||
list.add(new ElementImage(x, y, IMG_CRAFTING_SMALL.width, IMG_CRAFTING_SMALL.height, IMG_CRAFTING_SMALL, book.appearance.slotColor));
|
||||
list.add(new ImageElement(x, y, IMG_CRAFTING_SMALL.width, IMG_CRAFTING_SMALL.height, IMG_CRAFTING_SMALL, book.appearance.slotColor));
|
||||
resultX = x + X_RESULT_SMALL;
|
||||
resultY = y + Y_RESULT_SMALL;
|
||||
}
|
||||
else if (this.grid_size.equalsIgnoreCase("large")) {
|
||||
x = BookScreen.PAGE_WIDTH / 2 - IMG_CRAFTING_LARGE.width / 2;
|
||||
height = y + IMG_CRAFTING_LARGE.height;
|
||||
list.add(new ElementImage(x, y, IMG_CRAFTING_LARGE.width, IMG_CRAFTING_LARGE.height, IMG_CRAFTING_LARGE, book.appearance.slotColor));
|
||||
list.add(new ImageElement(x, y, IMG_CRAFTING_LARGE.width, IMG_CRAFTING_LARGE.height, IMG_CRAFTING_LARGE, book.appearance.slotColor));
|
||||
resultX = x + X_RESULT_LARGE;
|
||||
resultY = y + Y_RESULT_LARGE;
|
||||
}
|
||||
@@ -79,17 +79,17 @@ public class ContentCrafting extends PageContent {
|
||||
if (this.grid[i][j] == null || this.grid[i][j].getItems().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
list.add(new ElementItem(x + SLOT_MARGIN + (SLOT_PADDING + Math.round(ElementItem.ITEM_SIZE_HARDCODED * ITEM_SCALE)) * j, y + SLOT_MARGIN + (SLOT_PADDING + Math.round(ElementItem.ITEM_SIZE_HARDCODED * ITEM_SCALE)) * i, ITEM_SCALE, this.grid[i][j].getItems(), this.grid[i][j].action));
|
||||
list.add(new ItemElement(x + SLOT_MARGIN + (SLOT_PADDING + Math.round(ItemElement.ITEM_SIZE_HARDCODED * ITEM_SCALE)) * j, y + SLOT_MARGIN + (SLOT_PADDING + Math.round(ItemElement.ITEM_SIZE_HARDCODED * ITEM_SCALE)) * i, ITEM_SCALE, this.grid[i][j].getItems(), this.grid[i][j].action));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.result != null) {
|
||||
list.add(new ElementItem(resultX, resultY, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
list.add(new ItemElement(resultX, resultY, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
}
|
||||
|
||||
if (this.description != null && this.description.length > 0) {
|
||||
list.add(new ElementText(0, height + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - height - 5, this.description));
|
||||
list.add(new TextElement(0, height + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - height - 5, this.description));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import slimeknights.mantle.client.book.data.BookLoadException;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ContentError extends PageContent {
|
||||
}
|
||||
}
|
||||
|
||||
list.add(new ElementText(0, TITLE_HEIGHT, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - TITLE_HEIGHT, text));
|
||||
list.add(new TextElement(0, TITLE_HEIGHT, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - TITLE_HEIGHT, text));
|
||||
}
|
||||
|
||||
public void buildSimple(ArrayList<BookElement> list) {
|
||||
@@ -76,6 +76,6 @@ public class ContentError extends PageContent {
|
||||
text[0] = new TextData(exception.getMessage());
|
||||
text[0].color = "dark_red";
|
||||
|
||||
list.add(new ElementText(0, TITLE_HEIGHT, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - TITLE_HEIGHT, text));
|
||||
list.add(new TextElement(0, TITLE_HEIGHT, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - TITLE_HEIGHT, text));
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import slimeknights.mantle.client.book.data.BookData;
|
||||
import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -28,10 +28,10 @@ public class ContentImage extends PageContent {
|
||||
}
|
||||
|
||||
if (this.image != null && this.image.location != null) {
|
||||
list.add(new ElementImage(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y, this.image));
|
||||
list.add(new ImageElement(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y, this.image));
|
||||
}
|
||||
else {
|
||||
list.add(new ElementImage(ImageData.MISSING));
|
||||
list.add(new ImageElement(ImageData.MISSING));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -31,14 +31,14 @@ public class ContentImageText extends PageContent {
|
||||
}
|
||||
|
||||
if (this.image != null && this.image.location != null) {
|
||||
list.add(new ElementImage(0, y, BookScreen.PAGE_WIDTH, 100, this.image));
|
||||
list.add(new ImageElement(0, y, BookScreen.PAGE_WIDTH, 100, this.image));
|
||||
}
|
||||
else {
|
||||
list.add(new ElementImage(0, y, 32, 32, ImageData.MISSING));
|
||||
list.add(new ImageElement(0, y, 32, 32, ImageData.MISSING));
|
||||
}
|
||||
|
||||
if (this.text != null && this.text.length > 0) {
|
||||
list.add(new ElementText(0, y + 105, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 105 - y, this.text));
|
||||
list.add(new TextElement(0, y + 105, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 105 - y, this.text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import slimeknights.mantle.client.book.data.BookData;
|
||||
import slimeknights.mantle.client.book.data.SectionData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementSection;
|
||||
import slimeknights.mantle.client.screen.book.element.SelectionElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -18,8 +18,8 @@ public class ContentSectionList extends PageContent {
|
||||
|
||||
@Override
|
||||
public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) {
|
||||
int width = (ElementSection.WIDTH + 5) * 3 - 5;
|
||||
int height = (ElementSection.HEIGHT + 5) * 3 - 5;
|
||||
int width = (SelectionElement.WIDTH + 5) * 3 - 5;
|
||||
int height = (SelectionElement.HEIGHT + 5) * 3 - 5;
|
||||
|
||||
int ox = (BookScreen.PAGE_WIDTH - width) / 2;
|
||||
int oy = (BookScreen.PAGE_HEIGHT - height) / 2;
|
||||
@@ -28,10 +28,10 @@ public class ContentSectionList extends PageContent {
|
||||
int ix = i % 3;
|
||||
int iy = (int) Math.floor(i / 3F);
|
||||
|
||||
int x = ox + ix * (ElementSection.WIDTH + 5);
|
||||
int y = oy + iy * (ElementSection.HEIGHT + 5);
|
||||
int x = ox + ix * (SelectionElement.WIDTH + 5);
|
||||
int y = oy + iy * (SelectionElement.HEIGHT + 5);
|
||||
|
||||
list.add(new ElementSection(x, y, this.sections.get(i)));
|
||||
list.add(new SelectionElement(x, y, this.sections.get(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,10 @@ import slimeknights.mantle.client.book.data.element.ItemStackData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementItem;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementTooltip;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ItemElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TooltipElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -56,22 +56,22 @@ public class ContentSmelting extends PageContent {
|
||||
|
||||
TextData tdTitle = new TextData(this.title);
|
||||
tdTitle.underlined = true;
|
||||
list.add(new ElementText(0, 0, BookScreen.PAGE_WIDTH, 9, tdTitle));
|
||||
list.add(new ElementImage(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.slotColor));
|
||||
list.add(new ElementTooltip(ImmutableList.of(I18n.format("mantle:tooltip.cooktime", this.cookTime / 20)), x + 7, y + 42, 60, 28));
|
||||
list.add(new TextElement(0, 0, BookScreen.PAGE_WIDTH, 9, tdTitle));
|
||||
list.add(new ImageElement(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.slotColor));
|
||||
list.add(new TooltipElement(ImmutableList.of(I18n.format("mantle:tooltip.cooktime", this.cookTime / 20)), x + 7, y + 42, 60, 28));
|
||||
|
||||
if (this.input != null && !this.input.getItems().isEmpty()) {
|
||||
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
list.add(new ItemElement(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
}
|
||||
|
||||
if (this.result != null && !this.result.getItems().isEmpty()) {
|
||||
list.add(new ElementItem(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
list.add(new ItemElement(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
}
|
||||
|
||||
list.add(new ElementItem(x + FUEL_X, y + FUEL_Y, ITEM_SCALE, this.getFuelsList()));
|
||||
list.add(new ItemElement(x + FUEL_X, y + FUEL_Y, ITEM_SCALE, this.getFuelsList()));
|
||||
|
||||
if (this.description != null && this.description.length > 0) {
|
||||
list.add(new ElementText(0, IMG_SMELTING.height + y + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y - 5, this.description));
|
||||
list.add(new TextElement(0, IMG_SMELTING.height + y + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y - 5, this.description));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import slimeknights.mantle.client.book.data.element.ItemStackData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementItem;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ItemElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -46,22 +46,22 @@ public class ContentSmithing extends PageContent {
|
||||
this.addTitle(list, this.title);
|
||||
}
|
||||
|
||||
list.add(new ElementImage(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));
|
||||
list.add(new ImageElement(x, y, IMG_SMITHING.width, IMG_SMITHING.height, IMG_SMITHING, book.appearance.slotColor));
|
||||
|
||||
if (this.input != null && !this.input.id.equals("")) {
|
||||
list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
list.add(new ItemElement(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, this.input.getItems(), this.input.action));
|
||||
}
|
||||
|
||||
if (this.modifier != null && !this.modifier.id.equals("")) {
|
||||
list.add(new ElementItem(x + MODIFIER_X, y + MODIFIER_Y, ITEM_SCALE, this.modifier.getItems(), this.modifier.action));
|
||||
list.add(new ItemElement(x + MODIFIER_X, y + MODIFIER_Y, ITEM_SCALE, this.modifier.getItems(), this.modifier.action));
|
||||
}
|
||||
|
||||
if (this.result != null && !this.result.id.equals("")) {
|
||||
list.add(new ElementItem(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
list.add(new ItemElement(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, this.result.getItems(), this.result.action));
|
||||
}
|
||||
|
||||
if (this.description != null && this.description.length > 0) {
|
||||
list.add(new ElementText(0, IMG_SMITHING.height + y + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - IMG_SMITHING.height - y - 5, this.description));
|
||||
list.add(new TextElement(0, IMG_SMITHING.height + y + 5, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - IMG_SMITHING.height - y - 5, this.description));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import slimeknights.mantle.client.book.repository.BookRepository;
|
||||
import slimeknights.mantle.client.screen.book.ArrowButton;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementAnimationToggle;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementStructure;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.AnimationToggleElement;
|
||||
import slimeknights.mantle.client.screen.book.element.StructureElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ContentStructure extends PageContent {
|
||||
structureSizeX -= 2 * offset;
|
||||
structureSizeY -= 2 * offset;
|
||||
|
||||
list.add(new ElementText(0, BookScreen.PAGE_HEIGHT - 10 - 2 * offset, BookScreen.PAGE_WIDTH, 2 * offset, this.text));
|
||||
list.add(new TextElement(0, BookScreen.PAGE_HEIGHT - 10 - 2 * offset, BookScreen.PAGE_WIDTH, 2 * offset, this.text));
|
||||
}
|
||||
|
||||
if (this.size != null && this.size.length == 3 && this.structure != null && this.structure.length > 0) {
|
||||
@@ -71,8 +71,8 @@ public class ContentStructure extends PageContent {
|
||||
if (showButtons) {
|
||||
//structureSizeX -= ArrowButton.ArrowType.REFRESH.w;
|
||||
}
|
||||
ElementStructure elementStructure = new ElementStructure(offset, y, structureSizeX, structureSizeY, this.size, this.structure);
|
||||
list.add(elementStructure);
|
||||
StructureElement structureElement = new StructureElement(offset, y, structureSizeX, structureSizeY, this.size, this.structure);
|
||||
list.add(structureElement);
|
||||
|
||||
if (showButtons) {
|
||||
int col = book.appearance.structureButtonColor;
|
||||
@@ -87,7 +87,7 @@ public class ContentStructure extends PageContent {
|
||||
//midY += ArrowButton.ArrowType.UP.h + 2;
|
||||
//list.add(new ElementArrow(ElementStructure.BUTTON_ID_LAYER_DOWN, elementStructure, structureSizeX + offset + dx, midY, ArrowButton.ArrowType.DOWN, col, colHover));
|
||||
|
||||
list.add(new ElementAnimationToggle(BookScreen.PAGE_WIDTH - ArrowButton.ArrowType.REFRESH.w, 0, ArrowButton.ArrowType.REFRESH, col, colHover, colToggled, elementStructure));
|
||||
list.add(new AnimationToggleElement(BookScreen.PAGE_WIDTH - ArrowButton.ArrowType.REFRESH.w, 0, ArrowButton.ArrowType.REFRESH, col, colHover, colToggled, structureElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import slimeknights.mantle.client.book.data.BookData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ContentTableOfContents extends PageContent {
|
||||
|
||||
for (int i = 0; i < this.data.length; i++) {
|
||||
TextData text = this.data[i];
|
||||
list.add(new ElementText(0, y + i * (int) (Minecraft.getInstance().fontRenderer.FONT_HEIGHT * text.scale), BookScreen.PAGE_WIDTH, Minecraft.getInstance().fontRenderer.FONT_HEIGHT, text));
|
||||
list.add(new TextElement(0, y + i * (int) (Minecraft.getInstance().fontRenderer.FONT_HEIGHT * text.scale), BookScreen.PAGE_WIDTH, Minecraft.getInstance().fontRenderer.FONT_HEIGHT, text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import slimeknights.mantle.client.book.data.BookData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ContentText extends PageContent {
|
||||
@@ -29,7 +29,7 @@ public class ContentText extends PageContent {
|
||||
}
|
||||
|
||||
if (this.text != null && this.text.length > 0) {
|
||||
list.add(new ElementText(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y, this.text));
|
||||
list.add(new TextElement(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - y, this.text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -38,14 +38,14 @@ public class ContentTextImage extends PageContent {
|
||||
}
|
||||
|
||||
if (this.text != null && this.text.length > 0) {
|
||||
list.add(new ElementText(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 105, this.text));
|
||||
list.add(new TextElement(0, y, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 105, this.text));
|
||||
}
|
||||
|
||||
if (this.image != null && this.image.location != null) {
|
||||
list.add(new ElementImage(0, y + BookScreen.PAGE_HEIGHT - 100, BookScreen.PAGE_WIDTH, 100 - y, this.image));
|
||||
list.add(new ImageElement(0, y + BookScreen.PAGE_HEIGHT - 100, BookScreen.PAGE_WIDTH, 100 - y, this.image));
|
||||
}
|
||||
else {
|
||||
list.add(new ElementImage(0, y + BookScreen.PAGE_HEIGHT - 100, BookScreen.PAGE_WIDTH, 100 - y, ImageData.MISSING));
|
||||
list.add(new ImageElement(0, y + BookScreen.PAGE_HEIGHT - 100, BookScreen.PAGE_WIDTH, 100 - y, ImageData.MISSING));
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -7,8 +7,8 @@ import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -32,18 +32,18 @@ public class ContentTextLeftImage extends PageContent {
|
||||
}
|
||||
|
||||
if (this.image != null && this.image.location != null) {
|
||||
list.add(new ElementImage(0, y, 50, 50, this.image));
|
||||
list.add(new ImageElement(0, y, 50, 50, this.image));
|
||||
}
|
||||
else {
|
||||
list.add(new ElementImage(0, y, 50, 50, ImageData.MISSING));
|
||||
list.add(new ImageElement(0, y, 50, 50, ImageData.MISSING));
|
||||
}
|
||||
|
||||
if (this.text1 != null && this.text1.length > 0) {
|
||||
list.add(new ElementText(55, y, BookScreen.PAGE_WIDTH - 55, 50, this.text1));
|
||||
list.add(new TextElement(55, y, BookScreen.PAGE_WIDTH - 55, 50, this.text1));
|
||||
}
|
||||
|
||||
if (this.text2 != null && this.text2.length > 0) {
|
||||
list.add(new ElementText(0, y + 55, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 55 - y, this.text2));
|
||||
list.add(new TextElement(0, y + 55, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 55 - y, this.text2));
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -7,8 +7,8 @@ import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementImage;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.ImageElement;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -32,18 +32,18 @@ public class ContentTextRightImage extends PageContent {
|
||||
}
|
||||
|
||||
if (this.text1 != null && this.text1.length > 0) {
|
||||
list.add(new ElementText(0, y, BookScreen.PAGE_WIDTH - 55, 50, this.text1));
|
||||
list.add(new TextElement(0, y, BookScreen.PAGE_WIDTH - 55, 50, this.text1));
|
||||
}
|
||||
|
||||
if (this.image != null && this.image.location != null) {
|
||||
list.add(new ElementImage(BookScreen.PAGE_WIDTH - 50, y, 50, 50, this.image));
|
||||
list.add(new ImageElement(BookScreen.PAGE_WIDTH - 50, y, 50, 50, this.image));
|
||||
}
|
||||
else {
|
||||
list.add(new ElementImage(BookScreen.PAGE_WIDTH - 50, y, 50, 50, ImageData.MISSING));
|
||||
list.add(new ImageElement(BookScreen.PAGE_WIDTH - 50, y, 50, 50, ImageData.MISSING));
|
||||
}
|
||||
|
||||
if (this.text2 != null && this.text2.length > 0) {
|
||||
list.add(new ElementText(0, y + 55, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 55 - y, this.text2));
|
||||
list.add(new TextElement(0, y + 55, BookScreen.PAGE_WIDTH, BookScreen.PAGE_HEIGHT - 55 - y, this.text2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import slimeknights.mantle.client.book.data.element.TextData;
|
||||
import slimeknights.mantle.client.book.repository.BookRepository;
|
||||
import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import slimeknights.mantle.client.screen.book.element.BookElement;
|
||||
import slimeknights.mantle.client.screen.book.element.ElementText;
|
||||
import slimeknights.mantle.client.screen.book.element.TextElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -32,6 +32,6 @@ public abstract class PageContent {
|
||||
}
|
||||
|
||||
public void addTitle(ArrayList<BookElement> list, TextData[] title) {
|
||||
list.add(new ElementText(0, 0, BookScreen.PAGE_WIDTH, 9, title));
|
||||
list.add(new TextElement(0, 0, BookScreen.PAGE_WIDTH, 9, title));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
// a vertical slider!
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class WidgetSlider extends Widget {
|
||||
public class SliderWidget extends Widget {
|
||||
|
||||
// gui info
|
||||
public final ElementScreen slider;
|
||||
@@ -36,7 +36,7 @@ public class WidgetSlider extends Widget {
|
||||
private int clickY;
|
||||
private boolean clickedBar; // if the bar has already been clicked and not released
|
||||
|
||||
public WidgetSlider(ElementScreen slider, ElementScreen sliderHighlighted, ElementScreen sliderDisabled, ElementScreen slideBarTop, ElementScreen slideBarBottom, ScalableElementScreen slideBar) {
|
||||
public SliderWidget(ElementScreen slider, ElementScreen sliderHighlighted, ElementScreen sliderDisabled, ElementScreen slideBarTop, ElementScreen slideBarBottom, ScalableElementScreen slideBar) {
|
||||
this.slider = slider;
|
||||
this.sliderHighlighted = sliderHighlighted;
|
||||
this.sliderDisabled = sliderDisabled;
|
||||
+2
-2
@@ -13,7 +13,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import java.util.List;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class WidgetTabs extends Widget {
|
||||
public class TabsWidget extends Widget {
|
||||
|
||||
private static final ResourceLocation
|
||||
creativeInventoryTabs = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
|
||||
@@ -35,7 +35,7 @@ public class WidgetTabs extends Widget {
|
||||
private final MultiModuleScreen parent;
|
||||
private boolean clicked = false;
|
||||
|
||||
public WidgetTabs(MultiModuleScreen parent, ElementScreen tabLeft, ElementScreen tabCenter, ElementScreen tabRight, ElementScreen activeLeft, ElementScreen activeCenter, ElementScreen activeRight) {
|
||||
public TabsWidget(MultiModuleScreen parent, ElementScreen tabLeft, ElementScreen tabCenter, ElementScreen tabRight, ElementScreen activeLeft, ElementScreen activeCenter, ElementScreen activeRight) {
|
||||
this.parent = parent;
|
||||
|
||||
this.tab[0] = tabLeft;
|
||||
+3
-3
@@ -2,15 +2,15 @@ package slimeknights.mantle.client.screen.book.element;
|
||||
|
||||
import slimeknights.mantle.client.screen.book.ArrowButton;
|
||||
|
||||
public class ElementAnimationToggle extends ElementArrow {
|
||||
public class AnimationToggleElement extends ArrowElement {
|
||||
|
||||
private final int arrowColorActive;
|
||||
private final int arrowColorInactive;
|
||||
private boolean toggled = false;
|
||||
|
||||
public ElementAnimationToggle(int x, int y, ArrowButton.ArrowType arrowType, int arrowColor, int arrowColorHover, int arrowColorActive, ElementStructure elementStructure) {
|
||||
public AnimationToggleElement(int x, int y, ArrowButton.ArrowType arrowType, int arrowColor, int arrowColorHover, int arrowColorActive, StructureElement structureElement) {
|
||||
super(x, y, arrowType, arrowColor, arrowColorHover, (p_212998_1_) -> {
|
||||
elementStructure.canTick = !elementStructure.canTick;
|
||||
structureElement.canTick = !structureElement.canTick;
|
||||
});
|
||||
|
||||
this.arrowColorInactive = arrowColor;
|
||||
+2
-2
@@ -4,11 +4,11 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.button.Button.IPressable;
|
||||
import slimeknights.mantle.client.screen.book.ArrowButton;
|
||||
|
||||
public class ElementArrow extends ElementButton {
|
||||
public class ArrowElement extends ButtonElement {
|
||||
|
||||
protected final ArrowButton button;
|
||||
|
||||
public ElementArrow(int x, int y, ArrowButton.ArrowType arrowType, int arrowColor, int arrowColorHover, IPressable iPressable) {
|
||||
public ArrowElement(int x, int y, ArrowButton.ArrowType arrowType, int arrowColor, int arrowColorHover, IPressable iPressable) {
|
||||
super(x, y, arrowType.w, arrowType.h);
|
||||
|
||||
this.button = new ArrowButton(x, y, arrowType, arrowColor, arrowColorHover, iPressable);
|
||||
@@ -0,0 +1,8 @@
|
||||
package slimeknights.mantle.client.screen.book.element;
|
||||
|
||||
public abstract class ButtonElement extends SizedBookElement {
|
||||
|
||||
public ButtonElement(int x, int y, int width, int height) {
|
||||
super(x, y, width, height);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package slimeknights.mantle.client.screen.book.element;
|
||||
|
||||
public abstract class ElementButton extends SizedBookElement {
|
||||
|
||||
public ElementButton(int x, int y, int width, int height) {
|
||||
super(x, y, width, height);
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -1,6 +1,5 @@
|
||||
package slimeknights.mantle.client.screen.book.element;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
@@ -9,26 +8,26 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import slimeknights.mantle.client.book.data.element.ImageData;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ElementImage extends SizedBookElement {
|
||||
public class ImageElement extends SizedBookElement {
|
||||
|
||||
public ImageData image;
|
||||
public int colorMultiplier;
|
||||
|
||||
private ElementItem itemElement;
|
||||
private ItemElement itemElement;
|
||||
|
||||
public ElementImage(ImageData image) {
|
||||
public ImageElement(ImageData image) {
|
||||
this(image, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public ElementImage(ImageData image, int colorMultiplier) {
|
||||
public ImageElement(ImageData image, int colorMultiplier) {
|
||||
this(image.x, image.y, image.width, image.height, image, colorMultiplier);
|
||||
}
|
||||
|
||||
public ElementImage(int x, int y, int width, int height, ImageData image) {
|
||||
public ImageElement(int x, int y, int width, int height, ImageData image) {
|
||||
this(x, y, width, height, image, image.colorMultiplier);
|
||||
}
|
||||
|
||||
public ElementImage(int x, int y, int width, int height, ImageData image, int colorMultiplier) {
|
||||
public ImageElement(int x, int y, int width, int height, ImageData image, int colorMultiplier) {
|
||||
super(x, y, width, height);
|
||||
|
||||
this.image = image;
|
||||
@@ -56,7 +55,7 @@ public class ElementImage extends SizedBookElement {
|
||||
this.colorMultiplier = colorMultiplier;
|
||||
|
||||
if(image.item != null) {
|
||||
this.itemElement = new ElementItem(0, 0, 1F, image.item.getItems());
|
||||
this.itemElement = new ItemElement(0, 0, 1F, image.item.getItems());
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -16,7 +16,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ElementItem extends SizedBookElement {
|
||||
public class ItemElement extends SizedBookElement {
|
||||
|
||||
public static final int ITEM_SIZE_HARDCODED = 16;
|
||||
public static final int ITEM_SWITCH_TICKS = 90;
|
||||
@@ -29,31 +29,31 @@ public class ElementItem extends SizedBookElement {
|
||||
public int renderTick = 0;
|
||||
public int currentItem = 0;
|
||||
|
||||
public ElementItem(int x, int y, float scale, Item item) {
|
||||
public ItemElement(int x, int y, float scale, Item item) {
|
||||
this(x, y, scale, new ItemStack(item));
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, Block item) {
|
||||
public ItemElement(int x, int y, float scale, Block item) {
|
||||
this(x, y, scale, new ItemStack(item));
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, ItemStack item) {
|
||||
public ItemElement(int x, int y, float scale, ItemStack item) {
|
||||
this(x, y, scale, new ItemStack[] { item });
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, Collection<ItemStack> itemCycle) {
|
||||
public ItemElement(int x, int y, float scale, Collection<ItemStack> itemCycle) {
|
||||
this(x, y, scale, itemCycle.toArray(new ItemStack[itemCycle.size()]));
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, Collection<ItemStack> itemCycle, String action) {
|
||||
public ItemElement(int x, int y, float scale, Collection<ItemStack> itemCycle, String action) {
|
||||
this(x, y, scale, itemCycle.toArray(new ItemStack[itemCycle.size()]), action);
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, ItemStack... itemCycle) {
|
||||
public ItemElement(int x, int y, float scale, ItemStack... itemCycle) {
|
||||
this(x, y, scale, itemCycle, null);
|
||||
}
|
||||
|
||||
public ElementItem(int x, int y, float scale, ItemStack[] itemCycle, String action) {
|
||||
public ItemElement(int x, int y, float scale, ItemStack[] itemCycle, String action) {
|
||||
super(x, y, MathHelper.floor(ITEM_SIZE_HARDCODED * scale), MathHelper.floor(ITEM_SIZE_HARDCODED * scale));
|
||||
|
||||
NonNullList<ItemStack> nonNullStacks = NonNullList.withSize(itemCycle.length, ItemStack.EMPTY);
|
||||
+4
-5
@@ -1,6 +1,5 @@
|
||||
package slimeknights.mantle.client.screen.book.element;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -9,7 +8,7 @@ import slimeknights.mantle.client.book.data.SectionData;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ElementSection extends SizedBookElement {
|
||||
public class SelectionElement extends SizedBookElement {
|
||||
|
||||
public static final int IMG_SIZE = 32;
|
||||
|
||||
@@ -17,19 +16,19 @@ public class ElementSection extends SizedBookElement {
|
||||
public static final int HEIGHT = 42;
|
||||
|
||||
private SectionData section;
|
||||
private ElementImage iconRenderer;
|
||||
private ImageElement iconRenderer;
|
||||
|
||||
private final int iconX;
|
||||
private final int iconY;
|
||||
|
||||
public ElementSection(int x, int y, SectionData section) {
|
||||
public SelectionElement(int x, int y, SectionData section) {
|
||||
super(x, y, WIDTH, HEIGHT);
|
||||
|
||||
this.section = section;
|
||||
|
||||
this.iconX = this.x + WIDTH / 2 - IMG_SIZE / 2;
|
||||
this.iconY = this.y + HEIGHT / 2 - IMG_SIZE / 2;
|
||||
this.iconRenderer = new ElementImage(this.iconX, this.iconY, IMG_SIZE, IMG_SIZE, section.icon);
|
||||
this.iconRenderer = new ImageElement(this.iconX, this.iconY, IMG_SIZE, IMG_SIZE, section.icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
+2
-2
@@ -23,7 +23,7 @@ import slimeknights.mantle.client.screen.book.BookScreen;
|
||||
import java.util.Random;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class ElementStructure extends SizedBookElement {
|
||||
public class StructureElement extends SizedBookElement {
|
||||
|
||||
private float scale = 50.0F;
|
||||
private float xTranslate = 0F;
|
||||
@@ -32,7 +32,7 @@ public class ElementStructure extends SizedBookElement {
|
||||
private float w = 0F;
|
||||
private float h = 0F;
|
||||
|
||||
public ElementStructure(int x, int y, int width, int height, int[] size, BlockData[] structure) {
|
||||
public StructureElement(int x, int y, int width, int height, int[] size, BlockData[] structure) {
|
||||
super(x, y, width, height);
|
||||
|
||||
if (size.length == 3) {
|
||||
+4
-4
@@ -12,22 +12,22 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ElementText extends SizedBookElement {
|
||||
public class TextElement extends SizedBookElement {
|
||||
|
||||
public TextData[] text;
|
||||
private List<String> tooltip = new ArrayList<String>();
|
||||
|
||||
private boolean doAction = false;
|
||||
|
||||
public ElementText(int x, int y, int width, int height, String text) {
|
||||
public TextElement(int x, int y, int width, int height, String text) {
|
||||
this(x, y, width, height, new TextData(text));
|
||||
}
|
||||
|
||||
public ElementText(int x, int y, int width, int height, Collection<TextData> text) {
|
||||
public TextElement(int x, int y, int width, int height, Collection<TextData> text) {
|
||||
this(x, y, width, height, text.toArray(new TextData[text.size()]));
|
||||
}
|
||||
|
||||
public ElementText(int x, int y, int width, int height, TextData... text) {
|
||||
public TextElement(int x, int y, int width, int height, TextData... text) {
|
||||
super(x, y, width, height);
|
||||
|
||||
this.text = text;
|
||||
+2
-2
@@ -4,10 +4,10 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ElementTooltip extends SizedBookElement {
|
||||
public class TooltipElement extends SizedBookElement {
|
||||
private List<String> tooltip;
|
||||
|
||||
public ElementTooltip(List<String> tooltip, int x, int y, int width, int height) {
|
||||
public TooltipElement(List<String> tooltip, int x, int y, int width, int height) {
|
||||
super(x, y, width, height);
|
||||
|
||||
this.tooltip = tooltip;
|
||||
Reference in new issue
Block a user