mirror of
https://github.com/Xevion/RimWorld_ResearchWhatever.git
synced 2025-12-06 01:16:11 -06:00
1.1.5
This commit is contained in:
Binary file not shown.
@@ -15,7 +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");
|
//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)
|
||||||
@@ -42,29 +42,31 @@ namespace ResearchWhatever.Patches
|
|||||||
var projs = DefDatabase<ResearchProjectDef>.AllDefsListForReading.Where((ResearchProjectDef x) => x.CanStartNow && x.knowledgeCategory == knowledgeCategory).ToList();
|
var projs = DefDatabase<ResearchProjectDef>.AllDefsListForReading.Where((ResearchProjectDef x) => x.CanStartNow && x.knowledgeCategory == knowledgeCategory).ToList();
|
||||||
if (projs.NullOrEmpty() && knowledgeCategory.overflowCategory != null)
|
if (projs.NullOrEmpty() && knowledgeCategory.overflowCategory != null)
|
||||||
projs = DefDatabase<ResearchProjectDef>.AllDefsListForReading.Where((ResearchProjectDef x) => x.CanStartNow && x.knowledgeCategory == knowledgeCategory.overflowCategory).ToList();
|
projs = DefDatabase<ResearchProjectDef>.AllDefsListForReading.Where((ResearchProjectDef x) => x.CanStartNow && x.knowledgeCategory == knowledgeCategory.overflowCategory).ToList();
|
||||||
|
|
||||||
if (projs.NullOrEmpty())
|
if (projs.NullOrEmpty())
|
||||||
{
|
{
|
||||||
CompStudiable compStudiable = studiedThing.TryGetComp<CompStudiable>();
|
CompStudiable compStudiable = studiedThing.TryGetComp<CompStudiable>();
|
||||||
CompHoldingPlatformTarget compHoldingPlatformTarget = studiedThing.TryGetComp<CompHoldingPlatformTarget>();
|
CompHoldingPlatformTarget compHoldingPlatformTarget = studiedThing.TryGetComp<CompHoldingPlatformTarget>();
|
||||||
|
|
||||||
bool b = false;
|
bool b = false;
|
||||||
if (compStudiable != null)
|
if (compStudiable != null)
|
||||||
if (compStudiable.Completed)
|
if (compStudiable.Props.Completable)
|
||||||
{
|
if (compStudiable.Completed)
|
||||||
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;
|
compStudiable.studyEnabled = false;
|
||||||
b = true;
|
b = true;
|
||||||
}
|
}
|
||||||
|
else { }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var compStudyUnlocks = studiedThing.TryGetComp<CompStudyUnlocks>();
|
||||||
|
if (compStudyUnlocks != null)
|
||||||
|
{
|
||||||
|
if (compStudyUnlocks.Completed)
|
||||||
|
{
|
||||||
|
compStudiable.studyEnabled = false;
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (compHoldingPlatformTarget != null)
|
if (compHoldingPlatformTarget != null)
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
1.1.4
|
1.1.5
|
||||||
|
- fixed studiable objects would toggle off even if there is still something to study in their specific journal;
|
||||||
|
|
||||||
|
1.1.4
|
||||||
- studiable objects now also auto-toggle off;
|
- studiable objects now also auto-toggle off;
|
||||||
|
|
||||||
1.1.3
|
1.1.3
|
||||||
|
|||||||
Reference in New Issue
Block a user