Invert list order

I'm trying to edit Gameus's Quest System (an abandoned plugin).


The only thing left is that I would like to reverse the order of the quest list the plugin displays. By default the list follows an undesirable chronological order, so the new quests always go to the bottom of the list.


Anyone knows if there's an easy method to do this? Thanks.
Find this function in the .js file,
 


Game_Party.prototype.addQuest = function(quest_id) {
// Does party already have quest?
if (this.quests.indexOf(quest_id) < 0) {
// If not, give that crap to them. They don't have a choice now.
this.quests.push(quest_id);
}
};




then replace it with this.

 


Game_Party.prototype.addQuest = function(quest_id) {
// Does party already have quest?
if (this.quests.indexOf(quest_id) < 0) {
// If not, give that crap to them. They don't have a choice now.
this.quests.unshift(quest_id);
}
};


 that will put any newly added quests to the top of the list. 🙂  I've replaces this.quests.push(quest_id) with this.quests.unshift(quest_id), the push functionforces the element to the end of an array, whereas the unshift function pushes it to the beginning of the array.

 
Worked like critical hit! I love you.


How should I thank you in the credits, "chaucer"?


Thank you very much!
haha, no credits necessary bro, unless you feel like it, I just changed a single word in the function lol. but if you really think it's necessary Chaucer is fine. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/invert-list-order.61720/