world hopper: add option to disable Hop-to menu option

This commit is contained in:
kristo naeris
2019-07-04 01:25:29 +03:00
committed by Adam
parent d004dc0548
commit 9d927c3d6f
2 changed files with 17 additions and 1 deletions

View File

@@ -102,11 +102,22 @@ public interface WorldHopperConfig extends Config
return true; return true;
} }
@ConfigItem(
keyName = "menuOption",
name = "Show Hop-to menu option",
description = "Adds Hop-to menu option to the friends list and clan members list",
position = 6
)
default boolean menuOption()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "subscriptionFilter", keyName = "subscriptionFilter",
name = "Show subscription types", name = "Show subscription types",
description = "Only show free worlds, member worlds, or both types of worlds in sidebar", description = "Only show free worlds, member worlds, or both types of worlds in sidebar",
position = 6 position = 7
) )
default SubscriptionFilterMode subscriptionFilter() default SubscriptionFilterMode subscriptionFilter()
{ {

View File

@@ -327,6 +327,11 @@ public class WorldHopperPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuEntryAdded(MenuEntryAdded event) public void onMenuEntryAdded(MenuEntryAdded event)
{ {
if (!config.menuOption())
{
return;
}
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1()); int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
String option = event.getOption(); String option = event.getOption();