-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FossilOrigin-Name: 87fe3a88b0b6fafd734fe2868e0b599fbcf02369f2a6dde542ba1dca69a2469f
- Loading branch information
Showing
15 changed files
with
506 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Linq; | ||
using ConsoleLib.Console; | ||
using XRL.World; | ||
|
||
namespace QudGendersUnleashed | ||
{ | ||
public static class Formatting | ||
{ | ||
public static readonly string FromGenderText = Markup.Color("W", "<from gender>"); | ||
public static readonly string CreateNewText = Markup.Color("W", "<create new>"); | ||
|
||
public static string FormatGender(Gender G) | ||
{ | ||
var name = Markup.Color("M", G.Name); | ||
var summary = Markup.Color("c", G.GetBasicSummary()); | ||
|
||
return $"{name}\n{summary}"; | ||
} | ||
|
||
public static string FormatPronounSet(PronounSet P) | ||
{ | ||
var name = Markup.Color("M", P.GetShortName()); | ||
var summary = Markup.Color("c", P.GetBasicSummary()); | ||
|
||
if (P.FromGender) | ||
{ | ||
var suspects = Gender | ||
.Find(G => !G.DoNotReplicateAsPronounSet) | ||
.Where(G => new PronounSet(G).Name == P.Name) | ||
.Select(G => Markup.Color("m", G.Name)); | ||
|
||
var from = suspects.Any() ? string.Join(" / ", suspects) : "unknown"; | ||
var extra = Markup.Color("m", $"(from {from})"); | ||
|
||
return $"{name} {extra}\n{summary}"; | ||
} | ||
|
||
return $"{name}\n{summary}"; | ||
} | ||
|
||
public static string FormatFromGenderPronounOption(Gender G) | ||
{ | ||
var g1 = G ?? Gender.Get("nonspecific"); | ||
if (g1 is null) | ||
{ | ||
return FromGenderText; | ||
} | ||
|
||
var name = Markup.Color("m", g1.Name); | ||
var extra = Markup.Color("m", $"({name})"); | ||
var summary = Markup.Color("c", g1.GetBasicSummary()); | ||
|
||
return $"{FromGenderText} {extra}\n{summary}"; | ||
} | ||
} | ||
} |
Oops, something went wrong.