More Plugins

This commit is contained in:
thororen1234 2024-07-18 02:14:43 -04:00
parent b4587182c2
commit 167612920b
14 changed files with 1605 additions and 3 deletions

View file

@ -16,20 +16,32 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { definePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import definePlugin, { OptionType } from "@utils/types";
const settings = definePluginSettings({
maxAccounts: {
description: "Number of accounts that can be added, or 0 for no limit",
default: 0,
type: OptionType.NUMBER,
restartNeeded: true,
},
});
export default definePlugin({
name: "UnlimitedAccounts",
description: "Increases the amount of accounts you can add.",
authors: [EquicordDevs.Balaclava, EquicordDevs.thororen],
settings,
patches: [
{
find: "multiaccount_cta_tooltip_seen",
replacement: {
match: /(let \i=)\d+(,\i="switch-accounts-modal",\i="multiaccount_cta_tooltip_seen")/,
replace: "$1Infinity$2",
replace: "$1$self.getMaxAccounts()$2",
},
},
],
getMaxAccounts() { return settings.store.maxAccounts === 0 ? Infinity : settings.store.maxAccounts; },
});