Set up Moon Edition for release
3
Makefile
|
@ -727,6 +727,9 @@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GOD
|
||||||
DUMMY != mkdir -p $(ALL_DIRS)
|
DUMMY != mkdir -p $(ALL_DIRS)
|
||||||
# compressed segment generation
|
# compressed segment generation
|
||||||
|
|
||||||
|
all:
|
||||||
|
if [ ! -d "$(ADDONS_PATH)saturn" ]; then cp -R $(ADDONS)/saturn $(ADDONS_PATH); fi
|
||||||
|
|
||||||
# PC Area
|
# PC Area
|
||||||
$(BUILD_DIR)/%.table: %.aiff
|
$(BUILD_DIR)/%.table: %.aiff
|
||||||
$(AIFF_EXTRACT_CODEBOOK) $< >$@
|
$(AIFF_EXTRACT_CODEBOOK) $< >$@
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
8107EC40 0000
|
||||||
|
8107EC42 BB00
|
||||||
|
8107EC38 0000
|
||||||
|
8107EC3A BB00
|
||||||
|
8107ECA0 7306
|
||||||
|
8107ECA2 0000
|
||||||
|
8107EC98 3903
|
||||||
|
8107EC9A 0000
|
||||||
|
8107EC88 FEC1
|
||||||
|
8107EC8A 7900
|
||||||
|
8107EC80 7F60
|
||||||
|
8107EC82 3C00
|
||||||
|
8107EC58 FFFF
|
||||||
|
8107EC5A FF00
|
||||||
|
8107EC50 7F7F
|
||||||
|
8107EC52 7F00
|
||||||
|
8107EC28 9CB0
|
||||||
|
8107EC2A BB00
|
||||||
|
8107EC68 390E
|
||||||
|
8107EC6A 0700
|
||||||
|
8107EC20 9CB0
|
||||||
|
8107EC22 BB00
|
||||||
|
8107EC70 721C
|
||||||
|
8107EC72 0E00
|
After Width: | Height: | Size: 133 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 712 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.0 KiB |
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"bit": {
|
||||||
|
"name": "Saturn",
|
||||||
|
"authors": [
|
||||||
|
"Llennpie"
|
||||||
|
],
|
||||||
|
"description": "Main module for Saturn",
|
||||||
|
"version": 1.0,
|
||||||
|
"readOnly": true
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,9 +69,9 @@ namespace MoonInternal {
|
||||||
if(saveCache.find(fileIndex) == saveCache.end()){
|
if(saveCache.find(fileIndex) == saveCache.end()){
|
||||||
#ifndef TARGET_SWITCH
|
#ifndef TARGET_SWITCH
|
||||||
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
||||||
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/moon64/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/SaturnME/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
||||||
#else
|
#else
|
||||||
string path = "sdmc:/moon64/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
string path = "sdmc:/SaturnME/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
||||||
#endif
|
#endif
|
||||||
saveCache[fileIndex] = new MoonCFG(path, false);
|
saveCache[fileIndex] = new MoonCFG(path, false);
|
||||||
#ifdef GAME_DEBUG
|
#ifdef GAME_DEBUG
|
||||||
|
@ -205,9 +205,9 @@ namespace MoonInternal {
|
||||||
void eraseSaveFile( int fileIndex ){
|
void eraseSaveFile( int fileIndex ){
|
||||||
#ifndef TARGET_SWITCH
|
#ifndef TARGET_SWITCH
|
||||||
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
||||||
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/moon64/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/SaturnME/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
||||||
#else
|
#else
|
||||||
string path = "sdmc:/moon64/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
string path = "sdmc:/SaturnME/Moon64-Save-"+to_string(fileIndex + 1)+".dat";
|
||||||
#endif
|
#endif
|
||||||
if(fs::exists(path))
|
if(fs::exists(path))
|
||||||
fs::remove(path);
|
fs::remove(path);
|
||||||
|
@ -218,7 +218,7 @@ namespace MoonInternal {
|
||||||
// Scan old save format
|
// Scan old save format
|
||||||
#ifndef TARGET_SWITCH
|
#ifndef TARGET_SWITCH
|
||||||
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
string cwd = MoonInternal::getEnvironmentVar("MOON_UPATH");
|
||||||
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/moon64/";
|
string path = cwd.substr(0, cwd.find_last_of("/\\")) + "/SaturnME/";
|
||||||
#else
|
#else
|
||||||
string path = "sdmc:/";
|
string path = "sdmc:/";
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -127,4 +127,27 @@ void MoonFS::read(string file, EntryFileData *entry){
|
||||||
|
|
||||||
string MoonFS::getPath(){
|
string MoonFS::getPath(){
|
||||||
return this->path;
|
return this->path;
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_binary(string file, char *data, int size){
|
||||||
|
std::ofstream out(file, std::ios::out | std::ios::binary);
|
||||||
|
if(!out) return;
|
||||||
|
|
||||||
|
out.write(data, size);
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoonFS::extract(string dir){
|
||||||
|
if(this->type) return;
|
||||||
|
|
||||||
|
for(auto &path : this->entries()){
|
||||||
|
string file = FSUtils::joinPath(dir, path);
|
||||||
|
EntryFileData *entry;
|
||||||
|
this->read(path, entry = new EntryFileData());
|
||||||
|
if(!entry->size && !fs::exists(file)){
|
||||||
|
fs::create_directories(file);
|
||||||
|
} else {
|
||||||
|
if(!fs::exists(file)) write_binary(file, entry->data, entry->size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,7 @@ public:
|
||||||
std::wstring readWide(std::string file);
|
std::wstring readWide(std::string file);
|
||||||
void read(std::string file, EntryFileData *entry);
|
void read(std::string file, EntryFileData *entry);
|
||||||
std::string getPath();
|
std::string getPath();
|
||||||
|
void extract(std::string path);
|
||||||
void close();
|
void close();
|
||||||
protected:
|
protected:
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
|
@ -176,6 +176,15 @@ namespace MoonInternal {
|
||||||
|
|
||||||
int selected_eye_item = 0;
|
int selected_eye_item = 0;
|
||||||
|
|
||||||
|
int selected_emblem_item = 1;
|
||||||
|
int current_emblem_item = 1;
|
||||||
|
int selected_stache_item = 0;
|
||||||
|
int current_stache_item = 0;
|
||||||
|
int selected_button_item = 0;
|
||||||
|
int current_button_item = 0;
|
||||||
|
int selected_sideburn_item = 0;
|
||||||
|
int current_sideburn_item = 0;
|
||||||
|
|
||||||
int selected_sky_item = 0;
|
int selected_sky_item = 0;
|
||||||
int current_sky_item = 0;
|
int current_sky_item = 0;
|
||||||
|
|
||||||
|
@ -273,6 +282,10 @@ namespace MoonInternal {
|
||||||
#ifdef TARGET_SWITCH
|
#ifdef TARGET_SWITCH
|
||||||
MoonNX::handleVirtualKeyboard("Init");
|
MoonNX::handleVirtualKeyboard("Init");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static char cc_gameshark[1024 * 16] = "";
|
||||||
|
apply_cc_from_editor();
|
||||||
|
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
||||||
}});
|
}});
|
||||||
|
|
||||||
Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [](HookCall call){
|
Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [](HookCall call){
|
||||||
|
@ -340,12 +353,12 @@ namespace MoonInternal {
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (ImGui::BeginMenu("Tools")) {
|
if (ImGui::BeginMenu("Tools")) {
|
||||||
ImGui::MenuItem("Toggle View (F1)", NULL, &show_menu_bar);
|
ImGui::MenuItem("Toggle View (F1)", NULL, &show_menu_bar);
|
||||||
ImGui::MenuItem("Jabo Mode", NULL, &configImGui.n64Mode);
|
ImGui::MenuItem("Jabo Mode", NULL, &configImGui.jaboMode);
|
||||||
ImGui::MenuItem("Night Mode", NULL, &enable_night_skybox);
|
//ImGui::MenuItem("Night Mode", NULL, &enable_night_skybox);
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("View")) {
|
if (ImGui::BeginMenu("View")) {
|
||||||
ImGui::MenuItem("Stats", NULL, &configImGui.moon64);
|
ImGui::MenuItem("Stats", NULL, &configImGui.s_stats);
|
||||||
ImGui::MenuItem("Machinima", NULL, &configImGui.s_machinima);
|
ImGui::MenuItem("Machinima", NULL, &configImGui.s_machinima);
|
||||||
ImGui::MenuItem("Quick Toggles", NULL, &configImGui.s_toggles);
|
ImGui::MenuItem("Quick Toggles", NULL, &configImGui.s_toggles);
|
||||||
ImGui::MenuItem("Appearance", NULL, &configImGui.s_appearance);
|
ImGui::MenuItem("Appearance", NULL, &configImGui.s_appearance);
|
||||||
|
@ -390,11 +403,11 @@ namespace MoonInternal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configWindow.internal_w = (configImGui.n64Mode && !show_menu_bar) ? SM64_WIDTH : size.x;
|
configWindow.internal_w = (configImGui.jaboMode && !show_menu_bar) ? SM64_WIDTH : size.x;
|
||||||
configWindow.internal_h = (configImGui.n64Mode && !show_menu_bar) ? SM64_HEIGHT : size.y;
|
configWindow.internal_h = (configImGui.jaboMode && !show_menu_bar) ? SM64_HEIGHT : size.y;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(configImGui.n64Mode) {
|
if(configImGui.jaboMode) {
|
||||||
configWindow.multiplier = (float)n64Mul;
|
configWindow.multiplier = (float)n64Mul;
|
||||||
int sw = size.y * SM64_WIDTH / SM64_HEIGHT;
|
int sw = size.y * SM64_WIDTH / SM64_HEIGHT;
|
||||||
pos = ImVec2(size.x / 2 - sw / 2, 0);
|
pos = ImVec2(size.x / 2 - sw / 2, 0);
|
||||||
|
@ -406,7 +419,7 @@ namespace MoonInternal {
|
||||||
ImGui::ImageRotated((ImTextureID) fbuf, pos, size, 180.0f);
|
ImGui::ImageRotated((ImTextureID) fbuf, pos, size, 180.0f);
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
if (configImGui.moon64 && show_menu_bar){
|
if (configImGui.s_stats && show_menu_bar){
|
||||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||||
ImGui::Begin("Stats", NULL, ImGuiWindowFlags_None);
|
ImGui::Begin("Stats", NULL, ImGuiWindowFlags_None);
|
||||||
|
|
||||||
|
@ -421,37 +434,37 @@ namespace MoonInternal {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||||
ImGui::Begin("Quick Toggles", NULL, ImGuiWindowFlags_None);
|
ImGui::Begin("Quick Toggles", NULL, ImGuiWindowFlags_None);
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
|
||||||
ImGui::Checkbox("HUD", &configHUD);
|
ImGui::Checkbox("HUD", &configHUD);
|
||||||
|
ImGui::Checkbox("Head Rotations", &enable_head_rotations);
|
||||||
|
|
||||||
if (ImGui::CollapsingHeader("Mario")) {
|
const char* capStates[] = { "Cap On", "Cap Off", "Wing Cap" }; // unused "wing cap off" not included
|
||||||
ImGui::Checkbox("Head Rotations", &enable_head_rotations);
|
ImGui::Combo("Cap", ¤t_cap_state, capStates, IM_ARRAYSIZE(capStates));
|
||||||
ImGui::Checkbox("M Cap Logo", &enable_cap_logo);
|
const char* handStates[] = { "Fists", "Open", "Peace", "With Cap", "With Wing Cap", "Right Open" };
|
||||||
ImGui::Checkbox("M Overall Buttons", &enable_overall_buttons);
|
ImGui::Combo("Hands", ¤t_hand_state, handStates, IM_ARRAYSIZE(handStates));
|
||||||
const char* capStates[] = { "Cap On", "Cap Off", "Wing Cap" }; // unused "wing cap off" not included
|
|
||||||
ImGui::Combo("Cap", ¤t_cap_state, capStates, IM_ARRAYSIZE(capStates));
|
|
||||||
const char* handStates[] = { "Fists", "Open", "Peace", "With Cap", "With Wing Cap", "Right Open" };
|
|
||||||
ImGui::Combo("Hands", ¤t_hand_state, handStates, IM_ARRAYSIZE(handStates));
|
|
||||||
ImGui::Checkbox("Dust Particles", &enable_dust_particles);
|
|
||||||
ImGui::Dummy(ImVec2(0, 5));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
|
||||||
|
ImGui::Checkbox("Dust Particles", &enable_dust_particles);
|
||||||
ImGui::Checkbox("Shadows", &enable_shadows);
|
ImGui::Checkbox("Shadows", &enable_shadows);
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
|
||||||
|
/*
|
||||||
const char* skyStates[] = { "Default", "Night", "Green", "Blue", "Pink"};
|
const char* skyStates[] = { "Default", "Night", "Green", "Blue", "Pink"};
|
||||||
ImGui::Combo("Skybox", &selected_sky_item, skyStates, IM_ARRAYSIZE(skyStates));
|
ImGui::Combo("Skybox", &selected_sky_item, skyStates, IM_ARRAYSIZE(skyStates));
|
||||||
|
|
||||||
if (selected_sky_item != current_sky_item) {
|
if (selected_sky_item != current_sky_item) {
|
||||||
current_sky_item = selected_sky_item;
|
current_sky_item = selected_sky_item;
|
||||||
if (selected_sky_item == 0) custom_sky_name = "default";
|
if (selected_sky_item == 0) custom_sky_name = "default";
|
||||||
if (selected_sky_item == 1) custom_sky_name = "skyboxes/night";
|
if (selected_sky_item == 1) custom_sky_name = "saturn/skyboxes/night";
|
||||||
if (selected_sky_item == 2) custom_sky_name = "skyboxes/green";
|
if (selected_sky_item == 2) custom_sky_name = "saturn/skyboxes/green";
|
||||||
if (selected_sky_item == 3) custom_sky_name = "skyboxes/blue";
|
if (selected_sky_item == 3) custom_sky_name = "saturn/skyboxes/blue";
|
||||||
if (selected_sky_item == 4) custom_sky_name = "skyboxes/pink";
|
if (selected_sky_item == 4) custom_sky_name = "saturn/skyboxes/pink";
|
||||||
saturn_sky_swap();
|
saturn_sky_swap();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//ImGui::Checkbox("Night Mode", &enable_night_skybox);
|
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, 5));
|
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
@ -470,51 +483,6 @@ namespace MoonInternal {
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, 10));
|
ImGui::Dummy(ImVec2(0, 10));
|
||||||
|
|
||||||
ImGui::Text("Eye State");
|
|
||||||
const char* eyeStates[] = { "Default", "Open", "Half", "Closed", "Custom...", "Dead" };
|
|
||||||
ImGui::Combo("Eyes", &selected_eye_item, eyeStates, IM_ARRAYSIZE(eyeStates));
|
|
||||||
if (selected_eye_item == 0) current_eye_state = 0;
|
|
||||||
if (selected_eye_item == 1) current_eye_state = 1;
|
|
||||||
if (selected_eye_item == 2) current_eye_state = 2;
|
|
||||||
if (selected_eye_item == 3) current_eye_state = 3;
|
|
||||||
if (selected_eye_item == 5) current_eye_state = 8; // dead
|
|
||||||
if (selected_eye_item == 4) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
SATURN: Moon Edition uses the unused "Left" eye state for custom textures.
|
|
||||||
|
|
||||||
If you are a model author, you must manually add the switch option to your model.
|
|
||||||
You can do this in Fast64 by navigating to 000-switch.001's bone and adding a material override under Switch Option 3.
|
|
||||||
Switch Option 7 is the "Dead" eye state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
current_eye_state = 4;
|
|
||||||
static int current_eye_id = 0;
|
|
||||||
string eye_name = eye_array[current_eye_id];
|
|
||||||
if (ImGui::BeginCombo(".png", eye_name.c_str()))
|
|
||||||
{
|
|
||||||
for (int o = 0; o < eye_array.size(); o++)
|
|
||||||
{
|
|
||||||
const bool is_eye_selected = (current_eye_id == o);
|
|
||||||
eye_name = eye_array[o];
|
|
||||||
if (ImGui::Selectable(eye_name.c_str(), is_eye_selected)) {
|
|
||||||
current_eye_id = o;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
|
||||||
if (is_eye_selected)
|
|
||||||
ImGui::SetItemDefaultFocus();
|
|
||||||
}
|
|
||||||
ImGui::EndCombo();
|
|
||||||
}
|
|
||||||
if (ImGui::Button("Set Eyes")) {
|
|
||||||
custom_eye_name = "eyes/" + eye_array[current_eye_id];
|
|
||||||
saturn_eye_swap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, 10));
|
|
||||||
|
|
||||||
ImGui::Text("Select Color Code");
|
ImGui::Text("Select Color Code");
|
||||||
static int current_cc_id = 0;
|
static int current_cc_id = 0;
|
||||||
string cc_name = MoonInternal::cc_array[current_cc_id].substr(0, MoonInternal::cc_array[current_cc_id].size() - 3);
|
string cc_name = MoonInternal::cc_array[current_cc_id].substr(0, MoonInternal::cc_array[current_cc_id].size() - 3);
|
||||||
|
@ -560,6 +528,235 @@ namespace MoonInternal {
|
||||||
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 10));
|
||||||
|
|
||||||
|
ImGui::Text("Eye State");
|
||||||
|
const char* eyeStates[] = { "Default", "Custom...", "Open", "Half", "Closed", "Dead" };
|
||||||
|
ImGui::Combo("Eyes", &selected_eye_item, eyeStates, IM_ARRAYSIZE(eyeStates));
|
||||||
|
if (selected_eye_item == 0) current_eye_state = 0;
|
||||||
|
if (selected_eye_item == 1 && eye_array.size() > 0) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
SATURN: Moon Edition uses the unused "Left" eye state for custom textures.
|
||||||
|
|
||||||
|
If you are a model author, you must manually add the switch option to your model.
|
||||||
|
You can do this in Fast64 by navigating to 000-switch.001's bone and adding a material override under Switch Option 3.
|
||||||
|
Switch Option 7 is the "Dead" eye state.
|
||||||
|
*/
|
||||||
|
|
||||||
|
current_eye_state = 4;
|
||||||
|
static int current_eye_id = 0;
|
||||||
|
string eye_name = eye_array[current_eye_id];
|
||||||
|
if (ImGui::BeginCombo(".png ###eye", eye_name.c_str()))
|
||||||
|
{
|
||||||
|
for (int o = 0; o < eye_array.size(); o++)
|
||||||
|
{
|
||||||
|
const bool is_eye_selected = (current_eye_id == o);
|
||||||
|
eye_name = eye_array[o];
|
||||||
|
if (ImGui::Selectable(eye_name.c_str(), is_eye_selected)) {
|
||||||
|
current_eye_id = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||||
|
if (is_eye_selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Set Eyes")) {
|
||||||
|
custom_eye_name = "saturn/eyes/" + eye_array[current_eye_id];
|
||||||
|
saturn_eye_swap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (selected_eye_item == 2) current_eye_state = 1;
|
||||||
|
if (selected_eye_item == 3) current_eye_state = 2;
|
||||||
|
if (selected_eye_item == 4) current_eye_state = 3;
|
||||||
|
if (selected_eye_item == 5) current_eye_state = 8; // dead eyes
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
|
||||||
|
if (ImGui::CollapsingHeader("Mario")) {
|
||||||
|
const char* emblemStates[] = { "Default", "None", "Custom..." };
|
||||||
|
ImGui::Combo("Emblem", &selected_emblem_item, emblemStates, IM_ARRAYSIZE(emblemStates));
|
||||||
|
if (selected_emblem_item == 0 && current_emblem_item != 0) {
|
||||||
|
current_emblem_item = 0;
|
||||||
|
custom_emblem_name = "default";
|
||||||
|
saturn_emblem_swap();
|
||||||
|
} else if (selected_emblem_item == 1 && current_emblem_item != 1) {
|
||||||
|
current_emblem_item = 1;
|
||||||
|
custom_emblem_name = "saturn/blank";
|
||||||
|
saturn_emblem_swap();
|
||||||
|
}
|
||||||
|
else if (selected_emblem_item == 2 && emblem_array.size() > 0) {
|
||||||
|
static int current_emblem_id = 0;
|
||||||
|
|
||||||
|
// Only do this once
|
||||||
|
if (current_emblem_item != 2) {
|
||||||
|
current_emblem_item = 2;
|
||||||
|
custom_emblem_name = "emblems/" + emblem_array[current_emblem_id];
|
||||||
|
saturn_emblem_swap();
|
||||||
|
}
|
||||||
|
|
||||||
|
string emblem_name = emblem_array[current_emblem_id];
|
||||||
|
if (ImGui::BeginCombo(".png ###emblem", emblem_name.c_str()))
|
||||||
|
{
|
||||||
|
for (int o = 0; o < emblem_array.size(); o++)
|
||||||
|
{
|
||||||
|
const bool is_emblem_selected = (current_emblem_id == o);
|
||||||
|
emblem_name = emblem_array[o];
|
||||||
|
if (ImGui::Selectable(emblem_name.c_str(), is_emblem_selected)) {
|
||||||
|
current_emblem_id = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||||
|
if (is_emblem_selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Set Emblem")) {
|
||||||
|
custom_emblem_name = "emblems/" + emblem_array[current_emblem_id];
|
||||||
|
saturn_emblem_swap();
|
||||||
|
}
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* stacheStates[] = { "Default", "None", "Custom..." };
|
||||||
|
ImGui::Combo("Stache", &selected_stache_item, stacheStates, IM_ARRAYSIZE(stacheStates));
|
||||||
|
if (selected_stache_item == 0 && current_stache_item != 0) {
|
||||||
|
current_stache_item = 0;
|
||||||
|
custom_stache_name = "default";
|
||||||
|
saturn_stache_swap();
|
||||||
|
} else if (selected_stache_item == 1 && current_stache_item != 1) {
|
||||||
|
current_stache_item = 1;
|
||||||
|
custom_stache_name = "saturn/blank";
|
||||||
|
saturn_stache_swap();
|
||||||
|
}
|
||||||
|
else if (selected_stache_item == 2 && stache_array.size() > 0) {
|
||||||
|
static int current_stache_id = 0;
|
||||||
|
|
||||||
|
// Only do this once
|
||||||
|
if (current_stache_item != 2) {
|
||||||
|
current_stache_item = 2;
|
||||||
|
custom_stache_name = "staches/" + stache_array[current_stache_id];
|
||||||
|
saturn_stache_swap();
|
||||||
|
}
|
||||||
|
|
||||||
|
string stache_name = stache_array[current_stache_id];
|
||||||
|
if (ImGui::BeginCombo(".png ###stache", stache_name.c_str()))
|
||||||
|
{
|
||||||
|
for (int o = 0; o < stache_array.size(); o++)
|
||||||
|
{
|
||||||
|
const bool is_stache_selected = (current_stache_id == o);
|
||||||
|
stache_name = stache_array[o];
|
||||||
|
if (ImGui::Selectable(stache_name.c_str(), is_stache_selected)) {
|
||||||
|
current_stache_id = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||||
|
if (is_stache_selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Set Stache")) {
|
||||||
|
custom_stache_name = "staches/" + stache_array[current_stache_id];
|
||||||
|
saturn_stache_swap();
|
||||||
|
}
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* buttonStates[] = { "Default", "None", "Custom..." };
|
||||||
|
ImGui::Combo("Buttons", &selected_button_item, buttonStates, IM_ARRAYSIZE(buttonStates));
|
||||||
|
if (selected_button_item == 0 && current_button_item != 0) {
|
||||||
|
current_button_item = 0;
|
||||||
|
custom_button_name = "default";
|
||||||
|
saturn_button_swap();
|
||||||
|
} else if (selected_button_item == 1 && current_button_item != 1) {
|
||||||
|
current_button_item = 1;
|
||||||
|
custom_button_name = "saturn/blank";
|
||||||
|
saturn_button_swap();
|
||||||
|
}
|
||||||
|
else if (selected_button_item == 2 && button_array.size() > 0) {
|
||||||
|
static int current_button_id = 0;
|
||||||
|
|
||||||
|
// Only do this once
|
||||||
|
if (current_button_item != 2) {
|
||||||
|
current_button_item = 2;
|
||||||
|
custom_button_name = "buttons/" + button_array[current_button_id];
|
||||||
|
saturn_button_swap();
|
||||||
|
}
|
||||||
|
|
||||||
|
string button_name = button_array[current_button_id];
|
||||||
|
if (ImGui::BeginCombo(".png ###button", button_name.c_str()))
|
||||||
|
{
|
||||||
|
for (int o = 0; o < button_array.size(); o++)
|
||||||
|
{
|
||||||
|
const bool is_button_selected = (current_button_id == o);
|
||||||
|
button_name = button_array[o];
|
||||||
|
if (ImGui::Selectable(button_name.c_str(), is_button_selected)) {
|
||||||
|
current_button_id = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||||
|
if (is_button_selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Set Buttons")) {
|
||||||
|
custom_button_name = "buttons/" + button_array[current_button_id];
|
||||||
|
saturn_button_swap();
|
||||||
|
}
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* sideburnStates[] = { "Default", "None", "Custom..." };
|
||||||
|
ImGui::Combo("Sideburns", &selected_sideburn_item, sideburnStates, IM_ARRAYSIZE(sideburnStates));
|
||||||
|
if (selected_sideburn_item == 0 && current_sideburn_item != 0) {
|
||||||
|
current_sideburn_item = 0;
|
||||||
|
custom_sideburn_name = "default";
|
||||||
|
saturn_sideburn_swap();
|
||||||
|
} else if (selected_sideburn_item == 1 && current_sideburn_item != 1) {
|
||||||
|
current_sideburn_item = 1;
|
||||||
|
custom_sideburn_name = "saturn/blank";
|
||||||
|
saturn_sideburn_swap();
|
||||||
|
}
|
||||||
|
else if (selected_sideburn_item == 2 && sideburn_array.size() > 0) {
|
||||||
|
static int current_sideburn_id = 0;
|
||||||
|
|
||||||
|
// Only do this once
|
||||||
|
if (current_sideburn_item != 2) {
|
||||||
|
current_sideburn_item = 2;
|
||||||
|
custom_sideburn_name = "sideburns/" + sideburn_array[current_sideburn_id];
|
||||||
|
saturn_sideburn_swap();
|
||||||
|
}
|
||||||
|
|
||||||
|
string sideburn_name = sideburn_array[current_sideburn_id];
|
||||||
|
if (ImGui::BeginCombo(".png ###sideburn", sideburn_name.c_str()))
|
||||||
|
{
|
||||||
|
for (int o = 0; o < sideburn_array.size(); o++)
|
||||||
|
{
|
||||||
|
const bool is_sideburn_selected = (current_sideburn_id == o);
|
||||||
|
sideburn_name = sideburn_array[o];
|
||||||
|
if (ImGui::Selectable(sideburn_name.c_str(), is_sideburn_selected)) {
|
||||||
|
current_sideburn_id = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||||
|
if (is_sideburn_selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
if (ImGui::Button("Set Sideburns")) {
|
||||||
|
custom_sideburn_name = "sideburns/" + sideburn_array[current_sideburn_id];
|
||||||
|
saturn_sideburn_swap();
|
||||||
|
}
|
||||||
|
ImGui::Dummy(ImVec2(0, 5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
|
@ -676,7 +873,7 @@ namespace MoonInternal {
|
||||||
ImGui::Checkbox("VSync", &configWindow.vsync);
|
ImGui::Checkbox("VSync", &configWindow.vsync);
|
||||||
ImGui::Text("Internal Multiplier");
|
ImGui::Text("Internal Multiplier");
|
||||||
ImGui::SliderFloat("###internal_multiplier", &configWindow.multiplier, 1.0f, 4.0f);
|
ImGui::SliderFloat("###internal_multiplier", &configWindow.multiplier, 1.0f, 4.0f);
|
||||||
ImGui::Checkbox("Jabo Mode", &configImGui.n64Mode);
|
ImGui::Checkbox("Jabo Mode", &configImGui.jaboMode);
|
||||||
ImGui::SameLine(); HelpMarker(
|
ImGui::SameLine(); HelpMarker(
|
||||||
"Mimics Project64's widescreen stretching");
|
"Mimics Project64's widescreen stretching");
|
||||||
ImGui::Text("Graphics Quality");
|
ImGui::Text("Graphics Quality");
|
||||||
|
|
|
@ -5382,6 +5382,7 @@ class zip_file
|
||||||
for(auto &member : members)
|
for(auto &member : members)
|
||||||
{
|
{
|
||||||
extract(member, path);
|
extract(member, path);
|
||||||
|
printf(member.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include "moon/fs/moonfs.h"
|
#include "moon/fs/moonfs.h"
|
||||||
#include "moon/libs/nlohmann/json.hpp"
|
#include "moon/libs/nlohmann/json.hpp"
|
||||||
using json = nlohmann::json;
|
#include <filesystem>
|
||||||
using namespace std;
|
|
||||||
#include "moon/config/mooncfg.h"
|
#include "moon/config/mooncfg.h"
|
||||||
#include "moon/config/saves/saves.h"
|
#include "moon/config/saves/saves.h"
|
||||||
#include "moon/mod-engine/audio/mod-audio.h"
|
#include "moon/mod-engine/audio/mod-audio.h"
|
||||||
|
@ -28,6 +27,10 @@ extern "C" {
|
||||||
#include "pc/configfile.h"
|
#include "pc/configfile.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using json = nlohmann::json;
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
namespace Moon {
|
namespace Moon {
|
||||||
|
|
||||||
vector<BitModule*> addons;
|
vector<BitModule*> addons;
|
||||||
|
@ -158,7 +161,14 @@ namespace Moon {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MoonInternal {
|
namespace MoonInternal {
|
||||||
void scanAddonsDirectory() {
|
|
||||||
|
void processCompressedAddon(string path, string outdir){
|
||||||
|
MoonFS file(path);
|
||||||
|
file.open();
|
||||||
|
file.extract(outdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
void scanAddonsDirectory() {
|
||||||
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
string addonsDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/";
|
string addonsDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/";
|
||||||
|
|
||||||
|
@ -168,7 +178,15 @@ namespace MoonInternal {
|
||||||
while ((de = readdir(dir)) != NULL) {
|
while ((de = readdir(dir)) != NULL) {
|
||||||
if (de->d_name[0] != '.') {
|
if (de->d_name[0] != '.') {
|
||||||
string file = addonsDir + de->d_name;
|
string file = addonsDir + de->d_name;
|
||||||
Moon::loadAddon(file);
|
string ext = file.substr(file.find_last_of(".") + 1);
|
||||||
|
if(ext == "bit" || ext == "zip"){
|
||||||
|
string path = file.substr(0, file.find_last_of("."));
|
||||||
|
processCompressedAddon(file, path);
|
||||||
|
Moon::loadAddon(path);
|
||||||
|
fs::remove(file);
|
||||||
|
} else {
|
||||||
|
Moon::loadAddon(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
|
@ -36,15 +36,11 @@ bool enable_dust_particles;
|
||||||
bool show_menu_bar;
|
bool show_menu_bar;
|
||||||
|
|
||||||
float camera_speed = 0.8f;
|
float camera_speed = 0.8f;
|
||||||
bool enable_cap_logo;
|
|
||||||
bool enable_overall_buttons;
|
|
||||||
bool enable_night_skybox;
|
bool enable_night_skybox;
|
||||||
bool enable_yoshi;
|
bool enable_yoshi;
|
||||||
|
|
||||||
// Second Check
|
// Second Check
|
||||||
|
|
||||||
bool has_changed_cap_logo;
|
|
||||||
bool has_changed_overall_buttons;
|
|
||||||
bool has_changed_night_skybox;
|
bool has_changed_night_skybox;
|
||||||
bool has_changed_yoshi;
|
bool has_changed_yoshi;
|
||||||
|
|
||||||
|
@ -70,8 +66,6 @@ namespace MoonInternal {
|
||||||
|
|
||||||
camera_frozen = false;
|
camera_frozen = false;
|
||||||
enable_shadows = true;
|
enable_shadows = true;
|
||||||
enable_cap_logo = true;
|
|
||||||
enable_overall_buttons = true;
|
|
||||||
enable_yoshi = false;
|
enable_yoshi = false;
|
||||||
|
|
||||||
MoonInternal::load_cc_directory();
|
MoonInternal::load_cc_directory();
|
||||||
|
@ -79,10 +73,15 @@ namespace MoonInternal {
|
||||||
// custom textures
|
// custom textures
|
||||||
current_eye_state = 0;
|
current_eye_state = 0;
|
||||||
saturn_load_eye_array();
|
saturn_load_eye_array();
|
||||||
custom_eye_name = "eyes/" + eye_array[0];
|
custom_eye_name = "saturn/eyes/" + eye_array[0];
|
||||||
saturn_eye_swap();
|
saturn_eye_swap();
|
||||||
saturn_toggle_m_cap();
|
|
||||||
saturn_toggle_m_buttons();
|
saturn_load_emblem_array();
|
||||||
|
custom_emblem_name = "saturn/blank";
|
||||||
|
saturn_emblem_swap();
|
||||||
|
saturn_load_stache_array();
|
||||||
|
saturn_load_button_array();
|
||||||
|
saturn_load_sideburn_array();
|
||||||
}});
|
}});
|
||||||
|
|
||||||
Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [&](HookCall call){
|
Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [&](HookCall call){
|
||||||
|
@ -140,23 +139,6 @@ namespace MoonInternal {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Custom Textures
|
|
||||||
|
|
||||||
if (enable_cap_logo && !has_changed_cap_logo) {
|
|
||||||
saturn_toggle_m_cap();
|
|
||||||
has_changed_cap_logo = true;
|
|
||||||
}
|
|
||||||
if (!enable_overall_buttons && has_changed_overall_buttons) {
|
|
||||||
saturn_toggle_m_buttons();
|
|
||||||
has_changed_overall_buttons = false;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if (enable_night_skybox && !has_changed_night_skybox) {
|
|
||||||
saturn_toggle_night_skybox();
|
|
||||||
has_changed_night_skybox = true;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Yoshi
|
// Yoshi
|
||||||
|
|
||||||
enableYoshi = (enable_yoshi) ? 1 : 0;
|
enableYoshi = (enable_yoshi) ? 1 : 0;
|
||||||
|
|
|
@ -15,8 +15,6 @@ extern bool camera_frozen;
|
||||||
extern bool show_menu_bar;
|
extern bool show_menu_bar;
|
||||||
|
|
||||||
extern float camera_speed;
|
extern float camera_speed;
|
||||||
extern bool enable_cap_logo;
|
|
||||||
extern bool enable_overall_buttons;
|
|
||||||
extern bool enable_night_skybox;
|
extern bool enable_night_skybox;
|
||||||
extern bool enable_yoshi;
|
extern bool enable_yoshi;
|
||||||
|
|
||||||
|
|
|
@ -138,8 +138,6 @@ namespace MoonInternal {
|
||||||
defaultColorHairGDark = 3;
|
defaultColorHairGDark = 3;
|
||||||
defaultColorHairBLight = 0;
|
defaultColorHairBLight = 0;
|
||||||
defaultColorHairBDark = 0;
|
defaultColorHairBDark = 0;
|
||||||
|
|
||||||
enable_cap_logo = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void load_cc_data(string content) {
|
void load_cc_data(string content) {
|
||||||
|
@ -246,8 +244,6 @@ namespace MoonInternal {
|
||||||
if (address == "07EC9A") {
|
if (address == "07EC9A") {
|
||||||
defaultColorHairBDark = value1;
|
defaultColorHairBDark = value1;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_cap_logo = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,22 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
string custom_eye_name;
|
string custom_eye_name;
|
||||||
|
string custom_emblem_name;
|
||||||
|
string custom_stache_name;
|
||||||
|
string custom_button_name;
|
||||||
|
string custom_sideburn_name;
|
||||||
string custom_sky_name;
|
string custom_sky_name;
|
||||||
|
|
||||||
std::vector<string> eye_array;
|
std::vector<string> eye_array;
|
||||||
string eyeDir;
|
string eyeDir;
|
||||||
|
std::vector<string> emblem_array;
|
||||||
|
string emblemDir;
|
||||||
|
std::vector<string> stache_array;
|
||||||
|
string stacheDir;
|
||||||
|
std::vector<string> button_array;
|
||||||
|
string buttonDir;
|
||||||
|
std::vector<string> sideburn_array;
|
||||||
|
string sideburnDir;
|
||||||
|
|
||||||
// Textures
|
// Textures
|
||||||
|
|
||||||
|
@ -35,16 +47,15 @@ void saturn_eye_swap() {
|
||||||
(*hookTexture) = const_cast<char*>(custom_eye_name.c_str());
|
(*hookTexture) = const_cast<char*>(custom_eye_name.c_str());
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
void saturn_load_eye_array() {
|
void saturn_load_eye_array() {
|
||||||
eye_array.clear();
|
eye_array.clear();
|
||||||
|
|
||||||
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
// Windows moment
|
// Windows moment
|
||||||
eyeDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\eyes\\";
|
eyeDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\saturn\\eyes\\";
|
||||||
#else
|
#else
|
||||||
eyeDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/eyes/";
|
eyeDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/saturn/eyes/";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (const auto & entry : fs::directory_iterator(eyeDir)) {
|
for (const auto & entry : fs::directory_iterator(eyeDir)) {
|
||||||
|
@ -54,33 +65,129 @@ void saturn_load_eye_array() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void saturn_toggle_m_cap() {
|
void saturn_emblem_swap() {
|
||||||
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
||||||
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
||||||
string texName = string(*hookTexture);
|
string texName = string(*hookTexture);
|
||||||
if(texName == "actors/mario/mario_logo.rgba16") {
|
if(texName == "actors/mario/mario_logo.rgba16") {
|
||||||
if (enable_cap_logo) {
|
if (custom_emblem_name != "default") {
|
||||||
(*hookTexture) = const_cast<char*>("actors/mario/mario_logo.rgba16");
|
(*hookTexture) = const_cast<char*>(custom_emblem_name.c_str());
|
||||||
} else {
|
} else {
|
||||||
(*hookTexture) = const_cast<char*>("blank");
|
(*hookTexture) = const_cast<char*>("actors/mario/mario_logo.rgba16");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
void saturn_load_emblem_array() {
|
||||||
|
emblem_array.clear();
|
||||||
|
|
||||||
void saturn_toggle_m_buttons() {
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
// Windows moment
|
||||||
|
emblemDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\saturn\\emblems\\";
|
||||||
|
#else
|
||||||
|
emblemDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/saturn/emblems/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (const auto & entry : fs::directory_iterator(emblemDir)) {
|
||||||
|
size_t last_index = entry.path().filename().u8string().find_last_of(".");
|
||||||
|
string stripped_name = entry.path().filename().u8string().substr(0, last_index);
|
||||||
|
emblem_array.push_back(stripped_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void saturn_stache_swap() {
|
||||||
|
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
||||||
|
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
||||||
|
string texName = string(*hookTexture);
|
||||||
|
if(texName == "actors/mario/mario_mustache.rgba16") {
|
||||||
|
if (custom_stache_name != "default") {
|
||||||
|
(*hookTexture) = const_cast<char*>(custom_stache_name.c_str());
|
||||||
|
} else {
|
||||||
|
(*hookTexture) = const_cast<char*>("actors/mario/mario_mustache.rgba16");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
void saturn_load_stache_array() {
|
||||||
|
stache_array.clear();
|
||||||
|
|
||||||
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
// Windows moment
|
||||||
|
stacheDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\saturn\\staches\\";
|
||||||
|
#else
|
||||||
|
stacheDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/saturn/staches/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (const auto & entry : fs::directory_iterator(stacheDir)) {
|
||||||
|
size_t last_index = entry.path().filename().u8string().find_last_of(".");
|
||||||
|
string stripped_name = entry.path().filename().u8string().substr(0, last_index);
|
||||||
|
stache_array.push_back(stripped_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void saturn_button_swap() {
|
||||||
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
||||||
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
||||||
string texName = string(*hookTexture);
|
string texName = string(*hookTexture);
|
||||||
if(texName == "actors/mario/mario_overalls_button.rgba16") {
|
if(texName == "actors/mario/mario_overalls_button.rgba16") {
|
||||||
if (enable_overall_buttons) {
|
if (custom_button_name != "default") {
|
||||||
(*hookTexture) = const_cast<char*>("actors/mario/mario_overalls_button.rgba16");
|
(*hookTexture) = const_cast<char*>(custom_button_name.c_str());
|
||||||
} else {
|
} else {
|
||||||
(*hookTexture) = const_cast<char*>("blank");
|
(*hookTexture) = const_cast<char*>("actors/mario/mario_overalls_button.rgba16");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
void saturn_load_button_array() {
|
||||||
|
button_array.clear();
|
||||||
|
|
||||||
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
// Windows moment
|
||||||
|
buttonDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\saturn\\buttons\\";
|
||||||
|
#else
|
||||||
|
buttonDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/saturn/buttons/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (const auto & entry : fs::directory_iterator(buttonDir)) {
|
||||||
|
size_t last_index = entry.path().filename().u8string().find_last_of(".");
|
||||||
|
string stripped_name = entry.path().filename().u8string().substr(0, last_index);
|
||||||
|
button_array.push_back(stripped_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void saturn_sideburn_swap() {
|
||||||
|
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
||||||
|
char* *hookTexture = reinterpret_cast<char**>(call.baseArgs["texture"]);
|
||||||
|
string texName = string(*hookTexture);
|
||||||
|
if(texName == "actors/mario/mario_sideburn.rgba16") {
|
||||||
|
if (custom_sideburn_name != "default") {
|
||||||
|
(*hookTexture) = const_cast<char*>(custom_sideburn_name.c_str());
|
||||||
|
} else {
|
||||||
|
(*hookTexture) = const_cast<char*>("actors/mario/mario_sideburn.rgba16");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
void saturn_load_sideburn_array() {
|
||||||
|
sideburn_array.clear();
|
||||||
|
|
||||||
|
string cwd = MoonInternal::getEnvironmentVar("MOON_CWD");
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
// Windows moment
|
||||||
|
sideburnDir = cwd.substr(0, cwd.find_last_of("/\\")) + "\\addons\\saturn\\assets\\graphics\\saturn\\sideburns\\";
|
||||||
|
#else
|
||||||
|
sideburnDir = cwd.substr(0, cwd.find_last_of("/\\")) + "/addons/saturn/assets/graphics/saturn/sideburns/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (const auto & entry : fs::directory_iterator(sideburnDir)) {
|
||||||
|
size_t last_index = entry.path().filename().u8string().find_last_of(".");
|
||||||
|
string stripped_name = entry.path().filename().u8string().substr(0, last_index);
|
||||||
|
sideburn_array.push_back(stripped_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void saturn_sky_swap() {
|
void saturn_sky_swap() {
|
||||||
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
Moon::registerHookListener({.hookName = TEXTURE_BIND, .callback = [](HookCall call) {
|
||||||
|
|
|
@ -5,12 +5,28 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
extern std::string custom_eye_name;
|
extern std::string custom_eye_name;
|
||||||
|
extern std::string custom_emblem_name;
|
||||||
|
extern std::string custom_stache_name;
|
||||||
|
extern std::string custom_button_name;
|
||||||
|
extern std::string custom_sideburn_name;
|
||||||
extern std::string custom_sky_name;
|
extern std::string custom_sky_name;
|
||||||
|
|
||||||
extern std::vector<std::string> eye_array;
|
extern std::vector<std::string> eye_array;
|
||||||
|
extern std::vector<std::string> emblem_array;
|
||||||
|
extern std::vector<std::string> stache_array;
|
||||||
|
extern std::vector<std::string> button_array;
|
||||||
|
extern std::vector<std::string> sideburn_array;
|
||||||
|
|
||||||
void saturn_eye_swap(void);
|
void saturn_eye_swap(void);
|
||||||
void saturn_load_eye_array(void);
|
void saturn_load_eye_array(void);
|
||||||
|
void saturn_emblem_swap(void);
|
||||||
|
void saturn_load_emblem_array(void);
|
||||||
|
void saturn_stache_swap(void);
|
||||||
|
void saturn_load_stache_array(void);
|
||||||
|
void saturn_button_swap(void);
|
||||||
|
void saturn_load_button_array(void);
|
||||||
|
void saturn_sideburn_swap(void);
|
||||||
|
void saturn_load_sideburn_array(void);
|
||||||
void saturn_toggle_m_cap(void);
|
void saturn_toggle_m_cap(void);
|
||||||
void saturn_toggle_m_buttons(void);
|
void saturn_toggle_m_buttons(void);
|
||||||
void saturn_sky_swap(void);
|
void saturn_sky_swap(void);
|
||||||
|
|
|
@ -56,13 +56,13 @@ ConfigWindow configWindow = {
|
||||||
};
|
};
|
||||||
|
|
||||||
ImGuiConfig configImGui = {
|
ImGuiConfig configImGui = {
|
||||||
.moon64 = false,
|
.s_stats = false,
|
||||||
.texture_debug = false,
|
.texture_debug = false,
|
||||||
.s_toggles = false,
|
.s_toggles = false,
|
||||||
.s_machinima = false,
|
.s_machinima = false,
|
||||||
.s_appearance = false,
|
.s_appearance = false,
|
||||||
.s_options = false,
|
.s_options = false,
|
||||||
.n64Mode = false
|
.jaboMode = false
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int configLanguage = 0;
|
unsigned int configLanguage = 0;
|
||||||
|
@ -181,13 +181,13 @@ static const struct ConfigOption options[] = {
|
||||||
#endif
|
#endif
|
||||||
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
||||||
|
|
||||||
{.name = "moon64_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.moon64},
|
{.name = "s_stats_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_stats},
|
||||||
{.name = "texture_debug_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.texture_debug},
|
{.name = "texture_debug_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.texture_debug},
|
||||||
{.name = "s_toggles_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_toggles},
|
{.name = "s_toggles_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_toggles},
|
||||||
{.name = "s_machinima", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_machinima},
|
{.name = "s_machinima", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_machinima},
|
||||||
{.name = "s_appearance_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_appearance},
|
{.name = "s_appearance_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_appearance},
|
||||||
{.name = "s_options_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_options},
|
{.name = "s_options_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_options},
|
||||||
{.name = "n64Mode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.n64Mode}
|
{.name = "jaboMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.jaboMode}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Reads an entire line from a file (excluding the newline character) and returns an allocated string
|
// Reads an entire line from a file (excluding the newline character) and returns an allocated string
|
||||||
|
|
|
@ -22,13 +22,13 @@ typedef struct {
|
||||||
} ConfigWindow;
|
} ConfigWindow;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool moon64;
|
bool s_stats;
|
||||||
bool s_toggles;
|
bool s_toggles;
|
||||||
bool s_machinima;
|
bool s_machinima;
|
||||||
bool s_appearance;
|
bool s_appearance;
|
||||||
bool s_options;
|
bool s_options;
|
||||||
bool texture_debug;
|
bool texture_debug;
|
||||||
bool n64Mode;
|
bool jaboMode;
|
||||||
} ImGuiConfig;
|
} ImGuiConfig;
|
||||||
|
|
||||||
extern ConfigWindow configWindow;
|
extern ConfigWindow configWindow;
|
||||||
|
|
|
@ -118,7 +118,7 @@ const char *sys_user_path(void) {
|
||||||
static char path[SYS_MAX_PATH] = { 0 };
|
static char path[SYS_MAX_PATH] = { 0 };
|
||||||
|
|
||||||
// get the new pref path from SDL
|
// get the new pref path from SDL
|
||||||
char *sdlpath = SDL_GetPrefPath("", "moon64");
|
char *sdlpath = SDL_GetPrefPath("", "SaturnME");
|
||||||
if (sdlpath) {
|
if (sdlpath) {
|
||||||
const unsigned int len = strlen(sdlpath);
|
const unsigned int len = strlen(sdlpath);
|
||||||
strncpy(path, sdlpath, sizeof(path));
|
strncpy(path, sdlpath, sizeof(path));
|
||||||
|
|