diff --git a/gradle.properties b/gradle.properties index c8177f2..3b6a9b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,10 +8,10 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.14.9 # Mod Properties - mod_version = 0.1.5 + mod_version = 0.1.6 maven_group = io.wispforest archives_base_name = gadget # Dependencies fabric_version=0.67.0+1.19.2 - owo_version=0.9.2+1.19 + owo_version=0.9.3+1.19 diff --git a/src/main/java/io/wispforest/gadget/client/gui/search/SearchGui.java b/src/main/java/io/wispforest/gadget/client/gui/search/SearchGui.java index 74a9ee8..13895de 100644 --- a/src/main/java/io/wispforest/gadget/client/gui/search/SearchGui.java +++ b/src/main/java/io/wispforest/gadget/client/gui/search/SearchGui.java @@ -12,6 +12,7 @@ import io.wispforest.owo.ui.container.HorizontalFlowLayout; import io.wispforest.owo.ui.container.ScrollContainer; import io.wispforest.owo.ui.core.*; +import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -60,10 +61,9 @@ public SearchGui(ScrollContainer scroll) { searchBox.setSuggestion(searchHint); searchBox.onChanged().subscribe(s -> { searchBox.setSuggestion(s.isEmpty() ? searchHint : ""); -// if (!s.equals(this.lastSearchFieldText)) { -// searchField.setEditableColor(TextFieldWidget.DEFAULT_EDITABLE_COLOR); -// matchIndicator.text(Text.empty()); -// } + + searchBox.setEditableColor(TextFieldWidget.DEFAULT_EDITABLE_COLOR); + matchIndicator.text(Text.empty()); }); searchBox.keyPress().subscribe((keyCode, scanCode, modifiers) -> { diff --git a/src/main/java/io/wispforest/gadget/mixin/client/TextFieldWidgetMixin.java b/src/main/java/io/wispforest/gadget/mixin/client/TextFieldWidgetMixin.java deleted file mode 100644 index 0e97838..0000000 --- a/src/main/java/io/wispforest/gadget/mixin/client/TextFieldWidgetMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.wispforest.gadget.mixin.client; - -import io.wispforest.gadget.mixin.owo.TextBoxComponentAccessor; -import io.wispforest.owo.ui.component.TextBoxComponent; -import net.minecraft.client.gui.widget.TextFieldWidget; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(TextFieldWidget.class) -public class TextFieldWidgetMixin { - @SuppressWarnings("ConstantConditions") - @Inject(method = "onChanged", at = @At("HEAD")) - private void mald(String newText, CallbackInfo ci) { - if ((Object) this instanceof TextBoxComponent textBox) { - ((TextBoxComponentAccessor) textBox).getTextValue().set(newText); - } - } -} diff --git a/src/main/java/io/wispforest/gadget/mixin/owo/TextBoxComponentAccessor.java b/src/main/java/io/wispforest/gadget/mixin/owo/TextBoxComponentAccessor.java deleted file mode 100644 index 80d1398..0000000 --- a/src/main/java/io/wispforest/gadget/mixin/owo/TextBoxComponentAccessor.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.wispforest.gadget.mixin.owo; - -import io.wispforest.owo.ui.component.TextBoxComponent; -import io.wispforest.owo.util.Observable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(TextBoxComponent.class) -public interface TextBoxComponentAccessor { - @Accessor - Observable getTextValue(); -} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 63c1b1b..b6085ee 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -42,6 +42,6 @@ "fabric-api": "*", "minecraft": "1.19.x", "java": ">=17", - "owo": ">=0.9.0" + "owo": ">=0.9.3" } } diff --git a/src/main/resources/gadget.mixins.json b/src/main/resources/gadget.mixins.json index 2c10736..5d53aab 100644 --- a/src/main/resources/gadget.mixins.json +++ b/src/main/resources/gadget.mixins.json @@ -33,10 +33,8 @@ "client.NarratorLinuxMixin", "client.NarratorWindowsMixin", "client.ProfileKeysMixin", - "client.TextFieldWidgetMixin", "client.WorldListWidgetWorldEntryMixin", - "client.WorldRendererMixin", - "owo.TextBoxComponentAccessor" + "client.WorldRendererMixin" ], "injectors": { "defaultRequire": 1