mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-31 02:07:51 +01:00
editing custom roles
This commit is contained in:
@@ -6,6 +6,8 @@ export class DeckStateManager {
|
||||
constructor() {
|
||||
this.deck = null;
|
||||
this.customRoleOptions = [];
|
||||
this.createMode = false;
|
||||
this.currentlyEditingRoleName = null;
|
||||
}
|
||||
|
||||
addToDeck(role) {
|
||||
@@ -22,6 +24,13 @@ export class DeckStateManager {
|
||||
localStorage.setItem("play-werewolf-custom-roles", JSON.stringify(this.customRoleOptions.concat(this.deck.filter(card => card.custom === true))));
|
||||
}
|
||||
|
||||
updateCustomRoleOption(option, name, description, team) {
|
||||
option.role = name;
|
||||
option.description = description;
|
||||
option.team = team;
|
||||
localStorage.setItem("play-werewolf-custom-roles", JSON.stringify(this.customRoleOptions.concat(this.deck.filter(card => card.custom === true))));
|
||||
}
|
||||
|
||||
removeFromCustomRoleOptions(name) {
|
||||
let option = this.customRoleOptions.find((option) => option.role === name);
|
||||
if (option) {
|
||||
|
||||
Reference in New Issue
Block a user