Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion OverlayPlugin.Core/Integration/FFXIVRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ public Language GetLanguage()
{
var repo = GetRepository();
if (repo == null)
return Language.Unknown;
{
// Defaults to English
return Language.English;
}
return repo.GetSelectedLanguageID();
}

Expand Down
7 changes: 7 additions & 0 deletions OverlayPlugin.Core/MemoryProcessors/FFXIVProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ static internal bool IsCrafter(EntityJob job)
job == EntityJob.CUL;
}

static internal string ToProperCase(string name)
{
System.Globalization.CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Globalization.TextInfo textInfo = cultureInfo.TextInfo;
return textInfo.ToTitleCase(name);
}

[Serializable]
public class EntityData
{
Expand Down
3 changes: 1 addition & 2 deletions OverlayPlugin.Core/MemoryProcessors/FFXIVProcessCn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@ public unsafe override EntityData GetEntityDataFromByteArray(byte[] source) {

// dump '\0' string terminators
var memoryName = System.Text.Encoding.UTF8.GetString(mem.Name, EntityMemory.nameBytes).Split(new[] { '\0' }, 2)[0];
var capitalizedName = FFXIV_ACT_Plugin.Common.StringHelper.ToProperCase(memoryName);

EntityData entity = new EntityData() {
name = capitalizedName,
name = memoryName,
id = mem.id,
type = mem.type,
distance = mem.distance,
Expand Down
3 changes: 1 addition & 2 deletions OverlayPlugin.Core/MemoryProcessors/FFXIVProcessIntl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ public unsafe override EntityData GetEntityDataFromByteArray(byte[] source) {

// dump '\0' string terminators
var memoryName = System.Text.Encoding.UTF8.GetString(mem.Name, EntityMemory.nameBytes).Split(new[] { '\0' }, 2)[0];
var capitalizedName = FFXIV_ACT_Plugin.Common.StringHelper.ToProperCase(memoryName);

EntityData entity = new EntityData() {
name = capitalizedName,
name = memoryName,
id = mem.id,
type = mem.type,
distance = mem.distance,
Expand Down
2 changes: 1 addition & 1 deletion OverlayPlugin.Core/MemoryProcessors/FFXIVProcessKo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public unsafe override EntityData GetEntityDataFromByteArray(byte[] source) {

// dump '\0' string terminators
var memoryName = System.Text.Encoding.UTF8.GetString(mem.Name, EntityMemory.nameBytes).Split(new[] { '\0' }, 2)[0];
var capitalizedName = FFXIV_ACT_Plugin.Common.StringHelper.ToProperCase(memoryName);
var capitalizedName = ToProperCase(memoryName);

EntityData entity = new EntityData() {
name = capitalizedName,
Expand Down