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:
parent
0c665679d4
commit
5acde0000a
5 changed files with 35 additions and 5 deletions
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
|
||||||
using Dalamud.Game.ClientState.Objects.Enums;
|
using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
using Dalamud.Game.Text;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
|
|
||||||
namespace Auracite;
|
namespace Auracite;
|
||||||
|
|
||||||
|
|
30
dalamud/Auracite/CurrencyStep.cs
Normal file
30
dalamud/Auracite/CurrencyStep.cs
Normal 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.";
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||||
private readonly WindowSystem WindowSystem = new("Auracite");
|
private readonly WindowSystem WindowSystem = new("Auracite");
|
||||||
|
|
||||||
private readonly List<Type> _steps =
|
private readonly List<Type> _steps =
|
||||||
[typeof(AppearanceStep), typeof(PlaytimeStep)];
|
[typeof(AppearanceStep), typeof(CurrencyStep), typeof(PlaytimeStep)];
|
||||||
|
|
||||||
private int _stepIndex;
|
private int _stepIndex;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||||
public string playtime;
|
public string playtime;
|
||||||
public int height;
|
public int height;
|
||||||
public int bust_size;
|
public int bust_size;
|
||||||
|
public uint gil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Package? package;
|
public static Package? package;
|
||||||
|
|
|
@ -2,7 +2,7 @@ use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Default, Serialize)]
|
#[derive(Default, Serialize)]
|
||||||
pub struct Currencies {
|
pub struct Currencies {
|
||||||
pub gil: i64,
|
pub gil: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Serialize)]
|
#[derive(Default, Serialize)]
|
||||||
|
|
|
@ -32,6 +32,7 @@ struct Package {
|
||||||
playtime: String,
|
playtime: String,
|
||||||
height: i32,
|
height: i32,
|
||||||
bust_size: i32,
|
bust_size: i32,
|
||||||
|
gil: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -113,6 +114,7 @@ fn main() {
|
||||||
char_data.playtime = package.playtime.parse().unwrap();
|
char_data.playtime = package.playtime.parse().unwrap();
|
||||||
char_data.appearance.height = package.height;
|
char_data.appearance.height = package.height;
|
||||||
char_data.appearance.bust_size = package.bust_size;
|
char_data.appearance.bust_size = package.bust_size;
|
||||||
|
char_data.currencies.gil = package.gil;
|
||||||
}
|
}
|
||||||
|
|
||||||
let serialized = serde_json::to_string(&char_data).unwrap();
|
let serialized = serde_json::to_string(&char_data).unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue