RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.clanchannel.content.ClanShowcase Class Reference
Collaboration diagram for com.runehive.content.clanchannel.content.ClanShowcase:

Public Member Functions

 ClanShowcase (ClanChannel channel)
void openShowcase (Player player, int slot)
void remove (Player player)
void select (Player player, int item, int slot)
void set (Player player)

Public Attributes

int[] showcase = new int[3]
List< Integer > showcaseItems = new ArrayList<>(28)

Private Attributes

final ClanChannel channel
int currentItem = -1
int currentSlot = -1
int showcaseSlot

Detailed Description

Definition at line 15 of file ClanShowcase.java.

Constructor & Destructor Documentation

◆ ClanShowcase()

com.runehive.content.clanchannel.content.ClanShowcase.ClanShowcase ( ClanChannel channel)

Definition at line 22 of file ClanShowcase.java.

22 {
23 this.channel = channel;
24 }

References channel.

Member Function Documentation

◆ openShowcase()

void com.runehive.content.clanchannel.content.ClanShowcase.openShowcase ( Player player,
int slot )

Definition at line 26 of file ClanShowcase.java.

26 {
27 Item[] showcase = new Item[28];
28 for (int index = 0; index < showcaseItems.size(); index++) {
29 showcase[index] = new Item(showcaseItems.get(index));
30 }
31 player.send(new SendString(channel.getName() + "'s Showcase", 57702));
32 player.send(new SendString(showcaseItems.size() + "/28", 57718));
33 player.send(new SendItemOnInterface(57716, showcase));
34 player.send(new SendItemOnInterface(57717));
35 showcaseSlot = slot;
36 currentSlot = -1;
37 currentItem = -1;
38 player.interfaceManager.open(57700);
39 }
val index

References channel, currentItem, currentSlot, com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.InterfaceManager.open(), com.runehive.game.world.entity.mob.player.Player.send(), showcase, showcaseItems, and showcaseSlot.

Referenced by remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

void com.runehive.content.clanchannel.content.ClanShowcase.remove ( Player player)

Definition at line 73 of file ClanShowcase.java.

73 {
74 if (!player.interfaceManager.isInterfaceOpen(57700))
75 return;
76
77 if (currentSlot == -1 || currentItem == -1) {
78 player.send(new SendMessage("You should select an item first."));
79 return;
80 }
81
82 if (showcaseItems.size() <= 3) {
83 player.send(new SendMessage("You need a minimum of 3 showcase items. This action can not be performed."));
84 return;
85 }
86
87 player.dialogueFactory.sendStatement(
88 "Are you sure you want to delete <col=225>" + ItemDefinition.get(currentItem).getName() + "</col>?",
89 "Once this action is performed it can not be undone!")
90 .sendOption("Yes", () -> {
91 showcaseItems.remove(currentSlot);
92 openShowcase(player, currentItem);
93 player.send(new SendMessage("You have successfully removed that item from your showcase."));
94 }, "Nevermind", () -> player.dialogueFactory.clear()).execute();
95 }

References currentItem, currentSlot, com.runehive.game.world.items.ItemDefinition.get(), com.runehive.game.world.items.ItemDefinition.getName(), openShowcase(), and showcaseItems.

Here is the call graph for this function:

◆ select()

void com.runehive.content.clanchannel.content.ClanShowcase.select ( Player player,
int item,
int slot )

Definition at line 41 of file ClanShowcase.java.

41 {
42 if (!player.interfaceManager.isInterfaceOpen(57700) || slot < 0 || slot >= showcaseItems.size())
43 return;
44
45 int id = showcaseItems.get(slot);
46 if (item == id) {
47 currentSlot = slot;
48 currentItem = id;
49 player.send(new SendItemOnInterface(57717, new Item(id)));
50 }
51 }

References currentItem, currentSlot, com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.InterfaceManager.isInterfaceOpen(), com.runehive.game.world.entity.mob.player.Player.send(), and showcaseItems.

Here is the call graph for this function:

◆ set()

void com.runehive.content.clanchannel.content.ClanShowcase.set ( Player player)

Definition at line 53 of file ClanShowcase.java.

53 {
54 if (!player.interfaceManager.isInterfaceOpen(57700) || showcaseSlot < 0 || showcaseSlot >= 3)
55 return;
56
57 if (currentSlot == -1 || currentItem == -1) {
58 player.send(new SendMessage("You should select an item first."));
59 return;
60 }
61
62 showcase[showcaseSlot] = currentItem;
63 ClanChannelHandler.manage(player);
64 Item[] showcase = new Item[28];
65 for (int index = 0; index < showcaseItems.size(); index++) {
66 showcase[index] = new Item(showcaseItems.get(index));
67 }
68 player.send(new SendItemOnInterface(57716));
69 player.send(new SendItemOnInterface(57716, showcase));
70 player.send(new SendMessage("You have successfully changed your showcase."));
71 }

References currentItem, currentSlot, com.runehive.content.clanchannel.channel.ClanChannelHandler.manage(), showcase, showcaseItems, and showcaseSlot.

Here is the call graph for this function:

Member Data Documentation

◆ channel

final ClanChannel com.runehive.content.clanchannel.content.ClanShowcase.channel
private

Definition at line 16 of file ClanShowcase.java.

Referenced by ClanShowcase(), and openShowcase().

◆ currentItem

int com.runehive.content.clanchannel.content.ClanShowcase.currentItem = -1
private

Definition at line 19 of file ClanShowcase.java.

Referenced by openShowcase(), remove(), select(), and set().

◆ currentSlot

int com.runehive.content.clanchannel.content.ClanShowcase.currentSlot = -1
private

Definition at line 19 of file ClanShowcase.java.

Referenced by openShowcase(), remove(), select(), and set().

◆ showcase

int [] com.runehive.content.clanchannel.content.ClanShowcase.showcase = new int[3]

Definition at line 17 of file ClanShowcase.java.

Referenced by openShowcase(), and set().

◆ showcaseItems

List<Integer> com.runehive.content.clanchannel.content.ClanShowcase.showcaseItems = new ArrayList<>(28)

Definition at line 18 of file ClanShowcase.java.

Referenced by openShowcase(), remove(), select(), and set().

◆ showcaseSlot

int com.runehive.content.clanchannel.content.ClanShowcase.showcaseSlot
private

Definition at line 20 of file ClanShowcase.java.

Referenced by openShowcase(), and set().


The documentation for this class was generated from the following file: