Skip to content

Commit 7a8fb0b

Browse files
authored
Update VFE-Classical compat for v2.05 API changes (#544)
SenatorQuests.GenerateQuestFor signature changed from (SenatorInfo, Faction) to (List<QuestScriptDef>, Slate, SenatorInfo, Faction). Updated SyncedQuestButton to use GetValidQuestsFrom and the new signature. Updated VFEC.dll reference and added Publicize for private member access.
1 parent c58306f commit 7a8fb0b

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

References/VFEC.dll

83.5 KB
Binary file not shown.

References/VFEC.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1D3B8B299E2720EF1A58E0DC172CDBF46A90F78D
1+
F171507DFBE7291770E8B4BE2DBB8A953177A723

Source_Referenced/Multiplayer_Compat_Referenced.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141

4242
<ItemGroup>
4343
<Publicize Include="Assembly-CSharp" />
44+
<Publicize Include="VFEC" />
4445
</ItemGroup>
4546
</Project>

Source_Referenced/VanillaFactionsClassical.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Multiplayer.API;
77
using RimWorld;
88
using RimWorld.Planet;
9+
using RimWorld.QuestGen;
910
using UnityEngine;
1011
using Verse;
1112
using VFEC;
@@ -142,9 +143,13 @@ private static void SyncedQuestButton(int senatorDataIndex)
142143
if (canTakeQuest)
143144
{
144145
var senatorInfo = WorldComponent_Senators.Instance.InfoFor(info.Pawn, dialog.Faction);
145-
info.Quest = (senatorInfo.Quest = SenatorQuests.GenerateQuestFor(senatorInfo, dialog.Faction));
146-
Find.QuestManager.Add(senatorInfo.Quest);
147-
QuestUtility.SendLetterQuestAvailable(senatorInfo.Quest);
146+
var quests = SenatorQuests.GetValidQuestsFrom(info.Pawn, out var slate);
147+
if (quests.Any())
148+
{
149+
info.Quest = (senatorInfo.Quest = SenatorQuests.GenerateQuestFor(quests, slate, senatorInfo, dialog.Faction));
150+
Find.QuestManager.Add(senatorInfo.Quest);
151+
QuestUtility.SendLetterQuestAvailable(senatorInfo.Quest);
152+
}
148153
}
149154
else
150155
Messages.Message("VFEC.UI.AlreadyQuest".Translate(), MessageTypeDefOf.RejectInput, false);

0 commit comments

Comments
 (0)