Update 'mbchc-local.user.js'

This commit is contained in:
Mute 2022-07-09 17:52:03 +00:00
parent a0e482c536
commit 561bedc606

View File

@ -341,6 +341,20 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
} }
} }
}, },
copy_bce_trigger: function(trigger) {
let result = {
Type: "Action",
Event: trigger.Event,
Matchers: trigger.Matchers.map(m => ({Tester: new RegExp(m.Tester.source.replace(/^\^/, "^SourceCharacter\\s+"), "u")}))
}
return(result)
},
patch_bce: function() {
this.remove_bce_hook()
delete this.remove_bce_hook
let actions = window.bce_ActivityTriggers.filter(t => "Emote" === t.Type).map(t => this.copy_bce_trigger(t))
window.bce_ActivityTriggers = window.bce_ActivityTriggers.concat(actions)
},
gather_versions: function() { return(window.ChatRoomCharacter.filter(c => c.MBCHC).map(c => ({name: c.dn, cid: c.cid, version: c.MBCHC.VERSION}))) }, gather_versions: function() { return(window.ChatRoomCharacter.filter(c => c.MBCHC).map(c => ({name: c.dn, cid: c.cid, version: c.MBCHC.VERSION}))) },
need_load_hook: function(module, screen) { need_load_hook: function(module, screen) {
if (!module || !screen) return(true) if (!module || !screen) return(true)
@ -489,6 +503,10 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
} }
return(next(args)) return(next(args))
}) })
window.MBCHC.remove_bce_hook = window.MBCHC.sdk.hookFunction("MainRun", 0, (args, next) => {
if (window.bce_ActivityTriggers) window.MBCHC.patch_bce()
return(next(args))
})
// MAIN SCREEN TURN ON // MAIN SCREEN TURN ON
if (window.MBCHC.need_load_hook(window.CurrentModule, window.CurrentScreen)) { if (window.MBCHC.need_load_hook(window.CurrentModule, window.CurrentScreen)) {