mirror of
https://github.com/bdnugget/IdleRSC.git
synced 2026-11-07 07:57:27 +00:00
* Adds patcher and core openrsc client the IdleRSC project * app = idlersc app files * client = openrsc client * patcher = idlersc patcher "* Fix CLI due to input causing the program to crash on startup. * Fix transitive dependency spitting out an error on [startup](https://www.slf4j.org/codes.html#StaticLoggerBinder). * Fix `.editorconfig` causing IDE formatting to clash with spotless' preferred formatting. * Fix typo in debugger button. (This isn't 100% fixed, I'll investigate later.) * Fix infinite looping bug when the cache creation window is exited. * Add more documentation. * Add `patcher` and `client` subprojects. * Add `run` task to gradle for development/debugging purposes. This can be invoked via IDE or command line using the gradle wrapper. Bonus - args can be passed via the gradle --args option. For example, `./gradlew run --args='--auto-login --username username --password password --init-cache coleslaw'` * Move main project to `app` subproject due to shared dependencies. * ~~Bump JDK required to 11.~~ Keeping minimum required JDK at 8. * Add convenience scripts to update code shared from `core` repository. * Played musical chairs with level 3 chickens. Spoiler: I lost, every time."
38 lines
1.0 KiB
Java
38 lines
1.0 KiB
Java
package callbacks;
|
|
|
|
import bot.Main;
|
|
import controller.Controller;
|
|
import orsc.ORSCharacter;
|
|
import orsc.enumerations.ORSCharacterDirection;
|
|
|
|
public class DrawPlayerCallback {
|
|
|
|
public static void drawPlayerCallback(int index, int x, int y, int topPixelSkew) {
|
|
Controller c = Main.getController();
|
|
|
|
int healthCurrent = c.getPlayer(index).healthCurrent;
|
|
int healthMax = c.getPlayer(index).healthMax;
|
|
int skew = 0;
|
|
ORSCharacter player = c.getPlayer(index);
|
|
|
|
if (c.getCharacterDirection(player) == ORSCharacterDirection.COMBAT_A) {
|
|
skew = -25;
|
|
} else if (c.getCharacterDirection(player) == ORSCharacterDirection.COMBAT_B) {
|
|
skew = 25;
|
|
}
|
|
|
|
if (c.getShowBotPaint()) {
|
|
if (healthMax != 0) {
|
|
c.drawString(
|
|
"@red@" + c.getPlayer(index).healthCurrent + "/" + c.getPlayer(index).healthMax,
|
|
x + 16 + skew,
|
|
y - 5,
|
|
0xFFFFFF,
|
|
1);
|
|
} else {
|
|
c.drawString("@red@ ?/?", x + 16, y, 0xFFFFFF, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|