mirror of
https://git.crafterpika.cc/crafterpika/SplatTool-public.git
synced 2026-08-17 10:42:15 +02:00
add support for editing headgear, clothes and shoes, seperate into it's own tab
This commit is contained in:
parent
2d900b0cae
commit
100de2a71b
5 changed files with 179 additions and 14 deletions
26
Func.cs
26
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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
52
httpMenu.cs
52
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})<br><br>Total Wins: {Codes.TotalWins()}<br>Total Losses: {Codes.TotalLoss()}<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 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.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()}";
|
||||
|
||||
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";
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<div class="tab-menu">
|
||||
<button class="tab-link active" onclick="openTab(event, 'Tab1')">Player & Lobby</button>
|
||||
<button class="tab-link" onclick="openTab(event, 'Tab8')">Save Editor</button>
|
||||
<button class="tab-link" onclick="openTab(event, 'Tab9')">Equipment</button>
|
||||
<button class="tab-link" onclick="openTab(event, 'Tab4')">Utilities</button>
|
||||
<button class="tab-link" onclick="openTab(event, 'Tab5')">PID Grabber</button>
|
||||
<button class="tab-link" onclick="openTab(event, 'Tab6')">Stats</button>
|
||||
|
|
@ -118,6 +119,44 @@
|
|||
<button class="action-btn" onclick="SeaSnails()">Toggle Thread</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="Tab9" class="tab-content">
|
||||
<div class="profile-card">
|
||||
<div class="input-row">
|
||||
<div class="label-stack">
|
||||
<span class="input-label">Change Headgear:</span>
|
||||
<span class="input-note">Changes Equipped Headgear.</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="headgear-sets" class="dropdown" style="flex: 1;"></select>
|
||||
<button class="action-btn" onclick="changeHeadgear()">Toggle Thread</button>
|
||||
<button class="action-btn" onclick="changeHeadgearApply()">Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-row">
|
||||
<div class="label-stack">
|
||||
<span class="input-label">Change Clothes:</span>
|
||||
<span class="input-note">Changes Clothes Headgear.</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="clothes-sets" class="dropdown" style="flex: 1;"></select>
|
||||
<button class="action-btn" onclick="changeClothes()">Toggle Thread</button>
|
||||
<button class="action-btn" onclick="changeClothesApply()">Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-row">
|
||||
<div class="label-stack">
|
||||
<span class="input-label">Change Shoes:</span>
|
||||
<span class="input-note">Changes Shoes Headgear.</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="shoes-sets" class="dropdown" style="flex: 1;"></select>
|
||||
<button class="action-btn" onclick="changeShoes()">Toggle Thread</button>
|
||||
<button class="action-btn" onclick="changeShoesApply()">Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-row">
|
||||
<div class="label-stack">
|
||||
<span class="input-label">Change Weapon:</span>
|
||||
|
|
@ -126,6 +165,7 @@
|
|||
<div class="input-group">
|
||||
<select id="weapon-sets" class="dropdown" style="flex: 1;"></select>
|
||||
<button class="action-btn" onclick="changeWeapon()">Toggle Thread</button>
|
||||
<button class="action-btn" onclick="changeWeaponApply()">Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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]); }
|
||||
|
|
|
|||
Loading…
Reference in a new issue