Skip to content

Commit

Permalink
fix: button position & icon for item filter mode (in filter covers) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerooni authored Dec 2, 2023
1 parent ef4384f commit 74f963b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ public boolean canAttach() {

@Override
public Widget createUIWidget() {
final var group = new WidgetGroup(0, 0, 176, 80);
group.addWidget(new LabelWidget(5, 3, attachItem.getDescriptionId()));
group.addWidget(new EnumSelectorWidget<>(10, 20, 110, 20,
ItemFilterMode.VALUES, ItemFilterMode.FILTER_INSERT,
this::setFilterMode));
group.addWidget(getItemFilter().openConfigurator((176 - 80) / 2, (60 - 55) / 2 + 15));
final var group = new WidgetGroup(0, 0, 176, 85);
group.addWidget(new LabelWidget(7, 5, attachItem.getDescriptionId()));
group.addWidget(new EnumSelectorWidget<>(7, 61, 18, 18,
ItemFilterMode.VALUES, ItemFilterMode.FILTER_INSERT, this::setFilterMode));
group.addWidget(getItemFilter().openConfigurator(30, 25));
return group;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.gregtechceu.gtceu.common.cover.data;

import com.gregtechceu.gtceu.api.gui.GuiTextures;
import com.gregtechceu.gtceu.api.gui.widget.EnumSelectorWidget;
import com.lowdragmc.lowdraglib.gui.texture.IGuiTexture;
import com.lowdragmc.lowdraglib.gui.texture.TextTexture;
import com.lowdragmc.lowdraglib.gui.texture.ResourceTexture;
import net.minecraft.MethodsReturnNonnullByDefault;

import javax.annotation.ParametersAreNonnullByDefault;

@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
public enum ItemFilterMode implements EnumSelectorWidget.SelectableEnum {

FILTER_INSERT("cover.filter.mode.filter_insert"),
FILTER_EXTRACT("cover.filter.mode.filter_extract"),
FILTER_BOTH("cover.filter.mode.filter_both");
FILTER_INSERT("filter_insert"),
FILTER_EXTRACT("filter_extract"),
FILTER_BOTH("filter_both");

public static final ItemFilterMode[] VALUES = values();
private static final float OFFSET = 1.0f / VALUES.length;

public final String localeName;

Expand All @@ -22,11 +25,11 @@ public enum ItemFilterMode implements EnumSelectorWidget.SelectableEnum {

@Override
public String getTooltip() {
return this.localeName;
return "cover.filter.mode." + this.localeName;
}

@Override
public IGuiTexture getIcon() {
return new TextTexture(this.localeName);
return new ResourceTexture("gtceu:textures/gui/icon/item_filter_mode/" + localeName + ".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.
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 74f963b

Please sign in to comment.