Skip to content

Commit

Permalink
Huge update and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scrim-dev committed Dec 4, 2024
1 parent b06d1c2 commit db5f9cf
Show file tree
Hide file tree
Showing 16 changed files with 422 additions and 95 deletions.
8 changes: 8 additions & 0 deletions Catalyss/Catalyss.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;8622</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;8622</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="wwwroot\**" />
<Content Include="evilmane_scrimmane.ico" />
Expand Down
35 changes: 35 additions & 0 deletions Catalyss/InjectHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ namespace Catalyss
internal class InjectHandler
{
private static Injector MonoInjector;

private static void LaunchGame()
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = "steam://rungameid/2768430",
UseShellExecute = true
});
}
catch { }
}

public static void EventReceived(object sender, string message)
{
//var window = (PhotinoWindow)sender;
Expand Down Expand Up @@ -49,6 +63,27 @@ public static void EventReceived(object sender, string message)
MessageBox.Show("Atlyss game process is NOT active!");
}
}
else if (message == "StartGame")
{
LaunchGame();
}
else if(message == "QuitGame")
{
QuitGame();
}
}

private static void QuitGame()
{
try
{
Process[] processes = Process.GetProcessesByName("ATLYSS");
foreach (var process in processes)
{
process.Kill();
}
}
catch { }
}

private static bool IsAtlyssProcessRunning()
Expand Down
15 changes: 10 additions & 5 deletions Catalyss/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ internal class Program
[STAThread]
static void Main()
{
string windowTitle = "Catalyss Injector v1.0";
using var mutex = new Mutex(true, "CAT_INJ_APP", out bool isFirstInstance);
if (!isFirstInstance)
{
MessageBox.Show("The injector is already opened!", "Catalyss", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}

string windowTitle = "Catalyss Injector v1.1";

// Creating a new PhotinoWindow instance with the fluent API
#pragma warning disable CS8622 // Nullability of reference types in type of parameter doesn't match the target delegate (possibly because of nullability attributes).
var window = new PhotinoWindow()
.SetTitle(windowTitle)
// Resize to a percentage of the main monitor work area
.SetUseOsDefaultSize(false)
.SetSize(new Size(1000, 650))
.SetSize(new Size(1300, 750))
// Center window in the middle of the screen
.Center()
// Users can resize windows by default.
Expand All @@ -30,7 +36,7 @@ static void Main()
(() =>{
window.setTimeout(() => {
alert(`Only inject when you're in the game's main menu!`);
}, 1000);
}, 563);
})();
"));
})
Expand All @@ -40,7 +46,6 @@ static void Main()
// This could be added in the PhotinoWindowOptions if preferred.
.RegisterWebMessageReceivedHandler(InjectHandler.EventReceived)
.Load("wwwroot/index.html"); // Can be used with relative path strings or "new URI()" instance to load a website.
#pragma warning restore CS8622 // Nullability of reference types in type of parameter doesn't match the target delegate (possibly because of nullability attributes).

window.WaitForClose(); // Starts the application event loop
}
Expand Down
2 changes: 2 additions & 0 deletions Catalyss/wwwroot/alt-theme/Note.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
I plan on expanding this injector for alot of stuff for this game or other games.
Also the windows GUI is nice and modern looking so it will be better to look at GUI wise.
13 changes: 13 additions & 0 deletions Catalyss/wwwroot/alt-theme/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en" oncontextmenu="return false" onkeydown="return false;">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Windows GUI</title>
</head>
<body>
<script>
window.location = "./src/pages/page1.html";
</script>
</body>
</html>
54 changes: 54 additions & 0 deletions Catalyss/wwwroot/alt-theme/src/pages/page1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" oncontextmenu="return false" onkeydown="return false;">
<head>
<title>Windows UI</title>
<meta charset="UTF-8" />
<meta name="theme-color" content="#EEE" />
<meta name="mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="manifest" href="../../manifest.json" />
<link rel="shortcut icon" href="../public/favicon.ico" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/config/app-config.css" rel="stylesheet" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/windows-ui.min.css" rel="stylesheet" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/icons/winui-icons.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<div class="app-navbar-wrap" id="NavBarMain">
<div class="app-navbar-topbar-mobile">
<span class="app-navbar-toggler" data-win-toggle="navbar-left" data-win-target="#NavBarMain"></span>
<div><span class="app-navbar-name">Windows UI</span></div>
</div>
<nav class="app-navbar">
<div class="app-navbar-header">
<span class="app-navbar-toggler" data-win-toggle="navbar-left" data-win-target="#NavBarMain" aria-controls="NavBarMain" aria-label="Toggle navigation"></span>
<span class="app-navbar-name">Windows UI</span>
</div>
<ul class="app-navbar-list" id="app-navbar-list">
<label class="app-navbar-theme-switch">
<input id="app-navbar-theme-switch" type="checkbox" checked>
<div class="app-navbar-theme-switch-icon"></div>
<span id="app-navbar-theme-switch-text">Day Mode</span>
</label>
<li class="app-navbar-list-item">
<a href="#" class="active">
<img src="../public/mountain.jpg">
<span>Page1</span>
</a>
</li>
<li class="app-navbar-list-item">
<a href="./page2.html" class="unactive">
<i class="icons10-puzzle"></i>
<span>Page2</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="app-page-container has-padding">
<h1>Page1</h1>
<p>Uhhh lorem ipsum LOL</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/windows-ui.min.js" crossorigin="anonymous"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions Catalyss/wwwroot/alt-theme/src/pages/page2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" oncontextmenu="return false" onkeydown="return false;">
<head>
<title>Windows UI</title>
<meta charset="UTF-8" />
<meta name="theme-color" content="#EEE" />
<meta name="mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="manifest" href="../../manifest.json" />
<link rel="shortcut icon" href="../public/favicon.ico" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/config/app-config.css" rel="stylesheet" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/windows-ui.min.css" rel="stylesheet" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/icons/winui-icons.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<div class="app-navbar-wrap" id="NavBarMain">
<div class="app-navbar-topbar-mobile">
<span class="app-navbar-toggler" data-win-toggle="navbar-left" data-win-target="#NavBarMain"></span>
<div><span class="app-navbar-name">Windows UI</span></div>
</div>
<nav class="app-navbar">
<div class="app-navbar-header">
<span class="app-navbar-toggler" data-win-toggle="navbar-left" data-win-target="#NavBarMain" aria-controls="NavBarMain" aria-label="Toggle navigation"></span>
<span class="app-navbar-name">Windows UI</span>
</div>
<ul class="app-navbar-list" id="app-navbar-list">
<label class="app-navbar-theme-switch">
<input id="app-navbar-theme-switch" type="checkbox" checked>
<div class="app-navbar-theme-switch-icon"></div>
<span id="app-navbar-theme-switch-text">Day Mode</span>
</label>
<li class="app-navbar-list-item">
<a href="./page1.html" class="unactive">
<img src="../public/mountain.jpg">
<span>Page1</span>
</a>
</li>
<li class="app-navbar-list-item">
<a href="#" class="active">
<i class="icons10-puzzle"></i>
<span>Page2</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="app-page-container has-padding">
<h1>Page2</h1>
<p>Uhhh lorem ipsum LOL</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/windows-ui.min.js" crossorigin="anonymous"></script>
</body>
</html>
Binary file added Catalyss/wwwroot/alt-theme/src/public/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Catalyss/wwwroot/assets/ButtonCalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@

function UnloadDll() {
window.external.sendMessage('EjectMonoDll');
}

function StartAtlyss() {
window.external.sendMessage('StartGame');
}

function QuitAtlyss() {
window.external.sendMessage('QuitGame');
}
2 changes: 1 addition & 1 deletion Catalyss/wwwroot/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body {
/* Center Box */
.center-box {
position: center;
width: 400px;
width: 550px;
height: 400px;
background-color: rgba(30, 30, 30, 0.8);
border-radius: 20px;
Expand Down
6 changes: 5 additions & 1 deletion Catalyss/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Black GUI</title>
<title>GUI</title>
<link rel="stylesheet" href="assets/main.css">
</head>
<body>
Expand All @@ -18,6 +18,10 @@
<button class="action-btn" onclick="InjectDll()">INJECT</button>
&nbsp; &nbsp;
<button class="action-btn" onclick="UnloadDll()">UNLOAD</button>
&nbsp; &nbsp;
<button class="action-btn" onclick="StartAtlyss()">LAUNCH GAME</button>
&nbsp; &nbsp;
<button class="action-btn" onclick="QuitAtlyss()">CLOSE GAME</button>
</div>
<script src="assets/script.js"></script>
<script src="assets/ButtonCalls.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions CatalyssMod/CatalyssMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;8618</NoWarn>
<NoWarn>1701;1702;8618;8600;8603</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;8618</NoWarn>
<NoWarn>1701;1702;8618;8600;8603</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit db5f9cf

Please sign in to comment.