mirror of
https://github.com/Xevion/RimWorld_ResearchWhatever.git
synced 2025-12-09 04:08:29 -06:00
1.1.4
This commit is contained in:
Binary file not shown.
@@ -3,6 +3,7 @@ using RimWorld;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -14,6 +15,7 @@ namespace ResearchWhatever.Patches
|
|||||||
[HarmonyPatch(typeof(StudyManager), "StudyAnomaly")]
|
[HarmonyPatch(typeof(StudyManager), "StudyAnomaly")]
|
||||||
static class StudyManager_StudyAnomaly_ResearchWhateverPatch
|
static class StudyManager_StudyAnomaly_ResearchWhateverPatch
|
||||||
{
|
{
|
||||||
|
private static readonly PropertyInfo LStudyCompleted = AccessTools.Property(typeof(ITab_StudyNotes), "StudyCompleted");
|
||||||
internal static void Prefix(Thing studiedThing, Pawn studier, float knowledgeAmount, KnowledgeCategoryDef knowledgeCategory)
|
internal static void Prefix(Thing studiedThing, Pawn studier, float knowledgeAmount, KnowledgeCategoryDef knowledgeCategory)
|
||||||
{
|
{
|
||||||
if (!ModsConfig.AnomalyActive)
|
if (!ModsConfig.AnomalyActive)
|
||||||
@@ -47,11 +49,23 @@ namespace ResearchWhatever.Patches
|
|||||||
CompHoldingPlatformTarget compHoldingPlatformTarget = studiedThing.TryGetComp<CompHoldingPlatformTarget>();
|
CompHoldingPlatformTarget compHoldingPlatformTarget = studiedThing.TryGetComp<CompHoldingPlatformTarget>();
|
||||||
|
|
||||||
bool b = false;
|
bool b = false;
|
||||||
if (compStudiable != null && compStudiable.Completed)
|
if (compStudiable != null)
|
||||||
{
|
if (compStudiable.Completed)
|
||||||
compStudiable.studyEnabled = false;
|
{
|
||||||
b = true;
|
compStudiable.studyEnabled = false;
|
||||||
}
|
b = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (studiedThing.GetInspectTabs().FirstOrDefault(
|
||||||
|
x => x is ITab_StudyNotes
|
||||||
|
|| x.GetType().IsSubclassOf(typeof(ITab_StudyNotes))) is ITab_StudyNotes tab
|
||||||
|
&& (bool)LStudyCompleted.GetValue(tab))
|
||||||
|
{
|
||||||
|
compStudiable.studyEnabled = false;
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
if (compHoldingPlatformTarget != null)
|
if (compHoldingPlatformTarget != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
1.1.3
|
1.1.4
|
||||||
|
- studiable objects now also auto-toggle off;
|
||||||
|
|
||||||
|
1.1.3
|
||||||
- mod now automatically picks CHEAPEST anomaly research;
|
- mod now automatically picks CHEAPEST anomaly research;
|
||||||
- if anomly is fully studied and nothing left to research, study will be automatically toggled off;
|
- if anomly is fully studied and nothing left to research, study will be automatically toggled off;
|
||||||
- cheapest project now takes into account already made progress;
|
- cheapest project now takes into account already made progress;
|
||||||
|
|||||||
Reference in New Issue
Block a user