-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from edbmods/develop
Merge to master for v0.17.1.4 release candidate 3
- Loading branch information
Showing
12 changed files
with
210 additions
and
72 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Defs> | ||
<!-- This file is no longer used, but since the workshop doesn't seem to consistently | ||
delete files on mod updates, we're leaving it here to avoid mod corruption errors. | ||
We leave a placeholder pawn relation def since that should leave no side-effects. | ||
--> | ||
<EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
<defName>EdBPrepareCarefullyDummyDefinitionMapGenerators</defName> | ||
</EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
|
||
<GenStepDef> | ||
<defName>RemovePrepareCarefullyScenParts</defName> | ||
<linkWithMapGenerator>BasicMap</linkWithMapGenerator> | ||
<order>2147483647</order> | ||
<genStep Class="EdB.PrepareCarefully.GenStep_RemovePrepareCarefullyScenario"/> | ||
</GenStepDef> | ||
|
||
</Defs> |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ThingDefs> | ||
<!-- This file is no longer used, but since the workshop doesn't seem to consistently | ||
delete files on mod updates, we're leaving it here to avoid mod corruption errors. | ||
We leave a placeholder pawn relation def since that should leave no side-effects. | ||
--> | ||
<EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
<defName>EdBPrepareCarefullyDummyDefinition</defName> | ||
</EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
<!-- This file is no longer used, but since the workshop doesn't seem to consistently | ||
delete files on mod updates, we're leaving it here to avoid mod corruption errors. | ||
We leave a placeholder pawn relation def since that should leave no side-effects. | ||
--> | ||
<EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
<defName>EdBPrepareCarefullyDummyDefinition</defName> | ||
</EdB.PrepareCarefully.CarefullyPawnRelationDef> | ||
</ThingDefs> |
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
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,29 @@ | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using UnityEngine; | ||
using Verse; | ||
using Verse.Sound; | ||
|
||
namespace EdB.PrepareCarefully { | ||
public static class ExtensionsObject { | ||
public static void SetPrivateField(this object target, string name, object value) { | ||
FieldInfo info = target.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance); | ||
if (info != null) { | ||
info.SetValue(target, value); | ||
} | ||
} | ||
public static T GetPrivateField<T>(this object target, string name) { | ||
FieldInfo info = target.GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Instance); | ||
if (info != null) { | ||
return (T)info.GetValue(target); | ||
} | ||
else { | ||
return default(T); | ||
} | ||
} | ||
} | ||
} |
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,24 @@ | ||
using RimWorld; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using UnityEngine; | ||
using Verse; | ||
using Verse.Sound; | ||
|
||
namespace EdB.PrepareCarefully { | ||
// Removes the customized scenario (with PrepareCarefully-specific scenario parts) and replaces | ||
// it with a vanilla-friendly version that was prepared earlier. This is a workaround to avoid | ||
// creating a dependency between a saved game and the mod. See Controller.PrepareGame() for | ||
// more details. | ||
// TODO: Re-evaluate to see if it would be better to use method routing instead of a map generator step. | ||
public class GenStep_RemovePrepareCarefullyScenario : GenStep { | ||
public override void Generate(Map map) { | ||
if (PrepareCarefully.OriginalScenario != null) { | ||
Current.Game.Scenario = PrepareCarefully.OriginalScenario; | ||
} | ||
} | ||
} | ||
} |
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.