From 69d22a9dc8eb30031bb4889e2845b7c6a1253d12 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 20 Jul 2023 20:56:14 +0100 Subject: [PATCH] Added IStyled.styled(...) helper method --- .../com/minelittlepony/common/client/gui/style/IStyled.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/minelittlepony/common/client/gui/style/IStyled.java b/src/main/java/com/minelittlepony/common/client/gui/style/IStyled.java index af450778..6256ea0f 100644 --- a/src/main/java/com/minelittlepony/common/client/gui/style/IStyled.java +++ b/src/main/java/com/minelittlepony/common/client/gui/style/IStyled.java @@ -1,7 +1,13 @@ package com.minelittlepony.common.client.gui.style; +import java.util.function.Function; + public interface IStyled> extends IStyleFactory { + default T styled(Function styleChange) { + return setStyle(styleChange.apply(getStyle())); + } + default T setStyle(IStyleFactory factory) { return setStyle(factory.getStyle()); }