Skip to content

Commit

Permalink
git commit from PowerShell in C#RimWriter - Books, Scrolls, Tablets, …
Browse files Browse the repository at this point in the history
…and Libraries Added new simple option to right click books to force characters to read them. This is particularly useful for skill books. Skill books can be encountered on traders now as well.
  • Loading branch information
jecrell committed Sep 25, 2018
1 parent 77fc155 commit 08d0365
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 669 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>RimWriter - Books, Scrolls, Tablets, and Libraries</name>
<author>Jecrell</author>
<targetVersion>0.19.0</targetVersion>
<description>1.19.0.2 (09-25-2018)
<description>1.19.0.3 (09-25-2018)

Add tablets, books, scrolls and more to your RimWorld playthroughs.

Expand Down
2 changes: 1 addition & 1 deletion About/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.0.2
1.19.0.3
Binary file modified Assemblies/RimWriter.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion Defs/ThingDefs_Item/RimWriter_Books.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<techLevel>Neolithic</techLevel>
<filthLeaving>Filth_RubbleRock</filthLeaving>
<recipeMaker>
<workSpeedStat>ResearchSpeed</workSpeedStat>
<workSpeedStat>SculptingSpeed</workSpeedStat>
<workSkill>Intellectual</workSkill>
<unfinishedThingDef>UnfinishedWritingTablet</unfinishedThingDef>
<soundWorking>Recipe_MakeStoneBlocks</soundWorking>
Expand Down Expand Up @@ -153,6 +153,10 @@
<descriptionMaker>RimWriterArtDescription_Guide</descriptionMaker>
</li>
</comps>
<tradeTags>
<li>ExoticMisc</li>
<li>Books</li>
</tradeTags>
</ThingDef>

<ThingDef ParentName="Jecrell_BookByHand" Name="Jecrell_HandwrittenBook">
Expand Down
5 changes: 5 additions & 0 deletions Languages/English/Keyed/RimWriter_Keys.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>

<!-- 9-25-18 -->
<RimWriter_Read>Read {0}</RimWriter_Read>
<RimWriter_NoInternalStorage>Storage unavailable</RimWriter_NoInternalStorage>
<RimWriter_CannotRead>Cannot read {0}</RimWriter_CannotRead>

<!-- 9-24-18 -->
<RimWriter_GuideTitleWithAuthor>{0}'s {1} Skillbook</RimWriter_GuideTitleWithAuthor>
<RimWriter_GuideTitle>{0} Skillbook</RimWriter_GuideTitle>
Expand Down
855 changes: 193 additions & 662 deletions Source/.idea/.idea.RimWriter/.idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Source/JobDriver_ReadABook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ protected override IEnumerable<Toil> MakeNewToils()
{
this.job.SetTarget(TargetIndex.B, book as ThingBook);
}
}else if (TargetA.Thing is ThingBook tBook)
{
this.job.SetTarget(TargetIndex.B, tBook );
}
}
};
Expand Down
36 changes: 33 additions & 3 deletions Source/ThingBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
using RimWorld;
using UnityEngine;
using Verse;
using Verse.AI;

namespace RimWriter
{
public class ThingBook : ThingWithComps
{
CompArt compArt;

CompArt CompArt
{
get
Expand All @@ -16,6 +18,7 @@ CompArt CompArt
{
compArt = this.TryGetComp<CompArt>();
}

return compArt;
}
}
Expand All @@ -28,10 +31,37 @@ public override string Label
{
return "RimWriter_BookTitle".Translate(CompArt.Title, CompArt.AuthorName) + " (" + base.Label + ")";
}

return base.Label;
}
}

public override IEnumerable<FloatMenuOption> GetFloatMenuOptions(Pawn selPawn)
{
foreach (var op in base.GetFloatMenuOptions(selPawn))
yield return op;

if (!selPawn.health.capacities.CapableOf(PawnCapacityDefOf.Sight) ||
!selPawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation))
{
yield return new FloatMenuOption(
"RimWriter_CannotRead".Translate(Label) + " (" + "Incapable".Translate() + ")", null);
}
else
{


yield return FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption("RimWriter_Read".Translate(this.Label), delegate()
{
Job job = new Job(DefDatabase<JobDef>.GetNamedSilentFail("RimWriter_ReadABook"), this);
job.count = 1;
selPawn.jobs.TryTakeOrderedJob(job, JobTag.MiscWork);
},
MenuOptionPriority.Low), selPawn, this);
}
}

public override IEnumerable<Gizmo> GetGizmos()
{
foreach (var gizmo in base.GetGizmos())
Expand All @@ -44,9 +74,9 @@ public override IEnumerable<Gizmo> GetGizmos()
action = () => Destroy(DestroyMode.KillFinalize),
defaultLabel = "RimWriter_Destroy".Translate(),
defaultDesc = "RimWriter_DestroyDesc".Translate(Label),
icon = ContentFinder<Texture2D>.Get("UI/Commands/jecrellDestroyWriting", true)
};
icon = ContentFinder<Texture2D>.Get("UI/Commands/jecrellDestroyWriting")
};
}
}
}
}
}
2 changes: 1 addition & 1 deletion Source/WorkGiver_ReturnBooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
Building_InternalStorage Building_InternalStorage = this.FindBestStorage(pawn, t);
if (Building_InternalStorage == null)
{
JobFailReason.Is("NoEmptyGraveLower".Translate());
JobFailReason.Is("RimWriter_NoInternalStorage".Translate());
return null;
}
return new Job(DefDatabase<JobDef>.GetNamed("RimWriter_ReturnBook"), t, Building_InternalStorage)
Expand Down
38 changes: 38 additions & 0 deletions updateinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
==============================
==========Steam Format========
==============================

RimWriter - Books, Scrolls, Tablets, and Libraries Update
====================
Version: 1.19.0.2
Updated: 09-25-2018
Description: Initial Release
====================

Download now on...
- Patreon: https://www.patreon.com/posts/21613863
- GitHub: https://github.com/jecrell/RimWriter
- Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1521844535
Discuss the mod on...
- Discord: https://discord.gg/AaVFA7V
- Ludeon forums: https://ludeon.com/forums/index.php?topic=45847.0

==============================
===========BBS Format=========
==============================

[center][b][glow=red,2,300][size=18pt]RimWriter - Books, Scrolls, Tablets, and Libraries[/size][/glow][/b]
[img width=260]https://raw.githubusercontent.com/jecrell/RimWriter/master/About/Preview.png[/img]
[hr]
[b]RimWriter - Books, Scrolls, Tablets, and Libraries
Version: 1.19.0.2
Updated: 09-25-2018
Description: [color=orange]Initial Release[/color]
[hr]
[b]Download now on...[/b]
[url=https://www.patreon.com/posts/21613863]Patreon[/url]
[url=https://github.com/jecrell/RimWriter]GitHub[/url]
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=1521844535]Steam[/url]
[b]Discuss the mod on...[/b]
[url=https://discord.gg/AaVFA7V]Discord[/url]
[url=https://ludeon.com/forums/index.php?topic=45847.0]Ludeon[/url]

0 comments on commit 08d0365

Please sign in to comment.