Skip to content

Commit

Permalink
Release v1.0.3
Browse files Browse the repository at this point in the history
Move activity into main menu button instead of navigation tab
  • Loading branch information
RappyTV authored Nov 21, 2024
2 parents ea85d28 + dd40b51 commit 604075a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 41 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";")

group = "com.rappytv.signsearch"
version = providers.environmentVariable("VERSION").getOrElse("1.0.2")
version = providers.environmentVariable("VERSION").getOrElse("1.0.3")

labyMod {
defaultPackageName = "com.rappytv.signsearch" //change this to your main package name (used by all modules)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rappytv.signsearch;

import com.rappytv.signsearch.gui.navigation.SignSearchNavigationActivity;
import com.rappytv.signsearch.gui.navigation.SignSearchNavigationElement;
import com.rappytv.signsearch.gui.settings.SignSearchSettingsActivity;
import com.rappytv.signsearch.listeners.PauseMenuListener;
import com.rappytv.signsearch.utils.SignManager;
import com.rappytv.signsearch.utils.SignSearchSettings;
import net.labymod.api.addon.LabyAddon;
Expand All @@ -20,8 +20,8 @@ protected void enable() {
config = configuration();
signManager = new SignManager();
searchSettings = new SignSearchSettings(config.enabled());
SignSearchNavigationActivity activity = new SignSearchNavigationActivity(searchSettings);
labyAPI().navigationService().register(new SignSearchNavigationElement(activity));
SignSearchSettingsActivity activity = new SignSearchSettingsActivity(searchSettings);
registerListener(new PauseMenuListener(activity));
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rappytv.signsearch.gui.navigation;
package com.rappytv.signsearch.gui.settings;

import com.rappytv.signsearch.utils.SignSearchSettings;
import net.labymod.api.client.gui.screen.Parent;
Expand All @@ -17,11 +17,11 @@

@Link("sign-search.lss")
@AutoActivity
public class SignSearchNavigationActivity extends SimpleActivity {
public class SignSearchSettingsActivity extends SimpleActivity {

private final SignSearchSettings settings;

public SignSearchNavigationActivity(SignSearchSettings settings) {
public SignSearchSettingsActivity(SignSearchSettings settings) {
this.settings = settings;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.rappytv.signsearch.listeners;

import com.rappytv.signsearch.gui.settings.SignSearchSettingsActivity;
import net.labymod.api.Laby;
import net.labymod.api.client.component.Component;
import net.labymod.api.client.gui.icon.Icon;
import net.labymod.api.client.resources.ResourceLocation;
import net.labymod.api.event.Subscribe;
import net.labymod.api.event.client.gui.screen.IngameMenuInitializeEvent;

public class PauseMenuListener {

private final Icon icon = Icon.texture(ResourceLocation.create(
"signsearch",
"textures/sign_search.png"
));
private final SignSearchSettingsActivity activity;

public PauseMenuListener(SignSearchSettingsActivity activity) {
this.activity = activity;
}

@Subscribe
public void onMenuOpen(IngameMenuInitializeEvent event) {
event.addLeftButton(
Component.translatable("signsearch.ui.title"),
icon,
() -> Laby.labyAPI().minecraft().minecraftWindow().displayScreen(activity)
);
}

}

0 comments on commit 604075a

Please sign in to comment.