Skip to content

Commit

Permalink
add medium texturesize for clock; readjust slider layouts and alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Nov 9, 2024
1 parent 02ea434 commit ec839a4
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ContainerClock(int windowId, World world, BlockPos pos, PlayerInventory p
tile = (TileRedstoneClock) world.getTileEntity(pos);
this.playerEntity = player;
this.playerInventory = playerInventory;
layoutPlayerInventorySlots(8, 153);
layoutPlayerInventorySlots(8, 84);
this.trackAllIntFields(tile, TileRedstoneClock.Fields.values().length);
}

Expand Down
18 changes: 7 additions & 11 deletions src/main/java/com/lothrazar/cyclic/block/clock/ScreenClock.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,29 @@ public class ScreenClock extends ScreenBase<ContainerClock> {

public ScreenClock(ContainerClock screenContainer, PlayerInventory inv, ITextComponent titleIn) {
super(screenContainer, inv, titleIn);
this.ySize = 256;
}

@Override
public void init() {
super.init();
int x, y;
int w = 160;
int h = 20;
x = guiLeft + 8;
y = guiTop + 8;
int h = 18;
x = guiLeft + 6;
y = guiTop + 6;
btnRedstone = addButton(new ButtonMachineField(x, y, TileRedstoneClock.Fields.REDSTONE.ordinal(), container.tile.getPos()));
int f = TileRedstoneClock.Fields.DURATION.ordinal();
x = guiLeft + 8;
y = guiTop + 38;
y = guiTop + 26;
GuiSliderInteger dur = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(),
1, 200, container.tile.getField(f)));
dur.setTooltip("cyclic.clock.duration");
y += 26;
y += h + 1;
f = TileRedstoneClock.Fields.DELAY.ordinal();
GuiSliderInteger delay = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(),
1, 200, container.tile.getField(f)));
delay.setTooltip("cyclic.clock.delay");
y += 26;
y += h + 1;
f = TileRedstoneClock.Fields.POWER.ordinal();
GuiSliderInteger power = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(),
1, 15, container.tile.getField(f)));
Expand All @@ -60,9 +59,6 @@ protected void drawGuiContainerForegroundLayer(MatrixStack ms, int mouseX, int m

@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack ms, float partialTicks, int mouseX, int mouseY) {
this.drawBackground(ms, TextureRegistry.INVENTORY_LARGE_PLAIN);
// this.txtDuration.render(ms, mouseX, mouseX, partialTicks);
// this.txtDelay.render(ms, mouseX, mouseX, partialTicks);
// this.txtPower.render(ms, mouseX, mouseX, partialTicks);
this.drawBackground(ms, TextureRegistry.INVENTORY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ContainerItemCollector(int windowId, World world, BlockPos pos, PlayerInv
}
}
addSlot(new SlotItemHandler(tile.filter, 0, 152, 9));
layoutPlayerInventorySlots(8, 153);
layoutPlayerInventorySlots(8, 132);
this.trackAllIntFields(tile, TileItemCollector.Fields.values().length);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public class ScreenItemCollector extends ScreenBase<ContainerItemCollector> {

private ButtonMachineField btnRedstone;
private ButtonMachineField btnRender;
private GuiSliderInteger sizeSlider;
private ButtonMachineField btnDirection;
private GuiSliderInteger sizeSlider;
private GuiSliderInteger heightslider;

public ScreenItemCollector(ContainerItemCollector screenContainer, PlayerInventory inv, ITextComponent titleIn) {
super(screenContainer, inv, titleIn);
this.ySize = 256;
this.ySize = 214;
}

@Override
Expand All @@ -29,33 +29,28 @@ public void init() {
int x = guiLeft + 6;
int y = guiTop + 6;
int f = TileItemCollector.Fields.REDSTONE.ordinal();
int h = 20;
btnRedstone = addButton(new ButtonMachineField(x, y, f, container.tile.getPos()));
f = TileItemCollector.Fields.RENDER.ordinal();
y += 20;
y += h;
btnRender = addButton(new ButtonMachineField(x, y, f,
container.tile.getPos(), TextureEnum.RENDER_HIDE, TextureEnum.RENDER_SHOW, "gui.cyclic.render"))
// .setSize(18)
;
container.tile.getPos(), TextureEnum.RENDER_HIDE, TextureEnum.RENDER_SHOW, "gui.cyclic.render"));
//then toggle
f = TileItemCollector.Fields.DIRECTION.ordinal();
y += 20;
y += h;
btnDirection = addButton(new ButtonMachineField(x, y, f,
container.tile.getPos(), TextureEnum.DIR_DOWN, TextureEnum.DIR_UPWARDS, "gui.cyclic.direction"))
//.setSize(18)
;
int w = 110;
int h = 18;
//now start sliders
//
y = guiTop + 22;
x = guiLeft + 34;
container.tile.getPos(), TextureEnum.DIR_DOWN, TextureEnum.DIR_UPWARDS, "gui.cyclic.direction"));
int w = 140;
//now start sliders
x = guiLeft + 30;
y = guiTop + 34;
f = TileItemCollector.Fields.HEIGHT.ordinal();
heightslider = this.addButton(new GuiSliderInteger(x, y, w, h, TileItemCollector.Fields.HEIGHT.ordinal(), container.tile.getPos(),
0, TileItemCollector.MAX_HEIGHT, container.tile.getField(f)));
heightslider.setTooltip("buildertype.height.tooltip");
//then size
f = TileItemCollector.Fields.SIZE.ordinal();
y += h + 1;
y += h + 4;
sizeSlider = this.addButton(new GuiSliderInteger(x, y, w, h, TileItemCollector.Fields.SIZE.ordinal(),
container.tile.getPos(), 0, TileItemCollector.MAX_SIZE, container.tile.getField(f)));
sizeSlider.setTooltip("buildertype.size.tooltip");
Expand All @@ -81,7 +76,7 @@ protected void drawGuiContainerForegroundLayer(MatrixStack ms, int mouseX, int m

@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack ms, float partialTicks, int mouseX, int mouseY) {
this.drawBackground(ms, TextureRegistry.INVENTORY_LARGE_PLAIN);
this.drawBackground(ms, TextureRegistry.INVENTORY_MEDIUM);
for (int i = 0; i < 9; i++) {
int y = 81;
this.drawSlot(ms, 7 + i * Const.SQ, y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void init() {
x = guiLeft + 6;
y = guiTop + 6;
btnRedstone = addButton(new ButtonMachineField(x, y, TileFan.Fields.REDSTONE.ordinal(), container.tile.getPos()));
y += 20;
x += 20;
btnRender = addButton(new ButtonMachineField(x, y, TileFan.Fields.RENDER.ordinal(),
container.tile.getPos(), TextureEnum.RENDER_HIDE, TextureEnum.RENDER_SHOW, "gui.cyclic.render"));
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,25 @@ public ScreenForester(ContainerForester screenContainer, PlayerInventory inv, IT
@Override
public void init() {
super.init();
int x, y;
int x = guiLeft + 6;
int y = guiTop + 6;
energy.guiLeft = guiLeft;
energy.guiTop = guiTop;
energy.visible = TileForester.POWERCONF.get() > 0;
x = guiLeft + 6;
y = guiTop + 6;
btnRedstone = addButton(new ButtonMachineField(x, y, TileForester.Fields.REDSTONE.ordinal(), container.tile.getPos()));
y += 20;
btnRender = addButton(new ButtonMachineField(x, y, TileForester.Fields.RENDER.ordinal(),
container.tile.getPos(), TextureEnum.RENDER_HIDE, TextureEnum.RENDER_SHOW, "gui.cyclic.render"));
final int w = 110;
final int h = 18;
final int w = 120;
final int h = 20;
int f = TileForester.Fields.HEIGHT.ordinal();
x = guiLeft + 34;
y = guiTop + 38;
x = guiLeft + 30;
y = guiTop + 36;
heightslider = this.addButton(new GuiSliderInteger(x, y, w, h, TileForester.Fields.HEIGHT.ordinal(), container.tile.getPos(),
0, TileForester.MAX_HEIGHT, container.tile.getField(f)));
//
f = TileForester.Fields.SIZE.ordinal();
// x += 28;
y += 20;
y += h + 4;
size = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(), 0, TileForester.MAX_SIZE, container.tile.getField(f)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ public void init() {
y += 20;
btnDirection = addButton(new ButtonMachineField(x, y, f,
container.tile.getPos(), TextureEnum.DIR_DOWN, TextureEnum.DIR_UPWARDS, "gui.cyclic.direction"));
final int w = 110;
final int h = 18;
//now start sliders
//
//
y = guiTop + 24;
x = guiLeft + 34;
final int w = 120;
final int h = 20;
x = guiLeft + 30;
y = guiTop + 36;
f = TileHarvester.Fields.HEIGHT.ordinal();
heightslider = this.addButton(new GuiSliderInteger(x, y, w, h, TileHarvester.Fields.HEIGHT.ordinal(), container.tile.getPos(),
0, TileHarvester.MAX_HEIGHT, container.tile.getField(f)));
//
f = TileHarvester.Fields.SIZE.ordinal();
y += 28;
y += h + 4;
size = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(), 0, TileHarvester.MAX_SIZE, container.tile.getField(f)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public void init() {
//
int w = 120;
int h = 20;
x = guiLeft + 32;
y += h + 1;
x = guiLeft + 30;
y += h + 4;
// height fi
f = TileMiner.Fields.HEIGHT.ordinal();
GuiSliderInteger heightslider = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(),
0, TileMiner.MAX_HEIGHT, container.tile.getField(f)));
heightslider.setTooltip("buildertype.height.tooltip");
y += h + 1;
y += h + 4;
//
f = TileMiner.Fields.SIZE.ordinal();
sizeSlider = this.addButton(new GuiSliderInteger(x, y, w, h, f, container.tile.getPos(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class TextureRegistry {
public static final ResourceLocation INVENTORY_PLAIN = new ResourceLocation(ModCyclic.MODID, "textures/gui/inventory_plain.png");
public static final ResourceLocation INVENTORY_LARGE = new ResourceLocation(ModCyclic.MODID, "textures/gui/inventory_large.png");
public static final ResourceLocation INVENTORY_LARGE_PLAIN = new ResourceLocation(ModCyclic.MODID, "textures/gui/inventory_large_plain.png");
public static final ResourceLocation INVENTORY_MEDIUM = new ResourceLocation(ModCyclic.MODID, "textures/gui/inventory_medium.png"); // 176x214
public static final ResourceLocation INVENTORY_SOUND = new ResourceLocation(ModCyclic.MODID, "textures/gui/inventory_sound.png");
public static final ResourceLocation SLOT = new ResourceLocation(ModCyclic.MODID, "textures/gui/slot.png");
public static final ResourceLocation SLOT_CHARGE = new ResourceLocation(ModCyclic.MODID, "textures/gui/slot_charge.png");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion update.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@
,"1.5.22":"Fix #2351 advanced crafting stick not opening. "
,"1.5.23":"Growth enchantment now uses the same logic as Sprinkler & Terra Soil (only minecraft:crops or minecraft::saplings can grow, respect IGrowable::canUseBonemeal). New gloomIgnored config Gloom enchant (cyclic:curse) to ignore and not use these effects #2217 #2325. Fix Soundproofing block not muting Mekanism sounds #2389 (for example Precision Sawmill and others - you may need four or more soundproofing blocks for the desired effect). Patch an edge-case where User might drop items on the ground. New config [cyclic.blocks.soundproofing] radius = 6 to control the area. Fix item cable routing #2245 #2230. New config under [cyclic.blocks] wireless_transfer_dimensional = true allowing transfer nodes to connect across dimensions #1913. Balance recipe changes for #2372. Balance changes made for Excavate enchant it will no longer trigger if the tool is not 'mineable' effective for example axe on dirt. New feature for Excavate enchant #2116 it will not trigger on anything matching the block data-tag 'cyclic:ignored/excavate'. [Backported changes from mc1.20.1] #2182 candle model assets; Block Breaker no longer tries (and fails) to mine liquid source blocks; Block Randomizer use wireframe rendering only of non-air instead of solid shading; Glistering & Corrupted chorus only restores 1 food-unit down from 3; a few recipes tweaked/backported to match mc1.20.1+, ported crafttweaker zenscript support for generator_fluid and generator_item; backported item data tags for use in recipes for example forge:vines, forge:sandstone, forge:mushrooms "
,"1.5.24":"Fixed bug in the item cyclic:offset_scepter #2427. Tweaked block model visuals of the Transfer Nodes. Fix Mattock not saving contents of Shulker Boxes when mined #2411. "
,"1.6.0":"Add mouse-dragging capability to the slider controls in machines. Fluid Hoppers can now insert into cauldrons. Backport #2399 Dry Peat Bog can now hydrate from waterlogged blocks such as scaffolding. Fix spelling #2435. Added an optional item slot in the Block Breaker using the BlockState Data Card so players have the option to limit the block breaker to only the targets listed in the data card. Add new block data tags cyclic:ignored/breaker and cyclic:ignored/miner so that pack devs can customize these machines to not break certain blocks (regardless of hardness). Many blocks now allow minecraft:comparator to pull a redstone signal based on inventory contents (most machines and blocks that have inventory). Fluid collector will now place air and scoop up the fluid if the itemslot is empty. New feature: some machines can now be placed facing Up or Down vertically for convenience (harvester, forester, miner, item collector, fluid collector, dropper). Backported machine feature 'Preview Outline' mode on machines that already have the button. Backported cable (fluid & energy) buffer and flow speed configs from 1.20.1. Facades overhaul backported from 1.20.1: Renamed 'Concentrated Glowstone' to 'Glowstone Facade' and 'Concentrated Soundproofing' to 'Soundproofing Facade' . Backport cable facades from 1.20.1 (New feature with cables: hide them using solid blocks with a feature called 'facades', just sneak-left-click a block onto the cable; empty hand to remove it) "
,"1.6.0":"Add mouse-dragging capability to the slider controls in machines. Fluid Hoppers can now insert into cauldrons. Backport #2399 Dry Peat Bog can now hydrate from waterlogged blocks such as scaffolding. Fix spelling #2435. Clock gui-screen size reduced from large to normal. Added an optional item slot in the Block Breaker using the BlockState Data Card so players have the option to limit the block breaker to only the targets listed in the data card. Add new block data tags cyclic:ignored/breaker and cyclic:ignored/miner so that pack devs can customize these machines to not break certain blocks (regardless of hardness). Many blocks now allow minecraft:comparator to pull a redstone signal based on inventory contents (most machines and blocks that have inventory). Fluid collector will now place air and scoop up the fluid if the itemslot is empty. New feature: some machines can now be placed facing Up or Down vertically for convenience (harvester, forester, miner, item collector, fluid collector, dropper). Backported machine feature 'Preview Outline' mode on machines that already have the button. Backported cable (fluid & energy) buffer and flow speed configs from 1.20.1. Facades overhaul backported from 1.20.1: Renamed 'Concentrated Glowstone' to 'Glowstone Facade' and 'Concentrated Soundproofing' to 'Soundproofing Facade' . Backport cable facades from 1.20.1 (New feature with cables: hide them using solid blocks with a feature called 'facades', just sneak-left-click a block onto the cable; empty hand to remove it) "
}
}

0 comments on commit ec839a4

Please sign in to comment.