This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
Source/VFECore/Memes/PlaceWorkers/PlaceWorker_DisabledByMeme.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,40 @@ | ||
using System.Collections.Generic; | ||
using RimWorld; | ||
using Verse; | ||
namespace VanillaMemesExpanded | ||
{ | ||
public class PlaceWorker_DisabledByMeme : PlaceWorker | ||
{ | ||
|
||
public override bool IsBuildDesignatorVisible(BuildableDef def) | ||
{ | ||
List<MemeDef> list = Current.Game?.World?.factionManager?.OfPlayer?.ideos?.PrimaryIdeo?.memes; | ||
if (list != null) | ||
{ | ||
foreach (MemeDef meme in list) | ||
{ | ||
ExtendedMemeProperties extendedMemeProps = meme.GetModExtension<ExtendedMemeProperties>(); | ||
if (extendedMemeProps != null) | ||
{ | ||
if (extendedMemeProps.removedDesignators != null) | ||
{ | ||
foreach (ThingDef thing in extendedMemeProps.removedDesignators) | ||
{ | ||
if (thing == def) | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
} | ||
|
||
} | ||
return true; | ||
} | ||
|
||
} | ||
} |
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