mirror of https://github.com/sm64pc/sm64pc.git
Merge branch 'Llennpie:moon' into moon
This commit is contained in:
commit
5680dbf898
8
Makefile
8
Makefile
|
@ -416,10 +416,10 @@ ifeq ($(TARGET_SWITCH),1)
|
|||
CXX := $(CROSS)g++
|
||||
STRIP := $(CROSS)strip
|
||||
NXARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
|
||||
APP_TITLE := Moon64 - [$(GIT_BRANCH)]
|
||||
APP_AUTHOR := Nintendo, n64decomp team, UnderVolt team
|
||||
APP_VERSION := $(GIT_HASH)
|
||||
APP_ICON := $(CURDIR)/textures/logo/moon64-logo.jpg
|
||||
APP_TITLE := Saturn: Moon Edition
|
||||
APP_AUTHOR := Llennpie
|
||||
APP_VERSION := $(GIT_BRANCH) $(GIT_HASH)
|
||||
APP_ICON := $(CURDIR)/textures/logo/saturn-logo.jpg
|
||||
INCLUDE_CFLAGS += -I$(LIBNX)/include -I$(PORTLIBS)/include
|
||||
OPT_FLAGS := -O2
|
||||
LIBDIRS := $(PORTLIBS) $(LIBNX)
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
Lights1 n64_N64_Green_lights = gdSPDefLights1(
|
||||
0x3, 0x49, 0x18,
|
||||
0x6, 0x93, 0x30, 0x28, 0x28, 0x28);
|
||||
0x7f, 0x7f, 0x7f,
|
||||
0xff, 0xff, 0xff, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64_N64_Blue_lights = gdSPDefLights1(
|
||||
0x0, 0xE, 0x54,
|
||||
0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28);
|
||||
0x67, 0x67, 0x67,
|
||||
0xce, 0xce, 0xce, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64_N64_Red_lights = gdSPDefLights1(
|
||||
0x7F, 0xF, 0xA,
|
||||
0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28);
|
||||
0x60, 0x7f, 0x66,
|
||||
0xc0, 0xff, 0xee, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64_N64_Yellow_lights = gdSPDefLights1(
|
||||
0x7F, 0x60, 0x0,
|
||||
0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28);
|
||||
0x60, 0x60, 0x60,
|
||||
0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28);
|
||||
|
||||
Vtx n64_N_Logo_mesh_vtx_0[56] = {
|
||||
{{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}},
|
||||
|
|
|
@ -3394,20 +3394,20 @@ const f32 intro_seg7_table_0700C880[] = {
|
|||
};
|
||||
|
||||
Lights1 n64logo_N64_Green_lights = gdSPDefLights1(
|
||||
0x3, 0x49, 0x18,
|
||||
0x6, 0x93, 0x30, 0x28, 0x28, 0x28);
|
||||
0x60, 0x7f, 0x66,
|
||||
0xc0, 0xff, 0xee, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Blue_lights = gdSPDefLights1(
|
||||
0x0, 0xE, 0x54,
|
||||
0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28);
|
||||
0x67, 0x67, 0x67,
|
||||
0xce, 0xce, 0xce, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Red_lights = gdSPDefLights1(
|
||||
0x7F, 0xF, 0xA,
|
||||
0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28);
|
||||
0x60, 0x7f, 0x66,
|
||||
0xc0, 0xff, 0xee, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Yellow_lights = gdSPDefLights1(
|
||||
0x7F, 0x60, 0x0,
|
||||
0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28);
|
||||
0x60, 0x60, 0x60,
|
||||
0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28);
|
||||
|
||||
Vtx n64logo_N64_mesh_vtx_0[56] = {
|
||||
{{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}},
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
Lights1 n64logo_N64_Green_lights = gdSPDefLights1(
|
||||
0x3, 0x49, 0x18,
|
||||
0x6, 0x93, 0x30, 0x28, 0x28, 0x28);
|
||||
0x7f, 0x7f, 0x7f,
|
||||
0xff, 0xff, 0xff, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Blue_lights = gdSPDefLights1(
|
||||
0x0, 0xE, 0x54,
|
||||
0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28);
|
||||
0x67, 0x67, 0x67,
|
||||
0xce, 0xce, 0xce, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Red_lights = gdSPDefLights1(
|
||||
0x7F, 0xF, 0xA,
|
||||
0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28);
|
||||
0x60, 0x7f, 0x66,
|
||||
0xc0, 0xff, 0xee, 0x28, 0x28, 0x28);
|
||||
|
||||
Lights1 n64logo_N64_Yellow_lights = gdSPDefLights1(
|
||||
0x7F, 0x60, 0x0,
|
||||
0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28);
|
||||
0x60, 0x60, 0x60,
|
||||
0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28);
|
||||
|
||||
Vtx n64logo_N64_mesh_vtx_0[56] = {
|
||||
{{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}},
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
"concepts": "cpp",
|
||||
"ranges": "cpp",
|
||||
"surface_collision.h": "c",
|
||||
"math_util.h": "c"
|
||||
"math_util.h": "c",
|
||||
"controller_keyboard.h": "c"
|
||||
}
|
||||
}
|
|
@ -20,6 +20,8 @@
|
|||
#include "icons/IconsForkAwesome.h"
|
||||
#include "icons/IconsMaterialDesign.h"
|
||||
#include "moon/utils/moon-env.h"
|
||||
#include "pc/controller/controller_keyboard.h"
|
||||
#include "moon/ui/screens/addons/addons-view.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
|
@ -181,6 +183,8 @@ namespace MoonInternal {
|
|||
static ImVec4 uiHairColor = ImVec4(115.0f / 255.0f, 6.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f);
|
||||
static ImVec4 uiHairShadeColor = ImVec4(57.0f / 255.0f, 3.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f);
|
||||
|
||||
string cc_name;
|
||||
static char cc_gameshark[1024 * 16] = "";
|
||||
static char bufname[128] = "Sample";
|
||||
|
||||
bool hasChangedFullscreen;
|
||||
|
@ -265,6 +269,31 @@ namespace MoonInternal {
|
|||
defaultColorHairBDark = (int)(uiHairShadeColor.z * 255);
|
||||
}
|
||||
|
||||
void apply_editor_from_cc() {
|
||||
uiHatColor = ImVec4(float(defaultColorHatRLight) / 255.0f, float(defaultColorHatGLight) / 255.0f, float(defaultColorHatBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiHatShadeColor = ImVec4(float(defaultColorHatRDark) / 255.0f, float(defaultColorHatGDark) / 255.0f, float(defaultColorHatBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiOverallsColor = ImVec4(float(defaultColorOverallsRLight) / 255.0f, float(defaultColorOverallsGLight) / 255.0f, float(defaultColorOverallsBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiOverallsShadeColor = ImVec4(float(defaultColorOverallsRDark) / 255.0f, float(defaultColorOverallsGDark) / 255.0f, float(defaultColorOverallsBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiGlovesColor = ImVec4(float(defaultColorGlovesRLight) / 255.0f, float(defaultColorGlovesGLight) / 255.0f, float(defaultColorGlovesBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiGlovesShadeColor = ImVec4(float(defaultColorGlovesRDark) / 255.0f, float(defaultColorGlovesGDark) / 255.0f, float(defaultColorGlovesBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiShoesColor = ImVec4(float(defaultColorShoesRLight) / 255.0f, float(defaultColorShoesGLight) / 255.0f, float(defaultColorShoesBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiShoesShadeColor = ImVec4(float(defaultColorShoesRDark) / 255.0f, float(defaultColorShoesGDark) / 255.0f, float(defaultColorShoesBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiSkinColor = ImVec4(float(defaultColorSkinRLight) / 255.0f, float(defaultColorSkinGLight) / 255.0f, float(defaultColorSkinBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiSkinShadeColor = ImVec4(float(defaultColorSkinRDark) / 255.0f, float(defaultColorSkinGDark) / 255.0f, float(defaultColorSkinBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiHairColor = ImVec4(float(defaultColorHairRLight) / 255.0f, float(defaultColorHairGLight) / 255.0f, float(defaultColorHairBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiHairShadeColor = ImVec4(float(defaultColorHairRDark) / 255.0f, float(defaultColorHairGDark) / 255.0f, float(defaultColorHairBDark) / 255.0f, 255.0f / 255.0f);
|
||||
|
||||
cc_name = MoonInternal::cc_array[configColorCode].substr(0, MoonInternal::cc_array[configColorCode].size() - 3);
|
||||
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
||||
|
||||
// We never want to use the name "Mario" when saving/loading a CC, as it will cause file issues.
|
||||
if (cc_name == "Mario") {
|
||||
strcpy(bufname, "Sample");
|
||||
} else {
|
||||
strcpy(bufname, cc_name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void setupImGuiModule(string status) {
|
||||
MoonInternal::setupWindowHook(status);
|
||||
if(status == "PreStartup"){
|
||||
|
@ -298,7 +327,6 @@ namespace MoonInternal {
|
|||
MoonNX::handleVirtualKeyboard("Init");
|
||||
#endif
|
||||
|
||||
static char cc_gameshark[1024 * 16] = "";
|
||||
apply_cc_from_editor();
|
||||
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
||||
}});
|
||||
|
@ -589,7 +617,7 @@ namespace MoonInternal {
|
|||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
static char cc_gameshark[1024 * 16] = "";
|
||||
//static char cc_gameshark[1024 * 16] = "";
|
||||
|
||||
if (configImGui.s_machinima && show_menu_bar) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||
|
@ -603,16 +631,16 @@ namespace MoonInternal {
|
|||
ImGui::Dummy(ImVec2(0, 10));
|
||||
|
||||
ImGui::Text("Select Color Code");
|
||||
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);
|
||||
//static int current_cc_id = 0;
|
||||
cc_name = MoonInternal::cc_array[configColorCode].substr(0, MoonInternal::cc_array[configColorCode].size() - 3);
|
||||
if (ImGui::BeginCombo(".gs", cc_name.c_str()))
|
||||
{
|
||||
for (int n = 0; n < MoonInternal::cc_array.size(); n++)
|
||||
{
|
||||
const bool is_selected = (current_cc_id == n);
|
||||
const bool is_selected = (configColorCode == n);
|
||||
cc_name = MoonInternal::cc_array[n].substr(0, MoonInternal::cc_array[n].size() - 3);
|
||||
if (ImGui::Selectable(cc_name.c_str(), is_selected)) {
|
||||
current_cc_id = n;
|
||||
configColorCode = n;
|
||||
}
|
||||
|
||||
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
|
||||
|
@ -622,29 +650,8 @@ namespace MoonInternal {
|
|||
ImGui::EndCombo();
|
||||
}
|
||||
if (ImGui::Button("Load CC")) {
|
||||
load_cc_file(cc_array[current_cc_id]);
|
||||
|
||||
uiHatColor = ImVec4(float(defaultColorHatRLight) / 255.0f, float(defaultColorHatGLight) / 255.0f, float(defaultColorHatBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiHatShadeColor = ImVec4(float(defaultColorHatRDark) / 255.0f, float(defaultColorHatGDark) / 255.0f, float(defaultColorHatBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiOverallsColor = ImVec4(float(defaultColorOverallsRLight) / 255.0f, float(defaultColorOverallsGLight) / 255.0f, float(defaultColorOverallsBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiOverallsShadeColor = ImVec4(float(defaultColorOverallsRDark) / 255.0f, float(defaultColorOverallsGDark) / 255.0f, float(defaultColorOverallsBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiGlovesColor = ImVec4(float(defaultColorGlovesRLight) / 255.0f, float(defaultColorGlovesGLight) / 255.0f, float(defaultColorGlovesBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiGlovesShadeColor = ImVec4(float(defaultColorGlovesRDark) / 255.0f, float(defaultColorGlovesGDark) / 255.0f, float(defaultColorGlovesBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiShoesColor = ImVec4(float(defaultColorShoesRLight) / 255.0f, float(defaultColorShoesGLight) / 255.0f, float(defaultColorShoesBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiShoesShadeColor = ImVec4(float(defaultColorShoesRDark) / 255.0f, float(defaultColorShoesGDark) / 255.0f, float(defaultColorShoesBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiSkinColor = ImVec4(float(defaultColorSkinRLight) / 255.0f, float(defaultColorSkinGLight) / 255.0f, float(defaultColorSkinBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiSkinShadeColor = ImVec4(float(defaultColorSkinRDark) / 255.0f, float(defaultColorSkinGDark) / 255.0f, float(defaultColorSkinBDark) / 255.0f, 255.0f / 255.0f);
|
||||
uiHairColor = ImVec4(float(defaultColorHairRLight) / 255.0f, float(defaultColorHairGLight) / 255.0f, float(defaultColorHairBLight) / 255.0f, 255.0f / 255.0f);
|
||||
uiHairShadeColor = ImVec4(float(defaultColorHairRDark) / 255.0f, float(defaultColorHairGDark) / 255.0f, float(defaultColorHairBDark) / 255.0f, 255.0f / 255.0f);
|
||||
|
||||
// We never want to use the name "Mario" when saving/loading a CC, as it will cause file issues.
|
||||
if (cc_name == "Mario") {
|
||||
strcpy(bufname, "Sample");
|
||||
} else {
|
||||
strcpy(bufname, cc_name.c_str());
|
||||
}
|
||||
|
||||
strcpy(cc_gameshark, global_color_to_cc().c_str());
|
||||
load_cc_file(cc_array[configColorCode]);
|
||||
apply_editor_from_cc();
|
||||
}
|
||||
|
||||
ImGui::Dummy(ImVec2(0, 10));
|
||||
|
@ -884,6 +891,8 @@ namespace MoonInternal {
|
|||
ImGui::Begin("Appearance", NULL, ImGuiWindowFlags_None);
|
||||
|
||||
ImGui::InputText(".gs", bufname, IM_ARRAYSIZE(bufname));
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
if (ImGui::Button("Save to File")) {
|
||||
apply_cc_from_editor();
|
||||
|
||||
|
@ -909,22 +918,46 @@ namespace MoonInternal {
|
|||
if (ImGui::BeginTabItem("CC Editor")) {
|
||||
ImGui::Text("Shirt/Cap");
|
||||
ImGui::ColorEdit4("Hat Main", (float*)&uiHatColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Hat Shade", (float*)&uiHatShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Text("Overalls");
|
||||
ImGui::ColorEdit4("Overalls Main", (float*)&uiOverallsColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Overalls Shade", (float*)&uiOverallsShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Text("Gloves");
|
||||
ImGui::ColorEdit4("Gloves Main", (float*)&uiGlovesColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Gloves Shade", (float*)&uiGlovesShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Text("Shoes");
|
||||
ImGui::ColorEdit4("Shoes Main", (float*)&uiShoesColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Shoes Shade", (float*)&uiShoesShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Text("Skin");
|
||||
ImGui::ColorEdit4("Skin Main", (float*)&uiSkinColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Skin Shade", (float*)&uiSkinShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Text("Hair");
|
||||
ImGui::ColorEdit4("Hair Main", (float*)&uiHairColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::ColorEdit4("Hair Shade", (float*)&uiHairShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel);
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::EndTabItem();
|
||||
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
|
@ -936,7 +969,8 @@ namespace MoonInternal {
|
|||
}
|
||||
if (ImGui::BeginTabItem("GameShark")) {
|
||||
ImGui::InputTextMultiline("###gameshark_box", cc_gameshark, IM_ARRAYSIZE(cc_gameshark), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 25), ImGuiInputTextFlags_CharsUppercase);
|
||||
|
||||
if (ImGui::IsItemActivated()) accept_input = false;
|
||||
if (ImGui::IsItemDeactivated()) accept_input = true;
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
|
||||
if (ImGui::Button("Paste GS Code")) {
|
||||
|
@ -1047,6 +1081,36 @@ namespace MoonInternal {
|
|||
ImGui::Checkbox("Skip Intro", &configSkipIntro);
|
||||
ImGui::Checkbox("Enable Yoshi", &enable_yoshi);
|
||||
}
|
||||
if (ImGui::CollapsingHeader("Addons")) {
|
||||
{
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_None;
|
||||
ImGui::BeginChild("addon_child", ImVec2(ImGui::GetWindowContentRegionWidth(), 130), false, window_flags);
|
||||
for (int n = 0; n < texturePackList.size(); n++)
|
||||
{
|
||||
currentPack = texturePackList[n];
|
||||
ImGui::Selectable(currentPack->name.c_str());
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetMouseCursor(2);
|
||||
}
|
||||
|
||||
if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
|
||||
{
|
||||
int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
|
||||
if (n_next >= 0 && n_next < texturePackList.size())
|
||||
{
|
||||
texturePackList[n] = texturePackList[n_next];
|
||||
texturePackList[n_next] = currentPack;
|
||||
ImGui::ResetMouseDragDelta();
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
if (ImGui::Button("Reload Addons")) {
|
||||
rebuildTextureCache();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
ImGui::PopStyleColor();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
namespace MoonInternal {
|
||||
void setupImGuiModule(std::string status);
|
||||
void apply_editor_from_cc(void);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,7 +3,11 @@
|
|||
|
||||
#include "moon/utils/moon-env.h"
|
||||
#include "moon/fs/moonfs.h"
|
||||
#include "moon/ui/screens/addons/addons-view.h"
|
||||
#include "moon/mod-engine/engine.h"
|
||||
#include "moon/imgui/imgui_impl.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/controller/controller_keyboard.h"
|
||||
|
||||
#include "saturn_colors.h"
|
||||
#include "saturn_textures.h"
|
||||
|
@ -71,6 +75,8 @@ namespace MoonInternal {
|
|||
enable_yoshi = false;
|
||||
|
||||
MoonInternal::load_cc_directory();
|
||||
MoonInternal::load_cc_file(cc_array[configColorCode]);
|
||||
apply_editor_from_cc();
|
||||
|
||||
// custom textures
|
||||
current_eye_state = 0;
|
||||
|
@ -81,9 +87,18 @@ namespace MoonInternal {
|
|||
saturn_load_emblem_array();
|
||||
custom_emblem_name = "saturn/blank";
|
||||
saturn_emblem_swap();
|
||||
|
||||
saturn_load_stache_array();
|
||||
saturn_load_button_array();
|
||||
saturn_load_sideburn_array();
|
||||
|
||||
// addons
|
||||
if(texturePackList.empty()){
|
||||
texturePackList.clear();
|
||||
copy(Moon::addons.begin(), Moon::addons.end(), back_inserter(texturePackList));
|
||||
reverse(texturePackList.begin(), texturePackList.end());
|
||||
}
|
||||
currentPack = NULL;
|
||||
}});
|
||||
|
||||
Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [&](HookCall call){
|
||||
|
@ -91,15 +106,9 @@ namespace MoonInternal {
|
|||
switch (ev->type){
|
||||
case SDL_KEYDOWN:
|
||||
if(ev->key.keysym.sym == SDLK_f){
|
||||
if (!show_menu_bar)
|
||||
if (accept_input)
|
||||
freeze_camera();
|
||||
}
|
||||
if(ev->key.keysym.sym == SDLK_x){
|
||||
//cycle_eye_state(1);
|
||||
}
|
||||
if(ev->key.keysym.sym == SDLK_z){
|
||||
//cycle_eye_state(-1);
|
||||
}
|
||||
if(ev->key.keysym.sym == SDLK_F1){
|
||||
show_menu_bar = !show_menu_bar;
|
||||
}
|
||||
|
@ -107,12 +116,6 @@ namespace MoonInternal {
|
|||
if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_UP) {
|
||||
freeze_camera();
|
||||
}
|
||||
if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) {
|
||||
//cycle_eye_state(1);
|
||||
}
|
||||
if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT) {
|
||||
//cycle_eye_state(-1);
|
||||
}
|
||||
if(ev->cbutton.button == SDL_CONTROLLER_BUTTON_BACK){
|
||||
show_menu_bar = !show_menu_bar;
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ void rebuildTextureCache(){
|
|||
}
|
||||
reverse(order.begin(), order.end());
|
||||
MoonInternal::buildTextureCache(order);
|
||||
MoonInternal::buildAudioCache(order);
|
||||
MoonInternal::resetSoundSystem();
|
||||
//MoonInternal::buildAudioCache(order);
|
||||
//MoonInternal::resetSoundSystem();
|
||||
}
|
||||
|
||||
void MoonAddonsScreen::changeScroll(int idx){
|
||||
|
|
|
@ -13,5 +13,12 @@ private:
|
|||
void changeScroll(int idx);
|
||||
};
|
||||
|
||||
#include <vector>
|
||||
#include "moon/mod-engine/interfaces/bit-module.h"
|
||||
|
||||
extern BitModule* currentPack;
|
||||
extern std::vector<BitModule*> texturePackList;
|
||||
|
||||
extern void rebuildTextureCache();
|
||||
|
||||
#endif
|
|
@ -56,11 +56,11 @@ ConfigWindow configWindow = {
|
|||
};
|
||||
|
||||
ImGuiConfig configImGui = {
|
||||
.s_stats = false,
|
||||
.s_stats = true,
|
||||
.texture_debug = false,
|
||||
.s_toggles = false,
|
||||
.s_machinima = false,
|
||||
.s_appearance = false,
|
||||
.s_toggles = true,
|
||||
.s_machinima = true,
|
||||
.s_appearance = true,
|
||||
.s_options = false,
|
||||
.jaboMode = false
|
||||
};
|
||||
|
@ -73,6 +73,8 @@ bool configPrecacheRes = false;
|
|||
bool configPrecacheRes = true;
|
||||
#endif
|
||||
|
||||
unsigned int configColorCode = 0;
|
||||
|
||||
unsigned int configFiltering = 1; // 0=force nearest, 1=linear, (TODO) 2=three-point
|
||||
unsigned int configMasterVolume = MAX_VOLUME; // 0 - MAX_VOLUME
|
||||
unsigned int configMusicVolume = 0;
|
||||
|
@ -125,18 +127,21 @@ bool configDiscordRPC = true;
|
|||
unsigned int configLODMode = 2;
|
||||
|
||||
static const struct ConfigOption options[] = {
|
||||
{.name = "color_code", .type = CONFIG_TYPE_UINT, .uintValue = &configColorCode},
|
||||
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
||||
{.name = "window_x", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.x},
|
||||
{.name = "window_y", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.y},
|
||||
{.name = "window_w", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.w},
|
||||
{.name = "window_h", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.h},
|
||||
{.name = "internal_w", .type = CONFIG_TYPE_FLOAT, .uintValue = &configWindow.internal_w},
|
||||
{.name = "internal_h", .type = CONFIG_TYPE_FLOAT, .uintValue = &configWindow.internal_h},
|
||||
//{.name = "internal_w", .type = CONFIG_TYPE_FLOAT, .uintValue = &configWindow.internal_w},
|
||||
//{.name = "internal_h", .type = CONFIG_TYPE_FLOAT, .uintValue = &configWindow.internal_h},
|
||||
{.name = "multiplier", .type = CONFIG_TYPE_FLOAT, .uintValue = &configWindow.multiplier},
|
||||
{.name = "aa_level", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.antialias_level},
|
||||
{.name = "aa_enabled", .type = CONFIG_TYPE_BOOL, .uintValue = &configWindow.enable_antialias},
|
||||
//{.name = "aa_level", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.antialias_level},
|
||||
//{.name = "aa_enabled", .type = CONFIG_TYPE_BOOL, .uintValue = &configWindow.enable_antialias},
|
||||
{.name = "vsync", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.vsync},
|
||||
{.name = "texture_filtering", .type = CONFIG_TYPE_UINT, .uintValue = &configFiltering},
|
||||
{.name = "jaboMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.jaboMode},
|
||||
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
||||
{.name = "master_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMasterVolume},
|
||||
{.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume},
|
||||
{.name = "sfx_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configSfxVolume},
|
||||
|
@ -158,8 +163,6 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "key_stickright", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickRight},
|
||||
{.name = "stick_deadzone", .type = CONFIG_TYPE_UINT, .uintValue = &configStickDeadzone},
|
||||
{.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength},
|
||||
{.name = "precache", .type = CONFIG_TYPE_BOOL, .boolValue = &configPrecacheRes},
|
||||
{.name = "language", .type = CONFIG_TYPE_UINT, .boolValue = &configLanguage},
|
||||
#ifdef TARGET_SWITCH
|
||||
{.name = "nx_hud", .type = CONFIG_TYPE_BOOL, .boolValue = &configSwitchHud},
|
||||
#endif
|
||||
|
@ -176,18 +179,18 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade},
|
||||
#endif
|
||||
{.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro},
|
||||
{.name = "precache", .type = CONFIG_TYPE_BOOL, .boolValue = &configPrecacheRes},
|
||||
{.name = "language", .type = CONFIG_TYPE_UINT, .boolValue = &configLanguage},
|
||||
#ifdef DISCORDRPC
|
||||
{.name = "discordrpc_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configDiscordRPC},
|
||||
#endif
|
||||
{.name = "lodMode", .type = CONFIG_TYPE_UINT, .uintValue = &configLODMode},
|
||||
|
||||
{.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_machinima", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_machinima},
|
||||
{.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 = "jaboMode", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.jaboMode}
|
||||
{.name = "s_options_win", .type = CONFIG_TYPE_BOOL, .boolValue = &configImGui.s_options}
|
||||
};
|
||||
|
||||
// Reads an entire line from a file (excluding the newline character) and returns an allocated string
|
||||
|
|
|
@ -37,6 +37,7 @@ extern unsigned int configLanguage;
|
|||
#ifdef TARGET_SWITCH
|
||||
extern bool configSwitchHud;
|
||||
#endif
|
||||
extern unsigned int configColorCode;
|
||||
extern unsigned int configFiltering;
|
||||
extern unsigned int configMasterVolume;
|
||||
extern unsigned int configMusicVolume;
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include "../configfile.h"
|
||||
#include "controller_keyboard.h"
|
||||
|
||||
bool accept_input = true;
|
||||
|
||||
static int keyboard_buttons_down;
|
||||
|
||||
#define MAX_KEYBINDS 64
|
||||
|
@ -29,6 +31,8 @@ static int keyboard_map_scancode(int scancode) {
|
|||
}
|
||||
|
||||
bool keyboard_on_key_down(int scancode) {
|
||||
if (!accept_input) return false;
|
||||
|
||||
int mapped = keyboard_map_scancode(scancode);
|
||||
keyboard_buttons_down |= mapped;
|
||||
keyboard_lastkey = scancode;
|
||||
|
@ -36,6 +40,8 @@ bool keyboard_on_key_down(int scancode) {
|
|||
}
|
||||
|
||||
bool keyboard_on_key_up(int scancode) {
|
||||
if (!accept_input) return false;
|
||||
|
||||
int mapped = keyboard_map_scancode(scancode);
|
||||
keyboard_buttons_down &= ~mapped;
|
||||
if (keyboard_lastkey == (u32) scancode)
|
||||
|
|
|
@ -16,6 +16,7 @@ void keyboard_on_all_keys_up(void);
|
|||
}
|
||||
#endif
|
||||
|
||||
extern bool accept_input;
|
||||
extern struct ControllerAPI controller_keyboard;
|
||||
|
||||
#endif
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in New Issue