Skip to content

Commit

Permalink
Fixed Gizmos
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogliss committed Feb 27, 2020
1 parent 91bbee3 commit 8e2de0a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
Binary file modified 1.1/Assemblies/Quarry.dll
Binary file not shown.
57 changes: 53 additions & 4 deletions 1.1/Source/Quarry/Buildings/Building_Quarry.cs
Expand Up @@ -38,7 +38,7 @@ public class Building_Quarry : Building
private List<string> rockTypesUnder = new List<string>();
private List<ThingDef> blocksUnder = new List<ThingDef>();
private List<ThingDef> chunksUnder = new List<ThingDef>();
private List<Pawn> owners = new List<Pawn>();
private List<Pawn> owners => compAssignable.AssignedPawnsForReading;
#endregion Fields

#region Public Properties
Expand All @@ -54,7 +54,21 @@ public IEnumerable<Pawn> AssigningCandidates
{
return Enumerable.Empty<Pawn>();
}
return Map.mapPawns.FreeColonists;
return Map.mapPawns.FreeColonists.Where(x=> !x.WorkTagIsDisabled(WorkTags.Mining) && !x.WorkTypeIsDisabled(WorkTypeDefOf.Mining));
}
}
public CompAssignableToPawn compAssignable
{
get
{
return this.TryGetComp<CompAssignableToPawn>();
}
}
public CompForbiddable forbiddable
{
get
{
return this.TryGetComp<CompForbiddable>();
}
}

Expand Down Expand Up @@ -199,7 +213,6 @@ public override void ExposeData()
Scribe_Values.Look(ref quarryPercent, "QRY_quarryPercent", 1f);
Scribe_Values.Look(ref jobsCompleted, "QRY_jobsCompleted", 0);
Scribe_Collections.Look(ref rockTypesUnder, "QRY_rockTypesUnder", LookMode.Value);
Scribe_Collections.Look(ref owners, "owners", LookMode.Reference);

if (Scribe.mode == LoadSaveMode.PostLoadInit)
{
Expand Down Expand Up @@ -538,14 +551,50 @@ public override IEnumerable<Gizmo> GetGizmos()
},
hotKey = KeyBindingDefOf.Misc3
};

/*
if (base.GetGizmos() != null)
{
Log.Message("do base.GetGizmos()");
foreach (Command c in base.GetGizmos())
{
Log.Message(string.Format("base.GetGizmos() {0}",c));
yield return c;
}
}
*/

IEnumerator<Gizmo> enumerator = null;
if (((this.def.BuildableByPlayer && this.def.passability != Traversability.Impassable && !this.def.IsDoor) || this.def.building.forceShowRoomStats) && Gizmo_RoomStats.GetRoomToShowStatsFor(this) != null && Find.Selector.SingleSelectedObject == this)
{
yield return new Gizmo_RoomStats(this);
}
if (this.def.Minifiable && base.Faction == Faction.OfPlayer)
{
yield return InstallationDesignatorDatabase.DesignatorFor(this.def);
}
Command command = BuildCopyCommandUtility.BuildCopyCommand(this.def, base.Stuff);
if (command != null)
{
yield return command;
}
if (base.Faction == Faction.OfPlayer)
{
foreach (Command command2 in BuildFacilityCommandUtility.BuildFacilityCommands(this.def))
{
yield return command2;
}
IEnumerator<Command> enumerator2 = null;
}
if (forbiddable!=null)
{
foreach (Gizmo item in forbiddable.CompGetGizmosExtra())
{
yield return item;
}
;
}
yield break;
Log.Message("post base.GetGizmos()");
}


Expand Down
8 changes: 8 additions & 0 deletions _PublisherPlus.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Excluded>
<exclude>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\Quarry\.git</exclude>
<exclude>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\Quarry\1.1\Source</exclude>
<exclude>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\Quarry\Source</exclude>
</Excluded>
</Configuration>

0 comments on commit 8e2de0a

Please sign in to comment.