Skip to content

Commit

Permalink
added textures + translations + small change to jobtracker
Browse files Browse the repository at this point in the history
  • Loading branch information
rheirman committed Feb 25, 2018
1 parent 7834ea2 commit 8331d26
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
Binary file modified Assemblies/GiddyUpCaravan.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion Languages/English/Keyed/GiddyUpCaravan_Keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ This bonus is not applied when all colonists are riding.</GU_Car_incompleteCarav
<GU_Car_NonWildWeight_Title>Non-wild friendly NPC mount chance</GU_Car_NonWildWeight_Title>
<GU_Car_NonWildWeight_Description>The chance a mount used by a friendly NPC pawn is one not found in the wild.
Chances are normalized to 100% if the sum is not 100</GU_Car_NonWildWeight_Description>


<GU_Car_Designator_GU_DropAnimal_NPC_Clear_Label>Clear NPC mount drop point</GU_Car_Designator_GU_DropAnimal_NPC_Clear_Label>
<GU_Car_Designator_GU_DropAnimal_NPC_Clear_Description>Clear designated NPC mount points</GU_Car_Designator_GU_DropAnimal_NPC_Clear_Description>
<GU_Car_Designator_GU_DropAnimal_NPC_Expand_Label>Place NPC mount point</GU_Car_Designator_GU_DropAnimal_NPC_Expand_Label>
<GU_Car_Designator_GU_DropAnimal_NPC_Expand_Description>Place drop off points for NPC mounts. When traders or visitors arrive, they will temporarily leave their mounts at the drop off point closest to the place they gather. Mounts will stay near the drop off point until their rider returns. When a drop off point is designated in a room, this room will function as a stable, keeping the animals inside. </GU_Car_Designator_GU_DropAnimal_NPC_Expand_Description>
<!-- note for translators: The following items need to be really short to fit -->
<GU_Car_No_Rider>No rider</GU_Car_No_Rider>
<GU_Car_Set_Rider>Set rider</GU_Car_Set_Rider>
Expand Down
14 changes: 7 additions & 7 deletions Source/Giddy-up-Caravan/Harmony/Pawn_JobTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ static void Postfix(Pawn_JobTracker __instance, ref ThinkResult __result)
if (__result.SourceNode is JobGiver_Wander)
{

JobGiver_Wander jgWander = (JobGiver_Wander)__result.SourceNode;
//Traverse.Create(__result.SourceNode).Field("wanderRadius").SetValue(5f);
//JobGiver_Wander jgWander = (JobGiver_Wander)__result.SourceNode;
Traverse.Create(__result.SourceNode).Field("wanderRadius").SetValue(5f);
}

}

}


if (pawn.IsColonistPlayerControlled || pawn.RaceProps.Animal || pawn.Faction.HostileTo(Faction.OfPlayer))
if (pawn.IsColonistPlayerControlled || pawn.RaceProps.Animal)
{
return;
}
Expand Down Expand Up @@ -78,15 +78,15 @@ static void Postfix(Pawn_JobTracker __instance, ref ThinkResult __result)
}


//Log.Message("curLordToil: " + pawn.GetLord().CurLordToil.ToString() + ", pawn name: " + pawn.Name);
//Log.Message("lordJob: " + pawn.GetLord().LordJob + ", pawn name: " + pawn.Name);
//Log.Message("lord.CurLordToil.GetType().Name" + lord.CurLordToil.GetType().Name);
Log.Message("curLordToil: " + pawn.GetLord().CurLordToil.ToString() + ", pawn name: " + pawn.Name);
Log.Message("lordJob: " + pawn.GetLord().LordJob + ", pawn name: " + pawn.Name);
Log.Message("lord.CurLordToil.GetType().Name" + lord.CurLordToil.GetType().Name);

if (lord.CurLordToil is LordToil_ExitMapAndEscortCarriers || lord.CurLordToil is LordToil_Travel || lord.CurLordToil is LordToil_ExitMap || lord.CurLordToil is LordToil_ExitMapTraderFighting)
{
if (PawnData.owning != null && PawnData.mount == null && !PawnData.owning.Downed && PawnData.owning.Spawned && !pawn.IsBurning() && !pawn.Downed)
{
//Log.Message("Pawn " + pawn.Name + " should mount animal!");
Log.Message("Pawn " + pawn.Name + " should mount animal!");
mountAnimal(__instance, pawn, PawnData, ref __result);

}
Expand Down
9 changes: 5 additions & 4 deletions Source/Giddy-up-Caravan/Harmony/TraderCaravanUtility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Harmony;
using GiddyUpCore.Storage;
using Harmony;
using RimWorld;
using System;
using System.Collections.Generic;
Expand All @@ -15,14 +16,14 @@ static class TraderCaravanUtility_GetTraderCaravanRole
static bool Prefix(Pawn p, ref TraderCaravanRole __result)
{
//Log.Message("GetTraderCaravanRole called");
if (p.RaceProps.Animal && p.playerSettings != null)
if (p.RaceProps.Animal)
{
//Log.Message("animal!");
ExtendedPawnData pawnData = Base.GetExtendedDataStorage().GetExtendedDataFor(p);

if (p.playerSettings.master != null)
if (pawnData.ownedBy != null)
{
//Log.Message("animal master set, setting role to guard");

__result = TraderCaravanRole.Guard;
return false;
}
Expand Down
Binary file modified Textures/UI/GU_Car_Designator_GU_DropAnimal_NPC_Clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Textures/UI/GU_Car_Designator_GU_DropAnimal_NPC_Expand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8331d26

Please sign in to comment.