diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/Raid.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/Raid.java index d881351cbd..662aac5981 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/Raid.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/Raid.java @@ -31,7 +31,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.client.plugins.raids.solver.Layout; import net.runelite.client.plugins.raids.solver.Room; -class Raid +public class Raid { @Getter private final RaidRoom[] rooms = new RaidRoom[16]; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidRoom.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidRoom.java index 06101d6e08..df71695898 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidRoom.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidRoom.java @@ -29,7 +29,7 @@ import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @Getter -enum RaidRoom +public enum RaidRoom { START("Start", RoomType.START), END("End", RoomType.END), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index 7fbae8fc3b..57b74bd469 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -77,10 +77,13 @@ import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.chat.QueuedMessage; import net.runelite.client.config.ConfigManager; import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ChatInput; import net.runelite.client.events.ConfigChanged; import net.runelite.client.events.OverlayMenuClicked; +import net.runelite.client.plugins.raids.events.RaidReset; +import net.runelite.client.plugins.raids.events.RaidScouted; import net.runelite.client.game.ItemManager; import net.runelite.client.game.SpriteManager; import net.runelite.client.input.KeyManager; @@ -179,6 +182,9 @@ public class RaidsPlugin extends Plugin @Inject private ImageCapture imageCapture; + @Inject + private EventBus eventBus; + @Getter private final Set roomWhitelist = new HashSet(); @@ -506,6 +512,8 @@ public class RaidsPlugin extends Plugin { sendRaidLayoutMessage(); } + + eventBus.post(new RaidScouted(raid, firstSolve)); } private void sendRaidLayoutMessage() @@ -1008,5 +1016,6 @@ public class RaidsPlugin extends Plugin raid = null; chestOpened = false; updateInfoBoxState(); + eventBus.post(new RaidReset()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RoomType.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RoomType.java index 686391e563..0ddb2085fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RoomType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RoomType.java @@ -30,7 +30,7 @@ import lombok.Getter; @AllArgsConstructor @Getter -enum RoomType +public enum RoomType { START("Start", '#'), END("End", 'ยค'), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidReset.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidReset.java new file mode 100644 index 0000000000..e1d6f9aa83 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidReset.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020, Trevor + * 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.raids.events; + +/** + * An event that fires when the raid plugin resets + * + * This happens when the player leaves a raid and when the raid plugin turns off + */ +public class RaidReset +{ +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidScouted.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidScouted.java new file mode 100644 index 0000000000..b57152d975 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/events/RaidScouted.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020, Trevor + * 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.raids.events; + +import lombok.Value; +import net.runelite.client.plugins.raids.Raid; + +/** + * An event that fires when the player scouts a raid + * + * This will fire every time the raid plugin successfully scouts a raid but mostly fires at LOGGED_IN gamestate changes + * This event only fires in scoutable raids (not challenge mode) + * The raid object is not guaranteed to change in between events + */ +@Value +public class RaidScouted +{ + private Raid raid; + private boolean firstScout; +}