mirror of
https://github.com/redstrate/Auracite.git
synced 2025-04-26 06:17:44 +00:00
There's some data we want to save that's not available on the Lodestone, for example playtime information. Now you can install the Dalamud plugin (not currently distributed) to save playtime information. In the future, we can expand this to all sorts of interesting things!
41 lines
No EOL
978 B
C#
41 lines
No EOL
978 B
C#
using System;
|
|
using Dalamud.Game.Text;
|
|
using Dalamud.Game.Text.SeStringHandling;
|
|
|
|
namespace Auracite;
|
|
|
|
public class PlaytimeStep : IStep, IDisposable
|
|
{
|
|
public PlaytimeStep()
|
|
{
|
|
Plugin.ChatGui.ChatMessage += OnChatMessage;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Plugin.ChatGui.ChatMessage -= OnChatMessage;
|
|
}
|
|
|
|
public event IStep.CompletedDelegate? Completed;
|
|
|
|
public string StepName()
|
|
{
|
|
return "Playtime";
|
|
}
|
|
|
|
public string StepDescription()
|
|
{
|
|
return "Type /playtime into the chat window.";
|
|
}
|
|
|
|
private void OnChatMessage(XivChatType type, int timestamp, ref SeString sender, ref SeString message,
|
|
ref bool ishandled)
|
|
{
|
|
var msgString = message.ToString();
|
|
if (msgString.Contains("Total Play Time:") && type == XivChatType.SystemMessage)
|
|
{
|
|
Plugin.package.playtime = msgString.Split(": ")[1]; // TODO: lol
|
|
Completed?.Invoke();
|
|
}
|
|
}
|
|
} |