Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
add plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
raiyni committed Dec 24, 2019
1 parent ae0e01e commit 32fb15a
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 84 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -25,8 +25,8 @@ dependencies {
}
}

group = 'com.example'
version = '1.0-SNAPSHOT'
group = 'io.ryoung.menuswapperextended'
version = '1.0'
sourceCompatibility = '1.8'

tasks.withType(JavaCompile) {
Expand Down
12 changes: 6 additions & 6 deletions runelite-plugin.properties
@@ -1,6 +1,6 @@
displayName=Example
author=Nobody
support=
description=An example greeter plugin
tags=
plugins=com.example.ExamplePlugin
displayName=Menu Swapper Extended
author=raiyni
support=https://github.com/raiyni/menu-swapper-extended
description=External hub for extra menu swapper additions
tags=npcs,inventory,items,objects
plugins=io.ryoung.menuswapperextended
2 changes: 1 addition & 1 deletion settings.gradle
@@ -1 +1 @@
rootProject.name = 'example'
rootProject.name = 'menu-swapper-extended'
19 changes: 0 additions & 19 deletions src/main/java/com/example/ExampleConfig.java

This file was deleted.

53 changes: 0 additions & 53 deletions src/main/java/com/example/ExamplePlugin.java

This file was deleted.

19 changes: 19 additions & 0 deletions src/main/java/io/ryoung/menuswapperextended/MenuSwapperConfig.java
@@ -0,0 +1,19 @@
package io.ryoung.menuswapperextended;

import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;

@ConfigGroup("menuswapperextended")
public interface MenuSwapperConfig extends Config
{
@ConfigItem(
keyName = "swapStory",
name = "Story",
description = "Swap Talk-to with Story for Juna at Tears of Guthix"
)
default boolean swapStory()
{
return true;
}
}
45 changes: 45 additions & 0 deletions src/main/java/io/ryoung/menuswapperextended/MenuSwapperPlugin.java
@@ -0,0 +1,45 @@
package io.ryoung.menuswapperextended;

import com.google.common.collect.ImmutableSet;
import com.google.inject.Provides;
import java.util.Set;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.NPC;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.util.Text;

@Slf4j
@PluginDescriptor(
name = "Menu Swapper Extended"
)
public class MenuSwapperPlugin extends Plugin
{
private static final Set<MenuAction> NPC_MENU_TYPES = ImmutableSet.of(
MenuAction.NPC_FIRST_OPTION,
MenuAction.NPC_SECOND_OPTION,
MenuAction.NPC_THIRD_OPTION,
MenuAction.NPC_FOURTH_OPTION,
MenuAction.NPC_FIFTH_OPTION,
MenuAction.EXAMINE_NPC);

@Inject
private Client client;

@Inject
private MenuSwapperConfig config;

@Provides
MenuSwapperConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(MenuSwapperConfig.class);
}
}
@@ -1,13 +1,13 @@
package com.example;
package io.ryoung.menuswapperextended;

import net.runelite.client.RuneLite;
import net.runelite.client.externalplugins.ExternalPluginManager;

public class ExamplePluginTest
public class MenuSwapperPluginTest
{
public static void main(String[] args) throws Exception
{
ExternalPluginManager.loadBuiltin(ExamplePlugin.class);
ExternalPluginManager.loadBuiltin(MenuSwapperPlugin.class);
RuneLite.main(args);
}
}

0 comments on commit 32fb15a

Please sign in to comment.