More plugin system work

This commit is contained in:
ceikry 2022-07-10 09:58:08 -05:00 committed by Ceikry
parent a6577064b0
commit 8dfbcb9423
8 changed files with 91 additions and 9 deletions

View file

@ -1,15 +1,19 @@
package OverheadDebugPlugin;
import plugin.Plugin;
import plugin.api.API;
import plugin.api.FontColor;
import plugin.api.FontType;
import plugin.api.TextModifier;
import plugin.api.*;
import rt4.*;
/**
* @author ceikry
*/
public class plugin extends Plugin {
private boolean isEnabled = false;
@Override
public void PlayerOverheadDraw(Player player, int screenX, int screenY) {
if (!isEnabled) return;
API.DrawText(
FontType.SMALL,
FontColor.YELLOW,
@ -22,6 +26,8 @@ public class plugin extends Plugin {
@Override
public void NPCOverheadDraw(Npc npc, int screenX, int screenY) {
if (!isEnabled) return;
String npcSb =
(npc.type.name.strEquals(JagString.parse("null"))
? npc.type.getMultiNpc() != null
@ -44,4 +50,13 @@ public class plugin extends Plugin {
screenY
);
}
@Override
public void ProcessCommand(String commandStr, String[] args) {
if (!API.PlayerHasPrivilege(Privileges.JMOD)) return;
if (commandStr.equalsIgnoreCase("::npcdebug")) {
isEnabled = !isEnabled;
}
}
}

View file

@ -0,0 +1,3 @@
AUTHOR="Ceikry"
DESCRIPTION="Renders helpful debug text over the heads of players and NPCs."
VERSION=1.0