Skip to content

Instantly share code, notes, and snippets.

@shadowfacts
Created July 14, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shadowfacts/4179f765ab34868343bf3458444b00f1 to your computer and use it in GitHub Desktop.
Save shadowfacts/4179f765ab34868343bf3458444b00f1 to your computer and use it in GitHub Desktop.
public static void GuiScreen create(InventoryPlayer playerInv) {
UIFixedView view = new UIFixedView(176, 166);
UIImage texture = new UIImage(new ResourceLocation("modtest:textures/gui/test.png"), 176, 166);
view.add(texture);
UIFixedView topPanel = new UIFixedView(176, 166 / 2);
topPanel.setStyle(VERTICAL_LAYOUT, TOP);
UIListView list = new UIListView(topPanel.width - 10, topPanel.height - 10);
list.setStyle(VERTICAL_LAYOUT, TOP);
list.setStyle(HORIZONTAL_LAYOUT, LEFT);
list.setStyle(MARGIN_TOP, 5);
list.setStyle(MARGIN_LEFT, 5);
UIFixedView fixed1 = new UIFixedView(topPanel.width, 32);
UIStack stack1 = new UIStack(Items.IRON_INGOT, 32, 32);
stack1.setStyle(HORIZONTAL_LAYOUT, LEFT);
stack1.setStyle(VERTICAL_LAYOUT, TOP);
stack1.setStyle(MARGIN_LEFT, 20);
fixed1.add(stack1);
UIStackView stackView1 = new UIStackView();
stackView1.setStyle(HORIZONTAL_LAYOUT, RIGHT);
stackView1.setStyle(STACK_SPACING, 7);
UILabel title1 = new UILabel("Iron Ingot");
title1.setStyle(TEXT_UNDERLINE, true);
title1.setStyle(TEXT_COLOR, new Color(0x373737));
stackView1.add(title1);
UILabel subtext1 = new UILabel("Testerino!");
stackView1.add(subtext1);
fixed1.add(stackView1);
list.add(fixed1);
UIFixedView fixed2 = new UIFixedView(topPanel.width, 32);
UIStack stack2 = new UIStack(Items.REDSTONE, 32, 32);
stack2.setStyle(HORIZONTAL_LAYOUT, LEFT);
stack2.setStyle(VERTICAL_LAYOUT, TOP);
stack2.setStyle(MARGIN_LEFT, 20);
fixed2.add(stack2);
UIStackView stackView2 = new UIStackView();
stackView2.setStyle(HORIZONTAL_LAYOUT, RIGHT);
stackView2.setStyle(STACK_SPACING, 7);
UILabel title2 = new UILabel("Redstone");
title2.setStyle(TEXT_UNDERLINE, true);
title2.setStyle(TEXT_COLOR, new Color(0x373737));
stackView2.add(title2);
UILabel subtext2 = new UILabel("Test 2!");
stackView2.add(subtext2);
fixed2.add(stackView2);
list.add(fixed2);
UIFixedView fixed3 = new UIFixedView(topPanel.width, 32);
UIStack stack3 = new UIStack(Items.GOLD_INGOT, 32, 32);
stack3.setStyle(HORIZONTAL_LAYOUT, LEFT);
stack3.setStyle(VERTICAL_LAYOUT, TOP);
stack3.setStyle(MARGIN_LEFT, 20);
fixed3.add(stack3);
UIStackView stackView3 = new UIStackView();
stackView3.setStyle(HORIZONTAL_LAYOUT, RIGHT);
stackView3.setStyle(STACK_SPACING, 7);
UILabel title3 = new UILabel("Gold Ingot");
title3.setStyle(TEXT_UNDERLINE, true);
title3.setStyle(TEXT_COLOR, new Color(0x373737));
stackView3.add(title3);
UILabel subtext3 = new UILabel("Oooh, shiny!");
stackView3.add(subtext3);
fixed3.add(stackView3);
list.add(fixed3);
UIFixedView fixed4 = new UIFixedView(topPanel.width, 32);
UIStack stack4 = new UIStack(Items.DIAMOND, 32, 32);
stack4.setStyle(HORIZONTAL_LAYOUT, LEFT);
stack4.setStyle(VERTICAL_LAYOUT, TOP);
stack4.setStyle(MARGIN_LEFT, 20);
fixed4.add(stack4);
UIStackView stackView4 = new UIStackView();
stackView4.setStyle(HORIZONTAL_LAYOUT, RIGHT);
stackView4.setStyle(STACK_SPACING, 7);
UILabel title4 = new UILabel("Diamond");
title4.setStyle(TEXT_UNDERLINE, true);
title4.setStyle(TEXT_COLOR, new Color(0x373737));
stackView4.add(title4);
UILabel subtext4 = new UILabel("Precioussss!");
stackView4.add(subtext4);
fixed4.add(stackView4);
list.add(fixed4);
topPanel.add(list);
view.add(topPanel);
return new UIContainerWrapper(new ContainerPlayerInv(playerInv)).add(view).layout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment