Skip to content

Commit

Permalink
coloured yes/no text
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed May 24, 2024
1 parent 89c43b8 commit 8cfdae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.ix0rai.rainglow.Rainglow;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.Option;
import net.minecraft.text.CommonTexts;

import java.util.function.Consumer;

Expand Down Expand Up @@ -44,7 +43,7 @@ public static DeferredSaveOption<Boolean> createDeferredBoolean(String key, Stri
return new DeferredSaveOption<>(
Rainglow.translatableTextKey(key),
tooltip != null ? Option.constantTooltip(Rainglow.translatableText(tooltip)) : Option.emptyTooltip(),
(text, value) -> value ? CommonTexts.YES : CommonTexts.NO,
(text, value) -> value ? RainglowConfigScreen.YES : RainglowConfigScreen.NO,
BOOLEAN_VALUES,
defaultValue,
updateCallback,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

public class RainglowConfigScreen extends Screen {
private static final Text TITLE = Rainglow.translatableText("config.title");
public static final Text YES = Text.translatable("gui.yes").styled(style -> style.withColor(0x00FF00));
public static final Text NO = Text.translatable("gui.no").styled(style -> style.withColor(0xFF0000));

private final Screen parent;
private final Map<RainglowEntity, DeferredSaveOption<Boolean>> toggles = new HashMap<>();
Expand Down

0 comments on commit 8cfdae5

Please sign in to comment.