Skip to content

Commit

Permalink
🐛 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Dec 2, 2024
1 parent bf773b6 commit 0efe4af
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class GifSlider extends SettingSliderWidget {
// public GifSlider() {
// super(100, 100, 150, 20, CONFIG.gifSpeed, 1, 20);
// this.updateMessage();
// this.tip = Tooltip.of(createTranslatableText("gif.chatimage.tooltip"));
// this.tip = Tooltip.of(createTranslatableComponent("gif.chatimage.tooltip"));
// this.setTooltip(this.tip);
// }
// ELSE
Expand All @@ -26,7 +26,7 @@ public class GifSlider extends SettingSliderWidget {
// END IF
@Override
protected void updateMessage() {
this.setMessage(composeGenericOptionText(createTranslatableText("gif.chatimage.gui"), createLiteralText(String.valueOf(this.position))));
this.setMessage(composeGenericOptionText(createTranslatableComponent("gif.chatimage.gui"), createLiteralComponent(String.valueOf(this.position))));
ChatImageClient.CONFIG.gifSpeed = this.position;
ChatImageConfig.saveConfig(ChatImageClient.CONFIG);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public class LimitSlider extends SettingSliderWidget {
protected void updateMessage() {
switch (limitType) {
case WIDTH:
this.setMessage(composeGenericOptionText(title, CONFIG.limitWidth == 0 ? createTranslatableText("default.chatimage.gui") : createLiteralText(String.valueOf(this.position))));
this.setMessage(composeGenericOptionText(title, CONFIG.limitWidth == 0 ? createTranslatableComponent("default.chatimage.gui") : createLiteralComponent(String.valueOf(this.position))));
CONFIG.limitWidth = this.position;
break;
case HEIGHT:
this.setMessage(composeGenericOptionText(title, CONFIG.limitHeight == 0 ? createTranslatableText("default.chatimage.gui") : createLiteralText(String.valueOf(this.position))));
this.setMessage(composeGenericOptionText(title, CONFIG.limitHeight == 0 ? createTranslatableComponent("default.chatimage.gui") : createLiteralComponent(String.valueOf(this.position))));
CONFIG.limitHeight = this.position;
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static io.github.kituin.chatimage.client.ChatImageClient.CONFIG;
import static io.github.kituin.chatimage.tool.SimpleUtil.composeGenericOptionText;
import static io.github.kituin.chatimage.tool.SimpleUtil.createLiteralText;
import static io.github.kituin.chatimage.tool.SimpleUtil.createLiteralComponent;


public class PaddingSlider extends SettingSliderWidget {
Expand All @@ -36,7 +36,7 @@ public class PaddingSlider extends SettingSliderWidget {
// END IF
@Override
protected void updateMessage() {
this.setMessage(composeGenericOptionText(title, createLiteralText(String.valueOf(this.position))));
this.setMessage(composeGenericOptionText(title, createLiteralComponent(String.valueOf(this.position))));
switch (paddingType) {
case TOP:
CONFIG.paddingTop = this.position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// ELSE
//import net.minecraft.client.gui.tooltip.Tooltip;
// END IF
import static io.github.kituin.chatimage.tool.SimpleUtil.createLiteralText;
import static io.github.kituin.chatimage.tool.SimpleUtil.createLiteralComponent;


@Environment(EnvType.CLIENT)
Expand All @@ -28,7 +28,7 @@ public abstract class SettingSliderWidget extends SliderWidget {
// protected final TooltipSupplier tooltipSupplier;
// protected boolean isClick = false;
// public SettingSliderWidget(int x, int y, int width, int height, int value, float min, float max, TooltipSupplier tooltipSupplier) {
// super(x, y, width, height, createLiteralText(""), 0.0);
// super(x, y, width, height, createLiteralComponent(""), 0.0);
// this.min = min;
// this.max = max;
// this.value = ((MathHelper.clamp((float) value, min, max) - min) / (max - min));
Expand All @@ -45,7 +45,7 @@ public abstract class SettingSliderWidget extends SliderWidget {
// ELSE
// protected Tooltip tip;
// public SettingSliderWidget(int x, int y, int width, int height, int value, float min, float max) {
// super(x, y, width, height, createLiteralText(""), 0.0);
// super(x, y, width, height, createLiteralComponent(""), 0.0);
// this.min = min;
// this.max = max;
// this.value = ((MathHelper.clamp((float) value, min, max) - min) / (max - min));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public class TimeOutSlider extends SettingSliderWidget {
//public TimeOutSlider() {
// super(100, 100, 150, 20, CONFIG.timeout, 3, 60);
// this.updateMessage();
// this.tip = Tooltip.of(createTranslatableText("timeout.chatimage.tooltip"));
// this.tip = Tooltip.of(createTranslatableComponent("timeout.chatimage.tooltip"));
// this.setTooltip(this.tip);
//}
// END IF
@Override
protected void updateMessage() {
this.setMessage(composeGenericOptionText(
createTranslatableText("timeout.chatimage.gui"),
createLiteralText(String.valueOf(this.position)))
createTranslatableComponent("timeout.chatimage.gui"),
createLiteralComponent(String.valueOf(this.position)))
.append(" ")
.append(createTranslatableText("seconds.chatimage.gui")));
.append(createTranslatableComponent("seconds.chatimage.gui")));
CONFIG.timeout = this.position;
ChatImageConfig.saveConfig(CONFIG);
}
Expand Down

0 comments on commit 0efe4af

Please sign in to comment.