Skip to content

Commit

Permalink
Added confirmation for deleting titles
Browse files Browse the repository at this point in the history
  • Loading branch information
WTMike24 committed May 27, 2017
1 parent 13b0107 commit d89b88d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions randomTitleSystem/randomTitleSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,18 @@
}
currentTitles = JSON.parse($.inidb.get('titles', game.toLowerCase()));
currentList = unJoinFrom(currentTitles);
/*if (index.equalsIgnoreCase('all')) {
$.say($.lang.get('randomtitlesystem.delete.all', game));
$.inidb.RemoveKey('title', '', game);
if ($.inidb.exists('titles', game.toLowerCase()+'-used')) {
$.inidb.RemoveKey('title', '', game+'-used');
}
}*/
if (index > currentList.length-1) {
$.say($.lang.get('randomtitlesystem.query.oob', index, game, currentList.length-1));
return;
}

$.say($.lang.get('randomtitlesystem.delete.success', index, game))
postRemoved = removeAtIndex(currentList, index);
$.inidb.set('titles', game.toLowerCase(), JSON.stringify([joinFrom(postRemoved,0,',')]));
}
Expand Down Expand Up @@ -424,4 +431,4 @@
$.registerChatCommand('./systems/randomTitleSystem.js', 'titlequery', 2);
$.registerChatCommand('./systems/randomTitleSystem.js', 'titlereset', 2);
});
})();
})();
4 changes: 1 addition & 3 deletions randomTitleSystem/systems-randomTitleSystem.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d89b88d

Please sign in to comment.