Skip to content

Commit

Permalink
Abort amethyst completely if using a vanilla profile, don't show mods…
Browse files Browse the repository at this point in the history
… list on vanilla profiles
  • Loading branch information
FrederoxDev committed Feb 13, 2024
1 parent 70c61f1 commit 5344525
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-launcher",
"version": "2.1.1-pre-release",
"version": "2.1.2",
"main": "public/electron.js",
"author": "FrederoxDev",
"description": "AmethystLauncher",
Expand Down
12 changes: 6 additions & 6 deletions proxy/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ static void InjectIntoMinecraft(std::wstring& path)

static void Proxy()
{
std::wstring path = FindRuntimeDllPath();
if (path == L"Vanilla") {
return;
}

Log::InitializeConsole();
Log::Info("[AmethystProxy] Using 'AmethystProxy@{}'", PROXY_VERSION);
Log::Info("[AmethystProxy] McThreadID: {}, McThreadHandle: {}", dMcThreadID, hMcThreadHandle);
Expand Down Expand Up @@ -120,12 +125,7 @@ static void Proxy()
NtResumeThread = (NtResumeThreadPtr)_NtResumeThread;

SuspendMinecraftThread();
std::wstring path = FindRuntimeDllPath();
if (path == L"Vanilla") {
ResumeMinecraftThread();
Log::Info("Playing Vanilla, no mods have been loaded...");
return;
}


InjectIntoMinecraft(path);

Expand Down
Binary file modified public/proxy/dxgi.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default function Header() {
<>
<div className="h-[42px] bg-[#E6E8EB] flex flex-col justify-center items-center">
<p className="minecraft-ten block translate-y-[6px]">Amethyst Launcher</p>
<p className="minecraft-seven block text-[12px] text-[#464749]">v2.1.1-pre-release</p>
<p className="minecraft-seven block text-[12px] text-[#464749]">v2.1.2</p>
</div>


Expand Down
53 changes: 33 additions & 20 deletions src/pages/ProfileEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ export default function ProfileEditor() {

return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}
onClick={() => toggleModActive(name)}
onClick={() => {
if (profileRuntime == "Vanilla") {
alert("Cannot add mods to a vanilla profile");
return;
}

toggleModActive(name);
}}
>
<DividedSection className="cursor-pointer" style={{ backgroundColor: isHovered ? "#5A5B5C" : "#48494A", padding: "1px", paddingLeft: "4px", paddingRight: "4px" }}>
<p className="minecraft-seven text-white">{ name }</p>
Expand Down Expand Up @@ -99,27 +106,33 @@ export default function ProfileEditor() {
</DividedSection>

{/* Mod Selection */}
<DividedSection className="flex-grow flex justify-around gap-[8px]">
<div className=" w-[50%] h-full flex flex-col">
<p className="text-white minecraft-seven">Active Mods</p>
<div className="border-[2px] border-[#1E1E1F] bg-[#313233] flex-grow">
{
allMods.length > 0 ? allMods.filter(mod => profileActiveMods.includes(mod))
.map((mod, index) => <ModButton name={mod} key={index} />) : <></>
}
{
profileRuntime === "Vanilla"
? <DividedSection className="flex-grow flex justify-around gap-[8px]">
<div className="h-full flex flex-col"></div>
</DividedSection>
: <DividedSection className="flex-grow flex justify-around gap-[8px]">
<div className=" w-[50%] h-full flex flex-col">
<p className="text-white minecraft-seven">Active Mods</p>
<div className="border-[2px] border-[#1E1E1F] bg-[#313233] flex-grow">
{
allMods.length > 0 ? allMods.filter(mod => profileActiveMods.includes(mod))
.map((mod, index) => <ModButton name={mod} key={index} />) : <></>
}
</div>
</div>
</div>
<div className=" w-[50%] h-full flex flex-col">
<p className="text-white minecraft-seven">Inactive Mods</p>
<div className="border-[2px] border-[#1E1E1F] bg-[#313233] flex-grow">
{
allMods.length > 0 ? allMods.filter(mod => !profileActiveMods.includes(mod))
.map((mod, index) => <ModButton name={mod} key={index} />) : <></>
}
<div className=" w-[50%] h-full flex flex-col">
<p className="text-white minecraft-seven">Inactive Mods</p>
<div className="border-[2px] border-[#1E1E1F] bg-[#313233] flex-grow">
{
allMods.length > 0 ? allMods.filter(mod => !profileActiveMods.includes(mod))
.map((mod, index) => <ModButton name={mod} key={index} />) : <></>
}
</div>
</div>
</div>
</DividedSection>

</DividedSection>
}
{/* Profile Actions */}
<DividedSection className="flex justify-around gap-[8px]">
<div className="w-[50%]"><MinecraftButton text="Save Profile" onClick={() => saveProfile()} /></div>
Expand Down

0 comments on commit 5344525

Please sign in to comment.