Skip to content

Commit

Permalink
Textures Update
Browse files Browse the repository at this point in the history
- Added Hover/Focus split on Buttons
- Updated 2 Tab Buttons to show the BACK Icon
- Updated the Creative colour palette for the Energy Cell and Cell Housing
  • Loading branch information
Ridanisaurus committed Jun 24, 2024
1 parent 40583e4 commit fb765b3
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/appeng/client/gui/Icon.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public enum Icon {
HORIZONTAL_TAB_FOCUS(150, 128, 22, 22),
BACKGROUND_BLANK_PATTERN(240, 128),
TOOLBAR_BUTTON_BACKGROUND(176, 128, 18, 20),
TOOLBAR_BUTTON_BACKGROUND_HOVER(208, 128, 18, 20),
TOOLBAR_BUTTON_BACKGROUND_FOCUS(194, 128, 18, 20),
TOOLBAR_BUTTON_BACKGROUND_HOVER(212, 128, 18, 20),

// ROW 9
ACCESS_WRITE(0, 144),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Map;
import java.util.function.Consumer;

import appeng.client.gui.Icon;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.renderer.Rect2i;
Expand Down Expand Up @@ -38,7 +39,7 @@ public KeyTypeSelectionScreen(P parent, ISubMenuHost subMenuHost, Component dial
private void addBackButton(ISubMenuHost subMenuHost) {
var icon = subMenuHost.getMainMenuIcon();
var label = icon.getHoverName();
TabButton button = new TabButton(icon, label, btn -> returnToParent());
TabButton button = new TabButton(Icon.BACK, label, btn -> returnToParent());
widgets.add("back", button);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.function.Consumer;

import appeng.client.gui.Icon;
import com.google.common.primitives.Longs;

import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -61,7 +62,7 @@ public SetProcessingPatternAmountScreen(PatternEncodingTermScreen<C> parentScree

var icon = getMenu().getHost().getMainMenuIcon();
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
var button = new TabButton(icon, icon.getHoverName(), btn -> {
var button = new TabButton(Icon.BACK, icon.getHoverName(), btn -> {
returnToParent();
});
widgets.add("back", button);
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/appeng/client/gui/widgets/IconButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float
this.height = 8;
}

var yOffset = isHoveredOrFocused() ? 1 : 0;
var yOffset = isHovered() ? 1 : 0;

if (this.halfSize) {
if (!disableBackground) {
Expand All @@ -87,8 +87,11 @@ public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float
}
} else {
if (!disableBackground) {
Icon bgIcon = isHoveredOrFocused() ? Icon.TOOLBAR_BUTTON_BACKGROUND_HOVER
: Icon.TOOLBAR_BUTTON_BACKGROUND;
Icon bgIcon =
isHovered() ? Icon.TOOLBAR_BUTTON_BACKGROUND_HOVER :
isFocused() ? Icon.TOOLBAR_BUTTON_BACKGROUND_FOCUS :
Icon.TOOLBAR_BUTTON_BACKGROUND;

bgIcon.getBlitter()
.dest(getX() - 1, getY() + yOffset, 18, 20)
.zOffset(2)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/ae2/textures/guis/extra_panels.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/ae2/textures/guis/states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fb765b3

Please sign in to comment.