RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
ActivityPanel.java
1package com.osroyale.content.activity.panel;
2
3
4import com.osroyale.Config;
5import com.osroyale.game.world.World;
6import com.osroyale.game.world.entity.mob.player.Player;
7import com.osroyale.game.world.items.Item;
8import com.osroyale.net.packet.out.SendForceTab;
9import com.osroyale.net.packet.out.SendItemOnInterface;
10import com.osroyale.net.packet.out.SendProgressBar;
11import com.osroyale.net.packet.out.SendString;
12
51
52public class ActivityPanel {
54 public static void update(Player player, int amount, String title, String footer, String... strings) {
55 update(player, amount, title, footer, new Item[]{}, strings);
56 }
57
59 public static void update(Player player, int amount, String title, Item item, String... strings) {
60 update(player, amount, title, "Activity Completion:", new Item[]{item}, strings);
61 }
62
64 public static void update(Player player, int amount, String header, String footer, Item container, String... strings) {
65 update(player, amount, header, footer, new Item[]{container}, strings);
66 }
67
69 public static void update(Activity_Panel panel) {
70 update(panel.getPlayer(), panel.getProgress(), panel.getHeader(), panel.getFooter(), new Item[]{panel.getItem()}, panel.getText());
71 }
72
74 public static void update(Player player, int amount, String header, String footer, Item[] container, String... strings) {
75 player.interfaceManager.setSidebar(Config.ACTIVITY_TAB, 38000);
76 if (!player.interfaceManager.isSidebar(Config.ACTIVITY_TAB, 38000)) {
77 player.send(new SendForceTab(Config.ACTIVITY_TAB));
78 }
79 for (int index = 0, string = 38005; index < strings.length; index++, string += 1) {
80 player.send(new SendString(strings[index], string));
81 }
82 if (container != null) {
83 player.send(new SendItemOnInterface(38016, container));
84 }
85 player.send(new SendString(header, 38003));
86 player.send(new SendProgressBar(38015, amount));
87 player.send(new SendString(amount == -1 ? "" : footer, 38004));
88 }
89
91 public static void clear(Player player) {
92 player.send(new SendItemOnInterface(38016));
93 player.send(new SendString("", 38003));
94 player.send(new SendString("", 38004));
95 player.send(new SendString("", 38005));
96 player.send(new SendString("", 38006));
97 player.send(new SendString("", 38007));
98 player.send(new SendString("", 38008));
99 player.send(new SendProgressBar(38008, -1));
100 player.send(new SendForceTab(Config.INVENTORY_TAB));
101 player.interfaceManager.setSidebar(Config.ACTIVITY_TAB, -1);
102 }
103
105 public static void timedClear(Player player, int delay) {
106 World.schedule(delay, () -> clear(player));
107 }
108}
static void timedClear(Player player, int delay)
static void update(Player player, int amount, String header, String footer, Item container, String... strings)
static void update(Player player, int amount, String header, String footer, Item[] container, String... strings)
static void update(Player player, int amount, String title, Item item, String... strings)
static void update(Player player, int amount, String title, String footer, String... strings)
static void schedule(Task task)
Definition World.java:284