Skip to content

Commit

Permalink
Update Chargen selector patches to work with Moon Stair alpha
Browse files Browse the repository at this point in the history
FossilOrigin-Name: cf1d736149e60b01e8e82197b8cda4b916b46eb5c443819fde42edc93008765a
  • Loading branch information
librarianmage committed Oct 15, 2022
2 parents 132d168 + 3940456 commit cf286dd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "QudGendersUnleashed",
"title": "{{m-Y-g alternation|Qud: Genders Unleashed}}",
"description": "Adds gendeers and pronounce",
"version": "1.2",
"version": "1.3",
"author": "librarianmage",
"previewImage": "icon.png"
}
18 changes: 14 additions & 4 deletions selectors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ public static MethodInfo TargetMethod()
}
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
MethodInfo oldMethod = AccessTools.Method(typeof(Gender), nameof(Gender.GetAllGenericPersonalSingular));
MethodInfo oldPReefMethod = AccessTools.Method(typeof(Gender), nameof(Gender.GetAllGenericPersonalSingular));
MethodInfo oldMStairMethod = AccessTools.Method(typeof(Gender), nameof(Gender.GetAllGenericPersonal));
MethodInfo newMethod = AccessTools.Method(typeof(Gender), nameof(Gender.GetAllPersonal));
return HarmonyLib.Transpilers.MethodReplacer(instructions, oldMethod, newMethod);

IEnumerable<CodeInstruction> replacePReef = HarmonyLib.Transpilers.MethodReplacer(instructions, oldPReefMethod, newMethod);
IEnumerable<CodeInstruction> replaceMStair = HarmonyLib.Transpilers.MethodReplacer(replacePReef, oldMStairMethod, newMethod);

return replaceMStair;
}
}

Expand All @@ -35,9 +40,14 @@ public static MethodBase TargetMethod()
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{

MethodInfo oldMethod = AccessTools.Method(typeof(PronounSet), nameof(PronounSet.GetAllGenericPersonalSingular));
MethodInfo oldPReefMethod = AccessTools.Method(typeof(PronounSet), nameof(PronounSet.GetAllGenericPersonalSingular));
MethodInfo oldMStairMethod = AccessTools.Method(typeof(PronounSet), nameof(PronounSet.GetAllGenericPersonal));
MethodInfo newMethod = AccessTools.Method(typeof(PronounSet), nameof(PronounSet.GetAllPersonal));
return HarmonyLib.Transpilers.MethodReplacer(instructions, oldMethod, newMethod);

IEnumerable<CodeInstruction> replacePReef = HarmonyLib.Transpilers.MethodReplacer(instructions, oldPReefMethod, newMethod);
IEnumerable<CodeInstruction> replaceMStair = HarmonyLib.Transpilers.MethodReplacer(replacePReef, oldMStairMethod, newMethod);

return replaceMStair;
}
}

Expand Down
4 changes: 2 additions & 2 deletions workshop.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"WorkshopId": 2815078000,
"Title": "Qud: Genders Unleashed",
"Description": "A mod that works in conjunction with the [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1735379738]Gender and Pronoun Sets[/url] mod to allow your delver to wreathe themselves in the gender identity and pronouns they feel most comfortable in.\n\nSpecifically, this mod allows you to pick from all personal genders and pronouns defined in game (including pseudo-plural ones), with a number of additions.\n\nAdditionally, the \"choose pronoun\" prompt in game has been modified to use the modern UI. This will facilitate picking from the extended list this mod provides.\n\n[i]`=name=` pronoun sets:[\i] Starting with version 1.1, `=name=` in a pronoun set will be dynamically replaced with the player character's name (`=name's=` with the possessive version). To demonstrate this, a pronoun set consisting completely of `=name=` and `=name's=` has been added.\n\nTested to work on game version 203.54\n\n[url=https://github.com/librarianmage/QudGendersUnleashed]Github Page[/url]",
"Description": "A mod that works in conjunction with the [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1735379738]Gender and Pronoun Sets[/url] mod to allow your delver to wreathe themselves in the gender identity and pronouns they feel most comfortable in.\n\nSpecifically, this mod allows you to pick from all personal genders and pronouns defined in game (including pseudo-plural ones), with a number of additions.\n\nAdditionally, the \"choose pronoun\" prompt in game has been modified to use the modern UI. This will facilitate picking from the extended list this mod provides.\n\n[i]`=name=` pronoun sets:[/i] Starting with version 1.1, `=name=` in a pronoun set will be dynamically replaced with the player character's name (`=name's=` with the possessive version). To demonstrate this, a pronoun set consisting completely of `=name=` and `=name's=` has been added.\n\nTested to work on game version 203.54\n\n[url=https://github.com/librarianmage/QudGendersUnleashed]Github Page[/url]",
"Tags": "Stable,Beta,Script,Gender,Pronouns",
"Visibility": "2",
"ImagePath": "icon.png"
}
}

0 comments on commit cf286dd

Please sign in to comment.