GameActivityToggle

This commit is contained in:
Mirco Wittrien 2024-04-14 09:04:54 +02:00
parent 58f372aacd
commit a7849d4810
2 changed files with 19 additions and 10 deletions

View File

@ -630,10 +630,10 @@
"icon": "<svg name='Folder' width='%%width' height='%%height' viewBox='0 0 24 24'><path fill='%%color' d='M20 7H12L10.553 5.106C10.214 4.428 9.521 4 8.764 4H3C2.447 4 2 4.447 2 5V19C2 20.104 2.895 21 4 21H20C21.104 21 22 20.104 22 19V9C22 7.896 21.104 7 20 7Z'/></svg>"
},
"GAMEPAD": {
"icon": "<svg name='Gamepad' aria-hidden='false' width='%%width' height='%%height' viewBox='0 0 24 24'><path fill='%%color' d='M 7.4990194,2.5997624 C 7.1161842,2.5791288 6.6221504,2.6553912 5.8345189,2.8189029 3.9617119,3.2076961 2.9765623,3.8385821 2.9765623,4.648833 c 0,0.2429079 -0.2106019,0.5225245 -0.468359,0.621435 -0.7254896,0.2783968 -1.2371567,3.2816478 -1.4442859,8.478264 -0.20964625,5.25977 0.044969,6.464414 1.5415026,7.300922 0.9348719,0.52256 2.5067873,0.404549 3.2919408,-0.24707 0.2627702,-0.21808 0.9930307,-1.420344 1.6231432,-2.67158 0.6301117,-1.251236 1.294485,-2.285695 1.4759752,-2.298826 0.1814897,-0.01313 1.5331048,-0.02363 3.0035128,-0.02363 1.470408,0 2.821283,0.0105 3.002439,0.02363 0.181155,0.01313 0.799774,0.963693 1.374462,2.112449 0.574688,1.148756 1.268993,2.343159 1.543114,2.654392 0.747739,0.848974 2.234981,1.058357 3.365524,0.47373 1.605059,-0.830007 1.863173,-1.975731 1.649999,-7.324017 -0.207129,-5.1966162 -0.718797,-8.1998672 -1.444286,-8.478264 -0.257757,-0.09891 -0.468359,-0.3785271 -0.468359,-0.621435 0,-1.3963448 -4.065934,-2.638825 -5.519331,-1.6865221 -1.121811,0.7350384 -5.88585,0.7350384 -7.0076604,0 C 8.1533816,2.7378882 7.8818554,2.620396 7.4990194,2.5997624 Z M 6.0874973,6.4465366 c 1.1042857,0 1.099999,0.8249993 1.099999,0.8249993 V 8.371535 H 8.260103 c 0,0 0.8249993,-0.00429 0.8249993,1.099999 0,1.104286 -0.8249993,1.099999 -0.8249993,1.099999 H 7.1874963 v 1.099999 c 0,0 0.00998,0.825 -1.099999,0.825 -1.1099783,0 -1.0999991,-0.825 -1.0999991,-0.825 V 10.571533 H 3.8601066 c 0,0 -0.8249994,0.0043 -0.8249994,-1.099999 0,-1.1042857 0.8249994,-1.099999 0.8249994,-1.099999 H 4.9874982 V 7.2715359 c 0,0 -0.00429,-0.8249993 1.0999991,-0.8249993 z m 12.3749897,0 A 1.5124987,1.5124987 0 0 1 19.974986,7.9590353 1.5124987,1.5124987 0 0 1 18.462487,9.471534 1.5124987,1.5124987 0 0 1 16.949988,7.9590353 1.5124987,1.5124987 0 0 1 18.462487,6.4465366 Z M 15.437489,9.471534 a 1.5124987,1.5124987 0 0 1 1.512499,1.512499 1.5124987,1.5124987 0 0 1 -1.512499,1.512499 1.5124987,1.5124987 0 0 1 -1.512498,-1.512499 1.5124987,1.5124987 0 0 1 1.512498,-1.512499 z'/></svg>"
"icon": "<svg name='Gamepad' aria-hidden='false' width='%%width' height='%%height' viewBox='0 0 24 24'><path fill='%%color' fill-opacity='1' d='M 7.4990194,2.5997624 C 7.1161842,2.5791288 6.6221504,2.6553912 5.8345189,2.8189029 3.9617119,3.2076961 2.9765623,3.8385821 2.9765623,4.648833 c 0,0.2429079 -0.2106019,0.5225245 -0.468359,0.621435 -0.7254896,0.2783968 -1.2371567,3.2816478 -1.4442859,8.478264 -0.20964625,5.25977 0.044969,6.464414 1.5415026,7.300922 0.9348719,0.52256 2.5067873,0.404549 3.2919408,-0.24707 0.2627702,-0.21808 0.9930307,-1.420344 1.6231432,-2.67158 0.6301117,-1.251236 1.294485,-2.285695 1.4759752,-2.298826 0.1814897,-0.01313 1.5331048,-0.02363 3.0035128,-0.02363 1.470408,0 2.821283,0.0105 3.002439,0.02363 0.181155,0.01313 0.799774,0.963693 1.374462,2.112449 0.574688,1.148756 1.268993,2.343159 1.543114,2.654392 0.747739,0.848974 2.234981,1.058357 3.365524,0.47373 1.605059,-0.830007 1.863173,-1.975731 1.649999,-7.324017 -0.207129,-5.1966162 -0.718797,-8.1998672 -1.444286,-8.478264 -0.257757,-0.09891 -0.468359,-0.3785271 -0.468359,-0.621435 0,-1.3963448 -4.065934,-2.638825 -5.519331,-1.6865221 -1.121811,0.7350384 -5.88585,0.7350384 -7.0076604,0 C 8.1533816,2.7378882 7.8818554,2.620396 7.4990194,2.5997624 Z M 6.0874973,6.4465366 c 1.1042857,0 1.099999,0.8249993 1.099999,0.8249993 V 8.371535 H 8.260103 c 0,0 0.8249993,-0.00429 0.8249993,1.099999 0,1.104286 -0.8249993,1.099999 -0.8249993,1.099999 H 7.1874963 v 1.099999 c 0,0 0.00998,0.825 -1.099999,0.825 -1.1099783,0 -1.0999991,-0.825 -1.0999991,-0.825 V 10.571533 H 3.8601066 c 0,0 -0.8249994,0.0043 -0.8249994,-1.099999 0,-1.1042857 0.8249994,-1.099999 0.8249994,-1.099999 H 4.9874982 V 7.2715359 c 0,0 -0.00429,-0.8249993 1.0999991,-0.8249993 z m 12.3749897,0 A 1.5124987,1.5124987 0 0 1 19.974986,7.9590353 1.5124987,1.5124987 0 0 1 18.462487,9.471534 1.5124987,1.5124987 0 0 1 16.949988,7.9590353 1.5124987,1.5124987 0 0 1 18.462487,6.4465366 Z M 15.437489,9.471534 a 1.5124987,1.5124987 0 0 1 1.512499,1.512499 1.5124987,1.5124987 0 0 1 -1.512499,1.512499 1.5124987,1.5124987 0 0 1 -1.512498,-1.512499 1.5124987,1.5124987 0 0 1 1.512498,-1.512499 z'/></svg>"
},
"GAMEPAD_DISABLED": {
"icon": "<svg name='GamepadDisabled' aria-hidden='false' width='%%width' height='%%height' viewBox='0 0 24 24'><path fill='%%color' d='m 22.097645,1.0060792 c -0.228562,-0.026429 -0.47408,0.031766 -0.705098,0.2050764 L 1.4154195,21.193412 c -1.13712205,1.10129 0.304603,2.515921 1.398477,1.398425 L 22.789071,2.6095814 c 0.51979,-0.6932407 -0.0057,-1.5242148 -0.691426,-1.6035022 z M 7.4976235,2.5998159 c -0.382856,-0.020634 -0.876435,0.055238 -1.66411,0.2187481 -1.872909,0.3887889 -2.857503,1.0198214 -2.857503,1.8300627 0,0.2429057 -0.210992,0.5221791 -0.468763,0.6210891 -0.725529,0.278393 -1.236259,3.281886 -1.4434,8.4784442 -0.0939001,2.355548 -0.0860301,3.871508 0.07617,4.931598 L 17.169767,2.6447374 c -0.659606,-0.028927 -1.264479,0.055246 -1.666062,0.3183566 -1.121873,0.7350297 -5.8861385,0.7350297 -7.0080105,0 C 8.1531635,2.7386735 7.8804765,2.6204492 7.4976195,2.5998159 Z M 22.03905,6.1642388 19.783127,8.4200798 a 1.512586,1.512486 0 0 1 -0.8594,0.859368 l -2.025448,2.0273272 a 1.512586,1.512486 0 0 1 -1.136751,1.138662 l -3.367282,3.367159 c 1.234177,0.0023 2.450139,0.0081 2.607495,0.01953 0.181165,0.01313 0.80032,0.964518 1.375039,2.113265 0.57472,1.148741 1.268877,2.343045 1.543013,2.654275 0.74778,0.848961 2.234724,1.057275 3.365329,0.47265 1.605146,-0.829992 1.863624,-1.97593 1.650438,-7.324157 C 22.785794,9.9909478 22.472943,7.4274008 22.03905,6.1642378 Z M 6.0874275,6.4474398 c 1.104345,0 1.09964,0.824212 1.09964,0.824212 v 1.0996 h 1.072296 c 0,0 0.826195,-0.0047 0.826195,1.0996 0,1.1042752 -0.826195,1.1015542 -0.826195,1.1015542 h -1.072296 v 1.0996 c 0,0 0.0104,0.824212 -1.09964,0.824212 -1.11004,0 -1.099641,-0.824212 -1.099641,-0.824212 v -1.0996 h -1.128938 c 0,0 -0.824242,0.0027 -0.824242,-1.1015542 0,-1.104273 0.824242,-1.0996 0.824242,-1.0996 h 1.128938 v -1.0996 c 0,0 -0.0047,-0.824212 1.099641,-0.824212 z'/></svg>"
"icon": "<svg name='GamepadDisabled' aria-hidden='false' width='%%width' height='%%height' viewBox='0 0 24 24'><path fill='%%color' fill-opacity='1' d='m 7.4976235,2.5998159 c -0.382856,-0.020634 -0.876435,0.055238 -1.66411,0.2187481 -1.872909,0.3887889 -2.857503,1.0198214 -2.857503,1.8300627 0,0.2429057 -0.210992,0.5221791 -0.468763,0.6210891 -0.725529,0.278393 -1.236259,3.281886 -1.4434,8.4784442 -0.0939001,2.355548 -0.0860301,3.871508 0.07617,4.931598 L 17.169767,2.6447374 c -0.659606,-0.028927 -1.264479,0.055246 -1.666062,0.3183566 -1.121873,0.7350297 -5.8861385,0.7350297 -7.0080105,0 C 8.1531635,2.7386735 7.8804765,2.6204492 7.4976195,2.5998159 Z M 22.03905,6.1642388 19.783127,8.4200798 c -0.153712,0.3940022 -0.465376,0.705655 -0.8594,0.859368 l -2.025448,2.0273272 c -0.128856,0.566311 -0.570628,1.008826 -1.136751,1.138662 l -3.367282,3.367159 c 1.234177,0.0023 2.450139,0.0081 2.607495,0.01953 0.181165,0.01313 0.80032,0.964518 1.375039,2.113265 0.57472,1.148741 1.268877,2.343045 1.543013,2.654275 0.74778,0.848961 2.234724,1.057275 3.365329,0.47265 1.605146,-0.829992 1.863624,-1.97593 1.650438,-7.324157 C 22.785794,9.9909478 22.472943,7.4274008 22.03905,6.1642378 Z M 6.0874275,6.4474398 c 1.104345,0 1.09964,0.824212 1.09964,0.824212 v 1.0996 h 1.072296 c 0,0 0.826195,-0.0047 0.826195,1.0996 0,1.1042752 -0.826195,1.1015542 -0.826195,1.1015542 h -1.072296 v 1.0996 c 0,0 0.0104,0.824212 -1.09964,0.824212 -1.11004,0 -1.099641,-0.824212 -1.099641,-0.824212 v -1.0996 h -1.128938 c 0,0 -0.824242,0.0027 -0.824242,-1.1015542 0,-1.104273 0.824242,-1.0996 0.824242,-1.0996 h 1.128938 v -1.0996 c 0,0 -0.0047,-0.824212 1.099641,-0.824212 z'/><g transform='matrix(0.03999999910593033,0,0,0.03999999910593033,0,0)' opacity='1'><g transform='matrix(1,0,0,1,-200,-200)' opacity='1'><g transform='matrix(25,0,0,25,200,200)' opacity='1'><g opacity='1' transform='matrix(1,0,0,1,12,12)'><path stroke-linecap='round' stroke-linejoin='miter' fill-opacity='0' stroke-miterlimit='4' stroke='%%color' stroke-opacity='1' stroke-width='2' d=' M-10,10 C-10,10 10,-10 10,-10'/></g></g></g></g></svg>"
},
"GITHUB": {
"icon": "<svg name='Github' width='%%width' height='%%height' viewBox='0 0 24 24'><g fill='%%color'><path d='m12 .5c-6.63 0-12 5.28-12 11.792 0 5.211 3.438 9.63 8.205 11.188.6.111.82-.254.82-.567 0-.28-.01-1.022-.015-2.005-3.338.711-4.042-1.582-4.042-1.582-.546-1.361-1.335-1.725-1.335-1.725-1.087-.731.084-.716.084-.716 1.205.082 1.838 1.215 1.838 1.215 1.07 1.803 2.809 1.282 3.495.981.108-.763.417-1.282.76-1.577-2.665-.295-5.466-1.309-5.466-5.827 0-1.287.465-2.339 1.235-3.164-.135-.298-.54-1.497.105-3.121 0 0 1.005-.316 3.3 1.209.96-.262 1.98-.392 3-.398 1.02.006 2.04.136 3 .398 2.28-1.525 3.285-1.209 3.285-1.209.645 1.624.24 2.823.12 3.121.765.825 1.23 1.877 1.23 3.164 0 4.53-2.805 5.527-5.475 5.817.42.354.81 1.077.81 2.182 0 1.578-.015 2.846-.015 3.229 0 .309.21.678.825.56 4.801-1.548 8.236-5.97 8.236-11.173 0-6.512-5.373-11.792-12-11.792z'/></g></svg>"

View File

@ -2,7 +2,7 @@
* @name GameActivityToggle
* @author DevilBro
* @authorId 278543574059057154
* @version 1.2.3
* @version 1.2.4
* @description Adds a Quick-Toggle Game Activity Button
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -73,13 +73,22 @@ module.exports = (_ => {
delete this.props.forceState;
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PanelButton, Object.assign({}, this.props, {
tooltipText: enabled ? _this.labels.disable_activity : _this.labels.enable_activity,
icon: iconProps => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, Object.assign({}, iconProps, {
nativeClass: true,
width: 20,
height: 20,
color: enabled ? "currentColor" : BDFDB.DiscordConstants.ColorsCSS.STATUS_DANGER,
name: enabled ? BDFDB.LibraryComponents.SvgIcon.Names.GAMEPAD : BDFDB.LibraryComponents.SvgIcon.Names.GAMEPAD_DISABLED
})),
icon: iconProps => BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.lottieicon,
style: {
"--__lottieIconColor": enabled ? "currentColor" : BDFDB.DiscordConstants.ColorsCSS.STATUS_DANGER,
"display": "flex",
"width": "20px",
"height": "20px"
},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, Object.assign({}, iconProps, {
nativeClass: true,
width: 20,
height: 20,
color: "var(--__lottieIconColor)",
name: enabled ? BDFDB.LibraryComponents.SvgIcon.Names.GAMEPAD : BDFDB.LibraryComponents.SvgIcon.Names.GAMEPAD_DISABLED
}))
}),
onClick: _ => _this.toggle()
}));
}