|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
package me.shedaniel.rei.utils;
|
|
|
|
|
|
+import me.shedaniel.cloth.hooks.ScreenHooks;
|
|
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
|
|
import me.shedaniel.fiber2cloth.api.Fiber2Cloth;
|
|
|
import me.shedaniel.rei.RoughlyEnoughItemsCore;
|
|
@@ -13,9 +14,13 @@ import me.shedaniel.rei.gui.config.ItemCheatingMode;
|
|
|
import me.shedaniel.rei.gui.config.ItemListOrderingConfig;
|
|
|
import me.shedaniel.rei.gui.config.RecipeScreenType;
|
|
|
import me.shedaniel.rei.gui.config.SearchFieldLocation;
|
|
|
+import me.shedaniel.rei.gui.credits.CreditsScreen;
|
|
|
import me.zeroeightsix.fiber.exception.FiberException;
|
|
|
import me.zeroeightsix.fiber.tree.ConfigValue;
|
|
|
+import net.minecraft.client.MinecraftClient;
|
|
|
import net.minecraft.client.gui.screen.Screen;
|
|
|
+import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
|
|
|
+import net.minecraft.client.resource.language.I18n;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
@@ -66,8 +71,14 @@ public class ClothScreenRegistry {
|
|
|
.setSaveConsumer(var -> configValue.setValue((SearchFieldLocation) var))
|
|
|
.setErrorSupplier(var -> error((List) configValue.getConstraints(), var, SearchFieldLocation.class))
|
|
|
.build();
|
|
|
- })
|
|
|
- .build().getScreen();
|
|
|
+ }).setAfterInitConsumer(screen -> {
|
|
|
+ ((ScreenHooks) screen).cloth_addButton(new AbstractPressableButtonWidget(screen.width - 104, 4, 100, 20, I18n.translate("text.rei.credits")) {
|
|
|
+ @Override
|
|
|
+ public void onPress() {
|
|
|
+ MinecraftClient.getInstance().openScreen(new CreditsScreen(screen));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).build().getScreen();
|
|
|
}
|
|
|
|
|
|
}
|