a little bit of cleanup

This commit is contained in:
CrafterPika 2026-07-03 01:38:36 +02:00
commit f46a4e8283
No known key found for this signature in database
GPG key ID: B4E0BA4B52B201DC
3 changed files with 48 additions and 49 deletions

View file

@ -153,21 +153,28 @@ namespace ModMenu {
Program.writeUInt32((uint)(p_save_start + 0xA5B4), amount);
}
public static void ChangeEquippedHeadgear(uint WeaponSetID) {
public static void ChangeEquippedGear(uint id, string slot) {
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
Program.writeUInt32((uint)(p_save_start + 0x188), WeaponSetID);
}
public static void ChangeEquippedClothes(uint ClothesID) {
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
Program.writeUInt32((uint)(p_save_start + 0x180), ClothesID);
}
public static void ChangeEquippedShoes(uint ShoesID) {
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
Program.writeUInt32((uint)(p_save_start + 0x184), ShoesID);
}
public static void ChangeEquippedWeapon(uint WeaponSetID) {
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
Program.writeUInt32((uint)(p_save_start + 0x18C), WeaponSetID);
switch (slot.ToLower()) {
case "headgear":
Program.writeUInt32((uint)(p_save_start + 0x188), id);
return;
case "clothes":
Program.writeUInt32((uint)(p_save_start + 0x180), id);
return;
case "shoes":
Program.writeUInt32((uint)(p_save_start + 0x184), id);
return;
case "weapon":
Program.writeUInt32((uint)(p_save_start + 0x18C), id);
return;
default:
return;
}
}
private static T ByteArrayToStructure<T>(byte[] bytes) where T : struct {