Skip to content

Commit

Permalink
Merge pull request evemondevteam#36 from luyi1888/main
Browse files Browse the repository at this point in the history
fix shipname in unicode character and display the number of skills remaining

fixes evemondevteam#22
fixes evemondevteam#25
  • Loading branch information
mgoeppner authored Mar 30, 2022
2 parents 929d889 + edec5f1 commit 4e2c089
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/EVEMon.Common/Models/SkillQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,18 @@ public double GetOneDaySkillQueueWidth(int width)
return Math.Floor(WarningThresholdTimeSpan.TotalSeconds / totalSeconds * width);
}

public string GetCountInSkillQueueDescription()
{
if (this.Count > 1)
{
return string.Format("{0} skills", this.Count);
}
else
{
return string.Format("{0} skill", this.Count);
}
}

#endregion
}
}
22 changes: 21 additions & 1 deletion src/EVEMon.Common/Serialization/Esi/EsiAPIShip.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.Serialization;
using System.Text.RegularExpressions;

namespace EVEMon.Common.Serialization.Esi
{
Expand All @@ -15,7 +16,26 @@ public sealed class EsiAPIShip
[DataMember(Name = "ship_item_id")]
public long ShipItemID { get; set; }

private string _ShipName;
[DataMember(Name = "ship_name")]
public string ShipName { get; set; }
public string ShipName
{
get { return _ShipName; }
set
{
Regex pattern = new Regex(@"^u'(.*)'$");
Match match = pattern.Match(value);
if (match.Success)
{
_ShipName = Regex.Unescape(match.Groups[1].Value);
}
else
{
_ShipName = value;
}
}
}


}
}
3 changes: 2 additions & 1 deletion src/EVEMon/CharacterMonitoring/CharacterMonitorFooter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ private void UpdateSkillQueueInfo()

// Update the remaining queue time label
DateTime queueEndTime = ccpCharacter.SkillQueue.EndTime;
lblQueueRemaining.Text = queueEndTime.ToRemainingTimeDescription(DateTimeKind.Utc);
lblQueueRemaining.Text = string.Format("{0} ({1})", queueEndTime.ToRemainingTimeDescription(DateTimeKind.Utc),
ccpCharacter.SkillQueue.GetCountInSkillQueueDescription());
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/EVEMon/Controls/OverviewItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,9 @@ private void UpdateSkillQueueTrainingTime()
// More than one entry in queue ? Display total queue remaining time
if (ccpCharacter.SkillQueue.Count > 1)
{
text = "Queue ends in " + ccpCharacter.SkillQueue.EndTime.
ToRemainingTimeShortDescription(DateTimeKind.Utc);
text = string.Format("Queue ends in {0} ({1})", ccpCharacter.SkillQueue.EndTime.
ToRemainingTimeShortDescription(DateTimeKind.Utc),
ccpCharacter.SkillQueue.GetCountInSkillQueueDescription());
}
}
// Skill queue is empty ?
Expand Down

0 comments on commit 4e2c089

Please sign in to comment.