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

Commit

Permalink
added FloorGraphicExtension and ThingWithFloorGraphic classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taranchuk committed Dec 21, 2021
1 parent 8d368ec commit 429b215
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
Binary file modified 1.3/Assemblies/VFECore.dll
Binary file not shown.
1 change: 1 addition & 0 deletions Source/VFECore/VFECore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@
<Compile Include="VFECore\ScenParts\ScenPart_ArriveAtEdge.cs" />
<Compile Include="VFECore\ScenParts\ScenPart_ForcedFactionGoodwill.cs" />
<Compile Include="VFECore\StaticConstructorClass.cs" />
<Compile Include="VFECore\Things\ThingWithFloorGraphic.cs" />
<Compile Include="VFECore\Utilities\VerbUtility.cs" />
<Compile Include="VFECore\Traders\StockGenerator_ThingSetMakerTags.cs" />
<Compile Include="VFECore\Utilities\CustomSiegeUtility.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Source/VFECore/VFECore.csproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<!-- <ReferencePath>E:\Spiele\Steam\SteamApps\common\RimWorld\RimWorldWin64_Data\Managed\;E:\Spiele\Steam\SteamApps\workshop\content\294100\2009463077\v1.1\Assemblies\</ReferencePath> -->
Expand Down
51 changes: 51 additions & 0 deletions Source/VFECore/VFECore/Things/ThingWithFloorGraphic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using Verse.AI;
using VFE.Mechanoids;
using VFE.Mechanoids.Needs;

namespace VFECore
{
public class FloorGraphicExtension : DefModExtension
{
public GraphicData graphicData;
public override IEnumerable<string> ConfigErrors()
{
graphicData.ResolveReferencesSpecial();
return base.ConfigErrors();
}
}
public class ThingWithFloorGraphic : ThingWithComps
{
public Graphic graphicIntOverride;
public Graphic FloorGraphic(FloorGraphicExtension floorGraphicExtension)
{
if (graphicIntOverride == null)
{
if (floorGraphicExtension.graphicData == null)
{
return BaseContent.BadGraphic;
}
graphicIntOverride = floorGraphicExtension.graphicData.GraphicColoredFor(this);
}
return graphicIntOverride;
}
public override Graphic Graphic
{
get
{
var extension = this.def.GetModExtension<FloorGraphicExtension>();
if (extension != null)
{
return FloorGraphic(extension);
}
return base.Graphic;
}
}
}
}

0 comments on commit 429b215

Please sign in to comment.