Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed compatibility issues by adding dynamic prerequisite setting for Blueprints - Updated "About" with note that mod should be loaded after any Research-altering mods
- Loading branch information
1 parent
4be9ae0
commit 9cce293
Showing
24 changed files
with
178 additions
and
204 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
Binary file not shown.
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,3 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
</configuration> |
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
Binary file modified
BIN
+3 KB
(130%)
RELEASE/TechnologyBlueprints/Assemblies/RimworldDiscoverTechs.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
RELEASE/TechnologyBlueprints/Assemblies/RimworldDiscoverTechs.dll.config
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,3 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
</configuration> |
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
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+24 KB
(100%)
Sources/.vs/RimworldDiscoverTechsMod/v15/Server/sqlite3/storage.ide
Binary file not shown.
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
60 changes: 60 additions & 0 deletions
60
Sources/RimworldDiscoverTechs/Classes/RimworldDiscoverTechsClass.cs
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,60 @@ | ||
using Verse; | ||
using System; | ||
using RimWorld; | ||
using System.Collections.Generic; | ||
|
||
namespace RimworldDiscoverTechs | ||
{ | ||
[StaticConstructorOnStartup] | ||
class RimworldDiscoverTechsClass | ||
{ | ||
static RimworldDiscoverTechsClass() | ||
{ | ||
Log.Message("### Technology Blueprints mod loaded. ###"); | ||
|
||
// Go through research projects, create lists according to techLevels, then add those projectDefs as prerequisites to each technology blueprint researchDef accordingly. | ||
// First we create lists | ||
List<ResearchProjectDef> listOfBPs = new List<ResearchProjectDef>(4); | ||
List<List<ResearchProjectDef>> listOfResearchLists = new List<List<ResearchProjectDef>>(4); | ||
|
||
List<ResearchProjectDef> researchProjectsNeolithic = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Neolithic); | ||
listOfResearchLists.Add(researchProjectsNeolithic); | ||
ResearchProjectDef NeolithicBP = researchProjectsNeolithic.Find((ResearchProjectDef x) => x.defName == "NeolithicBlueprint"); | ||
researchProjectsNeolithic.Remove(NeolithicBP); | ||
listOfBPs.Add(NeolithicBP); | ||
|
||
List<ResearchProjectDef> researchProjectsMedieval = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Medieval); | ||
listOfResearchLists.Add(researchProjectsMedieval); | ||
ResearchProjectDef MedievalBP = researchProjectsMedieval.Find((ResearchProjectDef x) => x.defName == "MedievalBlueprint"); | ||
researchProjectsMedieval.Remove(MedievalBP); | ||
listOfBPs.Add(MedievalBP); | ||
|
||
List<ResearchProjectDef> researchProjectsIndustrial = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Industrial); | ||
listOfResearchLists.Add(researchProjectsIndustrial); | ||
ResearchProjectDef IndustrialBP = researchProjectsIndustrial.Find((ResearchProjectDef x) => x.defName == "IndustrialBlueprint"); | ||
researchProjectsIndustrial.Remove(IndustrialBP); | ||
listOfBPs.Add(IndustrialBP); | ||
|
||
List<ResearchProjectDef> researchProjectsSpacer = DefDatabase<ResearchProjectDef>.AllDefsListForReading.FindAll((ResearchProjectDef x) => x.techLevel == TechLevel.Spacer); | ||
listOfResearchLists.Add(researchProjectsSpacer); | ||
ResearchProjectDef SpacerBP = researchProjectsSpacer.Find((ResearchProjectDef x) => x.defName == "SpacerBlueprint"); | ||
researchProjectsSpacer.Remove(SpacerBP); | ||
listOfBPs.Add(SpacerBP); | ||
|
||
// Then we update the prereqs | ||
for (int i = 0; i < listOfBPs.Count; i++) | ||
{ | ||
Log.Message("Checking " + listOfBPs[i].defName); | ||
|
||
foreach (ResearchProjectDef researchProject in listOfResearchLists[i]) | ||
{ | ||
listOfBPs[i].prerequisites.Add(researchProject); | ||
Log.Message("+ Prerequisite " + researchProject.defName); | ||
} | ||
} | ||
|
||
Log.Message("Technology Blueprints: modified prerequisites for Technology Blueprints research projects."); | ||
Log.Message("### We hope you enjoy Technology Blueprints!###"); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.