Update 'mbchc-local.user.js'

This commit is contained in:
Mute 2022-07-18 04:25:30 +00:00
parent 6fbe13b17a
commit 0145147333

View File

@ -24,7 +24,8 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
if (!window.AsylumGGTSSAddItems) throw "AsylumGGTSSAddItems() not found, aborting MBCHC loading"
if (window.MBCHC) throw "MBCHC found, aborting loading"
window.MBCHC = {
VERSION: 'trunk',
VERSION: "trunk",
TARGET_VERSION: "R82",
NEXT_MESSAGE: 1,
LOG_MESSAGES: false,
RETHROW: false,
@ -56,7 +57,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
],
HIDE_ITEMS: [
"ItemMisc","ItemEars","ItemHead","ItemNose","ItemHood","ItemAddon","ItemMouth","ItemMouth2","ItemMouth3",
"ItemArms","ItemNeckAccessories","ItemNeck","ItemNeckRestraints","ItemNipples","ItemNipplesPiercings","ItemBreast","ItemTorso",
"ItemArms","ItemNeckAccessories","ItemNeck","ItemNeckRestraints","ItemNipples","ItemNipplesPiercings","ItemBreast","ItemTorso","ItemTorso2",
"ItemHands","ItemPelvis","ItemVulva","ItemVulvaPiercings",
"ItemDevices","ItemLegs","ItemFeet","ItemBoots"
],
@ -563,6 +564,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
window.CommandCombine(COMMANDS)
this.LOADED = true
this.log("info", `loaded version ${this.VERSION}`)
if (window.GameVersion !== this.TARGET_VERSION) console.warn(`Game version doesn't match the target ("${this.TARGET_VERSION}"), beware of incompatibilities`) // TODO: check betas & cheat
}
} // MBCHC
@ -612,17 +614,17 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
let colour = (C.MBCHC.VERSION === window.Player.MBCHC.VERSION) ? window.MBCHC.RGB_POLLY : window.MBCHC.RGB_MUTE
window.DrawRect(CharX + 175 * Zoom, CharY, 50 * Zoom, 50 * Zoom, colour)
}
if (C.MBCHC_LOCAL && C.MBCHC_LOCAL.TZ) {
if ((window.ChatRoomHideIconState < 1) && C.MBCHC_LOCAL && C.MBCHC_LOCAL.TZ) {
let localtime = new Date(window.CommonTime() + window.MBCHC.UTC_OFFSET + C.MBCHC_LOCAL.TZ * 60 * 60 * 1000)
let text = localtime.toLocaleTimeString([], {hourCycle: "h24", hour: "2-digit"})
window.DrawTextFit(text, CharX + 200 * Zoom, CharY + 25 * Zoom, 46 * Zoom, "white", "black")
}
return(next(nextargs))
})
window.MBCHC.sdk.hookFunction("ElementCreateInput", 0, (nextargs, next) => {
let [ID, Type, Value, MaxLength] = nextargs
window.MBCHC.sdk.hookFunction("ElementValue", 0, (nextargs, next) => { // TODO: layer priority will be locked too if it's the same as difficulty
let [ID, Value] = nextargs
let result = next(nextargs)
if (("bce_LayerPriority" === ID) && window.CurrentCharacter && window.CurrentCharacter.FocusGroup && window.InventoryLocked(window.CurrentCharacter, window.CurrentCharacter.FocusGroup.Name, true)) window.ElementSetAttribute(ID, "disabled", true)
if (("bce_LayerPriority" === ID) && window.CurrentCharacter?.FocusGroup && (window.InventoryGet(window.CurrentCharacter, window.CurrentCharacter.FocusGroup.Name)?.Difficulty.toString() === Value) && window.InventoryLocked(window.CurrentCharacter, window.CurrentCharacter.FocusGroup.Name, true)) window.ElementSetAttribute(ID, "disabled", true)
return(result)
})
window.MBCHC.sdk.hookFunction("ChatRoomCreateElement", 0, (nextargs, next) => {
@ -645,9 +647,19 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
}
return(result)
})
window.MBCHC.sdk.hookFunction("DocumentKeyDown", 0, (nextargs, next) => {
let [event] = nextargs
if ("InputChat" === document.activeElement.id) return(next(nextargs))
if ("inline" === document.getElementById("InputChat")?.style.display) window.ElementFocus("InputChat")
return(next(nextargs))
})
window.MBCHC.sdk.hookFunction("ChatRoomKeyDown", 0, (nextargs, next) => {
let [event] = nextargs
window.MBCHC.complete_hint_hide()
if ((window.KeyPress == 33) || (window.KeyPress == 34)) return(window.MBCHC.history(window.KeyPress - 33)) // better history
if ((window.KeyPress == 33) || (window.KeyPress == 34)) { // better history
event.preventDefault()
return(window.MBCHC.history(window.KeyPress - 33))
}
if (window.MBCHC.HISTORY_MODE) {
window.ChatRoomLastMessage.pop()
window.MBCHC.HISTORY_MODE = false