WIP: Start of creating multidrop command
This commit is contained in:
parent
f4c02d3613
commit
7e1dd51e0f
5 changed files with 115 additions and 9 deletions
|
@ -89,7 +89,7 @@ export default class CardDropHelperMetadata {
|
|||
const hexCode = Number("0x" + drop.card.colour);
|
||||
|
||||
if (hexCode) {
|
||||
colour = hexCode;
|
||||
colour = hexCode;
|
||||
} else {
|
||||
AppLogger.LogWarn("CardDropHelperMetadata/GenerateDropEmbed", `Card's colour override is invalid: ${drop.card.id}, ${drop.card.colour}`);
|
||||
}
|
||||
|
@ -149,4 +149,25 @@ export default class CardDropHelperMetadata {
|
|||
.setLabel("Reroll")
|
||||
.setStyle(ButtonStyle.Secondary));
|
||||
}
|
||||
|
||||
public static GenerateMultidropEmbed(drop: DropResult, quantityClaimed: number, imageFileName: string, cardsRemaining: number, claimedBy?: string, currency?: number): EmbedBuilder {
|
||||
const dropEmbed = this.GenerateDropEmbed(drop, quantityClaimed, imageFileName, claimedBy, currency);
|
||||
|
||||
dropEmbed.setFooter({ text: `${dropEmbed.data.footer?.text} · ${cardsRemaining} Remaining`});
|
||||
|
||||
return dropEmbed;
|
||||
}
|
||||
|
||||
public static GenerateMultidropButtons(drop: DropResult, cardsRemaining: number, disabled = false): ActionRowBuilder<ButtonBuilder> {
|
||||
return new ActionRowBuilder<ButtonBuilder>()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`multidrop keep ${drop.card.id} ${cardsRemaining}`)
|
||||
.setLabel("Keep")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setDisabled(disabled),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`multidrop sacrifice ${drop.card.id} ${cardsRemaining}`)
|
||||
.setStyle(ButtonStyle.Secondary));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue