Skip to content

Commit

Permalink
Merge pull request #806 from zymex22/issue757
Browse files Browse the repository at this point in the history
Added support for Research Tree (Continued)
  • Loading branch information
Sn1p3rr3c0n authored Jul 25, 2024
2 parents 896e354 + ea423b7 commit 2f30b84
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
34 changes: 18 additions & 16 deletions Source/ProjectRimFactory/Common/PRF_CustomizeDefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,28 @@ public static void ToggleLiteMode(bool remove = true)

ArchitectMenu_ClearCache();

if (ProjectRimFactory_ModComponent.ModSupport_ReserchPal)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPal_ResetLayout.Invoke(null, null);
}
else if (ProjectRimFactory_ModComponent.ModSupport_ReserchPowl)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPowl_ResetLayout.Invoke(null, null);
}
ModSupportResetLayout();
}




}

private static void ModSupportResetLayout()
{
if (ProjectRimFactory_ModComponent.ModSupport_ReserchPal)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPal_ResetLayout.Invoke(null, null);
}
else if (ProjectRimFactory_ModComponent.ModSupport_ReserchPowl)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPowl_ResetLayout.Invoke(null, null);
}
else if (ProjectRimFactory_ModComponent.ModSupport_ResearchTreeContinued)
{
ProjectRimFactory_ModComponent.ModSupport_ResearchTreeContinued_ResetLayout.Invoke(null, [true]);
}
}

private static void clearRecipesCache()
Expand Down Expand Up @@ -226,14 +235,7 @@ private static void resetResearchManager_progress()
}
if (Current.Game?.researchManager != null) SAL3.ReflectionUtility.ResearchManager_progress.SetValue(Current.Game.researchManager, progress);

if (ProjectRimFactory_ModComponent.ModSupport_ReserchPal)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPal_ResetLayout.Invoke(null, null);
}
else if (ProjectRimFactory_ModComponent.ModSupport_ReserchPowl)
{
ProjectRimFactory_ModComponent.ModSupport_ReserchPowl_ResetLayout.Invoke(null, null);
}
ModSupportResetLayout();

}

Expand Down
15 changes: 15 additions & 0 deletions Source/ProjectRimFactory/Common/ProjectRimFactory_ModComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public ProjectRimFactory_ModComponent(ModContentPack content) : base(content)

public static System.Reflection.MethodInfo ModSupport_ReserchPal_ResetLayout = null;
public static System.Reflection.MethodInfo ModSupport_ReserchPowl_ResetLayout = null;
public static System.Reflection.MethodInfo ModSupport_ResearchTreeContinued_ResetLayout = null;
public static bool ModSupport_ReserchPal = false;
public static bool ModSupport_ReserchPowl = false;
public static bool ModSupport_ResearchTreeContinued = false;

public static bool ModSupport_SeedsPlease = false;
public static bool ModSupport_SeedsPleaseLite = false;
Expand Down Expand Up @@ -141,7 +143,20 @@ private void LoadModSupport()
{
Log.Warning("Project Rimfactory - Failed to added Support for ResearchPowl when using Lite Mode");
}
}else if (ModLister.HasActiveModWithName("Research Tree (Continued)"))
{
ModSupport_ResearchTreeContinued_ResetLayout = AccessTools.Method("FluffyResearchTree.Tree:Reset");
if (ModSupport_ResearchTreeContinued_ResetLayout != null)
{
Log.Message("Project Rimfactory - added Support for Research Tree (Continued) when using Lite Mode");
ModSupport_ResearchTreeContinued = true;
}
else
{
Log.Warning("Project Rimfactory - Failed to added Support for Research Tree (Continued) when using Lite Mode");
}
}

if (ModLister.HasActiveModWithName("[KV] Save Storage, Outfit, Crafting, Drug, & Operation Settings [1.4]"))
{
//Get the Local Transpilers
Expand Down

0 comments on commit 2f30b84

Please sign in to comment.