Skip to content

Commit

Permalink
added world name to GetCharacterName
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Oct 21, 2023
1 parent a3e06ab commit e41a988
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion SomethingNeedDoing/Interface/HelpWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ static void DisplayChangelog(string date, string changes, bool separator = true)
ImGui.PushFont(UiBuilder.MonoFont);

DisplayChangelog(
"2023-10-17",
"2023-10-21",
"- Added an optional bool to pass to GetCharacterName to return the world name in addition.\n");

DisplayChangelog(
"2023-10-20",
"- Changed GetItemCount() to support HQ items. Default behaviour includes both HQ and NQ. Pass false to the function to do only NQ.\n");

DisplayChangelog(
Expand Down
5 changes: 4 additions & 1 deletion SomethingNeedDoing/Misc/CommandInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ public int GetZoneID() =>
Service.ClientState.TerritoryType;

/// <inheritdoc/>
public string GetCharacterName() => Service.ClientState.LocalPlayer == null ? "null" : Service.ClientState.LocalPlayer.Name.ToString();
public string GetCharacterName(bool includeWorld = false) =>
Service.ClientState.LocalPlayer == null ? "null"
: includeWorld ? $"{Service.ClientState.LocalPlayer.Name}@{Service.ClientState.LocalPlayer.HomeWorld.GameData.Name}"
: Service.ClientState.LocalPlayer.Name.ToString();

/// <inheritdoc/>
public unsafe int GetItemCount(int itemID, bool includeHQ = true) =>
Expand Down
3 changes: 2 additions & 1 deletion SomethingNeedDoing/Misc/ICommandInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ public interface ICommandInterface
/// <summary>
/// Gets the character's name.
/// </summary>
/// <param name="includeWorld">Bool to include the world in the string.</param>
/// <returns>Returns the current's name, string.</returns>
public string GetCharacterName();
public string GetCharacterName(bool includeWorld = false);

/// <summary>
/// Gets an item count from your inventory.
Expand Down
2 changes: 1 addition & 1 deletion SomethingNeedDoing/SomethingNeedDoing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Authors>daemitus, croizat</Authors>
<Company>-</Company>
<Version>1.4.1.7</Version>
<Version>1.4.1.8</Version>
<Description></Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Jaksuhn/SomethingNeedDoing</PackageProjectUrl>
Expand Down

0 comments on commit e41a988

Please sign in to comment.