Skip to content

Commit

Permalink
Merge pull request #617 from zymex22/issue616
Browse files Browse the repository at this point in the history
#616 removed Draw Patch
  • Loading branch information
Sn1p3rr3c0n authored Sep 20, 2022
2 parents 02e5dea + 5b413fa commit d7324cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
5 changes: 0 additions & 5 deletions Source/ProjectRimFactory/Common/ConditionalPatchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public void PatchHandler(bool patch)
AccessTools.Method(typeof(Verse.Thing), "Print", new Type[] { typeof(SectionLayer) }),
AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_Thing_Print), "Prefix")
);
public static TogglePatch Patch_ThingWithComps_Draw = new TogglePatch(
AccessTools.Method(typeof(Verse.ThingWithComps), "Draw"),
AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_ThingWithComps_Draw), "Prefix")
);
public static TogglePatch Patch_ThingWithComps_DrawGUIOverlay = new TogglePatch(
AccessTools.Method(typeof(Verse.ThingWithComps), "DrawGUIOverlay"),
AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_ThingWithComps_DrawGUIOverlay), "Prefix")
Expand Down Expand Up @@ -119,7 +115,6 @@ private static void updatePatchStorage()

Patch_MinifiedThing_Print.PatchHandler(state);
Patch_Thing_Print.PatchHandler(state);
Patch_ThingWithComps_Draw.PatchHandler(state);
Patch_ThingWithComps_DrawGUIOverlay.PatchHandler(state);
Patch_Thing_DrawGUIOverlay.PatchHandler(state);
Patch_FloatMenuMakerMap_ChoicesAtFor.PatchHandler(state);
Expand Down
15 changes: 0 additions & 15 deletions Source/ProjectRimFactory/Common/HarmonyPatches/PatchStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,6 @@ static bool Prefix(Thing __instance)
}
}

class Patch_ThingWithComps_Draw
{
static bool Prefix(Thing __instance)
{
if (__instance.def.category == ThingCategory.Item)
{
if (PatchStorageUtil.GetPRFMapComponent(__instance.Map)?.ShouldHideItemsAtPos(__instance.Position) ?? false)
{
return false;
}
}
return true;
}
}

class Patch_Thing_Print
{
static bool Prefix(Thing __instance, SectionLayer layer)
Expand Down
5 changes: 3 additions & 2 deletions Source/ProjectRimFactory/Storage/Building_MassStorageUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class Building_MassStorageUnit : Building_Storage, IHideItem, IH
public override void Notify_ReceivedThing(Thing newItem)
{
base.Notify_ReceivedThing(newItem);
if (newItem.Position != Position) RegisterNewItem(newItem);
if (newItem.Position != Position) HandleNewItem(newItem);
RefreshStorage();
}

Expand Down Expand Up @@ -229,7 +229,7 @@ public virtual void RefreshStorage()
{
if (cell != Position)
{
RegisterNewItem(item);
HandleNewItem(item);
}
else
{
Expand Down Expand Up @@ -309,6 +309,7 @@ public bool StackableAt(Thing thing, IntVec3 cell, Map map)
public void HandleNewItem(Thing item)
{
RegisterNewItem(item);
Map.dynamicDrawManager.DeRegisterDrawable(item);
}

public void HandleMoveItem(Thing item)
Expand Down

0 comments on commit d7324cd

Please sign in to comment.