Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Research Tree (Continued) #806

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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