forked from runelite/runelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runelite-client: add mage training arena plugin
- Loading branch information
1 parent
7d10744
commit b7b8fc8
Showing
22 changed files
with
1,993 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
runelite-client/src/main/java/net/runelite/client/plugins/mta/MTAConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* Copyright (c) 2018, Jasper Ketelaar <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package net.runelite.client.plugins.mta; | ||
|
||
import net.runelite.client.config.Config; | ||
import net.runelite.client.config.ConfigGroup; | ||
import net.runelite.client.config.ConfigItem; | ||
|
||
@ConfigGroup( | ||
keyName = "mta", | ||
name = "Mage Training Arena", | ||
description = "Configuration for the Mage Training Arena plugin" | ||
) | ||
public interface MTAConfig extends Config | ||
{ | ||
@ConfigItem( | ||
keyName = "alchemy", | ||
name = "Enable alchemy room", | ||
description = "Configures whether or not the alchemy room overlay is enabled.", | ||
position = 0 | ||
) | ||
default boolean alchemy() | ||
{ | ||
return true; | ||
} | ||
|
||
@ConfigItem( | ||
keyName = "graveyard", | ||
name = "Enable graveyard room", | ||
description = "Configures whether or not the graveyard room overlay is enabled.", | ||
position = 1 | ||
) | ||
default boolean graveyard() | ||
{ | ||
return true; | ||
} | ||
|
||
@ConfigItem( | ||
keyName = "telekinetic", | ||
name = "Enable telekinetic room", | ||
description = "Configures whether or not the telekinetic room overlay is enabled.", | ||
position = 2 | ||
) | ||
default boolean telekinetic() | ||
{ | ||
return true; | ||
} | ||
|
||
@ConfigItem( | ||
keyName = "enchantment", | ||
name = "Enable enchantment room", | ||
description = "Configures whether or not the enchantment room overlay is enabled.", | ||
position = 3 | ||
) | ||
default boolean enchantment() | ||
{ | ||
return true; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
runelite-client/src/main/java/net/runelite/client/plugins/mta/MTAInventoryOverlay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2018, Jasper Ketelaar <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package net.runelite.client.plugins.mta; | ||
|
||
import java.awt.Dimension; | ||
import java.awt.Graphics2D; | ||
import javax.inject.Inject; | ||
import net.runelite.client.ui.FontManager; | ||
import net.runelite.client.ui.overlay.Overlay; | ||
import net.runelite.client.ui.overlay.OverlayLayer; | ||
import net.runelite.client.ui.overlay.OverlayPosition; | ||
|
||
public class MTAInventoryOverlay extends Overlay | ||
{ | ||
private final MTAPlugin plugin; | ||
|
||
@Inject | ||
public MTAInventoryOverlay(MTAPlugin plugin) | ||
{ | ||
this.plugin = plugin; | ||
setPosition(OverlayPosition.DYNAMIC); | ||
setLayer(OverlayLayer.ABOVE_WIDGETS); | ||
} | ||
|
||
@Override | ||
public Dimension render(Graphics2D graphics) | ||
{ | ||
for (MTARoom room : plugin.getRooms()) | ||
{ | ||
if (room.inside()) | ||
{ | ||
graphics.setFont(FontManager.getRunescapeBoldFont()); | ||
room.over(graphics); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
runelite-client/src/main/java/net/runelite/client/plugins/mta/MTAPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Copyright (c) 2018, Jasper Ketelaar <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package net.runelite.client.plugins.mta; | ||
|
||
import com.google.common.eventbus.EventBus; | ||
import com.google.inject.Provides; | ||
import javax.inject.Inject; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import net.runelite.api.Client; | ||
import net.runelite.client.config.ConfigManager; | ||
import net.runelite.client.plugins.Plugin; | ||
import net.runelite.client.plugins.PluginDescriptor; | ||
import net.runelite.client.plugins.mta.alchemy.AlchemyRoom; | ||
import net.runelite.client.plugins.mta.enchantment.EnchantmentRoom; | ||
import net.runelite.client.plugins.mta.graveyard.GraveyardRoom; | ||
import net.runelite.client.plugins.mta.telekinetic.TelekineticRoom; | ||
import net.runelite.client.ui.overlay.OverlayManager; | ||
|
||
@PluginDescriptor(name = "Mage Training Arena") | ||
public class MTAPlugin extends Plugin | ||
{ | ||
@Inject | ||
private Client client; | ||
|
||
@Inject | ||
private OverlayManager overlayManager; | ||
|
||
@Inject | ||
private AlchemyRoom alchemyRoom; | ||
@Inject | ||
private GraveyardRoom graveyardRoom; | ||
@Inject | ||
private TelekineticRoom telekineticRoom; | ||
@Inject | ||
private EnchantmentRoom enchantmentRoom; | ||
|
||
@Inject | ||
private EventBus eventBus; | ||
@Inject | ||
private MTASceneOverlay sceneOverlay; | ||
@Inject | ||
private MTAInventoryOverlay inventoryOverlay; | ||
|
||
@Getter(AccessLevel.PROTECTED) | ||
private MTARoom[] rooms; | ||
|
||
@Provides | ||
public MTAConfig getConfig(ConfigManager manager) | ||
{ | ||
return manager.getConfig(MTAConfig.class); | ||
} | ||
|
||
@Override | ||
public void startUp() | ||
{ | ||
overlayManager.add(sceneOverlay); | ||
overlayManager.add(inventoryOverlay); | ||
|
||
this.rooms = new MTARoom[]{alchemyRoom, graveyardRoom, telekineticRoom, enchantmentRoom}; | ||
|
||
for (MTARoom room : rooms) | ||
{ | ||
eventBus.register(room); | ||
} | ||
} | ||
|
||
@Override | ||
public void shutDown() | ||
{ | ||
overlayManager.remove(sceneOverlay); | ||
overlayManager.remove(inventoryOverlay); | ||
|
||
for (MTARoom room : rooms) | ||
{ | ||
eventBus.unregister(room); | ||
} | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
runelite-client/src/main/java/net/runelite/client/plugins/mta/MTARoom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2018, Jasper Ketelaar <[email protected]> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package net.runelite.client.plugins.mta; | ||
|
||
import java.awt.Graphics2D; | ||
import javax.inject.Inject; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
|
||
public abstract class MTARoom | ||
{ | ||
@Getter(AccessLevel.PROTECTED) | ||
protected final MTAConfig config; | ||
|
||
@Inject | ||
protected MTARoom(MTAConfig config) | ||
{ | ||
this.config = config; | ||
} | ||
|
||
public abstract boolean inside(); | ||
|
||
public void under(Graphics2D graphics2D) | ||
{ | ||
} | ||
|
||
public void over(Graphics2D graphics2D) | ||
{ | ||
} | ||
} |
Oops, something went wrong.