Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Tweaks to CompGraphicByStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
juanosarg committed Dec 27, 2021
1 parent 7047713 commit 8085d70
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Binary file modified 1.3/Assemblies/VFECore.dll
Binary file not shown.
25 changes: 18 additions & 7 deletions Source/VFECore/AnimalBehaviours/Comps/CompGraphicByStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void CompTick()
if (changeGraphicsCounter > Props.changeGraphicsInterval)
{
this.ChangeTheGraphics();

changeGraphicsCounter = 0;
}
base.CompTick();
}
Expand All @@ -46,9 +46,12 @@ public override void PostSpawnSetup(bool respawningAfterLoad)
Pawn pawn = this.parent as Pawn;
this.pawn_renderer = pawn.Drawer.renderer;

GraphicData dessicatedgraphicdata = new GraphicData();
dessicatedgraphicdata.texPath = Props.dessicatedTxt;
dessicatedGraphic = dessicatedgraphicdata.Graphic;
if (Props.changeDesiccatedGraphic) {
GraphicData dessicatedgraphicdata = new GraphicData();
dessicatedgraphicdata.texPath = Props.dessicatedTxt;
dessicatedGraphic = dessicatedgraphicdata.Graphic;
}

this.ChangeTheGraphics();

}
Expand Down Expand Up @@ -90,7 +93,11 @@ public void ChangeTheGraphics()
try
{
Graphic_Multi nakedGraphic = (Graphic_Multi)GraphicDatabase.Get<Graphic_Multi>(Props.newImagePath, ShaderDatabase.Cutout, vector, Color.white);
this.pawn_renderer.graphics.dessicatedGraphic = dessicatedGraphic;
if (Props.changeDesiccatedGraphic)
{
this.pawn_renderer.graphics.dessicatedGraphic = dessicatedGraphic;

}
this.pawn_renderer.graphics.ResolveAllGraphics();
this.pawn_renderer.graphics.nakedGraphic = nakedGraphic;
(this.pawn_renderer.graphics.nakedGraphic.data = new GraphicData()).shadowData = pawn.ageTracker.CurKindLifeStage.bodyGraphicData.shadowData;
Expand All @@ -110,8 +117,12 @@ public void ChangeTheGraphics()

try
{
Graphic_Multi nakedGraphic = (Graphic_Multi)this.parent.def.graphic;
this.pawn_renderer.graphics.dessicatedGraphic = pawn.ageTracker.CurKindLifeStage.dessicatedBodyGraphicData.Graphic;
Graphic nakedGraphic = (Graphic_Multi)GraphicDatabase.Get<Graphic_Multi>(pawn.ageTracker.CurKindLifeStage.bodyGraphicData.texPath, ShaderDatabase.Cutout, vector, Color.white);
if (Props.changeDesiccatedGraphic)
{
this.pawn_renderer.graphics.dessicatedGraphic = pawn.ageTracker.CurKindLifeStage.dessicatedBodyGraphicData.Graphic;

}
this.pawn_renderer.graphics.ResolveAllGraphics();
this.pawn_renderer.graphics.nakedGraphic = nakedGraphic;
(this.pawn_renderer.graphics.nakedGraphic.data = new GraphicData()).shadowData = pawn.ageTracker.CurKindLifeStage.bodyGraphicData.shadowData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public CompProperties_GraphicByStyle()

public StyleCategoryDef style;
public string newImagePath;
public bool changeDesiccatedGraphic = false;
public string dessicatedTxt;
public int changeGraphicsInterval = 2000;

Expand Down

0 comments on commit 8085d70

Please sign in to comment.