Skip to content

Commit

Permalink
reverting
Browse files Browse the repository at this point in the history
  • Loading branch information
Killface1980 committed Nov 7, 2016
1 parent d59c2e0 commit 04ff09b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 38 deletions.
Binary file modified Assemblies/RW_FacialStuff.dll
Binary file not shown.
54 changes: 26 additions & 28 deletions Source/RW_FacialStuff/Detouring/_PawnGraphicSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public _PawnGraphicSet(Pawn pawn) : base(pawn)
if (pawn.RaceProps.hasGenders)
{

headGraphic = GraphicDatabaseHeadRecordsModded.ModifiedAlienHead(pawn, pawn.story.SkinColor, hairGraphic);
headGraphic = GraphicDatabaseHeadRecordsModded.ModifiedVanillaHead(pawn, pawn.story.SkinColor, hairGraphic);
}
else
{
Expand Down Expand Up @@ -152,41 +152,39 @@ public _PawnGraphicSet(Pawn pawn) : base(pawn)
hairGraphic = GraphicDatabase.Get<Graphic_Multi>(pawn.story.hairDef.texPath, ShaderDatabase.Cutout, Vector2.one, pawn.story.hairColor);
ResolveApparelGraphics();

if (pawn.kindDef.race.label.Contains("Alien"))

SaveablePawn pawnSave = MapComponent_FacialStuff.GetCache(pawn);
if (!pawnSave.sessionOptimized)
{
SaveablePawn pawnSave = MapComponent_FacialStuff.GetCache(pawn);
if (!pawnSave.sessionOptimized)
{
// Build the empty head index once to be used for the blank heads
if (HeadIndex.Count == 0)
for (int i = 0; i < 1024; i++)
{
HeadIndex.Add(i.ToString("0000"), null);
}
// Get the first free index and go on
foreach (KeyValuePair<string, Pawn> pair in HeadIndex)
// Build the empty head index once to be used for the blank heads
if (HeadIndex.Count == 0)
for (int i = 0; i < 1024; i++)
{
if (pair.Value == null)
{
string index = pair.Key;
HeadIndex.Remove(pair.Key);
HeadIndex.Add(index, pawn);

pawnSave.headGraphicIndex = "Heads/Blank/" + pair.Key;
GraphicDatabaseHeadRecordsModded.headsModded.Add(new GraphicDatabaseHeadRecordsModded.HeadGraphicRecordModded(pawn));
break;
}
HeadIndex.Add(i.ToString("0000"), null);
}
// Get the first free index and go on
foreach (KeyValuePair<string, Pawn> pair in HeadIndex)
{
if (pair.Value == null)
{
string index = pair.Key;
HeadIndex.Remove(pair.Key);
HeadIndex.Add(index, pawn);

//pawnSave.headGraphicIndex = "Heads/Blank/" + GraphicDatabaseHeadRecordsModded.headIndex.ToString("0000");
//GraphicDatabaseHeadRecordsModded.headsModded.Add(new GraphicDatabaseHeadRecordsModded.HeadGraphicRecordModded(pawn));
//GraphicDatabaseHeadRecordsModded.headIndex += 1;
pawnSave.headGraphicIndex = "Heads/Blank/" + pair.Key;
GraphicDatabaseHeadRecordsModded.headsModded.Add(new GraphicDatabaseHeadRecordsModded.HeadGraphicRecordModded(pawn));
break;
}
}

//pawnSave.headGraphicIndex = "Heads/Blank/" + GraphicDatabaseHeadRecordsModded.headIndex.ToString("0000");
//GraphicDatabaseHeadRecordsModded.headsModded.Add(new GraphicDatabaseHeadRecordsModded.HeadGraphicRecordModded(pawn));
//GraphicDatabaseHeadRecordsModded.headIndex += 1;
}

if (pawn.RaceProps.hasGenders)
if (pawn.RaceProps.hasGenders && hairGraphic != null)
{
headGraphic = GraphicDatabaseHeadRecordsModded.ModifiedVanillaHead(pawn, pawn.story.SkinColor, hairGraphic);
headGraphic = GraphicDatabaseHeadRecordsModded.ModifiedAlienHead(pawn, pawn.story.SkinColor, hairGraphic);
}
else
{
Expand Down
10 changes: 0 additions & 10 deletions Source/RW_FacialStuff/GraphicDatabaseHeadRecordsModded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,6 @@ public static Graphic_Multi ModifiedAlienHead(Pawn pawn, Color color, Graphic ha
MergeHeadWithHair(ref finalHeadBack, temptextureback, ContentFinder<Texture2D>.Get("MaskTex/MaskTex_Average_front+back"), pawn.story.hairColor);
}

if (false)
{
byte[] bytes = finalHeadFront.EncodeToPNG();
File.WriteAllBytes("Mods/RW_FacialStuff/MergedHeads/" + pawn.Name + "_01front.png", bytes);
byte[] bytes2 = finalHeadSide.EncodeToPNG();
File.WriteAllBytes("Mods/RW_FacialStuff/MergedHeads/" + pawn.Name + "_02side.png", bytes2);
byte[] bytes3 = finalHeadBack.EncodeToPNG();
File.WriteAllBytes("Mods/RW_FacialStuff/MergedHeads/" + pawn.Name + "_03back.png", bytes3);
}

finalHeadFront.Compress(true);
finalHeadSide.Compress(true);
finalHeadBack.Compress(true);
Expand Down

0 comments on commit 04ff09b

Please sign in to comment.