Skip to content

Commit

Permalink
Merge pull request #2 from aws404/depupdates
Browse files Browse the repository at this point in the history
Update Dependencies (Support Wynntils >=1.0.0)
  • Loading branch information
aws404 authored Mar 12, 2024
2 parents 706f2c4 + 76b5844 commit f75a0d8
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 48 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies {
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

modImplementation "maven.modrinth:controlify:1.7.0-beta.3+1.20.2"
modImplementation "maven.modrinth:controlify:1.7.0+1.20.2"
modImplementation "maven.modrinth:yacl:3.3.0-beta.1+1.20.2-fabric"
modImplementation "maven.modrinth:wynntils:PsmrW9n3"
modImplementation "maven.modrinth:wynntils:gb8QtkKN"
implementation "org.hid4java:hid4java:0.7.0"

include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.2")))
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.2+build.4
loader_version=0.15.1

#Fabric api
fabric_version=0.91.2+1.20.2
fabric_version=0.91.6+1.20.2

# Mod Properties
mod_version=1.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.wynntils.core.components.Managers;
import com.wynntils.core.components.Models;
import com.wynntils.features.overlays.NpcDialogueOverlayFeature;
import com.wynntils.features.overlays.NpcDialogueFeature;
import com.wynntils.features.ui.ContainerScrollFeature;
import com.wynntils.overlays.NpcDialogueOverlay;
import com.wynntils.models.containers.type.InteractiveContainerType;
import com.wynntils.utils.mc.McUtils;
import com.wynntils.utils.wynn.ContainerUtils;
import dev.isxander.controlify.Controlify;
Expand All @@ -16,8 +16,6 @@

import com.github.aws404.controlifywynn.mixin.client.ChatHudAccessor;
import com.github.aws404.controlifywynn.mixin.client.HandledScreenAccessor;
import com.github.aws404.controlifywynn.mixin.client.NpcDialogueOverlayAccessor;
import com.github.aws404.controlifywynn.mixin.client.NpcDialogueOverlayFeatureAccessor;

import net.fabricmc.api.ClientModInitializer;

Expand Down Expand Up @@ -59,11 +57,8 @@ public void onInitializeClient() {
// Don't trigger sneaking if the user presses sneak it in dialogue, just send the packets
if (controller.bindings().SNEAK.justPressed() && !McUtils.player().isSneaking()) {
// Test for Wynntils Dialogue or vanilla chat dialogue
NpcDialogueOverlayFeature dialogueOverlayFeature = Managers.Feature.getFeatureInstance(NpcDialogueOverlayFeature.class);
NpcDialogueOverlay dialogueOverlay = ((NpcDialogueOverlayFeatureAccessor) dialogueOverlayFeature).getNpcDialogueOverlay();
if (!((NpcDialogueOverlayAccessor) dialogueOverlay).getCurrentDialogue().isEmpty() ||
!((NpcDialogueOverlayAccessor) dialogueOverlay).getConfirmationlessDialogues().isEmpty()
) {
NpcDialogueFeature dialogueOverlayFeature = Managers.Feature.getFeatureInstance(NpcDialogueFeature.class);
if (!Models.NpcDialogue.getCurrentDialogue().isEmpty() || !Models.NpcDialogue.getConfirmationlessDialogues().isEmpty()) {
nextDialogueMessage();
controller.clearState();
} else if (((ChatHudAccessor) McUtils.mc().inGameHud.getChatHud()).getVisibleMessages().size() > 2) {
Expand All @@ -87,7 +82,7 @@ public void onInitializeClient() {
// Go to next page if next tab is pressed in a recognised menu
if (controller.bindings().GUI_NEXT_TAB.justPressed()) {
boolean scrollUp = Managers.Feature.getFeatureInstance(ContainerScrollFeature.class).invertScroll.get();
Optional<Integer> slot = Models.Container.getScrollSlot(gui, scrollUp);
Optional<Integer> slot = InteractiveContainerType.getScrollButton(gui, scrollUp);
if (slot.isEmpty()) return;

ContainerUtils.clickOnSlot(
Expand All @@ -101,7 +96,7 @@ public void onInitializeClient() {
// Go to previous page if next tab is pressed in a recognised menu
if (controller.bindings().GUI_PREV_TAB.justPressed()) {
boolean scrollUp = !Managers.Feature.getFeatureInstance(ContainerScrollFeature.class).invertScroll.get();
Optional<Integer> slot = Models.Container.getScrollSlot(gui, scrollUp);
Optional<Integer> slot = InteractiveContainerType.getScrollButton(gui, scrollUp);
if (slot.isEmpty()) return;

ContainerUtils.clickOnSlot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.wynntils.core.components.Models;
import com.wynntils.core.text.StyledText;
import com.wynntils.models.containers.type.InteractiveContainerType;
import dev.isxander.controlify.Controlify;
import dev.isxander.controlify.api.bind.BindRenderer;
import dev.isxander.controlify.api.vmousesnapping.ISnapBehaviour;
Expand Down Expand Up @@ -87,14 +88,14 @@ private void renderControllerButtonOverlay(DrawContext graphics, Controller<?, ?
ControlifyCompat.ifBeginHudBatching();

// Render left scroll if available
Optional<Integer> scrollLeft = Models.Container.getScrollSlot(this, true);
Optional<Integer> scrollLeft = InteractiveContainerType.getScrollButton(this, true);;
if (scrollLeft.isPresent() && this.handler.getSlot(scrollLeft.get()).hasStack()) {
BindRenderer renderer = controller.bindings().GUI_PREV_TAB.renderer();
renderer.render(graphics, this.x - renderer.size().width() - 4, this.y - 8);
}

// Render right scroll if available
Optional<Integer> scrollRight = Models.Container.getScrollSlot(this, false);
Optional<Integer> scrollRight = InteractiveContainerType.getScrollButton(this, false);;
if (scrollRight.isPresent() && this.handler.getSlot(scrollRight.get()).hasStack()) {
BindRenderer renderer = controller.bindings().GUI_NEXT_TAB.renderer();
renderer.render(graphics, this.x + this.backgroundWidth + 4, this.y - 8);
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/resources/controlifywynn.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"wynntilsscreens.WynntilsListScreenMixin",
"wynntilsscreens.WynntilsMenuScreenMixin",
"ChatHudAccessor",
"NpcDialogueOverlayAccessor",
"NpcDialogueOverlayFeatureAccessor",
"WynntilsMenuScreenBaseAccessor"
],
"injectors": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"java": ">=17",
"fabric-api": "*",
"controlify": "*",
"wynntils": "*"
"wynntils": ">=1.0.0"
}
}

0 comments on commit f75a0d8

Please sign in to comment.