diff --git a/Func.cs b/Func.cs index 5f5660e..5c76a66 100644 --- a/Func.cs +++ b/Func.cs @@ -200,6 +200,32 @@ namespace Func { return "Game not fully loaded yet..."; } } + + + public static string EquippedHeadgear() { + try { + var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x188))}"; + } catch { + return "Game not fully loaded yet..."; + } + } + public static string EquippedClothes() { + try { + var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x180))}"; + } catch { + return "Game not fully loaded yet..."; + } + } + public static string EquippedShoes() { + try { + 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)); diff --git a/SaveEditor.cs b/SaveEditor.cs index 2c58014..ca89462 100644 --- a/SaveEditor.cs +++ b/SaveEditor.cs @@ -153,6 +153,18 @@ namespace ModMenu { Program.writeUInt32((uint)(p_save_start + 0xA5B4), amount); } + public static void ChangeEquippedHeadgear(uint WeaponSetID) { + 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); diff --git a/httpMenu.cs b/httpMenu.cs index 3378c25..adb4944 100644 --- a/httpMenu.cs +++ b/httpMenu.cs @@ -22,6 +22,9 @@ namespace ModMenu { public static uint Level; public static uint Cash; public static uint SeaSnails; + public static uint HeadgearID; + public static uint ClothesID; + public static uint ShoesID; public static uint WeaponSetID; public static SessionData session = new SessionData(); static WorkThread sessiondIdThread = new WorkThread(() => { @@ -46,6 +49,15 @@ namespace ModMenu { Thread.Sleep(5000); SplatTelemetry.SendTelemetry(); }); + static WorkThread HeadgearChangeThread = new WorkThread(() => { + SaveEditor.ChangeEquippedHeadgear(HeadgearID); + }); + static WorkThread ClothesChangeThread = new WorkThread(() => { + SaveEditor.ChangeEquippedClothes(ClothesID); + }); + static WorkThread ShoesChangeThread = new WorkThread(() => { + SaveEditor.ChangeEquippedShoes(ShoesID); + }); static WorkThread WeaponChangeThread = new WorkThread(() => { SaveEditor.ChangeEquippedWeapon(WeaponSetID); }); @@ -55,7 +67,7 @@ namespace ModMenu { switch (data.action) { case "cbase": - return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})

Total Wins: {Codes.TotalWins()}
Total Losses: {Codes.TotalLoss()}
Equipped Weapon: {Codes.EquippedWep()}

Thread Status:
- Write Gear: {WriteGear.Status.ToString()}
- Telemetry: {TelemetryThread.Status.ToString()}
- Change Gender: {ChangeGender.Status.ToString()}
- Change Level: {ChangeLevel.Status.ToString()}
- Change Cash: {ChangeCash.Status.ToString()}
- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}
- Change Weapon: {WeaponChangeThread.Status.ToString()}"; + return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})

Total Wins: {Codes.TotalWins()}
Total Losses: {Codes.TotalLoss()}
Equipped Headgear: {Codes.EquippedHeadgear()}
Equipped Clothes: {Codes.EquippedClothes()}
Equipped Shoes: {Codes.EquippedShoes()}
Equipped Weapon: {Codes.EquippedWep()}

Thread Status:
- Write Gear: {WriteGear.Status.ToString()}
- Telemetry: {TelemetryThread.Status.ToString()}
- Change Gender: {ChangeGender.Status.ToString()}
- Change Level: {ChangeLevel.Status.ToString()}
- Change Cash: {ChangeCash.Status.ToString()}
- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}
- Change Headgear: {HeadgearChangeThread.Status.ToString()}
- Change Clothes: {ClothesChangeThread.Status.ToString()}
- Change Shoes: {ShoesChangeThread.Status.ToString()}
- Change Weapon: {WeaponChangeThread.Status.ToString()}"; case "sessiondata": return Codes.GetSessionData(); @@ -135,14 +147,48 @@ namespace ModMenu { HandleThread(TelemetryThread); return "1"; + case "HeadgearChange": + HeadgearID = UInt32.Parse(data.settings[0]); + HandleThread(HeadgearChangeThread); + return "1"; + + case "HeadgearChangeApply": + HeadgearID = UInt32.Parse(data.settings[0]); + return "1"; + + case "ClothesChange": + ClothesID = UInt32.Parse(data.settings[0]); + HandleThread(ClothesChangeThread); + return "1"; + + case "ClothesChangeApply": + ClothesID = UInt32.Parse(data.settings[0]); + return "1"; + + case "ShoesChange": + ShoesID = UInt32.Parse(data.settings[0]); + HandleThread(ShoesChangeThread); + return "1"; + + case "ShoesChangeApply": + ShoesID = UInt32.Parse(data.settings[0]); + return "1"; + case "WepChange": WeaponSetID = UInt32.Parse(data.settings[0]); HandleThread(WeaponChangeThread); return "1"; - case "EquippedWep": + case "WepChangeApply": + WeaponSetID = UInt32.Parse(data.settings[0]); + return "1"; + + case "AllEquipment": + string headgearID = Codes.EquippedHeadgear(); + string clothesID = Codes.EquippedClothes(); + string shoesID = Codes.EquippedShoes(); string weaponId = Codes.EquippedWep(); - return $"{{\"EquippedWepId\": \"{weaponId}\"}}"; + return $"{{\"EquippedHeadgearId\": \"{headgearID}\", \"EquippedClothesId\": \"{clothesID}\", \"EquippedShoesId\": \"{shoesID}\", \"EquippedWepId\": \"{weaponId}\"}}"; default: return "Not Found"; diff --git a/modmenu/index.html b/modmenu/index.html index 72c703e..9ddf0f5 100644 --- a/modmenu/index.html +++ b/modmenu/index.html @@ -14,6 +14,7 @@
+ @@ -118,6 +119,44 @@
+ + + +
+
+
+
+ Change Headgear: + Changes Equipped Headgear. +
+
+ + + +
+
+
+
+ Change Clothes: + Changes Clothes Headgear. +
+
+ + + +
+
+
+
+ Change Shoes: + Changes Shoes Headgear. +
+
+ + + +
+
Change Weapon: @@ -126,6 +165,7 @@
+
diff --git a/modmenu/script.js b/modmenu/script.js index c6e6b82..4b848e5 100644 --- a/modmenu/script.js +++ b/modmenu/script.js @@ -73,17 +73,45 @@ function populateAbilities() { }); } -function populateWeaponSets() { - const select = document.getElementById("weapon-sets"); - select.innerHTML = ''; +function populateEquipment() { + const weapons = document.getElementById("weapon-sets"); + const headgear = document.getElementById("headgear-sets"); + const clothes = document.getElementById("clothes-sets"); + const shoes = document.getElementById("shoes-sets"); + + weapons.innerHTML = ''; for (const [val, name] of Object.entries(gearData.WeaponSetIds)) { const opt = document.createElement('option'); opt.value = val; opt.textContent = name; - select.appendChild(opt); + weapons.appendChild(opt); } - sendToCSharp("EquippedWep"); + headgear.innerHTML = ''; + for (const [val, name] of Object.entries(gearData.headgear)) { + const opt = document.createElement('option'); + opt.value = val; + opt.textContent = name; + headgear.appendChild(opt); + } + + clothes.innerHTML = ''; + for (const [val, name] of Object.entries(gearData.clothes)) { + const opt = document.createElement('option'); + opt.value = val; + opt.textContent = name; + clothes.appendChild(opt); + } + + shoes.innerHTML = ''; + for (const [val, name] of Object.entries(gearData.shoes)) { + const opt = document.createElement('option'); + opt.value = val; + opt.textContent = name; + shoes.appendChild(opt); + } + + sendToCSharp("AllEquipment"); } window.external.receiveMessage(message => { @@ -98,11 +126,17 @@ window.external.receiveMessage(message => { try { const data = JSON.parse(message); - //console.log("Parsed Data:", data); + console.log("Parsed Data:", data); if (data.EquippedWepId !== undefined) { - const select = document.getElementById("weapon-sets"); - select.value = data.EquippedWepId; + const weapons = document.getElementById("weapon-sets"); + const headgear = document.getElementById("headgear-sets"); + const clothes = document.getElementById("clothes-sets"); + const shoes = document.getElementById("shoes-sets"); + weapons.value = data.EquippedWepId; + headgear.value = data.EquippedHeadgearId; + clothes.value = data.EquippedClothesId; + shoes.value = data.EquippedShoesId; return; } @@ -232,15 +266,14 @@ function openTab(evt, tabName) { if (tabName === 'Tab6') { keepStatsUpdated = true; updateStatsPage(); - } else if (tabName == 'Tab8') { - populateWeaponSets() + } else if (tabName == 'Tab9') { + populateEquipment() } else { keepStatsUpdated = false; } } function namechange() { sendToCSharp("namechange", [document.getElementById("name-input").value]); } -function changeWeapon() { sendToCSharp("WepChange", [document.getElementById("weapon-sets").value]); } function sessionid() { sendToCSharp("sessionid", [document.getElementById("session-input").value]); } function faceimgtga() { sendToCSharp("faceimgtga", [document.getElementById("format-select").value]); } function GenderChange() { sendToCSharp("ChangeGender", [document.getElementById("gender-select").value]); } @@ -250,3 +283,11 @@ function SeaSnails() { sendToCSharp("ChangeSeaSnails", [document.getElementById( function execute(cheat) { sendToCSharp(cheat); } function fetchCemuBase() { sendToCSharp("cbase"); } function fetchPids() { sendToCSharp("sessiondata"); } +function changeHeadgear() { sendToCSharp("HeadgearChange", [document.getElementById("headgear-sets").value]); } +function changeHeadgearApply() { sendToCSharp("HeadgearChangeApply", [document.getElementById("headgear-sets").value]); } +function changeClothes() { sendToCSharp("ClothesChange", [document.getElementById("clothes-sets").value]); } +function changeClothesApply() { sendToCSharp("ClothesChangeApply", [document.getElementById("clothes-sets").value]); } +function changeShoes() { sendToCSharp("ShoesChange", [document.getElementById("shoes-sets").value]); } +function changeShoesApply() { sendToCSharp("ShoesChangeApply", [document.getElementById("shoes-sets").value]); } +function changeWeapon() { sendToCSharp("WepChange", [document.getElementById("weapon-sets").value]); } +function changeWeaponApply() { sendToCSharp("WepChangeApply", [document.getElementById("weapon-sets").value]); }