Skip to content

Commit 1070c66

Browse files
committed
Added logs tab
1 parent 2e3bcae commit 1070c66

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/client/java/com/hanprogramer/androids/client/screen/android/AndroidInventoryHandledScreen.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import net.minecraft.client.MinecraftClient;
1111
import net.minecraft.client.gui.DrawContext;
1212
import net.minecraft.entity.player.PlayerInventory;
13+
import net.minecraft.item.ItemStack;
14+
import net.minecraft.item.Items;
1315
import net.minecraft.text.Text;
1416
import net.minecraft.util.Identifier;
1517

@@ -26,7 +28,8 @@ public AndroidInventoryHandledScreen(AndroidInventoryScreenHandler handler, Play
2628
// TODO: Implement more containers?
2729
tabs.add(new BackInventoryTab(this, Text.of(backItem.getName()), backItem, null));
2830
}
29-
tabs.add(new SettingsTab(this, Text.of("Settings"), null, Identifier.of(AndroidsCraft.MOD_ID, "settings_icon")));
31+
tabs.add(new SettingsTab(this, Text.of("Settings"), new ItemStack(ModItems.CHIP), null));
32+
tabs.add(new LogsTab(this, Text.of("Logs"), new ItemStack(Items.PAPER), null));
3033
}
3134

3235
public void resyncEntity() {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.hanprogramer.androids.client.screen.android;
2+
3+
import com.hanprogramer.androids.client.screen.base.BaseScreenTab;
4+
import net.minecraft.client.gl.RenderPipelines;
5+
import net.minecraft.client.gui.DrawContext;
6+
import net.minecraft.client.gui.Drawable;
7+
import net.minecraft.item.ItemStack;
8+
import net.minecraft.text.Text;
9+
import net.minecraft.util.Identifier;
10+
import org.jetbrains.annotations.Nullable;
11+
12+
import java.util.List;
13+
14+
public class LogsTab extends BaseScreenTab<AndroidInventoryHandledScreen> {
15+
private static final Identifier TEXTURE = Identifier.of("androids", "textures/gui/android_log.png");
16+
public LogsTab(AndroidInventoryHandledScreen parent, Text title, @Nullable ItemStack iconStack, @Nullable Identifier texture) {
17+
super(parent, title, iconStack, texture);
18+
}
19+
20+
@Override
21+
public void build(List<Drawable> elements) {
22+
23+
}
24+
@Override
25+
public void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
26+
int i = (this.parent.width - this.parent.backgroundWidth) / 2;
27+
int j = (this.parent.height - this.parent.backgroundHeight) / 2;
28+
context.drawTexture(RenderPipelines.GUI_TEXTURED, TEXTURE, i, j, 0.0F, 0.0F, this.parent.backgroundWidth, this.parent.backgroundHeight, 256, 256);
29+
}
30+
}

0 commit comments

Comments
 (0)