Update 'mbchc-local.user.js'

This commit is contained in:
Mute 2022-07-09 01:56:25 +00:00
parent 1fa1c8c951
commit 071ca9a8e1

View File

@ -364,6 +364,12 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
char.MBCHC_LOCAL.TZ = tz
this.save_settings((s) => { if (!s.timezones) s.timezones = {}; s.timezones[char.cid] = tz })
},
update_char: function(char) {
char.cid = char.MemberNumber // Club ID (shorter)
char.dn = window.CharacterNickname(char) // DisplayName (shortcut)
if (!char.MBCHC_LOCAL) char.MBCHC_LOCAL = {}
if (!char.MBCHC_LOCAL.TZ) char.MBCHC_LOCAL.TZ = this.find_timezone(char)
},
// Command actions
command_mbchc: function(argline, cmdline, args) { try {
@ -436,11 +442,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
window.MBCHC.sdk = window.bcModSdk.registerMod("MBCHC", window.MBCHC.VERSION)
window.MBCHC.sdk.hookFunction("CharacterOnlineRefresh", 0, (args, next) => {
let result = next(args)
let char = args[0]
char.cid = char.MemberNumber // Club ID (shorter)
char.dn = window.CharacterNickname(char) // DisplayName (shortcut)
if (!char.MBCHC_LOCAL) char.MBCHC_LOCAL = {}
if (!char.MBCHC_LOCAL.TZ) char.MBCHC_LOCAL.TZ = window.MBCHC.find_timezone(char)
window.MBCHC.update_char(args[0])
return(result)
})
window.MBCHC.sdk.hookFunction("ChatRoomMessageInvolvesPlayer", 0, (args, next) => {
@ -492,7 +494,10 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
window.MBCHC.remove_load_hook = window.MBCHC.sdk.hookFunction("AsylumGGTSSAddItems", 0, (args, next) => { window.MBCHC.loader(); return(next(args)) })
} else {
window.MBCHC.loader()
if(("Online" === window.CurrentModule) && ("ChatRoom" === window.CurrentScreen)) window.MBCHC.player_enters_room()
if(("Online" === window.CurrentModule) && ("ChatRoom" === window.CurrentScreen)) {
window.ChatRoomCharacter.forEach(c => window.MBCHC.update_char(c))
window.MBCHC.player_enters_room()
}
}
})()