Fixing Tmorph and added new features.
This commit is contained in:
@@ -27,10 +27,9 @@ import com.google.inject.Provides;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.InventoryID;
|
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.AnimationChanged;
|
||||||
import net.runelite.api.events.ItemContainerChanged;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.kit.KitType;
|
import net.runelite.api.kit.KitType;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -62,20 +61,28 @@ public class TMorph extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onItemContainerChanged(final ItemContainerChanged event)
|
public void onAnimationChanged(AnimationChanged event)
|
||||||
{
|
{
|
||||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT))
|
if (config.animationTarget() < 0 && config.animationSwap() < 0)
|
||||||
{
|
{
|
||||||
return;
|
if (event.getActor().getAnimation() != -1)
|
||||||
|
{
|
||||||
|
event.getActor().setAnimation(config.globalAnimSwap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (config.animationTarget() > 0 && config.animationSwap() > 0)
|
||||||
|
{
|
||||||
|
if (event.getActor().getAnimation() == config.animationTarget())
|
||||||
|
{
|
||||||
|
event.getActor().setAnimation(config.animationSwap());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEquip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameStateChanged(GameStateChanged event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (event.getGameState() != GameState.LOGGED_IN)
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -86,7 +93,6 @@ public class TMorph extends Plugin
|
|||||||
{
|
{
|
||||||
Player player = client.getLocalPlayer();
|
Player player = client.getLocalPlayer();
|
||||||
|
|
||||||
|
|
||||||
if (player == null
|
if (player == null
|
||||||
|| player.getPlayerComposition() == null
|
|| player.getPlayerComposition() == null
|
||||||
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
||||||
@@ -114,8 +120,6 @@ public class TMorph extends Plugin
|
|||||||
final int glovesID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
final int glovesID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||||
getEquipmentId(KitType.HANDS), 0);
|
getEquipmentId(KitType.HANDS), 0);
|
||||||
|
|
||||||
//Mage Swap
|
|
||||||
|
|
||||||
if (config.mageSwap())
|
if (config.mageSwap())
|
||||||
{
|
{
|
||||||
if (config.MainhandMage() > 0)
|
if (config.MainhandMage() > 0)
|
||||||
@@ -209,9 +213,6 @@ public class TMorph extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Range Swap
|
|
||||||
|
|
||||||
if (config.rangeSwap())
|
if (config.rangeSwap())
|
||||||
{
|
{
|
||||||
if (config.MainhandRange() > 0)
|
if (config.MainhandRange() > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user