mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-15 10:45:35 +01:00
Rework jigsaw screen settings
This commit is contained in:
parent
8e639e1ebe
commit
559cabae1c
@ -60,8 +60,11 @@ public abstract class MixinJigsawBlockScreen extends Screen {
|
||||
|
||||
@Inject(method = "init", at = @At("RETURN"))
|
||||
private void disableWidgets(CallbackInfo ci) {
|
||||
if (VisualSettings.global().removeNewerFeaturesFromJigsawScreen.isEnabled()) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
|
||||
if (!VisualSettings.global().hidePrioritySelectionsInJigsawScreen.isEnabled()) {
|
||||
selectionPriorityField.active = false;
|
||||
placementPriorityField.active = false;
|
||||
}
|
||||
if (VisualSettings.global().hideModernJigsawScreenFeatures.isEnabled()) {
|
||||
nameField.active = false;
|
||||
jointRotationButton.active = false;
|
||||
int index = children().indexOf(jointRotationButton);
|
||||
@ -69,15 +72,11 @@ public abstract class MixinJigsawBlockScreen extends Screen {
|
||||
((ClickableWidget) children().get(index + 2)).active = false; // keep jigsaws toggle
|
||||
((ClickableWidget) children().get(index + 3)).active = false; // generate button
|
||||
}
|
||||
|
||||
selectionPriorityField.active = false;
|
||||
placementPriorityField.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
private void copyText(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (VisualSettings.global().removeNewerFeaturesFromJigsawScreen.isEnabled() && ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
|
||||
if (VisualSettings.global().hideModernJigsawScreenFeatures.isEnabled()) {
|
||||
nameField.setText(targetField.getText());
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public abstract class MixinScreen {
|
||||
}
|
||||
|
||||
@Inject(method = "addDrawableChild", at = @At("HEAD"), cancellable = true)
|
||||
public <T extends Element & Drawable & Selectable> void removeRecipeBook(T drawableElement, CallbackInfoReturnable<T> cir) {
|
||||
private <T extends Element & Drawable & Selectable> void removeRecipeBook(T drawableElement, CallbackInfoReturnable<T> cir) {
|
||||
if (drawableElement instanceof TexturedButtonWidget button && button.textures == RecipeBookWidget.BUTTON_TEXTURES) {
|
||||
final boolean furnace = ((Screen) (Object) this) instanceof FurnaceScreen;
|
||||
|
||||
|
@ -30,8 +30,8 @@ public class VisualSettings extends SettingGroup {
|
||||
|
||||
private static final VisualSettings INSTANCE = new VisualSettings();
|
||||
|
||||
// 1.20.3 -> 1.20.2 and 1.16 -> 1.15.2
|
||||
public final VersionedBooleanSetting removeNewerFeaturesFromJigsawScreen = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.remove_newer_features_from_jigsaw_screen"), VersionRange.andOlder(ProtocolVersion.v1_20_2));
|
||||
// 1.20.3 -> 1.20.2
|
||||
public final VersionedBooleanSetting hidePrioritySelectionsInJigsawScreen = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_priority_selections_in_jigsaw_screen"), VersionRange.andOlder(ProtocolVersion.v1_20_2));
|
||||
|
||||
// 1.19.2 -> 1.19
|
||||
public final VersionedBooleanSetting disableSecureChatWarning = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.disable_secure_chat_warning"), VersionRange.andOlder(ProtocolVersion.v1_19));
|
||||
@ -39,6 +39,9 @@ public class VisualSettings extends SettingGroup {
|
||||
// 1.19 -> 1.18.2
|
||||
public final VersionedBooleanSetting hideSignatureIndicator = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_signature_indicator"), VersionRange.andOlder(ProtocolVersion.v1_18_2));
|
||||
|
||||
// 1.16 -> 1.15.2
|
||||
public final VersionedBooleanSetting hideModernJigsawScreenFeatures = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_modern_jigsaw_screen_features"), VersionRange.andOlder(ProtocolVersion.v1_15_2));
|
||||
|
||||
// 1.13 -> 1.12.2
|
||||
public final VersionedBooleanSetting replacePetrifiedOakSlab = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.replace_petrified_oak_slab"), VersionRange.of(LegacyProtocolVersion.r1_3_1tor1_3_2, ProtocolVersion.v1_12_2));
|
||||
public final VersionedBooleanSetting changeFontRendererBehaviour = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.change_font_renderer_behaviour"), VersionRange.andOlder(ProtocolVersion.v1_12_2));
|
||||
|
@ -73,7 +73,7 @@
|
||||
|
||||
"visual_settings.viafabricplus.disable_secure_chat_warning": "Disable Secure Chat warning",
|
||||
"visual_settings.viafabricplus.hide_signature_indicator": "Hide signature indicator",
|
||||
"visual_settings.viafabricplus.remove_newer_features_from_jigsaw_screen": "Remove newer features from the Jigsaw screen",
|
||||
"visual_settings.viafabricplus.hide_priority_selections_in_jigsaw_screen": "Hide priority selections in Jigsaw screen",
|
||||
"visual_settings.viafabricplus.replace_petrified_oak_slab": "Replace petrified oak slab texture with the 'unknown' texture",
|
||||
"visual_settings.viafabricplus.emulate_armor_hud": "Emulate Armor HUD",
|
||||
"visual_settings.viafabricplus.remove_newer_features_from_command_block_screen": "Remove newer features from the Command Block screen",
|
||||
@ -89,6 +89,7 @@
|
||||
"visual_settings.viafabricplus.enable_legacy_tablist": "Enable legacy tablist",
|
||||
"visual_settings.viafabricplus.hide_furnace_recipe_book": "Hide furnace recipe book",
|
||||
"visual_settings.viafabricplus.hide_crafting_recipe_book": "Hide crafting recipe book",
|
||||
"visual_settings.viafabricplus.hide_modern_jigsaw_screen_features": "Hide modern Jigsaw screen features",
|
||||
|
||||
"bedrock.viafabricplus.login": "Your browser should have opened.\nClosing this screen will cancel the process!",
|
||||
"authentication.viafabricplus.failed_to_verify_session": "ViaFabricPlus couldn't verify your session! Please log in to an account or disable the BetaCraft authentication in the ViaFabricPlus Settings",
|
||||
|
Loading…
Reference in New Issue
Block a user