parent
a9b7087c73
commit
b9cc3521ed
|
@ -2,7 +2,7 @@
|
||||||
* @name BDFDB
|
* @name BDFDB
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.5.3
|
* @version 1.5.2
|
||||||
* @description Required Library for DevilBro's Plugins
|
* @description Required Library for DevilBro's Plugins
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -22,7 +22,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "BDFDB",
|
"name": "BDFDB",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.5.3",
|
"version": "1.5.2",
|
||||||
"description": "Required Library for DevilBro's Plugins"
|
"description": "Required Library for DevilBro's Plugins"
|
||||||
},
|
},
|
||||||
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`
|
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`
|
||||||
|
@ -2225,7 +2225,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LibraryModules.KeyCodeUtils) LibraryModules.KeyCodeUtils.getString = function (keyArray) {
|
if (LibraryModules.KeyCodeUtils) LibraryModules.KeyCodeUtils.getString = function (keyArray) {
|
||||||
return LibraryModules.KeyCodeUtils.toString([keyArray].flat(10).filter(n => n).map(keyCode => [BDFDB.DiscordConstants.KeyboardDeviceTypes.KEYBOARD_KEY, keyCode, BDFDB.DiscordConstants.KeyboardEnvs[LibraryModules.KeyCodeUtils.getEnv()]]), true);
|
return LibraryModules.KeyCodeUtils.toString([keyArray].flat(10).filter(n => n).map(keycode => [BDFDB.DiscordConstants.KeyboardDeviceTypes.KEYBOARD_KEY, keycode, BDFDB.DiscordConstants.KeyboardEnvs.BROWSER]), true);
|
||||||
};
|
};
|
||||||
BDFDB.LibraryModules = Object.assign({}, LibraryModules);
|
BDFDB.LibraryModules = Object.assign({}, LibraryModules);
|
||||||
|
|
||||||
|
@ -6097,21 +6097,15 @@ module.exports = (_ => {
|
||||||
|
|
||||||
InternalComponents.LibraryComponents.KeybindRecorder = reactInitialized && class BDFDB_KeybindRecorder extends LibraryModules.React.Component {
|
InternalComponents.LibraryComponents.KeybindRecorder = reactInitialized && class BDFDB_KeybindRecorder extends LibraryModules.React.Component {
|
||||||
handleChange(arrays) {
|
handleChange(arrays) {
|
||||||
this.props.defaultValue = [];
|
if (typeof this.props.onChange == "function") this.props.onChange(arrays.map(platformkey => LibraryModules.KeyEvents.codes[LibraryModules.KeyCodeUtils.codeToKey(platformkey)] || platformkey[1]), this);
|
||||||
if (this.recorder) this.recorder.setState({codes: []});
|
|
||||||
if (typeof this.props.onChange == "function") this.props.onChange(, this);
|
|
||||||
}
|
}
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.props.defaultValue = [];
|
this.props.defaultValue = [];
|
||||||
if (this.recorder) this.recorder.setState({codes: []});
|
let recorder = BDFDB.ReactUtils.findOwner(this, {name: "KeybindRecorder"});
|
||||||
|
if (recorder) recorder.setState({codes: []});
|
||||||
if (typeof this.props.onChange == "function") this.props.onChange([], this);
|
if (typeof this.props.onChange == "function") this.props.onChange([], this);
|
||||||
if (typeof this.props.onReset == "function") this.props.onReset(this);
|
if (typeof this.props.onReset == "function") this.props.onReset(this);
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
|
||||||
let basePopout = BDFDB.ReactUtils.findOwner(this, {name: "KeybindRecorder"});
|
|
||||||
if (!recorder) return;
|
|
||||||
this.recorder = recorder;
|
|
||||||
}
|
|
||||||
render() {
|
render() {
|
||||||
return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Flex, {
|
return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Flex, {
|
||||||
className: BDFDB.disCN.hotkeywrapper,
|
className: BDFDB.disCN.hotkeywrapper,
|
||||||
|
@ -6119,7 +6113,7 @@ module.exports = (_ => {
|
||||||
align: InternalComponents.LibraryComponents.Flex.Align.CENTER,
|
align: InternalComponents.LibraryComponents.Flex.Align.CENTER,
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ReactUtils.createElement(InternalComponents.NativeSubComponents.KeybindRecorder, BDFDB.ObjectUtils.exclude(Object.assign({}, this.props, {
|
BDFDB.ReactUtils.createElement(InternalComponents.NativeSubComponents.KeybindRecorder, BDFDB.ObjectUtils.exclude(Object.assign({}, this.props, {
|
||||||
defaultValue: [this.props.defaultValue].flat(10).filter(n => n).map(keyCode => [BDFDB.DiscordConstants.KeyboardDeviceTypes.KEYBOARD_KEY, keyCode, BDFDB.DiscordConstants.KeyboardEnvs[LibraryModules.KeyCodeUtils.getEnv()]]),
|
defaultValue: [this.props.defaultValue].flat(10).filter(n => n).map(keycode => [BDFDB.DiscordConstants.KeyboardDeviceTypes.KEYBOARD_KEY, keycode, BDFDB.DiscordConstants.KeyboardEnvs.BROWSER]),
|
||||||
onChange: this.handleChange.bind(this)
|
onChange: this.handleChange.bind(this)
|
||||||
}), "reset", "onReset")),
|
}), "reset", "onReset")),
|
||||||
this.props.reset || this.props.onReset ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
|
this.props.reset || this.props.onReset ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
|
||||||
|
|
Loading…
Reference in New Issue