Commit bf523c2d authored by Joe's avatar Joe

Implements wilderness list

Shows current players in wilderness along with their cb lvl and wild lvl
parent d6474179
......@@ -5119,14 +5119,14 @@ public final class mudclient implements Runnable {
"Hits: " + this.playerStatCurrent[3] + "@gre@/@whi@" + this.playerStatBase[3], 7, i, 0xffffff, 1);
i += 14;
}
if (f2Fatigue == 0) {
if (f2Prayer == 0) {
this.getSurface().drawString(
"Fatigue: " + this.statFatigue + "%", 7, i, 0xffffff, 1);
"Prayer: " + this.playerStatCurrent[5] + "@gre@/@whi@" + this.playerStatBase[5], 7, i, 0xffffff, 1);
i += 14;
}
if (f2Prayer == 0) {
if (f2Fatigue == 0) {
this.getSurface().drawString(
"Prayer: " + this.playerStatCurrent[5] + "@gre@/@whi@" + this.playerStatBase[5], 7, i, 0xffffff, 1);
"Fatigue: " + this.statFatigue + "%", 7, i, 0xffffff, 1);
i += 14;
}
Date now = new Date();
......@@ -10046,14 +10046,6 @@ public final class mudclient implements Runnable {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Hits - @gre@Show", 21, null, null);
}
if (f2Fatigue == 1) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Fatigue - @red@Off", 22, null, null);
} else
if (f2Fatigue == 0) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Fatigue - @gre@Show", 22, null, null);
}
if (f2Prayer == 1) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Prayer - @red@Off", 23, null, null);
......@@ -10062,6 +10054,14 @@ public final class mudclient implements Runnable {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Prayer - @gre@Show", 23, null, null);
}
if (f2Fatigue == 1) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Fatigue - @red@Off", 22, null, null);
} else
if (f2Fatigue == 0) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Fatigue - @gre@Show", 22, null, null);
}
if (f2Date == 1) {
this.panelSettings.setListEntry(this.controlSettingPanel, index++,
"@whi@Date - @red@Off", 24, null, null);
......@@ -11274,18 +11274,24 @@ public final class mudclient implements Runnable {
"@or1@Total Time Spent In Wilderness:", 0, null, null);
this.panelQuestInfo.setListEntry(this.controlQuestInfoPanel, index++,
"@whi@" + this.timeInWild, 0, null, null);
this.drawButton(x + 2, y + 117, 85, 28, "@yel@PkPoint List", 3, false, new ButtonHandler() {
this.drawButton(x + 2, y + 116, 85, 15, "@yel@PkPoint List", 3, false, new ButtonHandler() {
@Override
void handle() {
sendCommandString("pkpointlist");
}
});
this.drawButton(x + 2, y + 147, 85, 28, "@yel@Kill Feed", 3, false, new ButtonHandler() {
this.drawButton(x + 2, y + 132, 85, 15, "@yel@Kill Feed", 3, false, new ButtonHandler() {
@Override
void handle() {
sendCommandString("killfeed");
}
});
this.drawButton(x + 2, y + 148, 85, 15, "@yel@Wilderness", 3, false, new ButtonHandler() {
@Override
void handle() {
sendCommandString("wildernesslist");
}
});
int position = this.panelQuestInfo.getControlSelectedListIndex(this.controlQuestInfoPanel) - 1;
......
......@@ -55,26 +55,10 @@ public final class RegularPlayer implements CommandListener {
return player.getWorld().getServer().getConfig().PLAYER_COMMANDS || player.isMod();
}
ArrayList<String> playerKills = new ArrayList<String>();
private ArrayList<String> getPlayerKills() {
Collections.sort(playerKills, Collections.reverseOrder());
return playerKills;
}
private ArrayList<String> getPlayerKills2() {
Collections.sort(playerKills, new Comparator<String>() {
public int compare(String o1, String o2) {
return extractInt(o2) - extractInt(o1);
}
int extractInt(String s) {
String num = s.replaceAll("\\D", "");
return num.isEmpty() ? 0 : Integer.parseInt(num);// return 0 if no digits found
}
});
return playerKills;
}
ArrayList<String> iw = new ArrayList<String>();
SortedMap<Integer, String> sm =
new TreeMap<Integer, String>(Collections.reverseOrder ());
new TreeMap<Integer, String>(Collections.reverseOrder ());
public void handleCommand(String cmd, String[] args, Player player) {
if (cmd.equalsIgnoreCase("wilderness")) {
......@@ -383,6 +367,16 @@ public final class RegularPlayer implements CommandListener {
}
}
}
} else if (cmd.equals("wildernesslist")) {
iw.clear();
for (Player p : player.getWorld().getPlayers()) {
if(p.getLocation().inWilderness()){
int i = p.getLocation().wildernessLevel();
int i2 = p.getCombatLevel();
iw.add(p.getUsername() + "[@yel@Lvl" + i2 + "@whi@] - @red@Wild Lvl" + i + "@whi@");
}
}
ActionSender.sendBox(player, "" + "Players currently in the wilderness % " + iw, true);
} else if (cmd.equals("onlinelist")) { // modern onlinelist display using ActionSender.SendOnlineList()
ActionSender.sendOnlineList(player);
/*} else if (cmd.equalsIgnoreCase("onlinelist")) { // this is the old onlinelist display using ActionSender.sendBox()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment