1
Fork 0
mirror of https://github.com/redstrate/Auracite.git synced 2025-04-23 13:17:45 +00:00

Support collecting gil from the plugin

This commit is contained in:
Joshua Goins 2024-10-05 12:26:12 -04:00
parent 0c665679d4
commit 5acde0000a
5 changed files with 35 additions and 5 deletions

View file

@ -1,7 +1,4 @@
using System;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
namespace Auracite;

View file

@ -0,0 +1,30 @@
using FFXIVClientStructs.FFXIV.Client.Game;
namespace Auracite;
public class CurrencyStep : IStep
{
public event IStep.CompletedDelegate? Completed;
public void Run()
{
if (Plugin.ClientState.LocalPlayer != null)
{
unsafe
{
Plugin.package.gil = InventoryManager.Instance()->GetGil();
}
}
Completed?.Invoke();
}
public string StepName()
{
return "Currency";
}
public string StepDescription()
{
return "No user action required.";
}
}

View file

@ -16,7 +16,7 @@ public sealed class Plugin : IDalamudPlugin
private readonly WindowSystem WindowSystem = new("Auracite");
private readonly List<Type> _steps =
[typeof(AppearanceStep), typeof(PlaytimeStep)];
[typeof(AppearanceStep), typeof(CurrencyStep), typeof(PlaytimeStep)];
private int _stepIndex;
@ -27,6 +27,7 @@ public sealed class Plugin : IDalamudPlugin
public string playtime;
public int height;
public int bust_size;
public uint gil;
}
public static Package? package;

View file

@ -2,7 +2,7 @@ use serde::Serialize;
#[derive(Default, Serialize)]
pub struct Currencies {
pub gil: i64,
pub gil: u32,
}
#[derive(Default, Serialize)]

View file

@ -32,6 +32,7 @@ struct Package {
playtime: String,
height: i32,
bust_size: i32,
gil: u32,
}
#[derive(Clone)]
@ -113,6 +114,7 @@ fn main() {
char_data.playtime = package.playtime.parse().unwrap();
char_data.appearance.height = package.height;
char_data.appearance.bust_size = package.bust_size;
char_data.currencies.gil = package.gil;
}
let serialized = serde_json::to_string(&char_data).unwrap();