Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
67b59ce
Initial Macos Support
thesupersonic16 Mar 5, 2025
8c956b4
Initial Macos Support
to-fuu Mar 6, 2025
6f941d9
Add building instructions
to-fuu Mar 6, 2025
409d8a0
Make self contained
to-fuu Mar 7, 2025
70d5b0b
Remove log
to-fuu Mar 7, 2025
6aee6fe
add build command
to-fuu Mar 7, 2025
2a4b84f
remove Dotnet.Bundle dependencies
to-fuu Mar 7, 2025
db07d96
Update icon
to-fuu Mar 7, 2025
e0ed516
Disable detecting UnleashedRecomp
to-fuu Mar 7, 2025
f1e7c13
Update build docs
to-fuu Mar 7, 2025
b8b3adb
Fix menu bar showing Avalonia Application
to-fuu Mar 7, 2025
a2ae2a1
Support URI Schemes
to-fuu Mar 7, 2025
73e5474
Support URI Schemes
to-fuu Mar 7, 2025
2993c29
Fix build command
to-fuu Mar 8, 2025
e758958
change bash to zsh
to-fuu Mar 8, 2025
1d2f7ea
change bash to zsh
to-fuu Mar 8, 2025
9fab194
update the build command
to-fuu Mar 8, 2025
e4bc8ad
change build command ro release
to-fuu Mar 8, 2025
8459403
Merge remote-tracking branch 'origin' into macos-support
to-fuu Mar 20, 2025
466a041
ignore output and idea folder
to-fuu Mar 20, 2025
b88eacd
move .icns file to macos folder
to-fuu Mar 20, 2025
f11c76a
move info.plist out
to-fuu Mar 20, 2025
56f7431
update locating on macos
to-fuu Mar 20, 2025
b6b158e
use the game's ID
to-fuu Mar 20, 2025
9bb00f0
change to macOS
to-fuu Mar 20, 2025
37f9d2d
update docs
to-fuu Mar 20, 2025
bc7f08a
update output folder
to-fuu Mar 20, 2025
dbe4881
fix rebase
to-fuu Mar 20, 2025
a3b7422
remove version requirement
to-fuu Mar 20, 2025
1b08a77
improve build docs
to-fuu Mar 20, 2025
0a3be97
remove version from docs
to-fuu Mar 20, 2025
25decd2
remove empty space
to-fuu Mar 20, 2025
964a1d7
use Executable for root
to-fuu Mar 20, 2025
c456b48
remove empty line
to-fuu Mar 20, 2025
32b4237
update build release
to-fuu Mar 20, 2025
83ace70
revert changes
to-fuu Mar 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
version:
description: 'Version'
required: true
default: '8.0.0.2'
default: '8.0.0.3'
tag:
description: 'Tag'
required: true
default: '8.0.0-beta2'
default: '8.0.0-beta3'
prerelease:
description: 'Prerelease'
required: true
Expand All @@ -19,6 +19,8 @@ on:
env:
PROJECT_PATH: ./Source/HedgeModManager.UI/HedgeModManager.UI.csproj
FLATPAK_ID: io.github.hedge_dev.hedgemodmanager
MACOS_ID: com.hedge_dev.hedgemodmanager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this is using com.hedge_dev.hedgemodmanager? Is io.github.hedge_dev.hedgemodmanager or com.github.hedge_dev.hedgemodmanager usable here? hedge-dev does not own/control hedge_dev.com.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ID can be anything on macOS as long as the code is consistent. I've seen com, org, and io in Mac app IDs before. I would make it the same as the Flatpak ID for consistency.

MACOS_BUILD_SCRIPT: ./macos/generate-bundle.bash
GENERATOR_URL: https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/refs/heads/master/dotnet/flatpak-dotnet-generator.py
DOTNET_VERSION: 8
DOTNET_CLI_HOME: /tmp/.dotnet
Expand Down Expand Up @@ -82,12 +84,19 @@ jobs:

- name: Build Flatpak Bundle
run: flatpak build-bundle repo ./flatpak/${{env.FLATPAK_ID}}.flatpak ${{env.FLATPAK_ID}}

- name: osx-arm64 Build
run: dotnet publish -p:PublishProfile=osx-arm64 -c Release -p:AssemblyVersion=${{ github.event.inputs.version }} -p:FileVersion=${{ github.event.inputs.version }} -o ./output/osx-arm64 ${{env.PROJECT_PATH}} -p:UseAppHost=true

- name: Build osx-arm64 Bundle
run: /bin/bash ${{env.MACOS_BUILD_SCRIPT}} ${{ github.event.inputs.version }} ${{ env.MACOS_ID }}

- name: Prepare Release
run: |
mkdir -p ./release
mv ./output/win-x64/HedgeModManager.UI.exe ./release/HedgeModManager.exe
mv ./flatpak/${{env.FLATPAK_ID}}.flatpak ./release/${{env.FLATPAK_ID}}.flatpak
mv ./output/osx-arm64/HedgeModManager.app ./release/HedgeModManager.app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can bundles support multi-arch? Like HedgeModManager.app being runnable on x86_64 and arm64 systems. If possible, might be worth adding unless it inflates the file size too much.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS bundles have supported multi-arch since the PowerPC -> Intel transition; the bundle doesn't have to be exclusively arm64. Other native-built projects I've seen (to give an example, ioquake3) separately build the x86_64 and arm64 executables and any dependencies, then combine them using the lipo command to put in the bundle. If this build process produces a standard Mach-O executable, then I think that's the best way to go about it.


- name: Create Release
uses: softprops/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,4 @@ _Pvt_Extensions/
ModelManifest.xml

Ignored/
.DS_Store
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ A mod manager for Hedgehog Engine games on PC.
- [Installation](#installation)
- [Windows](#windows)
- [Linux/Steam Deck](#linuxsteam-deck)
- [Building](#building)
- [Frequently Asked Questions](#frequently-asked-questions)
- [Bug/Issue Reporting](#bugissue-reporting)
- [Contribute](#contribute)
Expand Down Expand Up @@ -57,6 +58,9 @@ Download the Flatpak bundle (file ending with .flatpak) from the [releases page]
> [!NOTE]
> Currently Hedge Mod Manager is not officially available to be downloaded from any package managers.

### Building
[Check out the building instructions here](/docs/BUILDING.md).

### Frequently Asked Questions
- Where can I install mods?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<ProjectReference Include="..\HedgeModManager\HedgeModManager.csproj" />
</ItemGroup>

</Project>
</Project>
3 changes: 2 additions & 1 deletion Source/HedgeModManager.UI/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:local="using:HedgeModManager.UI"
xmlns:themes="using:HedgeModManager.UI.Themes"
xmlns:materialIcons="using:Material.Icons.Avalonia"
RequestedThemeVariant="{x:Static themes:Themes.Darker}">
RequestedThemeVariant="{x:Static themes:Themes.Darker}"
Name="Hedge Mod Manager">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->

<Application.Resources>
Expand Down
Binary file added Source/HedgeModManager.UI/Assets/AppIcon.icns
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/HedgeModManager.UI/HedgeModManager.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">8.0.0.2</AssemblyVersion>
<FileVersion Condition="'$(FileVersion)' == ''">8.0.0.2</FileVersion>
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">8.0.0.3</AssemblyVersion>
<FileVersion Condition="'$(FileVersion)' == ''">8.0.0.3</FileVersion>
</PropertyGroup>
<PropertyGroup Label="Avalonia">
<AvaloniaXamlReportImportance>Low</AvaloniaXamlReportImportance>
Expand Down Expand Up @@ -60,4 +60,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<RuntimeIdentifiers>osx-arm64</RuntimeIdentifiers>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<RuntimeIdentifiers>osx-x64</RuntimeIdentifiers>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
24 changes: 18 additions & 6 deletions Source/HedgeModManager.UI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public partial class MainWindowViewModel : ViewModelBase
[ObservableProperty] private string _lastLog = "";
[ObservableProperty] private string _message = "";
[ObservableProperty] private TabInfo? _currentTabInfo;
[ObservableProperty] private TabInfo[] _tabInfos =
[ObservableProperty] private TabInfo[] _tabInfos =
[new ("Loading"), new("Setup"), new("Mods"), new("Codes"), new("Settings"), new("About"), new("Test")];
[ObservableProperty] private ObservableCollection<Modal> _modals = [];
[ObservableProperty] private ObservableCollection<IMod> _mods = [];
Expand Down Expand Up @@ -82,6 +82,7 @@ public MainWindowViewModel(UILogger logger, List<LanguageEntry> languages)
Logger.Information($"Startup Date: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} (UTC)");
Logger.Debug($"IsWindows: {OperatingSystem.IsWindows()}");
Logger.Debug($"IsLinux: {OperatingSystem.IsLinux()}");
Logger.Debug($"IsMacos: {OperatingSystem.IsMacOS()}");
Logger.Debug($"RID: {RuntimeInformation.RuntimeIdentifier}");
Logger.Debug($"FlatpakID: \"{Program.FlatpakID}\" ({!string.IsNullOrEmpty(Program.FlatpakID)})");
Logger.Debug($"InstallLocation: {Program.InstallLocation}");
Expand Down Expand Up @@ -109,7 +110,7 @@ public async Task CheckForManagerUpdatesAsync()
.OnRun(async (d, c) =>
{
d.CreateProgress().ReportMax(-1);

var (update, status) = await Updater.CheckForUpdates();
if (update == null)
{
Expand Down Expand Up @@ -337,7 +338,7 @@ await CreateSimpleDownload("Download.Text.InstallModLoader", "Failed to install
var gameGeneric = GetModdableGameGeneric();
if (gameGeneric == null || gameGeneric.ModLoader == null)
return;

if (install == true)
_ = await gameGeneric.ModLoader.InstallAsync();
else
Expand Down Expand Up @@ -385,7 +386,7 @@ public async Task SwitchProfileAsync()

IsBusy = true;

await CreateSimpleDownload("Download.Text.SwitchProfileSave", "Failed to switch profiles",
await CreateSimpleDownload("Download.Text.SwitchProfileSave", "Failed to switch profiles",
async (d, p, c) =>
{
var backupProgress = d.CreateProgress();
Expand Down Expand Up @@ -453,7 +454,18 @@ public async Task SaveAsync(bool setBusy = true)

await SelectedGame.Game.ModDatabase.Save();
if (SelectedGame.Game.ModLoaderConfiguration is ModLoaderConfiguration config)
await config.Save(Path.Combine(SelectedGame.Game.Root, "cpkredir.ini"));
{
// For macos, save under the user's Application Support directory.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*macOS

if (OperatingSystem.IsMacOS())
{
var appSupportDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
await config.Save(Path.Combine( appSupportDir,SelectedGame.Game.Executable, "cpkredir.ini"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await config.Save(Path.Combine(appSupportDir, SelectedGame.Game.Executable, "cpkredir.ini"));

}
else
{
await config.Save(Path.Combine(SelectedGame.Game.Root, "cpkredir.ini"));
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats going on here? cpkredir.ini must be saved in the game's root. If the file must be next to the game executable, then make sure to set Root to the correct path in the locator.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macos executables usually live within the Applications folder (or anywhere you place them) however other files will live in the Application Support folder.
For the mods to load, cpkredir.ini must live inside Application Support, inside the game's folder.
The folder name matches the bundle name.
Previously it was UnleashedRecomp.app. Apparently it was changed to Unleashed Recompiled.app
I will double check and update the values accordingly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the root is set to the directory where the ini is located, this needs to be done in the locator. Since this is different from the app install, change the root directory existance check to check if the .app exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should not exist, please remove it, and later when the Unleashed Recompield macOS code gets approved you can then go fix the pathing issues in the locator.

While naming can be confusing, Root on non-Windows games is where the mod configuration gets saved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the root is set to the directory where the ini is located, this needs to be done in the locator. Since this is different from the app install, change the root directory existance check to check if the .app exist.

Previously I believe the root was used in the run command so by default I set as thr Applications dir. now that that was changed I agree it makes more sense to change this to where the .ini lives aka in Application Support

}
catch (UnauthorizedAccessException e)
{
Expand Down Expand Up @@ -889,7 +901,7 @@ public async Task StartServerAsync()
ServerStatus = 1;
while (ServerStatus == 1)
{
using var server = new NamedPipeServerStream(Program.PipeName, PipeDirection.In,
using var server = new NamedPipeServerStream(Program.PipeName, PipeDirection.In,
NamedPipeServerStream.MaxAllowedServerInstances,
PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
Logger.Debug("Waiting for connection");
Expand Down
40 changes: 31 additions & 9 deletions Source/HedgeModManager/GameSimple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

namespace HedgeModManager;

public class GameSimple(string platform, string id, string name, string root, string? executable, string nativeOS, string launchCommand, string launchCommandArgs) : IGame
public class GameSimple(
string platform,
string id,
string name,
string root,
string? executable,
string nativeOS,
string launchCommand,
string launchCommandArgs) : IGame
{
public string Platform { get; set; } = platform;
public string ID { get; set; } = id;
Expand All @@ -20,15 +28,29 @@ public class GameSimple(string platform, string id, string name, string root, st
public Task Run(string? launchArgs, bool useLauncher)
{
launchArgs ??= LaunchCommandArgs;

Process.Start(new ProcessStartInfo
if (OperatingSystem.IsMacOS())
{
FileName = LaunchCommand,
Arguments = launchArgs ?? string.Empty,
WorkingDirectory = Root,
UseShellExecute = true
});
// The command to launch macos apps is

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*macOS

// open -a path/to/my/app/appname
// When the app is inside the Application folder only the app's name is needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said, I think it would be better to opt for the full file path for specificity.

Process.Start(new ProcessStartInfo
{
FileName = "open",
Arguments = $"-a {Executable}",
UseShellExecute = false
});
}
else
{
Process.Start(new ProcessStartInfo
{
FileName = LaunchCommand,
Arguments = launchArgs ?? string.Empty,
WorkingDirectory = Root,
UseShellExecute = true
});
}

return Task.CompletedTask;
}
}
}
2 changes: 1 addition & 1 deletion Source/HedgeModManager/HedgeModManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
51 changes: 36 additions & 15 deletions Source/HedgeModManager/ModdableGameLocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace HedgeModManager;

using Foundation;
using HedgeModManager.Epic;
using HedgeModManager.Properties;
Expand All @@ -16,30 +17,30 @@ public class ModdableGameLocator
ID = "SonicGenerations",
ModLoaderName = "HE1ModLoader",
ModLoaderFileName = "d3d9.dll",
ModLoaderIncompatibleFileNames = [ "dinput8.dll" ],
ModLoaderIncompatibleFileNames = ["dinput8.dll"],
ModLoaderDownloadURL = Resources.HE1MLDownloadURL,
Is64Bit = false,
PlatformInfos = new()
{
{ "Steam", new ("71340", "SonicGenerations.exe") }
{ "Steam", new("71340", "SonicGenerations.exe") }
}
},
new()
{
ID = "SonicLostWorld",
ModLoaderName = "HE1ModLoader",
ModLoaderFileName = "d3d9.dll",
ModLoaderIncompatibleFileNames = [ "dinput8.dll" ],
ModLoaderIncompatibleFileNames = ["dinput8.dll"],
ModLoaderDownloadURL = Resources.HE1MLDownloadURL,
Is64Bit = false,
PlatformInfos = new() { { "Steam", new ("329440", "slw.exe") } }
PlatformInfos = new() { { "Steam", new("329440", "slw.exe") } }
},
new()
{
ID = "SonicForces",
ModLoaderName = "HE2ModLoader",
ModLoaderFileName = "d3d11.dll",
ModLoaderIncompatibleFileNames = [ "dinput8.dll" ],
ModLoaderIncompatibleFileNames = ["dinput8.dll"],
ModLoaderDownloadURL = Resources.HE2MLDownloadURL,
PlatformInfos = new() { { "Steam", new ("637100", Path.Combine("build", "main", "projects", "exec", "Sonic Forces.exe")) } }
},
Expand All @@ -49,15 +50,15 @@ public class ModdableGameLocator
ModLoaderName = "HE2ModLoader",
ModLoaderFileName = "dinput8.dll",
ModLoaderDownloadURL = Resources.HE2MLDownloadURL,
PlatformInfos = new() { { "Steam", new ("1259790", "PuyoPuyoTetris2.exe") } }
PlatformInfos = new() { { "Steam", new("1259790", "PuyoPuyoTetris2.exe") } }
},
new()
{
ID = "Tokyo2020",
ModLoaderName = "HE2ModLoader",
ModLoaderFileName = "dinput8.dll",
ModLoaderDownloadURL = Resources.HE2MLDownloadURL,
PlatformInfos = new() { { "Steam", new ("981890", "musashi.exe") } }
PlatformInfos = new() { { "Steam", new("981890", "musashi.exe") } }
},
new()
{
Expand Down Expand Up @@ -91,8 +92,8 @@ public class ModdableGameLocator
ModLoaderDownloadURL = Resources.HE2MLDownloadURL,
PlatformInfos = new()
{
{ "Steam", new ("1237320", "SonicFrontiers.exe") },
{ "Epic", new ("c5ca98fa240c4eb796835f97126df8e7", "SonicFrontiers.exe") }
{ "Steam", new("1237320", "SonicFrontiers.exe") },
{ "Epic", new("c5ca98fa240c4eb796835f97126df8e7", "SonicFrontiers.exe") }
}
},
// NOTE: Mod loader is not ready yet
Expand All @@ -118,8 +119,8 @@ public class ModdableGameLocator
ModDatabaseDirectoryName = "mods_shadow",
PlatformInfos = new()
{
{ "Steam", new ("2513280", "SONIC_X_SHADOW_GENERATIONS.exe") },
{ "Epic", new ("a88805d3fbec4ca9bfc248105f6adb0a", "SONIC_X_SHADOW_GENERATIONS.exe") }
{ "Steam", new("2513280", "SONIC_X_SHADOW_GENERATIONS.exe") },
{ "Epic", new("a88805d3fbec4ca9bfc248105f6adb0a", "SONIC_X_SHADOW_GENERATIONS.exe") }
}
},
new()
Expand All @@ -128,9 +129,11 @@ public class ModdableGameLocator
SupportsCodes = false,
PlatformInfos = new()
{
{ "Windows", new (string.Empty, "SOFTWARE\\UnleashedRecomp") },
{ "Flatpak", new ("io.github.hedge_dev.unleashedrecomp", "unleashedrecomp")},
{ "Desktop", new ("UnleashedRecomp", "unleashedrecomp")}
{ "Windows", new(string.Empty, "SOFTWARE\\UnleashedRecomp") },
{ "Flatpak", new("io.github.hedge_dev.unleashedrecomp", "unleashedrecomp") },
{ "Desktop", new("UnleashedRecomp", "unleashedrecomp") },
// Uncomment to detect on mac
//{ "Macos", new("UnleashedRecomp", "UnleashedRecomp") },
}
}
];
Expand Down Expand Up @@ -191,7 +194,7 @@ public static List<IModdableGame> LocateGames()
Is64Bit = gameInfo.Is64Bit
};
game.ModDatabase.SupportsCodeCompilation = gameInfo.SupportsCodes;
game.ModLoader = new ModLoaderGeneric(game, game.ModLoaderName,
game.ModLoader = new ModLoaderGeneric(game, game.ModLoaderName,
gameInfo.ModLoaderFileName, gameInfo.ModLoaderIncompatibleFileNames,
gameInfo.ModLoaderDownloadURL, gameInfo.Is64Bit);
if (gameInfo.ModDatabaseDirectoryName != null)
Expand Down Expand Up @@ -304,6 +307,24 @@ public static List<IModdableGame> LocateGames()
games.Add(game);
}
}
if (OperatingSystem.IsMacOS() && gameInfo.PlatformInfos.TryGetValue("Macos", out var macosDesktopInfo))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct Macos -> macOS

{
// The root is actually not necessary on macos

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like there should still be a root here as by default the data for unleashed is held in "~/Library/Application Support/UnleashedRecomp", and having the mod folder there makes it more similar to other platforms. maybe try something like this

Suggested change
// The root is actually not necessary on macos
string root = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library", "Application Support", "UnleashedRecomp");
if (Directory.Exists(root))
{
var gameSimple = new GameSimple(
"Macos", macosDesktopInfo.ID, gameInfo.ID,
root, macosDesktopInfo.Executable,
"Macos", "", ""
);
var game = new ModdableGameGeneric(gameSimple)
{
SupportsDirectLaunch = true,
SupportsLauncher = false,
Is64Bit = gameInfo.Is64Bit
};
game.ModDatabase.SupportsCodeCompilation = gameInfo.SupportsCodes;
games.Add(game);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.
Will try the changes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that Application Support should be accessed using Environment.SpecialFolder.ApplicationData

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried to pull and build the project, it didn't work right. It wouldn't save config files or be able to boot the game. I tried fixing the code myself, but it still had trouble detecting mods and saving.

The suggested fixes above worked, and HMM runs great for me.

Copy link
Member

@thesupersonic16 thesupersonic16 Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made changes to GameSimple, though it should be simple to work around for macOS. What I changed is making it work a bit more like running a command instead of executable and arguments.

Also please change all the Macos to macOS or MacOS, I think using the proper capitalisation would be good here.


var gameSimple = new GameSimple(
"Macos", macosDesktopInfo.ID, gameInfo.ID,
"/Applications", macosDesktopInfo.Executable, "Macos", ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to be careful assuming /Applications. Things can also be installed to ~/Applications

, "");

var game = new ModdableGameGeneric(gameSimple)
{
SupportsDirectLaunch = true,
SupportsLauncher = false,
Is64Bit = gameInfo.Is64Bit
};
game.ModDatabase.SupportsCodeCompilation = gameInfo.SupportsCodes;
games.Add(game);
}
}

return games;
Expand Down
Loading