From 46cbb107df845cd3e46d50887ea8ba46b7ca2a7b Mon Sep 17 00:00:00 2001 From: C-H716 <1536152356@qq.com> Date: Thu, 4 Sep 2025 03:10:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=80=8D=E5=A2=9E=E6=9C=80=E5=B0=8F=E6=94=B6=E7=9B=8A=E5=9B=A0?= =?UTF-8?q?=E5=AD=90=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extendedae_plus/client/ModConfigScreen.java | 15 +++++++++++++-- .../assets/extendedae_plus/lang/en_us.json | 1 + .../assets/extendedae_plus/lang/zh_cn.json | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/extendedae_plus/client/ModConfigScreen.java b/src/main/java/com/extendedae_plus/client/ModConfigScreen.java index b750c95..5a65d8d 100644 --- a/src/main/java/com/extendedae_plus/client/ModConfigScreen.java +++ b/src/main/java/com/extendedae_plus/client/ModConfigScreen.java @@ -18,6 +18,7 @@ public class ModConfigScreen extends Screen { private CycleButton crossDimToggle; private CycleButton providerRoundRobinToggle; private EditBox smartScalingMaxMulBox; + private EditBox smartScalingMinBenefitBox; private CycleButton showEncoderToggle; private CycleButton patternTerminalShowSlotsToggle; @@ -66,6 +67,13 @@ public class ModConfigScreen extends Screen { this.addRenderableWidget(smartScalingMaxMulBox); row++; + // smartScalingMinBenefitFactor: Int 1-1024 + smartScalingMinBenefitBox = new EditBox(this.font, rightX, y + row * rowHeight, boxWidth, 20, Component.translatable("config.extendedae_plus.smartScalingMinBenefitFactor")); + smartScalingMinBenefitBox.setValue(String.valueOf(ModConfigs.SMART_SCALING_MIN_BENEFIT_FACTOR.get())); + smartScalingMinBenefitBox.setFilter(s -> s.matches("\\d*") && parseIntOrDefault(s, 1) >= 1 && parseIntOrDefault(s, 1024) <= 1024); + this.addRenderableWidget(smartScalingMinBenefitBox); + row++; + // show encoder pattern player toggle showEncoderToggle = this.addRenderableWidget(createToggle(rightX, y + row * rowHeight, boxWidth, 20, ModConfigs.SHOW_ENCOD_PATTERN_PLAYER.get())); row++; @@ -95,6 +103,7 @@ public class ModConfigScreen extends Screen { boolean crossDim = crossDimToggle.getValue(); boolean providerRoundRobin = providerRoundRobinToggle.getValue(); int smartMaxMul = clamp(parseIntOrDefault(smartScalingMaxMulBox.getValue(), ModConfigs.SMART_SCALING_MAX_MULTIPLIER.get()), 0, 1048576); + int smartMinBenefit = clamp(parseIntOrDefault(smartScalingMinBenefitBox.getValue(), ModConfigs.SMART_SCALING_MIN_BENEFIT_FACTOR.get()), 1, 1024); boolean showEncoder = showEncoderToggle.getValue(); boolean patternShowSlots = patternTerminalShowSlotsToggle.getValue(); @@ -104,6 +113,7 @@ public class ModConfigScreen extends Screen { ModConfigs.WIRELESS_CROSS_DIM_ENABLE.set(crossDim); ModConfigs.PROVIDER_ROUND_ROBIN_ENABLE.set(providerRoundRobin); ModConfigs.SMART_SCALING_MAX_MULTIPLIER.set(smartMaxMul); + ModConfigs.SMART_SCALING_MIN_BENEFIT_FACTOR.set(smartMinBenefit); ModConfigs.SHOW_ENCOD_PATTERN_PLAYER.set(showEncoder); ModConfigs.PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT.set(patternShowSlots); @@ -144,8 +154,9 @@ public class ModConfigScreen extends Screen { g.drawString(this.font, Component.translatable("config.extendedae_plus.wirelessCrossDimEnable"), leftX, y + 2 * rowHeight + 6, labelColor, false); g.drawString(this.font, Component.translatable("config.extendedae_plus.providerRoundRobinEnable"), leftX, y + 3 * rowHeight + 6, labelColor, false); g.drawString(this.font, Component.translatable("config.extendedae_plus.smartScalingMaxMultiplier_with_range"), leftX, y + 4 * rowHeight + 6, labelColor, false); - g.drawString(this.font, Component.translatable("config.extendedae_plus.showEncoderPatternPlayer"), leftX, y + 5 * rowHeight + 6, labelColor, false); - g.drawString(this.font, Component.translatable("config.extendedae_plus.patternTerminalShowSlotsDefault"), leftX, y + 6 * rowHeight + 6, labelColor, false); + g.drawString(this.font, Component.translatable("config.extendedae_plus.smartScalingMinBenefitFactor"), leftX, y + 5 * rowHeight + 6, labelColor, false); + g.drawString(this.font, Component.translatable("config.extendedae_plus.showEncoderPatternPlayer"), leftX, y + 6 * rowHeight + 6, labelColor, false); + g.drawString(this.font, Component.translatable("config.extendedae_plus.patternTerminalShowSlotsDefault"), leftX, y + 7 * rowHeight + 6, labelColor, false); } private static int parseIntOrDefault(String s, int def) { diff --git a/src/main/resources/assets/extendedae_plus/lang/en_us.json b/src/main/resources/assets/extendedae_plus/lang/en_us.json index 6aac70c..3de5a8c 100644 --- a/src/main/resources/assets/extendedae_plus/lang/en_us.json +++ b/src/main/resources/assets/extendedae_plus/lang/en_us.json @@ -37,4 +37,5 @@ "config.extendedae_plus.state_off": "Off", "config.extendedae_plus.smartScalingMaxMultiplier": "Smart Scaling Max Multiplier", "config.extendedae_plus.smartScalingMaxMultiplier_with_range": "Smart Scaling Max Multiplier (0 = Unlimited)" + ,"config.extendedae_plus.smartScalingMinBenefitFactor": "Smart Scaling Min Benefit Factor (default 4)" } \ No newline at end of file diff --git a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json index 83dcbbb..4e6ad18 100644 --- a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json +++ b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json @@ -58,5 +58,6 @@ "gui.extendedae_plus.global.all_on": "全部开启", "gui.extendedae_plus.global.all_off": "全部关闭", "config.extendedae_plus.smartScalingMaxMultiplier": "智能倍增最大倍数", - "config.extendedae_plus.smartScalingMaxMultiplier_with_range": "智能倍增最大倍数 (0为不限制)" + "config.extendedae_plus.smartScalingMaxMultiplier_with_range": "智能倍增最大倍数 (0为不限制)", + "config.extendedae_plus.smartScalingMinBenefitFactor": "智能倍增最小收益因子 (默认 4)" } \ No newline at end of file