Skip to content

Commit

Permalink
Merge pull request #33 from UselessBullets/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
UselessBullets authored Nov 15, 2023
2 parents 0be2ac6 + 1e8680b commit 0eae223
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ dyes_version=0.1.7
potato_logistics_version=0.1.4

# Mod
mod_version=1.1.0
mod_version=1.1.1
mod_group=useless
mod_name=legacyui
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ protected void drawGuiContainerBackgroundLayer(float partialTick) {
UtilGui.drawTexturedModalRect(this, GUIx, GUIy, 0,0, this.xSize, this.ySize, 1f/guiTextureWidth); // Render Background


UtilGui.drawTexturedModalRect(this, GUIx + (tabWidth - 1) * (currentTab % 8), GUIy - 2, (tabWidth-1) * (currentTab % 8),229, tabWidth, 30, 1f/guiTextureWidth); // Render Selected Tab
UtilGui.drawTexturedModalRect(this, GUIx + (tabWidth-1) * (currentTab % 8), GUIy - 2, (tabWidth) * (currentTab % 8),229, tabWidth, 30, 1f/guiTextureWidth); // Render Selected Tab

IRecipe currentRecipe = (IRecipe) currentCategory().getRecipeGroups(isSmall())[currentSlot].getRecipes(isSmall())[currentScroll];
if ((currentCategory().getRecipeGroups(isSmall())[currentSlot].getContainer(currentScroll, isSmall()).inventorySlots.size() <= 5 && showCraftDisplay) || isSmall()){ // 2x2 Crafting overlay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ protected void drawGuiContainerForegroundLayer(){
protected void drawGuiContainerBackgroundLayer(float renderPartialTick) {
UtilGui.bindTexture("/assets/legacyui/gui/legacycreative.png");
UtilGui.drawTexturedModalRect(this, GUIx,GUIy, 0, 0, xSize, ySize,1f/guiTextureWidth); // GUI Background
UtilGui.drawTexturedModalRect(this, GUIx + (tabWidth - 1) * (currentTab % 8), GUIy - 2, (tabWidth-1) * (currentTab % 8),215, tabWidth, 30, 1f/guiTextureWidth); // Render Selected Tab
UtilGui.drawTexturedModalRect(this, GUIx + (tabWidth - 1) * (currentTab % 8), GUIy - 2, (tabWidth) * (currentTab % 8),215, tabWidth, 30, 1f/guiTextureWidth); // Render Selected Tab

float scrollProgressLimited = ((float) currentRow) /(LegacyContainerPlayerCreative.getTotalRows()-LegacyContainerPlayerCreative.slotsTall);
UtilGui.drawTexturedModalRect(this,scrollBar.xPosition, (scrollBar.yPosition + (int) ((scrollBar.height-15)*scrollProgressLimited)),131,184,15,15,1f/guiTextureWidth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,25 @@
public class GuiLegacyInventory extends GuiInventory implements IGuiController {
private static int GUIx;
private static int GUIy;

protected GuiAuditoryButton craftButton;
protected EntityPlayer player;
public List<GuiButtonPrompt> prompts = new ArrayList<>();
public GuiLegacyInventory(EntityPlayer player) {
super(player);
this.xSize = 176;
this.ySize = 176;
this.overlayButtonsLayout = new ListLayout(this).setAlign(0.5, 0.5).setVertical(false).setElementSize(11, 11).setOffset(-(this.xSize / 2), -(this.ySize / 2) - 10).setMargin(1);
this.player = player;
inventorySlots = Gamemode.survival.getContainer(player.inventory, !player.world.isClientSide);
}
public void initGui() {
super.initGui();

// Setup size variables
xSize = 176;
ySize = 176;
GUIx = (this.width - this.xSize) / 2;
GUIy = (this.height - this.ySize) / 2;

overlayButtonsLayout = new ListLayout(this).setAlign(0.5, 0.5).setVertical(false).setElementSize(11, 11).setOffset(-(this.xSize / 2), -(this.ySize / 2) - 10).setMargin(1);
updateOverlayButtons();

// Offset Armor Button
GuiButton armorButton = ((GuiInventoryAccessor)this).getArmorButton();
if (armorButton != null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ public GuiOptionsPageLegacy(GuiScreen parent, GameSettings settings) {
super(parent, settings);
ILegacyOptions legacyOptions = (ILegacyOptions)settings;
this.addOptionsCategory("legacyui.options.gameplay",
legacyOptions.getCoordsOnMaps(),
legacyOptions.getEnableAutoBridge());
this.addOptionsCategory("legacyui.options.hud",
legacyOptions.getHideHotbarInGUIs(),
legacyOptions.getEnablePaperDoll(),
legacyOptions.getEnableHUDFadeout(),
legacyOptions.getHUDFadeoutDelay(),
legacyOptions.getHUDFadeoutAlpha());
this.addOptionsCategory("legacyui.options.gui",
legacyOptions.getEnableLegacyInventorySurvival(),
legacyOptions.getEnableLegacyCrafting(),
legacyOptions.getEnableLegacyInventoryCreative(),
legacyOptions.getEnableLegacyFlag(),
legacyOptions.getHideHotbarInGUIs(),
legacyOptions.getGuiControllerType(),
legacyOptions.getShowCraftingItemNamePreview(),
legacyOptions.getCraftingHideUndiscoveredItems(),
legacyOptions.getCoordsOnMaps(),
legacyOptions.getForceButtonPrompts(),
legacyOptions.getForceLegacyTooltip(),
legacyOptions.getEnablePaperDoll(),
legacyOptions.getEnableHUDFadeout(),
legacyOptions.getHUDFadeoutDelay());
legacyOptions.getForceLegacyTooltip());
this.addOptionsCategory("legacyui.options.panorama",
legacyOptions.getEnablePanorama(),
legacyOptions.getPanoramaScrollLength(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/useless/legacyui/Gui/GuiScreens/UtilGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@ public static float getHotbarAlpha(){
if (currentTime - timeHotbarLastActive <= (LegacyUI.modSettings.getHUDFadeoutDelay().value * 10000)){
return 1f;
}
return (float) Math.max(1f - ((currentTime - timeHotbarLastActive) - (LegacyUI.modSettings.getHUDFadeoutDelay().value * 10000))/1000f, 0.2);
return (float) Math.max(1f - ((currentTime - timeHotbarLastActive) - (LegacyUI.modSettings.getHUDFadeoutDelay().value * 10000))/1000f, LegacyUI.modSettings.getHUDFadeoutAlpha().value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private boolean dontRenderInGuiArmor(Boolean instance){
}
return instance;
}
@Redirect(method = "renderGameOverlay(FZII)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/ItemEntityRenderer;renderItemIntoGUI(Lnet/minecraft/client/render/FontRenderer;Lnet/minecraft/client/render/RenderEngine;Lnet/minecraft/core/item/ItemStack;IIF)V", ordinal = 1))
@Redirect(method = "renderGameOverlay(FZII)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/ItemEntityRenderer;renderItemIntoGUI(Lnet/minecraft/client/render/FontRenderer;Lnet/minecraft/client/render/RenderEngine;Lnet/minecraft/core/item/ItemStack;IIF)V"))
private void alphaHeldItem(ItemEntityRenderer instance, FontRenderer fontrenderer, RenderEngine renderengine, ItemStack itemstack, int i, int j, float alpha){
UtilGui.blockAlpha = UtilGui.getHotbarAlpha();
instance.renderItemIntoGUI(fontrenderer, renderengine, itemstack, i, j, UtilGui.getHotbarAlpha());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ private void displayString(Option<?> option, CallbackInfoReturnable<String> cir)
public BooleanOption enableHUDFadeout = new BooleanOption(thisAs, "legacyui.enableHUDFadeout", true);
@Unique
public FloatOption HUDFadeoutDelay = new FloatOption(thisAs, "legacyui.hudFadeoutDelay", 0.5f);
@Unique
public FloatOption HUDFadeoutAlpha = new FloatOption(thisAs, "legacyui.hudFadeoutAlpha", 0.20f);
public BooleanOption getCraftingHideUndiscoveredItems() {
return craftingHideUndiscoveredItems;
}
Expand Down Expand Up @@ -173,4 +175,7 @@ public BooleanOption getEnableHUDFadeout() {
public FloatOption getHUDFadeoutDelay() {
return HUDFadeoutDelay;
}
public FloatOption getHUDFadeoutAlpha() {
return HUDFadeoutAlpha;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ public interface ILegacyOptions {
BooleanOption getEnablePaperDoll();
BooleanOption getEnableHUDFadeout();
FloatOption getHUDFadeoutDelay();
FloatOption getHUDFadeoutAlpha();
}
Binary file modified src/main/resources/assets/legacyui/gui/legacycrafting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/legacyui/gui/legacycreative.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/main/resources/lang/legacyui/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ legacyui.prompt.opencrafting=Open Crafting

legacyui.options.title=Better Than Legacy Settings
legacyui.options.gameplay=Legacy Gameplay Settings
legacyui.options.hud=Legacy HUD Settings
legacyui.options.gui=Legacy GUI Settings
legacyui.options.sound=Legacy Sound Settings
legacyui.options.panorama=Legacy Panorama Settings
Expand Down Expand Up @@ -67,6 +68,7 @@ options.legacyui.enablePaperDoll=Enable Paper Doll
options.legacyui.enableHUDFadeout=Enable HUD Fadeout
options.legacyui.hudFadeoutDelay=HUD Fadeout Delay
options.legacyui.hudFadeout.unit=Seconds
options.legacyui.hudFadeoutAlpha=Fadeout Opacity

options.tooltipStyle.legacy=Legacy
options.legacyui.tooltipStyle.legacy=Legacy
Expand Down

0 comments on commit 0eae223

Please # to comment.