Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit b28f6fe

Browse files
authored
Add files via upload
1 parent 17f38cc commit b28f6fe

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

Includes/cheats.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ namespace CTRPluginFramework
3535
void thickFogWeather(MenuEntry *entry);
3636
void getCstickMovement(MenuEntry *entry);
3737
void displayMegapackVersion();
38+
void changeSkinToCustom();
39+
std::vector<std::string> list3dstFiles(const std::string& path);
3840
class Player;
3941
bool IsSwimming();
4042
int GetSlotNumber();

Sources/cheats.cpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
#include "types.h"
44
#include "3ds.h"
55
#include <iostream>
6+
#include <dirent.h>
67
#include <fstream>
78
#include <unordered_map>
89
#include <sstream>
10+
#include <cstring>
911
#include <cstdint>
1012
#include <random>
1113

@@ -117,6 +119,7 @@ namespace CTRPluginFramework
117119
std::string megapackDir;
118120
std::string megapackWorldDir;
119121
std::string megapackCodeDir;
122+
std::string megapackSkinsDir;
120123

121124
void initializePaths() {
122125
processId = Process::GetTitleID();
@@ -130,10 +133,12 @@ namespace CTRPluginFramework
130133
megapackDir = "sdmc:/megapackPlugin";
131134
megapackWorldDir = "sdmc:/megapackPlugin/worldBackups";
132135
megapackCodeDir = "sdmc:/megapackPlugin/codeBackups";
136+
megapackSkinsDir = "sdmc:/megapackPlugin/Skins";
133137
if (Directory::IsExists(megapackDir) == 0){
134138
Directory::Create(megapackDir);
135139
Directory::Create(megapackWorldDir);
136140
Directory::Create(megapackCodeDir);
141+
Directory::Create(megapackSkinsDir);
137142
}
138143
}
139144

@@ -709,6 +714,38 @@ void displayMegapackVersion() {
709714
Process::WriteString(0x340E883C, buffer);
710715
}
711716

712-
717+
//void changeSkinToCustom() {
718+
// static u32 address;
719+
// std::string skinsDir = megapackSkinsDir;
720+
// OSD::Notify(skinsDir);
721+
// std::vector<u64> buffer(0x4000);
722+
// std::vector<std::string> skinFiles;
723+
// Directory dir;
724+
// Directory::Open(dir, skinsDir);
725+
// dir.ListFiles(skinFiles);
726+
// Keyboard kb1("Select a Skin:");
727+
// kb1.Populate(skinFiles);
728+
// int skinIndex = kb1.Open();
729+
// if (skinIndex < 0) return;
730+
// std::string skinName = skinFiles[skinIndex];
731+
// std::string selectedSkin = skinsDir + "/" + skinName;
732+
733+
// if (address == NULL)
734+
735+
736+
// u32 address = 0x30910000;
737+
// File file;
738+
// if (File::Open(file, selectedSkin, File::READ) == 0){
739+
// file.Seek(0x20);
740+
// file.Read(buffer.data(), 0x4000);
741+
//
742+
// for (size_t i = 0; i < 0x4000; i += 8) {
743+
// u64 value = 0;
744+
// std::memcpy(&value, &buffer[i], 8); // Copy 8 bytes from buffer into value
745+
// Process::Write64(address + i, value); // Write 64-bit value to memory
746+
// }
747+
// // }
748+
// file.Close();
749+
// }
713750

714751
}

Sources/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ namespace CTRPluginFramework
170170
}
171171

172172
}));
173+
//toolsFolder->Append(new MenuEntry("Load Skin from SDMC", nullptr, [](MenuEntry *entry)
174+
//{
175+
// if (MessageBox("Are you sure?", "Loading the Skin will a small amount of time. Please be patient as the menu cannot be exited until complete.\nOnce this operation is completed it will affect the 'Steve' skin, and is temporary.", DialogType::DialogOkCancel, ClearScreen::Both)()){
176+
// changeSkinToCustom();
177+
// } else{
178+
// OSD::Notify("Operation cancelled.");
179+
// }
180+
//}));
173181
funFolder->Append(new MenuEntry("Control Mobs (Models)", nullptr, [](MenuEntry *entry)
174182
{
175183
mobController();

0 commit comments

Comments
 (0)