Skip to content

Commit d4a7a5f

Browse files
committed
show icon if a mod is inside an enabled merge pack
1 parent d5eb3fc commit d4a7a5f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/ModRow.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ModDropdown from "./ModDropdown";
1313
import { isModAlwaysEnabled } from "./modsHelpers";
1414
import * as modRowSorting from "./utility/modRowSorting";
1515
import { SortingType } from "./utility/modRowSorting";
16+
import { HiOutlineCollection } from "react-icons/hi";
1617

1718
export default function ModRow() {
1819
const dispatch = useAppDispatch();
@@ -28,6 +29,10 @@ export default function ModRow() {
2829
const [contextMenuMod, setContextMenuMod] = useState<Mod>();
2930

3031
const presetMods = useAppSelector((state) => state.app.currentPreset.mods);
32+
const enabledMods = presetMods.filter(
33+
(iterMod) => iterMod.isEnabled || alwaysEnabledMods.find((mod) => mod.name === iterMod.name)
34+
);
35+
const enabledMergeMods = enabledMods.filter((mod) => mod.mergedModsData);
3136

3237
const modsToOrder = presetMods.filter((iterMod) => {
3338
const isHidden = hiddenMods.find((mod) => mod.name === iterMod.name);
@@ -566,6 +571,26 @@ export default function ModRow() {
566571
</span>
567572
</Tooltip>
568573
)}
574+
{enabledMergeMods.some((mergeMod) =>
575+
mergeMod.mergedModsData.some((mergeModData) => mergeModData.path == mod.path)
576+
) && (
577+
<Tooltip
578+
placement="bottom"
579+
content={
580+
<>
581+
<p>Mod is merged in another enabled pack</p>
582+
<p>
583+
You can leave it enabled, but this mod will be ignored since it's inside the
584+
merged mod
585+
</p>
586+
</>
587+
}
588+
>
589+
<span className="text-gray-300">
590+
<HiOutlineCollection className="inline h-4 overflow-visible"></HiOutlineCollection>
591+
</span>
592+
</Tooltip>
593+
)}
569594
{mod.name.replace(".pack", "")}
570595
</span>
571596
</label>

src/PlayGame.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ export default function PlayGame() {
208208
<>
209209
<p>Create new preset by typing its name</p>
210210
<p className="mt-4">When selecting existing preset:</p>
211-
<p>Hold Shift to add a preset to existing selection</p>
212-
<p>Hold Ctrl to remove preset from existing selection</p>
211+
<p>Hold Shift to add mods in preset to current mods</p>
212+
<p>Hold Ctrl to remove mods in preset from current mods</p>
213213
</>
214214
}
215215
>

0 commit comments

Comments
 (0)