Merge pull request #371 from Ganom/tmorphfix
Updated Tmorph to include Anim Swaps
This commit is contained in:
@@ -27,10 +27,9 @@ import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -62,20 +61,28 @@ public class TMorph extends Plugin
|
||||
}
|
||||
|
||||
@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
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
if (event.getGameState() != GameState.LOGGED_IN)
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -86,7 +93,6 @@ public class TMorph extends Plugin
|
||||
{
|
||||
Player player = client.getLocalPlayer();
|
||||
|
||||
|
||||
if (player == null
|
||||
|| player.getPlayerComposition() == 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().
|
||||
getEquipmentId(KitType.HANDS), 0);
|
||||
|
||||
//Mage Swap
|
||||
|
||||
if (config.mageSwap())
|
||||
{
|
||||
if (config.MainhandMage() > 0)
|
||||
@@ -209,9 +213,6 @@ public class TMorph extends Plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Range Swap
|
||||
|
||||
if (config.rangeSwap())
|
||||
{
|
||||
if (config.MainhandRange() > 0)
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface TMorphConfig extends Config
|
||||
)
|
||||
default boolean mageSwap()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
@@ -63,7 +63,7 @@ public interface TMorphConfig extends Config
|
||||
)
|
||||
default boolean rangeSwap()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
@@ -75,9 +75,64 @@ public interface TMorphConfig extends Config
|
||||
)
|
||||
default boolean meleeSwap()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "experimentalFunctions",
|
||||
name = "Experimental Functions",
|
||||
description = "May bug out in unintended ways.",
|
||||
parent = "swaps",
|
||||
position = 4
|
||||
)
|
||||
default boolean experimentalFunctions()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////Experimental Functions
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "globalAnimSwap",
|
||||
name = "Global Animation Swap",
|
||||
description = "DO NOT USE WITH ANIMATION SWAP BELOW",
|
||||
|
||||
group = "Experimental Functions",
|
||||
hidden = true,
|
||||
unhide = "experimentalFunctions"
|
||||
)
|
||||
default int globalAnimSwap()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "animationSwap",
|
||||
name = "Animation Swap",
|
||||
description = "ID",
|
||||
group = "Experimental Functions",
|
||||
hidden = true,
|
||||
unhide = "experimentalFunctions"
|
||||
)
|
||||
default int animationSwap()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "animationTarget",
|
||||
name = "Animation Target",
|
||||
description = "ID",
|
||||
group = "Experimental Functions",
|
||||
hidden = true,
|
||||
unhide = "experimentalFunctions"
|
||||
)
|
||||
default int animationTarget()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//////////////////Mage
|
||||
|
||||
@ConfigItem(
|
||||
|
||||
Reference in New Issue
Block a user