Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ protected IWidget createIoRow() {
.coverChildrenHeight()
.child(new ToggleButton()
.value(new BooleanSyncValue(this::isIoEnabled, this::setIoEnabled))
.overlay(IKey.dynamic(() -> IKey.lang(this.ioEnabled ?
.overlay(IKey.lang(() -> this.ioEnabled ?
"behaviour.soft_hammer.enabled" :
"behaviour.soft_hammer.disabled").get())
"behaviour.soft_hammer.disabled")
.color(Color.WHITE.darker(1)))
.widthRel(0.6f)
.left(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) {

protected abstract boolean isItemValid(ItemStack stack);

protected abstract String getFilterName();
protected abstract @NotNull IKey getFilterKey();

@Override
public @NotNull ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) {
Expand Down Expand Up @@ -244,7 +244,7 @@ public IWidget initUI(GuiData data, PanelSyncManager manager) {
}
return true;
}))
.child(IKey.dynamic(this::getFilterName)
.child(getFilterKey()
.color(CoverWithUI.UI_TEXT_COLOR)
.shadow(false)
.alignment(Alignment.CenterRight).asWidget()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.cleanroommc.modularui.api.drawable.IKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
Expand Down Expand Up @@ -56,9 +57,9 @@ protected boolean isItemValid(ItemStack stack) {
}

@Override
protected String getFilterName() {
return hasFilter() ?
getFilterStack().getDisplayName() :
IKey.lang("metaitem.fluid_filter.name").get();
protected @NotNull IKey getFilterKey() {
return IKey.lang(() -> hasFilter() ?
getFilterStack().getTranslationKey() + ".name" :
"metaitem.fluid_filter.name");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.cleanroommc.modularui.api.drawable.IKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
Expand Down Expand Up @@ -57,9 +58,9 @@ protected boolean isItemValid(ItemStack stack) {
}

@Override
protected String getFilterName() {
return hasFilter() ?
getFilterStack().getDisplayName() :
IKey.lang("metaitem.item_filter.name").get();
protected @NotNull IKey getFilterKey() {
return IKey.lang(() -> hasFilter() ?
getFilterStack().getTranslationKey() + ".name" :
"metaitem.item_filter.name");
}
}
Loading