Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Made the GPose fix Release ready.
Browse files Browse the repository at this point in the history
Improvised fix for #191 commented out for now.
  • Loading branch information
StoiaCode committed Sep 17, 2023
1 parent 7d4b9f0 commit cc7f5fc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CustomizePlus/Data/Armature/Armature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ public unsafe bool TryLinkSkeleton(bool forceRebuild = false)
}
catch
{
PluginLog.LogError($"Error occured while attempting to link skeleton: {this}");
// This is on wait until isse #191 on Github responds. Keeping it in code, delete it if I forget and this is longer then a month ago.

// Disabling this if its any Default Profile due to Log spam. A bit crazy but hey, if its for me id Remove Default profiles all together so this is as much as ill do for now! :)
//if(!(Profile.CharacterName.Equals(Constants.DefaultProfileCharacterName) || Profile.CharacterName.Equals("DefaultCutscene"))) {
PluginLog.LogError($"Error occured while attempting to link skeleton: {this}");
//}
}

return false;
Expand Down
1 change: 0 additions & 1 deletion CustomizePlus/Data/Profile/CharacterProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public bool AppliesTo(Dalamud.Game.ClientState.Objects.Types.GameObject obj)
if (obj.Name.TextValue.IsNullOrEmpty() && (obj.ObjectIndex == 200 || obj.ObjectIndex == 201))
{
var test = GameDataHelper.GetCutsceneName(obj);
PluginLog.Information("Found Character in 200 or 201." + test + " with type " + test.GetType());
//Player is sometimes in 200 sometimes in 201. Don't ask me why.
return AppliesTo(test);
}
Expand Down
22 changes: 19 additions & 3 deletions CustomizePlus/Helpers/GameDataHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,8 @@ public unsafe static string GetObjectName(DalamudObject obj)
/// </summary>
public static unsafe string GetCutsceneName(DalamudObject gameObject)
{
PluginLog.Verbose($"Its {gameObject.ObjectKind}. Also, Name is: {gameObject.Name.TextValue}");
if (gameObject.ObjectKind != DalamudObjectKind.Player && gameObject.Name.TextValue != string.Empty) {
PluginLog.Verbose($"Found Object that isnt player or Cutscene object. Its {gameObject.ObjectKind}. Also, Name is: {gameObject.Name.TextValue}");
if (gameObject.ObjectKind != DalamudObjectKind.Player && gameObject.Name.TextValue != string.Empty) {
PluginLog.Verbose($"Found Object that isnt player or Cutscene object. Its {gameObject.ObjectKind}. Also, Name is: {GetInitials(gameObject.Name.TextValue)}");
return gameObject.Name.TextValue;
}

Expand Down Expand Up @@ -393,6 +392,23 @@ public static unsafe string GetCutsceneName(DalamudObject gameObject)
return null;
}

/// <summary>
/// Returns the Initials of what looks like names, aka Player names etc. Simply determined by a Space present.
/// If we have no or more then one space, return the full thing.
/// This is mainly to be used in Debug messages, to be able to Identify issues without printing a full Player name to log every time.
/// </summary>
/// <param name="input">The Name to Annonymize.</param>
/// <returns>The Initials, or the Full string when more or less then 1 Space.</returns>
public static string GetInitials(string input) {
string[] nameParts = input.Split(' ');

if (nameParts.Length == 2) {
return $"{nameParts[0][0]}. {nameParts[1][0]}.";
} else {
return input;
}
}

/*
public static void SetTemporaryCharacterScale(string characterName, CharacterProfile scale)
{
Expand Down

0 comments on commit cc7f5fc

Please sign in to comment.