Skip to content

Commit

Permalink
Add %pg4 for missing pronoun His/Hers
Browse files Browse the repository at this point in the history
His/Her is represented by %g3, but there was no equivalent for His/Hers. This is now represented by %g4.
Fixed comment for Pronoun3() method as this is "his/her".
"pronounHers" text already available in localization tables, but was not mapped to anything.
  • Loading branch information
Interkarma committed Nov 1, 2023
1 parent 4baa405 commit 83ce866
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Assets/Scripts/Game/Questing/QuestMCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public override string Pronoun2self()
}
}

// His/Hers
// His/Her
public override string Pronoun3()
{
if (parent.LastResourceReferenced == null)
Expand All @@ -126,6 +126,22 @@ public override string Pronoun3()
}
}

// His/Hers
public override string Pronoun4()
{
if (parent.LastResourceReferenced == null)
return TextManager.Instance.GetLocalizedText("pronounHis");

switch (parent.LastResourceReferenced.Gender)
{
default:
case Game.Entity.Genders.Male:
return TextManager.Instance.GetLocalizedText("pronounHis");
case Game.Entity.Genders.Female:
return TextManager.Instance.GetLocalizedText("pronounHers");
}
}

public override string VampireNpcClan()
{
// %vcn
Expand Down
13 changes: 13 additions & 0 deletions Assets/Scripts/Game/TalkManagerMCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,19 @@ public override string Pronoun3()
}
}

// His/Hers
public override string Pronoun4()
{
switch (parent.potentialQuestorGender)
{
default:
case Game.Entity.Genders.Male:
return TextManager.Instance.GetLocalizedText("pronounHis");
case Game.Entity.Genders.Female:
return TextManager.Instance.GetLocalizedText("pronounHers");
}
}

public override string PotentialQuestorName()
{
return TalkManager.Instance.GetQuestorName();
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/Utility/MacroDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ public virtual string Pronoun3()
throw new NotImplementedException();
}

public virtual string Pronoun4()
{ // %g4
throw new NotImplementedException();
}

public virtual string Honorific()
{ // %hnr
throw new NotImplementedException();
Expand Down
7 changes: 7 additions & 0 deletions Assets/Scripts/Utility/MacroHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static class MacroHelper
{ "%g2", Pronoun2 }, // Him/Her etc...
{ "%g2self", Pronoun2self },// Himself/Herself etc...
{ "%g3", Pronoun3 }, // His/Her
{ "%g4", Pronoun4 }, // His/Hers
{ "%gii", GoldCarried }, // Amount of gold in hand
{ "%gdd", GodDesc }, // God description i.e. God of Logic
{ "%god", God }, // God of current region or current temple
Expand Down Expand Up @@ -1309,6 +1310,12 @@ public static string Pronoun3(IMacroContextProvider mcp)
return mcp.GetMacroDataSource().Pronoun3();
}

public static string Pronoun4(IMacroContextProvider mcp)
{ // %g4
if (mcp == null) return null;
return mcp.GetMacroDataSource().Pronoun4();
}

public static string QuestDate(IMacroContextProvider mcp)
{ // %qdt
if (mcp == null) return null;
Expand Down

1 comment on commit 83ce866

@Interkarma
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Commit title is incorrect. This should read "Add %g4 for missing pronoun His/Hers".

To recap: %g3="his/her" and %g4="his/hers".

Please sign in to comment.