Theme No More

This commit is contained in:
zelophed 2024-10-25 13:14:53 +02:00
parent 9d13cd9853
commit 51e46b016e
9 changed files with 26 additions and 57 deletions

View file

@ -28,8 +28,8 @@ jei_minecraft_version = 1.20.1
jei_version = 15.10.0.39
curios_minecraft_version = 1.20.1
curios_version = 5.3.1
catnip_version = 0.8.15
ponder_version = 0.8.10
catnip_version = 0.8.16
ponder_version = 0.8.11
cc_tweaked_enable = true
cc_tweaked_minecraft_version = 1.20.1

View file

@ -29,7 +29,6 @@ import com.simibubi.create.foundation.advancement.AllAdvancements;
import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.block.CopperRegistries;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.gui.CreateTheme;
import com.simibubi.create.foundation.item.ItemDescription;
import com.simibubi.create.foundation.item.KineticStats;
import com.simibubi.create.foundation.item.TooltipModifier;
@ -41,6 +40,7 @@ import com.simibubi.create.infrastructure.data.CreateDatagen;
import com.simibubi.create.infrastructure.worldgen.AllFeatures;
import com.simibubi.create.infrastructure.worldgen.AllPlacementModifiers;
import net.createmod.catnip.utility.FontHelper;
import net.createmod.catnip.utility.lang.LangBuilder;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
@ -83,10 +83,10 @@ public class Create {
.defaultCreativeTab((ResourceKey<CreativeModeTab>) null);
static {
REGISTRATE.setTooltipModifierFactory(item -> {
return new ItemDescription.Modifier(item, CreateTheme.Key.STANDARD_TOOLTIP.palette())
.andThen(TooltipModifier.mapNull(KineticStats.create(item)));
});
REGISTRATE.setTooltipModifierFactory(item ->
new ItemDescription.Modifier(item, FontHelper.Palette.STANDARD_CREATE)
.andThen(TooltipModifier.mapNull(KineticStats.create(item)))
);
}
public static final ServerSchematicLoader SCHEMATIC_RECEIVER = new ServerSchematicLoader();

View file

@ -18,7 +18,6 @@ import com.simibubi.create.content.schematics.client.SchematicHandler;
import com.simibubi.create.content.trains.GlobalRailwayManager;
import com.simibubi.create.foundation.ClientResourceReloadListener;
import com.simibubi.create.foundation.blockEntity.behaviour.ValueSettingsClient;
import com.simibubi.create.foundation.gui.CreateTheme;
import com.simibubi.create.foundation.ponder.CreatePonderPlugin;
import com.simibubi.create.foundation.render.AllInstanceTypes;
import com.simibubi.create.foundation.utility.ModelSwapper;
@ -93,7 +92,6 @@ public class CreateClient {
//AllPonderTags.register();
//PonderIndex.register();
PonderIndex.addPlugin(new CreatePonderPlugin());
CreateTheme.loadClass();
setupConfigUIBackground();
}

View file

@ -29,7 +29,6 @@ import com.simibubi.create.content.kinetics.base.HorizontalKineticBlock;
import com.simibubi.create.content.kinetics.base.RotatedPillarKineticBlock;
import com.simibubi.create.content.kinetics.transmission.sequencer.SequencedGearshiftBlock;
import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.gui.CreateTheme;
import dev.engine_room.flywheel.lib.transform.TransformStack;
import net.createmod.catnip.gui.AbstractSimiScreen;
@ -40,7 +39,6 @@ import net.createmod.catnip.platform.CatnipServices;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.catnip.utility.theme.Theme;
import net.createmod.ponder.enums.PonderGuiTextures;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
@ -104,9 +102,9 @@ public class RadialWrenchMenu extends AbstractSimiScreen {
private int ticksOpen;
private int selectedStateIndex = 0;
private RenderElement iconScroll = RenderElement.of(PonderGuiTextures.ICON_SCROLL);
private RenderElement iconUp = RenderElement.of(AllIcons.I_PRIORITY_HIGH);
private RenderElement iconDown = RenderElement.of(AllIcons.I_PRIORITY_LOW);
private final RenderElement iconScroll = RenderElement.of(PonderGuiTextures.ICON_SCROLL);
private final RenderElement iconUp = RenderElement.of(AllIcons.I_PRIORITY_HIGH);
private final RenderElement iconDown = RenderElement.of(AllIcons.I_PRIORITY_LOW);
public static Optional<RadialWrenchMenu> tryCreateFor(BlockState state, BlockPos pos, @Nullable Level level) {
if (BLOCK_BLACKLIST.contains(CatnipServices.REGISTRIES.getKeyOrThrow(state.getBlock())))
@ -198,18 +196,18 @@ public class RadialWrenchMenu extends AbstractSimiScreen {
if (selectedPropertyIndex > 0) {
iconScroll.at(-14, -46).render(graphics);
iconUp.at(-1, -46).render(graphics);
graphics.drawCenteredString(font, propertiesForState.get(selectedPropertyIndex - 1).getValue(), 0, -30, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, propertiesForState.get(selectedPropertyIndex - 1).getValue(), 0, -30, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
}
if (selectedPropertyIndex < propertiesForState.size() - 1) {
iconScroll.at(-14, 30).render(graphics);
iconDown.at(-1, 30).render(graphics);
graphics.drawCenteredString(font, propertiesForState.get(selectedPropertyIndex + 1).getValue(), 0, 22, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, propertiesForState.get(selectedPropertyIndex + 1).getValue(), 0, 22, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
}
graphics.drawCenteredString(font, "Currently", 0, -13, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, "Changing:", 0, -3, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, propertyLabel, 0, 7, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, "Currently", 0, -13, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
graphics.drawCenteredString(font, "Changing:", 0, -3, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
graphics.drawCenteredString(font, propertyLabel, 0, 7, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
ms.popPose();
@ -269,7 +267,7 @@ public class RadialWrenchMenu extends AbstractSimiScreen {
poseStack.translate(0, 0, 50);
if (i == selectedStateIndex) {
graphics.drawCenteredString(font, blockState.getValue(property).toString(), 0, 15, Theme.Key.TEXT.i());
graphics.drawCenteredString(font, blockState.getValue(property).toString(), 0, 15, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
}
poseStack.popPose();
@ -338,7 +336,7 @@ public class RadialWrenchMenu extends AbstractSimiScreen {
@Override
public void renderBackground(GuiGraphics graphics) {
Color color = CreateTheme.Key.RADIAL_BACKGROUND.c()
Color color = BACKGROUND_COLOR
.scaleAlpha(Math.min(1, (ticksOpen + AnimationTickHolder.getPartialTicks()) / 20f));
graphics.fillGradient(0, 0, this.width, this.height, color.getRGB(), color.getRGB());

View file

@ -21,13 +21,13 @@ import com.simibubi.create.infrastructure.config.AllConfigs;
import com.simibubi.create.infrastructure.config.CClient;
import net.createmod.catnip.CatnipClient;
import net.createmod.catnip.gui.element.BoxElement;
import net.createmod.catnip.gui.element.GuiGameElement;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.lang.Components;
import net.createmod.catnip.utility.outliner.Outline;
import net.createmod.catnip.utility.outliner.Outliner.OutlineEntry;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.catnip.utility.theme.Theme;
import net.minecraft.client.Minecraft;
import net.minecraft.client.MouseHandler;
import net.minecraft.client.gui.GuiGraphics;
@ -195,11 +195,11 @@ public class GoggleOverlayRenderer {
float fade = Mth.clamp((hoverTicks + partialTicks) / 24f, 0, 1);
Boolean useCustom = cfg.overlayCustomColor.get();
Color colorBackground = useCustom ? new Color(cfg.overlayBackgroundColor.get())
: Theme.Key.VANILLA_TOOLTIP_BACKGROUND.c().scaleAlpha(.75f);
: BoxElement.COLOR_VANILLA_BACKGROUND.scaleAlpha(.75f);
Color colorBorderTop = useCustom ? new Color(cfg.overlayBorderColorTop.get())
: Theme.Key.VANILLA_TOOLTIP_BORDER.c(true).copy();
: BoxElement.COLOR_VANILLA_BORDER.getFirst().copy();
Color colorBorderBot = useCustom ? new Color(cfg.overlayBorderColorBot.get())
: Theme.Key.VANILLA_TOOLTIP_BORDER.c(false).copy();
: BoxElement.COLOR_VANILLA_BORDER.getSecond().copy();
if (fade < 1) {
poseStack.translate(Math.pow(1 - fade, 3) * Math.signum(cfg.overlayOffsetX.get() + .5f) * 8, 0, 0);

View file

@ -15,7 +15,6 @@ import com.simibubi.create.AllKeys;
import com.simibubi.create.AllPackets;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.gui.CreateTheme;
import com.simibubi.create.foundation.utility.CreateLang;
import dev.engine_room.flywheel.lib.transform.TransformStack;
@ -215,7 +214,7 @@ public class RadialToolboxMenu extends AbstractSimiScreen {
@Override
public void renderBackground(GuiGraphics graphics) {
Color color = CreateTheme.Key.RADIAL_BACKGROUND.c()
Color color = BACKGROUND_COLOR
.scaleAlpha(Math.min(1, (ticksOpen + AnimationTickHolder.getPartialTicks()) / 20f));
graphics.fillGradient(0, 0, this.width, this.height, color.getRGB(), color.getRGB());

View file

@ -1,26 +0,0 @@
package com.simibubi.create.foundation.gui;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.catnip.utility.theme.Theme;
public class CreateTheme extends Theme {
public static final CreateTheme CREATE_THEME = addTheme(new CreateTheme());
@Override
protected void init() {
put(Key.STANDARD_TOOLTIP, new Color(0xff_c9974c), new Color(0xff_f1dd79));
put(Key.RADIAL_BACKGROUND, new Color(0x50_101010, true));
}
public static void loadClass() {}
public static class Key {
public static final Theme.Key STANDARD_TOOLTIP = new Theme.Key();
public static final Theme.Key RADIAL_BACKGROUND = new Theme.Key();
}
}

View file

@ -180,10 +180,10 @@ public class ScrollInput extends AbstractSimiWidget {
if (title == null)
return;
toolTip.add(title.plainCopy()
.withStyle(s -> s.withColor(HEADER_RGB)));
.withStyle(s -> s.withColor(HEADER_RGB.getRGB())));
if (hint != null)
toolTip.add(hint.plainCopy()
.withStyle(s -> s.withColor(HINT_RGB)));
.withStyle(s -> s.withColor(HINT_RGB.getRGB())));
toolTip.add(scrollToModify.plainCopy()
.withStyle(ChatFormatting.ITALIC, ChatFormatting.DARK_GRAY));
toolTip.add(shiftScrollsFaster.plainCopy()

View file

@ -35,7 +35,7 @@ public class SelectionScrollInput extends ScrollInput {
if (title == null)
return;
toolTip.add(title.plainCopy()
.withStyle(s -> s.withColor(HEADER_RGB)));
.withStyle(s -> s.withColor(HEADER_RGB.getRGB())));
int min = Math.min(this.max - 16, state - 7);
int max = Math.max(this.min + 16, state + 8);
min = Math.max(min, this.min);
@ -65,7 +65,7 @@ public class SelectionScrollInput extends ScrollInput {
if (hint != null)
toolTip.add(hint.plainCopy()
.withStyle(s -> s.withColor(HINT_RGB)));
.withStyle(s -> s.withColor(HINT_RGB.getRGB())));
toolTip.add(scrollToSelect.plainCopy()
.withStyle(ChatFormatting.DARK_GRAY, ChatFormatting.ITALIC));
}