import { createPortal } from "react-dom"; import React, { useEffect, useState } from "react"; import { useAppSelector, useAppDispatch } from "../lib/hooks"; import { setPluginsTxt } from "../slices/pluginsTxt"; import { applyLoadOrder } from "../slices/plugins"; import styles from "../styles/PluginTxtEditor.module.css"; export const excludedPlugins = [ "Skyrim.esm", "Update.esm", "Dawnguard.esm", "HearthFires.esm", "Dragonborn.esm", ]; type Props = {}; const PluginsLoader: React.FC = () => { const [editPluginsTxt, setEditPluginsTxt] = useState(null); const [pluginsTxtShown, setPluginsTxtShown] = useState(false); const dispatch = useAppDispatch(); const pluginsTxt = useAppSelector((state) => state.pluginsTxt); useEffect(() => { setPluginsTxtShown(false); console.log("going to apply!"); dispatch(applyLoadOrder()); }, [dispatch, pluginsTxt]); const onPluginsTxtButtonClick = async () => { setEditPluginsTxt(pluginsTxt); setPluginsTxtShown(true); }; return ( <>

Paste or drag-and-drop your plugins.txt below to sort and enable the loaded plugins by your current load order.

{process.browser && createPortal(

Paste plugins.txt

The plugins.txt file is typically found at{" "} C:\Users\username\AppData\Local\Skyrim Special Edition . You can also drag-and-drop the file anywhere on the window to load the file.