Merge pull request #487 from runelite-extended/removetick

Removed unused tick counter
This commit is contained in:
Ganom
2019-06-03 16:19:12 -04:00
committed by GitHub
3 changed files with 0 additions and 423 deletions

View File

@@ -1,107 +0,0 @@
/*
* Copyright (c) 2018, James Munson <https://github.com/james-munson>
* 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 HOLDER 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.tickcounter;
import java.awt.Color;
import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("tickcounter")
public interface TickCounterConfig extends Config
{
@ConfigItem(
keyName = "resetInstance",
name = "Reset on new instances",
description = "",
position = 1
)
default boolean instance()
{
return true;
}
@Alpha
@ConfigItem(
keyName = "selfColor",
name = "Your color",
description = "",
position = 4
)
default Color selfColor()
{
return Color.green;
}
@Alpha
@ConfigItem(
keyName = "totalColor",
name = "Total color",
description = "",
position = 6
)
default Color totalColor()
{
return Color.RED;
}
@Alpha
@ConfigItem(
keyName = "otherColor",
name = "Other players color",
description = "",
position = 5
)
default Color otherColor()
{
return Color.white;
}
@Alpha
@ConfigItem(
keyName = "bgColor",
name = "Background color",
description = "",
position = 3
)
default Color bgColor()
{
return new Color(70, 61, 50, 156);
}
@Alpha
@ConfigItem(
keyName = "titleColor",
name = "Title color",
description = "",
position = 2
)
default Color titleColor()
{
return Color.white;
}
}

View File

@@ -1,83 +0,0 @@
/*
* Copyright (c) 2018, James Munson <https://github.com/james-munson>
* 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 HOLDER 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.tickcounter;
/*public class TickCounterOverlay extends Overlay
{
private TickCounterPlugin plugin;
private TickCounterConfig config;
private Client client;
private PanelComponent panelComponent = new PanelComponent();
@Inject
public TickCounterOverlay(TickCounterPlugin plugin, Client client, TickCounterConfig config)
{
super(plugin);
setPosition(OverlayPosition.DYNAMIC);
setPosition(OverlayPosition.DETACHED);
setPosition(OverlayPosition.BOTTOM_RIGHT);
this.plugin = plugin;
this.client = client;
this.config = config;
}
@Override
public Dimension render(Graphics2D g)
{
List<LayoutableRenderableEntity> elems = panelComponent.getChildren();
elems.clear();
panelComponent.setBackgroundColor(config.bgColor());
elems.add(TitleComponent.builder().text("Combat counter").color(config.titleColor()).build());
List<Entry<String, Integer>> list = new ArrayList<>(plugin.activity.entrySet());
list.sort((o1, o2) ->
{
int value = -Integer.compare(o1.getValue(), o2.getValue());
if (value == 0)
{
value = o1.getKey().compareTo(o2.getKey());
}
return value;
});
int total = 0;
for (Entry<String, Integer> e : list)
{
total += e.getValue();
if (e.getKey().equals(client.getLocalPlayer().getName()))
{
elems.add(LineComponent.builder().leftColor(config.selfColor()).rightColor(config.selfColor()).left(e.getKey()).right(e.getValue().toString()).build());
}
else
{
elems.add(LineComponent.builder().left(e.getKey()).right(e.getValue().toString()).leftColor(config.otherColor()).rightColor(config.otherColor()).build());
}
}
elems.add(LineComponent.builder().left("Total").leftColor(config.totalColor()).rightColor(config.totalColor()).right(String.valueOf(total)).build());
return this.panelComponent.render(g);
}
}*/

View File

@@ -1,233 +0,0 @@
/*
* Copyright (c) 2018, James Munson <https://github.com/james-munson>
* 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 HOLDER 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.tickcounter;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
@PluginDescriptor(name = "Tick Counter",
description = "Counts combat activity for nearby players",
enabledByDefault = false,
type = PluginType.PVP
)
public class TickCounterPlugin extends Plugin
{
//todo once bytecodes work again, re-enable
/*
@Inject
private OverlayManager overlayManager;
@Inject
private TickCounterConfig config;
@Inject
private Client client;
@Provides
TickCounterConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(TickCounterConfig.class);
}
@Inject
private TickCounterOverlay overlay;
Map<String, Integer> activity = new HashMap<>();
private List<Player> blowpiping = new ArrayList<>();
private boolean instanced = false;
@Override
protected void startUp() throws Exception
{
overlayManager.add(overlay);
}
@Override
protected void shutDown() throws Exception
{
overlayManager.remove(overlay);
activity.clear();
}
@Subscribe
public void onAnimationChanged(AnimationChanged e)
{
if (!(e.getActor() instanceof Player))
{
return;
}
Player p = (Player) e.getActor();
int weapon = -1;
if (p.getPlayerComposition() != null)
{
weapon = p.getPlayerComposition().getEquipmentId(KitType.WEAPON);
}
int delta = 0;
switch (p.getAnimation())
{
case 7617: // rune knife
case 8194: // dragon knife
case 8291: // dragon knife spec
case 5061: // blowpipe
if (weapon == 12926)
{
blowpiping.add(p);
}
else
{
delta = 2;
}
break;
case 2323: // rpg
case 7618: // chin
delta = 3;
break;
case 426: // bow shoot
if (weapon == 20997) // twisted bow
{
delta = 5;
}
else // shortbow
{
delta = 3;
}
break;
case 376: // dds poke
case 377: // dds slash
case 422: // punch
case 423: // kick
case 386: // lunge
case 390: // generic slash
case 1062: // dds spec
case 1067: // claw stab
case 1074: // msb spec
case 1167: // trident cast
case 1658: // whip
case 2890: // arclight spec
case 3294: // abby dagger slash
case 3297: // abby dagger poke
case 3298: // bludgeon attack
case 3299: // bludgeon spec
case 3300: // abby dagger spec
case 7514: // claw spec
case 7515: // d sword spec
case 8145: // rapier stab
case 8288: // dhl stab
case 8289: // dhl slash
case 8290: // dhl crush
delta = 4;
break;
case 393: // staff bash
if (weapon == 13652)
{ // claw scratch
delta = 4;
break;
}
case 395: // axe autos
case 400: // pick smash
case 1379: //burst or blitz
case 1979: // barrage spell cast
case 1162: // strike/bolt spells
case 7552: // generic crossbow
case 7855: // surge spells
case 8056: // scythe swing
delta = 5;
break;
case 401:
if (weapon == 13576) // dwh bop
{
delta = 6;
}
else // used by pickaxe and axe
{
delta = 5;
}
break;
case 1378:
case 7045:
case 7054:
case 7055: // godsword autos
case 7511: // dinh's attack
case 7516: // maul attack
case 7555: // ballista attack
case 7638: // zgs spec
case 7640: // sgs spec
case 7642: // bgs spec
case 7643: // bgs spec
case 7644: // ags spec
delta = 6;
break;
case 428: // chally swipe
case 440: // chally jab
case 1203: // chally spec
delta = 7;
break;
case -1:
blowpiping.remove(p);
break;
}
if (delta > 0)
{
String name = p.getName();
this.activity.put(name, this.activity.getOrDefault(name, 0) + delta);
}
}
@Subscribe
public void onClientTick(ClientTick e)
{
*//*
* Hack for blowpipe since the AnimationChanged event doesn't fire when using a
* blowpipe because of its speed. If blowpipe animation restarts, then add 2
*//*
for (Player p : blowpiping)
{
if (p.getActionFrame() == 0 && p.getActionFrameCycle() == 1)
{
String name = p.getName();
int activity = this.activity.getOrDefault(name, 0);
this.activity.put(name, activity + 2);
}
}
}
@Subscribe
public void onGameTick(GameTick tick)
{
if (!config.instance())
{
return;
}
boolean prevInstance = instanced;
instanced = client.isInInstancedRegion();
if (!prevInstance && instanced)
{
activity.clear();
}
}*/
}