Improve patch. (#359)

This commit is contained in:
Etorix 2025-08-22 15:07:01 -07:00 • committed by GitHub
parent 865097b0dc
commit 03e9c2b501
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1066,16 +1066,12 @@ export default definePlugin({
match: /(START_QUEST_CTA.{0,400}?disabled:)(!0)/,
replace: "$1$self.shouldDisableQuestAcceptedButton(arguments[0].quest)??$2"
},
{
// When the Quest Accepted button which has been enabled again by the above patch is
// clicked, resume the automatic completion of the Quest and disable the button again.
match: /(START_QUEST_CTA.*?,{variant:"secondary",)/,
replace: "$1onClick:()=>{$self.processQuestForAutoComplete(arguments[0].quest)},",
},
{
// The "Quest Accepted" text is changed to "Resume" if the Quest is in progress but not active.
// When the Quest Accepted button which has been enabled again by the above patch is clicked,
// resume the automatic completion of the Quest and disable the button again.
match: /(\i.intl.string\(\i.\i#{intl::QUEST_ACCEPTED}\))/,
replace: "$self.getQuestAcceptedButtonText(arguments[0].quest)??$1"
replace: "$self.getQuestAcceptedButtonText(arguments[0].quest)??$1,onClick:()=>{$self.processQuestForAutoComplete(arguments[0].quest)}"
}
]
},