mirror of
https://git.crafterpika.cc/crafterpika/SplatTool-public.git
synced 2026-08-17 10:42:15 +02:00
a little bit of cleanup
This commit is contained in:
parent
d40ad03bad
commit
f46a4e8283
3 changed files with 48 additions and 49 deletions
44
Func.cs
44
Func.cs
|
|
@ -202,34 +202,26 @@ namespace Func {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static string EquippedHeadgear() {
|
public static string EquippedGear(string slot) {
|
||||||
try {
|
try {
|
||||||
var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC));
|
var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC));
|
||||||
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x188))}";
|
switch (slot.ToLower()) {
|
||||||
} catch {
|
case "headgear":
|
||||||
return "Game not fully loaded yet...";
|
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x188))}";
|
||||||
}
|
|
||||||
}
|
case "clothes":
|
||||||
public static string EquippedClothes() {
|
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x180))}";
|
||||||
try {
|
|
||||||
var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC));
|
case "shoes":
|
||||||
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x180))}";
|
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x184))}";
|
||||||
} catch {
|
|
||||||
return "Game not fully loaded yet...";
|
case "weapon":
|
||||||
}
|
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x18C))}";
|
||||||
}
|
|
||||||
public static string EquippedShoes() {
|
default:
|
||||||
try {
|
return "";
|
||||||
var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC));
|
}
|
||||||
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x184))}";
|
|
||||||
} catch {
|
|
||||||
return "Game not fully loaded yet...";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static string EquippedWep() {
|
|
||||||
try {
|
|
||||||
var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC));
|
|
||||||
return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x18C))}";
|
|
||||||
} catch {
|
} catch {
|
||||||
return "Game not fully loaded yet...";
|
return "Game not fully loaded yet...";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,21 +153,28 @@ namespace ModMenu {
|
||||||
Program.writeUInt32((uint)(p_save_start + 0xA5B4), amount);
|
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));
|
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
|
||||||
Program.writeUInt32((uint)(p_save_start + 0x188), WeaponSetID);
|
switch (slot.ToLower()) {
|
||||||
}
|
case "headgear":
|
||||||
public static void ChangeEquippedClothes(uint ClothesID) {
|
Program.writeUInt32((uint)(p_save_start + 0x188), id);
|
||||||
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
|
return;
|
||||||
Program.writeUInt32((uint)(p_save_start + 0x180), ClothesID);
|
|
||||||
}
|
case "clothes":
|
||||||
public static void ChangeEquippedShoes(uint ShoesID) {
|
Program.writeUInt32((uint)(p_save_start + 0x180), id);
|
||||||
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
|
return;
|
||||||
Program.writeUInt32((uint)(p_save_start + 0x184), ShoesID);
|
|
||||||
}
|
case "shoes":
|
||||||
public static void ChangeEquippedWeapon(uint WeaponSetID) {
|
Program.writeUInt32((uint)(p_save_start + 0x184), id);
|
||||||
var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC));
|
return;
|
||||||
Program.writeUInt32((uint)(p_save_start + 0x18C), WeaponSetID);
|
|
||||||
|
case "weapon":
|
||||||
|
Program.writeUInt32((uint)(p_save_start + 0x18C), id);
|
||||||
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static T ByteArrayToStructure<T>(byte[] bytes) where T : struct {
|
private static T ByteArrayToStructure<T>(byte[] bytes) where T : struct {
|
||||||
|
|
|
||||||
18
httpMenu.cs
18
httpMenu.cs
|
|
@ -50,16 +50,16 @@ namespace ModMenu {
|
||||||
SplatTelemetry.SendTelemetry();
|
SplatTelemetry.SendTelemetry();
|
||||||
});
|
});
|
||||||
static WorkThread HeadgearChangeThread = new WorkThread(() => {
|
static WorkThread HeadgearChangeThread = new WorkThread(() => {
|
||||||
SaveEditor.ChangeEquippedHeadgear(HeadgearID);
|
SaveEditor.ChangeEquippedGear(HeadgearID, "headgear");
|
||||||
});
|
});
|
||||||
static WorkThread ClothesChangeThread = new WorkThread(() => {
|
static WorkThread ClothesChangeThread = new WorkThread(() => {
|
||||||
SaveEditor.ChangeEquippedClothes(ClothesID);
|
SaveEditor.ChangeEquippedGear(ClothesID, "clothes");
|
||||||
});
|
});
|
||||||
static WorkThread ShoesChangeThread = new WorkThread(() => {
|
static WorkThread ShoesChangeThread = new WorkThread(() => {
|
||||||
SaveEditor.ChangeEquippedShoes(ShoesID);
|
SaveEditor.ChangeEquippedGear(ShoesID, "shoes");
|
||||||
});
|
});
|
||||||
static WorkThread WeaponChangeThread = new WorkThread(() => {
|
static WorkThread WeaponChangeThread = new WorkThread(() => {
|
||||||
SaveEditor.ChangeEquippedWeapon(WeaponSetID);
|
SaveEditor.ChangeEquippedGear(WeaponSetID, "weapon");
|
||||||
});
|
});
|
||||||
|
|
||||||
public static string RunCode(ModMenuRequest data) {
|
public static string RunCode(ModMenuRequest data) {
|
||||||
|
|
@ -67,7 +67,7 @@ namespace ModMenu {
|
||||||
|
|
||||||
switch (data.action) {
|
switch (data.action) {
|
||||||
case "cbase":
|
case "cbase":
|
||||||
return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})<br><br>Total Wins: {Codes.TotalWins()}<br>Total Losses: {Codes.TotalLoss()}<br>Equipped Headgear: {Codes.EquippedHeadgear()}<br>Equipped Clothes: {Codes.EquippedClothes()}<br>Equipped Shoes: {Codes.EquippedShoes()}<br>Equipped Weapon: {Codes.EquippedWep()}<br><br>Thread Status:<br>- Write Gear: {WriteGear.Status.ToString()}<br>- Telemetry: {TelemetryThread.Status.ToString()}<br>- Change Gender: {ChangeGender.Status.ToString()}<br>- Change Level: {ChangeLevel.Status.ToString()}<br>- Change Cash: {ChangeCash.Status.ToString()}<br>- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}<br>- Change Headgear: {HeadgearChangeThread.Status.ToString()}<br>- Change Clothes: {ClothesChangeThread.Status.ToString()}<br>- Change Shoes: {ShoesChangeThread.Status.ToString()}<br>- Change Weapon: {WeaponChangeThread.Status.ToString()}";
|
return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})<br><br>Total Wins: {Codes.TotalWins()}<br>Total Losses: {Codes.TotalLoss()}<br>Equipped Headgear: {Codes.EquippedGear("headgear")}<br>Equipped Clothes: {Codes.EquippedGear("clothes")}<br>Equipped Shoes: {Codes.EquippedGear("shoes")}<br>Equipped Weapon: {Codes.EquippedGear("weapon")}<br><br>Thread Status:<br>- Write Gear: {WriteGear.Status.ToString()}<br>- Telemetry: {TelemetryThread.Status.ToString()}<br>- Change Gender: {ChangeGender.Status.ToString()}<br>- Change Level: {ChangeLevel.Status.ToString()}<br>- Change Cash: {ChangeCash.Status.ToString()}<br>- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}<br>- Change Headgear: {HeadgearChangeThread.Status.ToString()}<br>- Change Clothes: {ClothesChangeThread.Status.ToString()}<br>- Change Shoes: {ShoesChangeThread.Status.ToString()}<br>- Change Weapon: {WeaponChangeThread.Status.ToString()}";
|
||||||
|
|
||||||
case "sessiondata":
|
case "sessiondata":
|
||||||
return Codes.GetSessionData();
|
return Codes.GetSessionData();
|
||||||
|
|
@ -184,10 +184,10 @@ namespace ModMenu {
|
||||||
return "1";
|
return "1";
|
||||||
|
|
||||||
case "AllEquipment":
|
case "AllEquipment":
|
||||||
string headgearID = Codes.EquippedHeadgear();
|
string headgearID = Codes.EquippedGear("headgear");
|
||||||
string clothesID = Codes.EquippedClothes();
|
string clothesID = Codes.EquippedGear("clothes");
|
||||||
string shoesID = Codes.EquippedShoes();
|
string shoesID = Codes.EquippedGear("shoes");
|
||||||
string weaponId = Codes.EquippedWep();
|
string weaponId = Codes.EquippedGear("weapon");
|
||||||
return $"{{\"EquippedHeadgearId\": \"{headgearID}\", \"EquippedClothesId\": \"{clothesID}\", \"EquippedShoesId\": \"{shoesID}\", \"EquippedWepId\": \"{weaponId}\"}}";
|
return $"{{\"EquippedHeadgearId\": \"{headgearID}\", \"EquippedClothesId\": \"{clothesID}\", \"EquippedShoesId\": \"{shoesID}\", \"EquippedWepId\": \"{weaponId}\"}}";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue