-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using HarmonyLib; | ||
using NewHorizons.External; | ||
using QSB; | ||
using QSB.Patches; | ||
using QSB.SaveSync; | ||
using QSB.Utility; | ||
|
||
namespace QSBNH.Patches; | ||
|
||
/// <summary> | ||
/// pretends to be a new profile when in multiplayer so nh saves its data to a new place | ||
/// </summary> | ||
public class NewHorizonsDataPatches : QSBPatch | ||
{ | ||
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart; | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(NewHorizonsData), nameof(NewHorizonsData.GetProfileName))] | ||
public static bool NewHorizonsData_GetProfileName(out string __result) | ||
{ | ||
if (QSBCore.IsInMultiplayer) | ||
{ | ||
DebugLog.DebugWrite($"using fake multiplayer profile for nh"); | ||
__result = QSBStandaloneProfileManager.SharedInstance?.currentProfile?.profileName + "_mult"; | ||
} | ||
else | ||
{ | ||
__result = QSBStandaloneProfileManager.SharedInstance?.currentProfile?.profileName; | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters