Remove map region changed event
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* 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.api.events;
|
||||
|
||||
import lombok.Data;
|
||||
import net.runelite.api.Client;
|
||||
|
||||
/**
|
||||
* An event where a map region has been modified.
|
||||
* <p>
|
||||
* This event exposes the index into the map that is changing,
|
||||
* the value of which can be obtained by using the index with
|
||||
* the {@link Client#getMapRegions()} array.
|
||||
*/
|
||||
@Data
|
||||
public class MapRegionChanged
|
||||
{
|
||||
/**
|
||||
* The map region index.
|
||||
*/
|
||||
private int index;
|
||||
}
|
||||
@@ -37,7 +37,6 @@ import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MapRegionChanged;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
@@ -214,16 +213,6 @@ class InstanceMapOverlay extends Overlay
|
||||
graphics.drawRect(x, y, PLAYER_MARKER_SIZE, PLAYER_MARKER_SIZE);//outline
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles region changes and re-draws the map
|
||||
*
|
||||
* @param event The region change event
|
||||
*/
|
||||
public void onRegionChange(MapRegionChanged event)
|
||||
{
|
||||
mapImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles game state changes and re-draws the map
|
||||
*
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Binder;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MapRegionChanged;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import static net.runelite.api.widgets.WidgetInfo.WORLD_MAP_OPTION;
|
||||
@@ -96,12 +95,6 @@ public class InstanceMapPlugin extends Plugin
|
||||
mouseManager.unregisterMouseWheelListener(inputListener);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void regionChange(MapRegionChanged event)
|
||||
{
|
||||
overlay.onRegionChange(event);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void gameStateChange(GameStateChanged event)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,6 @@ import net.runelite.api.events.GameObjectChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MapRegionChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WallObjectChanged;
|
||||
import net.runelite.api.events.WallObjectDespawned;
|
||||
@@ -334,12 +333,6 @@ public class MotherlodePlugin extends Plugin
|
||||
rocks.remove(gameObject);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onRegionChanged(MapRegionChanged event)
|
||||
{
|
||||
inMlm = checkInMlm();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,6 @@ import net.runelite.api.events.DraggingWidgetChanged;
|
||||
import net.runelite.api.events.ExperienceChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GrandExchangeOfferChanged;
|
||||
import net.runelite.api.events.MapRegionChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
@@ -735,15 +734,6 @@ public abstract class RSClientMixin implements RSClient
|
||||
}
|
||||
}
|
||||
|
||||
@FieldHook("mapRegions")
|
||||
@Inject
|
||||
public static void mapRegionsChanged(int idx)
|
||||
{
|
||||
MapRegionChanged regionChanged = new MapRegionChanged();
|
||||
regionChanged.setIndex(idx);
|
||||
eventBus.post(regionChanged);
|
||||
}
|
||||
|
||||
@FieldHook("playerOptions")
|
||||
@Inject
|
||||
public static void playerOptionsChanged(int idx)
|
||||
|
||||
Reference in New Issue
Block a user