refactor: use AgentId enums

This commit is contained in:
Anna 2021-12-21 02:36:48 -05:00
parent 24d4fd6f6c
commit 09c0f7e51d
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
3 changed files with 4 additions and 7 deletions

View File

@ -114,8 +114,7 @@ namespace Glamaholic {
var list = new List<GlamourItem>(); var list = new List<GlamourItem>();
var agents = Framework.Instance()->GetUiModule()->GetAgentModule(); var agents = Framework.Instance()->GetUiModule()->GetAgentModule();
// TODO: replace with AgentId.MiragePrismPrismBox when ClientStructs is updated var dresserAgent = agents->GetAgentByInternalId(AgentId.MiragePrismPrismBox);
var dresserAgent = agents->GetAgentByInternalId((AgentId) 292);
var itemsStart = *(IntPtr*) ((IntPtr) dresserAgent + 0x28); var itemsStart = *(IntPtr*) ((IntPtr) dresserAgent + 0x28);
if (itemsStart == IntPtr.Zero) { if (itemsStart == IntPtr.Zero) {
@ -171,7 +170,7 @@ namespace Glamaholic {
} }
} }
private static unsafe AgentInterface* EditorAgent => Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId((AgentId) 294); private static unsafe AgentInterface* EditorAgent => Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.MiragePrismMiragePlate);
internal unsafe void SetGlamourPlateSlot(MirageSource source, int glamId, uint itemId, byte stainId) { internal unsafe void SetGlamourPlateSlot(MirageSource source, int glamId, uint itemId, byte stainId) {
this._setGlamourPlateSlot((IntPtr) EditorAgent, source, glamId, itemId, stainId); this._setGlamourPlateSlot((IntPtr) EditorAgent, source, glamId, itemId, stainId);

View File

@ -94,8 +94,7 @@ namespace Glamaholic {
internal unsafe void TryOn(IEnumerable<SavedGlamourItem> items) { internal unsafe void TryOn(IEnumerable<SavedGlamourItem> items) {
void SetTryOnSave(bool save) { void SetTryOnSave(bool save) {
// TODO: replace with AgentId.Tryon once ClientStructs is updated for new agents var tryOnAgent = (IntPtr) Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.Tryon);
var tryOnAgent = (IntPtr) Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId((AgentId) 147);
if (tryOnAgent != IntPtr.Zero) { if (tryOnAgent != IntPtr.Zero) {
*(byte*) (tryOnAgent + 0x2E2) = (byte) (save ? 1 : 0); *(byte*) (tryOnAgent + 0x2E2) = (byte) (save ? 1 : 0);
} }

View File

@ -47,8 +47,7 @@ namespace Glamaholic.Ui.Helpers {
} }
private static unsafe Dictionary<PlateSlot, SavedGlamourItem> GetTryOnItems() { private static unsafe Dictionary<PlateSlot, SavedGlamourItem> GetTryOnItems() {
// TODO: replace with AgentId.Tryon once ClientStructs is updated for new agents var agent = (IntPtr) Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.Tryon);
var agent = (IntPtr) Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId((AgentId) 147);
var firstItem = agent + 0x2E8; var firstItem = agent + 0x2E8;
var items = new Dictionary<PlateSlot, SavedGlamourItem>(); var items = new Dictionary<PlateSlot, SavedGlamourItem>();