mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Bump 1.0.2
This commit is contained in:
@@ -130,7 +130,7 @@ jobs:
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
if [ ! -d "SDL2-2.28.5" ]; then
|
||||
wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
|
||||
wget https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.tar.gz
|
||||
tar -xzf SDL2-2.28.5.tar.gz
|
||||
fi
|
||||
cd SDL2-2.28.5
|
||||
@@ -261,7 +261,7 @@ jobs:
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
if [ ! -d "SDL2-2.30.3" ]; then
|
||||
wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz
|
||||
wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
|
||||
tar -xzf SDL2-2.30.3.tar.gz
|
||||
fi
|
||||
cd SDL2-2.30.3
|
||||
|
||||
@@ -66,3 +66,4 @@ _packages/
|
||||
|
||||
/mm/src/boot/build.c
|
||||
/mm/windows/properties.h
|
||||
/clang-format.exe
|
||||
|
||||
@@ -16,8 +16,8 @@ android {
|
||||
}
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
versionCode 3
|
||||
versionName "1.0.2"
|
||||
externalNativeBuild {
|
||||
//ndkBuild {
|
||||
// arguments "APP_PLATFORM=android-23"
|
||||
@@ -79,7 +79,7 @@ dependencies {
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '7.3'
|
||||
gradleVersion = '7.0.3'
|
||||
}
|
||||
|
||||
task prepareKotlinBuildScriptModel {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dishii.mm"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.0.1"
|
||||
android:versionCode="3"
|
||||
android:versionName="1.0.2"
|
||||
android:installLocation="auto">
|
||||
|
||||
<!-- OpenGL ES 3.0 -->
|
||||
|
||||
@@ -277,6 +277,7 @@ public class HIDDeviceManager {
|
||||
0x044f, // Thrustmaster
|
||||
0x045e, // Microsoft
|
||||
0x0738, // Mad Catz
|
||||
0x0b05, // ASUS
|
||||
0x0e6f, // PDP
|
||||
0x0f0d, // Hori
|
||||
0x10f5, // Turtle Beach
|
||||
@@ -590,7 +591,13 @@ public class HIDDeviceManager {
|
||||
} else {
|
||||
flags = 0;
|
||||
}
|
||||
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
|
||||
if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) {
|
||||
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
|
||||
intent.setPackage(mContext.getPackageName());
|
||||
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
|
||||
} else {
|
||||
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
|
||||
HIDDeviceOpenResult(deviceID, false);
|
||||
|
||||
@@ -38,6 +38,10 @@ public class SDL {
|
||||
}
|
||||
|
||||
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
|
||||
loadLibrary(libraryName, mContext);
|
||||
}
|
||||
|
||||
public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
|
||||
|
||||
if (libraryName == null) {
|
||||
throw new NullPointerException("No library name provided.");
|
||||
@@ -53,10 +57,10 @@ public class SDL {
|
||||
// To use ReLinker, just add it as a dependency. For more information, see
|
||||
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
|
||||
//
|
||||
Class<?> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
||||
Class<?> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
||||
Class<?> contextClass = mContext.getClassLoader().loadClass("android.content.Context");
|
||||
Class<?> stringClass = mContext.getClassLoader().loadClass("java.lang.String");
|
||||
Class<?> relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
||||
Class<?> relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
||||
Class<?> contextClass = context.getClassLoader().loadClass("android.content.Context");
|
||||
Class<?> stringClass = context.getClassLoader().loadClass("java.lang.String");
|
||||
|
||||
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
|
||||
// they've changed during updates.
|
||||
@@ -66,7 +70,7 @@ public class SDL {
|
||||
|
||||
// Actually load the library!
|
||||
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
|
||||
loadMethod.invoke(relinkInstance, mContext, libraryName, null, null);
|
||||
loadMethod.invoke(relinkInstance, context, libraryName, null, null);
|
||||
}
|
||||
catch (final Throwable e) {
|
||||
// Fall back
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 2;
|
||||
private static final int SDL_MINOR_VERSION = 30;
|
||||
private static final int SDL_MICRO_VERSION = 3;
|
||||
private static final int SDL_MICRO_VERSION = 5;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -281,7 +281,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
// Load the .so
|
||||
public void loadLibraries() {
|
||||
for (String lib : getLibraries()) {
|
||||
SDL.loadLibrary(lib);
|
||||
SDL.loadLibrary(lib, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -995,8 +995,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
/* No valid hint, nothing is explicitly allowed */
|
||||
if (!is_portrait_allowed && !is_landscape_allowed) {
|
||||
if (resizable) {
|
||||
/* All orientations are allowed */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
/* All orientations are allowed, respecting user orientation lock setting */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||
} else {
|
||||
/* Fixed window and nothing specified. Get orientation from w/h of created window */
|
||||
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||
@@ -1005,8 +1005,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
/* At least one orientation is allowed */
|
||||
if (resizable) {
|
||||
if (is_portrait_allowed && is_landscape_allowed) {
|
||||
/* hint allows both landscape and portrait, promote to full sensor */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
/* hint allows both landscape and portrait, promote to full user */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||
} else {
|
||||
/* Use the only one allowed "orientation" */
|
||||
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
|
||||
|
||||
+3
-3
@@ -5,11 +5,11 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
|
||||
project(2s2h VERSION 1.0.1 LANGUAGES C CXX)
|
||||
project(2s2h VERSION 1.0.2 LANGUAGES C CXX)
|
||||
include(CMake/2ship-cvars.cmake)
|
||||
include(CMake/lus-cvars.cmake)
|
||||
set(PROJECT_BUILD_NAME "Rika Bravo" CACHE STRING "")
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||
set(PROJECT_BUILD_NAME "Rika Charlie" CACHE STRING "" FORCE)
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 208 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"name": "NTSC-U 1.0",
|
||||
"sha1": "d6133ace5afaa0882cf214cf88daba39e266c078"
|
||||
},
|
||||
{
|
||||
"name": "NTSC-U GC",
|
||||
"sha1": "9743aa026e9269b339eb0e3044cd5830a440c1fd"
|
||||
}
|
||||
]
|
||||
+1
-1
Submodule libultraship updated: 7dd40ea028...e2f0264218
@@ -56,6 +56,24 @@ static const std::unordered_map<int32_t, const char*> alwaysWinDoggyraceOptions
|
||||
};
|
||||
|
||||
namespace BenGui {
|
||||
std::shared_ptr<std::vector<Ship::WindowBackend>> availableWindowBackends;
|
||||
std::unordered_map<Ship::WindowBackend, const char*> availableWindowBackendsMap;
|
||||
Ship::WindowBackend configWindowBackend;
|
||||
|
||||
void UpdateWindowBackendObjects() {
|
||||
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
|
||||
int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
|
||||
if (configWindowBackendId != -1 && configWindowBackendId < static_cast<int>(Ship::WindowBackend::BACKEND_COUNT)) {
|
||||
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
|
||||
} else {
|
||||
configWindowBackend = runningWindowBackend;
|
||||
}
|
||||
|
||||
availableWindowBackends = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends();
|
||||
for (auto& backend : *availableWindowBackends) {
|
||||
availableWindowBackendsMap[backend] = windowBackendsMap[backend];
|
||||
}
|
||||
}
|
||||
|
||||
void DrawMenuBarIcon() {
|
||||
static bool gameIconLoaded = false;
|
||||
@@ -247,32 +265,17 @@ void DrawSettingsMenu() {
|
||||
// UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
|
||||
// #endregion */
|
||||
|
||||
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
|
||||
Ship::WindowBackend configWindowBackend;
|
||||
int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
|
||||
if (configWindowBackendId != -1 &&
|
||||
configWindowBackendId < static_cast<int>(Ship::WindowBackend::BACKEND_COUNT)) {
|
||||
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
|
||||
} else {
|
||||
configWindowBackend = runningWindowBackend;
|
||||
}
|
||||
|
||||
auto availableWindowBackends = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends();
|
||||
std::unordered_map<Ship::WindowBackend, const char*> availableWindowBackendsMap;
|
||||
for (auto& backend : *availableWindowBackends) {
|
||||
availableWindowBackendsMap[backend] = windowBackendsMap[backend];
|
||||
}
|
||||
|
||||
if (UIWidgets::Combobox(
|
||||
"Renderer API (Needs reload)", &configWindowBackend, availableWindowBackendsMap,
|
||||
{ .tooltip = "Sets the renderer API used by the game. Requires a relaunch to take effect.",
|
||||
.disabled = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1,
|
||||
.disabled = availableWindowBackends->size() <= 1,
|
||||
.disabledTooltip = "Only one renderer API is available on this platform." })) {
|
||||
Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id",
|
||||
static_cast<int32_t>(configWindowBackend));
|
||||
Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name",
|
||||
windowBackendsMap.at(configWindowBackend));
|
||||
Ship::Context::GetInstance()->GetConfig()->Save();
|
||||
UpdateWindowBackendObjects();
|
||||
}
|
||||
|
||||
if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
||||
@@ -618,8 +621,32 @@ const char* logLevels[] = {
|
||||
|
||||
void DrawDeveloperToolsMenu() {
|
||||
if (UIWidgets::BeginMenu("Developer Tools", UIWidgets::Colors::Yellow)) {
|
||||
UIWidgets::CVarCheckbox("Debug Mode", "gDeveloperTools.DebugEnabled",
|
||||
{ .tooltip = "Enables Debug Mode, allowing you to select maps with L + R + Z." });
|
||||
if (UIWidgets::CVarCheckbox("Debug Mode", "gDeveloperTools.DebugEnabled",
|
||||
{ .tooltip = "Enables Debug Mode, revealing some developer options and allows you "
|
||||
"to enter Map Select with L + R + Z" })) {
|
||||
// If disabling debug mode, disable all debug features
|
||||
if (!CVarGetInteger("gDeveloperTools.DebugEnabled", 0)) {
|
||||
CVarClear("gDeveloperTools.DebugSaveFileMode");
|
||||
CVarClear("gDeveloperTools.PreventActorUpdate");
|
||||
CVarClear("gDeveloperTools.PreventActorDraw");
|
||||
CVarClear("gDeveloperTools.PreventActorInit");
|
||||
CVarClear("gDeveloperTools.DisableObjectDependency");
|
||||
if (gPlayState != NULL) {
|
||||
gPlayState->frameAdvCtx.enabled = false;
|
||||
}
|
||||
RegisterDebugSaveCreate();
|
||||
RegisterPreventActorUpdateHooks();
|
||||
RegisterPreventActorDrawHooks();
|
||||
RegisterPreventActorInitHooks();
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f),
|
||||
"Warning: Some of these features can break your game,\nor cause unexpected behavior, "
|
||||
"please ensure you disable them\nbefore reporting any bugs.");
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gDeveloperTools.DebugEnabled", 0)) {
|
||||
UIWidgets::CVarCheckbox(
|
||||
@@ -632,45 +659,48 @@ void DrawDeveloperToolsMenu() {
|
||||
"Change the behavior of creating saves while debug mode is enabled:\n\n"
|
||||
"- Empty Save: The default 3 heart save file in first cycle\n"
|
||||
"- Vanilla Debug Save: Uses the title screen save info (8 hearts, all items and masks)\n"
|
||||
"- 100\% Save: All items, equipment, mask, quast status and bombers notebook complete" })) {
|
||||
"- 100\% Save: All items, equipment, mask, quast status and bombers notebook complete",
|
||||
.defaultIndex = DEBUG_SAVE_INFO_NONE })) {
|
||||
RegisterDebugSaveCreate();
|
||||
}
|
||||
}
|
||||
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Update", "gDeveloperTools.PreventActorUpdate")) {
|
||||
RegisterPreventActorUpdateHooks();
|
||||
}
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Draw", "gDeveloperTools.PreventActorDraw")) {
|
||||
RegisterPreventActorDrawHooks();
|
||||
}
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Init", "gDeveloperTools.PreventActorInit")) {
|
||||
RegisterPreventActorInitHooks();
|
||||
}
|
||||
if (UIWidgets::CVarCombobox("Log Level", "gDeveloperTools.LogLevel", logLevels,
|
||||
{
|
||||
.tooltip = "The log level determines which messages are printed to the "
|
||||
"console. This does not affect the log file output",
|
||||
.defaultIndex = 1,
|
||||
})) {
|
||||
Ship::Context::GetInstance()->GetLogger()->set_level(
|
||||
(spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1));
|
||||
}
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Update", "gDeveloperTools.PreventActorUpdate")) {
|
||||
RegisterPreventActorUpdateHooks();
|
||||
}
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Draw", "gDeveloperTools.PreventActorDraw")) {
|
||||
RegisterPreventActorDrawHooks();
|
||||
}
|
||||
if (UIWidgets::CVarCheckbox("Prevent Actor Init", "gDeveloperTools.PreventActorInit")) {
|
||||
RegisterPreventActorInitHooks();
|
||||
}
|
||||
UIWidgets::CVarCheckbox("Disable Object Dependency", "gDeveloperTools.DisableObjectDependency");
|
||||
|
||||
if (gPlayState != NULL) {
|
||||
ImGui::Separator();
|
||||
UIWidgets::Checkbox(
|
||||
"Frame Advance", (bool*)&gPlayState->frameAdvCtx.enabled,
|
||||
{ .tooltip = "This allows you to advance through the game one frame at a time on command. "
|
||||
"To advance a frame, hold Z and tap R on the second controller. Holding Z "
|
||||
"and R will advance a frame every half second. You can also use the buttons below." });
|
||||
if (gPlayState->frameAdvCtx.enabled) {
|
||||
if (UIWidgets::Button("Advance 1", { .size = UIWidgets::Sizes::Inline })) {
|
||||
CVarSetInteger("gDeveloperTools.FrameAdvanceTick", 1);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
UIWidgets::Button("Advance (Hold)", { .size = UIWidgets::Sizes::Inline });
|
||||
if (ImGui::IsItemActive()) {
|
||||
CVarSetInteger("gDeveloperTools.FrameAdvanceTick", 1);
|
||||
if (UIWidgets::CVarCombobox("Log Level", "gDeveloperTools.LogLevel", logLevels,
|
||||
{
|
||||
.tooltip = "The log level determines which messages are printed to the "
|
||||
"console. This does not affect the log file output",
|
||||
.defaultIndex = 1,
|
||||
})) {
|
||||
Ship::Context::GetInstance()->GetLogger()->set_level(
|
||||
(spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1));
|
||||
}
|
||||
|
||||
if (gPlayState != NULL) {
|
||||
ImGui::Separator();
|
||||
UIWidgets::Checkbox(
|
||||
"Frame Advance", (bool*)&gPlayState->frameAdvCtx.enabled,
|
||||
{ .tooltip = "This allows you to advance through the game one frame at a time on command. "
|
||||
"To advance a frame, hold Z and tap R on the second controller. Holding Z "
|
||||
"and R will advance a frame every half second. You can also use the buttons below." });
|
||||
if (gPlayState->frameAdvCtx.enabled) {
|
||||
if (UIWidgets::Button("Advance 1", { .size = UIWidgets::Sizes::Inline })) {
|
||||
CVarSetInteger("gDeveloperTools.FrameAdvanceTick", 1);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
UIWidgets::Button("Advance (Hold)", { .size = UIWidgets::Sizes::Inline });
|
||||
if (ImGui::IsItemActive()) {
|
||||
CVarSetInteger("gDeveloperTools.FrameAdvanceTick", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -714,6 +744,10 @@ void DrawDeveloperToolsMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
void BenMenuBar::InitElement() {
|
||||
UpdateWindowBackendObjects();
|
||||
}
|
||||
|
||||
void BenMenuBar::DrawElement() {
|
||||
if (ImGui::BeginMenuBar()) {
|
||||
DrawMenuBarIcon();
|
||||
|
||||
@@ -15,7 +15,7 @@ class BenMenuBar : public Ship::GuiMenuBar {
|
||||
|
||||
protected:
|
||||
void DrawElement() override;
|
||||
void InitElement() override{};
|
||||
void InitElement() override;
|
||||
void UpdateElement() override{};
|
||||
};
|
||||
} // namespace BenGui
|
||||
|
||||
@@ -277,8 +277,15 @@ void ActorViewerWindow::DrawElement() {
|
||||
ImGui::InputScalar("rZ", ImGuiDataType_S16, &newActor.rot.z);
|
||||
ImGui::EndGroup();
|
||||
|
||||
UIWidgets::CVarCheckbox("Remove Obj Dep?", "gObjDep",
|
||||
{ .tooltip = "Allows actors to spawn where/when they normally wouldn't." });
|
||||
UIWidgets::CVarCheckbox("Disable Object Dependency", "gDeveloperTools.DisableObjectDependency");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextColored(
|
||||
ImVec4(1.0f, 1.0f, 0.0f, 1.0f),
|
||||
"Warning: This will cause some actors to spawn in places they normally wouldn't,\nplease ensure "
|
||||
"this is disabled before reporting any actor related issues");
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
if (UIWidgets::Button("Fetch from Link")) {
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
|
||||
@@ -8,6 +8,8 @@ extern "C" {
|
||||
#include <macros.h>
|
||||
#include <variables.h>
|
||||
#include <functions.h>
|
||||
#include "overlays/actors/ovl_En_Test4/z_en_test4.h"
|
||||
|
||||
extern PlayState* gPlayState;
|
||||
extern SaveContext gSaveContext;
|
||||
extern TexturePtr gItemIcons[131];
|
||||
@@ -22,6 +24,9 @@ void PlayerCall_Init(Actor* thisx, PlayState* play);
|
||||
void PlayerCall_Update(Actor* thisx, PlayState* play);
|
||||
void PlayerCall_Draw(Actor* thisx, PlayState* play);
|
||||
void TransitionFade_SetColor(void* thisx, u32 color);
|
||||
|
||||
void func_80A42198(EnTest4* thisx);
|
||||
void func_80A425E4(EnTest4* thisx, PlayState* play);
|
||||
}
|
||||
|
||||
bool safeMode = true;
|
||||
@@ -137,6 +142,174 @@ int setPlayerName(ImGuiInputTextCallbackData* data) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
EnTest4* FindEnTest4Actor() {
|
||||
if (gPlayState == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Actor* enTest4Search = gPlayState->actorCtx.actorLists[ACTORCAT_SWITCH].first;
|
||||
|
||||
while (enTest4Search != NULL) {
|
||||
if (enTest4Search->id == ACTOR_EN_TEST4) {
|
||||
return (EnTest4*)enTest4Search;
|
||||
}
|
||||
enTest4Search = enTest4Search->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void UpdateGameTime(u16 gameTime) {
|
||||
bool newTimeIsNight = (gameTime > CLOCK_TIME(18, 0)) || (gameTime < CLOCK_TIME(6, 0));
|
||||
bool prevTimeIsNight = (gSaveContext.save.time > CLOCK_TIME(18, 0)) || (gSaveContext.save.time < CLOCK_TIME(6, 0));
|
||||
|
||||
gSaveContext.save.time = gameTime;
|
||||
|
||||
if (gPlayState == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear weather from day 2
|
||||
gWeatherMode = WEATHER_MODE_CLEAR;
|
||||
gPlayState->envCtx.lightningState = LIGHTNING_LAST;
|
||||
|
||||
// When transitioning over night boundaries, stop the sequences and ask to replay, then respawn actors
|
||||
if (newTimeIsNight != prevTimeIsNight) {
|
||||
// AMBIENCE_ID_13 is used to persist a scenes sequence through night, so we shouldn't
|
||||
// change anything if thats active
|
||||
if (gPlayState->sequenceCtx.ambienceId != AMBIENCE_ID_13) {
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 240);
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
|
||||
Environment_PlaySceneSequence(gPlayState);
|
||||
}
|
||||
|
||||
// Kills/Spawns half-day actors
|
||||
gPlayState->numSetupActors = -gPlayState->numSetupActors;
|
||||
}
|
||||
|
||||
EnTest4* enTest4 = FindEnTest4Actor();
|
||||
|
||||
// Update EnTest4 actor to be in sync with the new time
|
||||
// This ensures that day transitions are not triggered with the change
|
||||
if (enTest4 != NULL) {
|
||||
enTest4->unk_146 = gameTime;
|
||||
enTest4->lastBellTime = gameTime;
|
||||
enTest4->csIdIndex = newTimeIsNight ? 0 : 1;
|
||||
|
||||
// Sets the nextBellTime based on the new current time
|
||||
if (CURRENT_DAY == 3) {
|
||||
func_80A42198(enTest4);
|
||||
} else {
|
||||
func_80A425E4(enTest4, gPlayState);
|
||||
}
|
||||
|
||||
// Unset any screen scaling from the above funcs
|
||||
gSaveContext.screenScale = 1000.0f;
|
||||
gSaveContext.screenScaleFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTempleClears() {
|
||||
bool cleared;
|
||||
bool open;
|
||||
|
||||
// Woodfall
|
||||
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE);
|
||||
if (UIWidgets::Checkbox("Woodfall cleared", &cleared)) {
|
||||
if (cleared) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (cleared) {
|
||||
open = true;
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_20_01);
|
||||
} else {
|
||||
open = CHECK_WEEKEVENTREG(WEEKEVENTREG_20_01);
|
||||
}
|
||||
if (UIWidgets::Checkbox("Woodfall Open", &open, { .disabled = cleared })) {
|
||||
if (open) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_20_01);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_20_01);
|
||||
}
|
||||
}
|
||||
|
||||
// Snowhead
|
||||
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE);
|
||||
if (UIWidgets::Checkbox("Snowhead cleared", &cleared)) {
|
||||
if (cleared) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (cleared) {
|
||||
open = true;
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_30_01);
|
||||
} else {
|
||||
open = CHECK_WEEKEVENTREG(WEEKEVENTREG_30_01);
|
||||
}
|
||||
if (UIWidgets::Checkbox("Snowhead Open", &open, { .disabled = cleared })) {
|
||||
if (open) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_30_01);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_30_01);
|
||||
}
|
||||
}
|
||||
|
||||
// Great Bay
|
||||
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE);
|
||||
if (UIWidgets::Checkbox("Great Bay cleared", &cleared)) {
|
||||
if (cleared) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (cleared) {
|
||||
open = true;
|
||||
// 53_20 is if the turtle is raised
|
||||
// 93_08 determines if a long or short cutscene should play
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_53_20);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_93_08);
|
||||
} else {
|
||||
open = CHECK_WEEKEVENTREG(WEEKEVENTREG_53_20);
|
||||
}
|
||||
if (UIWidgets::Checkbox("Great Bay Open", &open, { .disabled = cleared })) {
|
||||
if (open) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_53_20);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_93_08);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_53_20);
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_93_08);
|
||||
}
|
||||
}
|
||||
|
||||
// Stone Tower
|
||||
// Stone Tower Temple is always open so there is no need to have an option to open it.
|
||||
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE);
|
||||
if (UIWidgets::Checkbox("Stone Tower cleared", &cleared)) {
|
||||
if (cleared) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawGeneralTab() {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 3.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(8.0f, 8.0f));
|
||||
@@ -179,8 +352,11 @@ void DrawGeneralTab() {
|
||||
}
|
||||
hours += std::to_string(curHours);
|
||||
std::string timeString = hours + ":" + minutes + ampm + " (0x%x)";
|
||||
ImGui::SliderScalar("##timeInput", ImGuiDataType_U16, &gSaveContext.save.time, &minTime, &maxTime,
|
||||
timeString.c_str());
|
||||
|
||||
u16 gameTime = gSaveContext.save.time;
|
||||
if (ImGui::SliderScalar("##timeInput", ImGuiDataType_U16, &gameTime, &minTime, &maxTime, timeString.c_str())) {
|
||||
UpdateGameTime(gameTime);
|
||||
}
|
||||
UIWidgets::PopStyleSlider();
|
||||
ImGui::EndGroup();
|
||||
|
||||
@@ -230,7 +406,7 @@ void DrawGeneralTab() {
|
||||
for (size_t i = 0; i < timeSkipAmounts.size(); i++) {
|
||||
const auto& skip = timeSkipAmounts.at(i);
|
||||
if (UIWidgets::Button(skip.second, { .color = UIWidgets::Colors::Indigo, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.time += CLOCK_TIME(0, skip.first);
|
||||
UpdateGameTime(gSaveContext.save.time + CLOCK_TIME(0, skip.first));
|
||||
}
|
||||
if (i < timeSkipAmounts.size() - 1) {
|
||||
ImGui::SameLine();
|
||||
@@ -238,27 +414,33 @@ void DrawGeneralTab() {
|
||||
}
|
||||
// Day slider
|
||||
UIWidgets::PushStyleSlider();
|
||||
static s32 minDay = 1;
|
||||
static s32 maxDay = 3;
|
||||
static s32 minDay = 0;
|
||||
static s32 maxDay = 4;
|
||||
if (ImGui::SliderScalar("##dayInput", ImGuiDataType_S32, &gSaveContext.save.day, &minDay, &maxDay, "Day: %d")) {
|
||||
gSaveContext.save.eventDayCount = CURRENT_DAY;
|
||||
// Reset the time to the start of day/night
|
||||
if (gSaveContext.save.time < CLOCK_TIME(6, 0) || gSaveContext.save.time > CLOCK_TIME(18, 0)) {
|
||||
gSaveContext.save.time = CLOCK_TIME(18, 1);
|
||||
} else {
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 1);
|
||||
}
|
||||
|
||||
if (gPlayState != nullptr) {
|
||||
Interface_NewDay(gPlayState, CURRENT_DAY);
|
||||
// Inverting setup actors forces actors to kill/respawn for new day
|
||||
// Inverting setup actors forces half-day actors to kill/respawn for new day
|
||||
gPlayState->numSetupActors = -gPlayState->numSetupActors;
|
||||
// Load environment values for new day
|
||||
func_800FEAF4(&gPlayState->envCtx);
|
||||
// Clear weather from day 2
|
||||
gWeatherMode = WEATHER_MODE_CLEAR;
|
||||
gPlayState->envCtx.lightningState = LIGHTNING_LAST;
|
||||
}
|
||||
}
|
||||
// Time speed slider
|
||||
// Values are added to R_TIME_SPEED which is generally 3 in normal play state
|
||||
static s32 minSpeed = -3; // Time frozen
|
||||
static s32 maxSpeed = 7;
|
||||
std::string timeSpeedString = "Time Speed: " + std::to_string(gSaveContext.save.timeSpeedOffset + 3);
|
||||
std::string extraText = "";
|
||||
if (gSaveContext.save.timeSpeedOffset == 0) {
|
||||
extraText = " (default)";
|
||||
} else if (gSaveContext.save.timeSpeedOffset == -2) {
|
||||
extraText = " (inverted)";
|
||||
}
|
||||
std::string timeSpeedString = "Time Speed: " + std::to_string(gSaveContext.save.timeSpeedOffset + 3) + extraText;
|
||||
ImGui::SliderScalar("##timeSpeedInput", ImGuiDataType_S32, &gSaveContext.save.timeSpeedOffset, &minSpeed, &maxSpeed,
|
||||
timeSpeedString.c_str());
|
||||
UIWidgets::PopStyleSlider();
|
||||
@@ -350,24 +532,7 @@ void DrawGeneralTab() {
|
||||
UIWidgets::Tooltip("To recieve the rewards, set the bank to 199, 999, or 4,999 then deposit a single rupee");
|
||||
UIWidgets::PopStyleSlider();
|
||||
|
||||
// Temple clears
|
||||
static const std::array<std::pair<int32_t, const char*>, 4> templeClears = { {
|
||||
{ WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE, "Woodfall Cleared" },
|
||||
{ WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE, "Snowhead Cleared" },
|
||||
{ WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE, "Great Bay Cleared" },
|
||||
{ WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE, "Stone Tower Cleared" },
|
||||
} };
|
||||
|
||||
for (const auto& temple : templeClears) {
|
||||
bool cleared = CHECK_WEEKEVENTREG(temple.first);
|
||||
if (UIWidgets::Checkbox(temple.second, &cleared, { .color = UIWidgets::Colors::Gray })) {
|
||||
if (cleared) {
|
||||
SET_WEEKEVENTREG(temple.first);
|
||||
} else {
|
||||
CLEAR_WEEKEVENTREG(temple.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
DrawTempleClears();
|
||||
|
||||
UIWidgets::Checkbox("Has Tatl", (bool*)&gSaveContext.save.hasTatl, { .color = UIWidgets::Colors::Gray });
|
||||
UIWidgets::Checkbox("Is Owl Save", (bool*)&gSaveContext.save.isOwlSave, { .color = UIWidgets::Colors::Gray });
|
||||
@@ -408,38 +573,38 @@ void DrawEquipItemMenu(InventorySlot slot) {
|
||||
|
||||
if (ImGui::BeginMenu("Equip")) {
|
||||
if (ImGui::MenuItem("C-Left")) {
|
||||
gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][EQUIP_SLOT_C_LEFT] = currentItemId;
|
||||
gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_LEFT] = slot;
|
||||
SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_C_LEFT, currentItemId);
|
||||
SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_LEFT, slot);
|
||||
Interface_LoadItemIconImpl(gPlayState, EQUIP_SLOT_C_LEFT);
|
||||
}
|
||||
if (ImGui::MenuItem("C-Down")) {
|
||||
gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][EQUIP_SLOT_C_DOWN] = currentItemId;
|
||||
gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_DOWN] = slot;
|
||||
SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_C_DOWN, currentItemId);
|
||||
SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_DOWN, slot);
|
||||
Interface_LoadItemIconImpl(gPlayState, EQUIP_SLOT_C_DOWN);
|
||||
}
|
||||
if (ImGui::MenuItem("C-Right")) {
|
||||
gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][EQUIP_SLOT_C_RIGHT] = currentItemId;
|
||||
gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_RIGHT] = slot;
|
||||
SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_C_RIGHT, currentItemId);
|
||||
SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_RIGHT, slot);
|
||||
Interface_LoadItemIconImpl(gPlayState, EQUIP_SLOT_C_RIGHT);
|
||||
}
|
||||
if (ImGui::MenuItem("D-Right")) {
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_RIGHT] = currentItemId;
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_RIGHT] = slot;
|
||||
DPAD_SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_D_RIGHT, currentItemId);
|
||||
DPAD_SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_RIGHT, slot);
|
||||
Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_RIGHT);
|
||||
}
|
||||
if (ImGui::MenuItem("D-Left")) {
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_LEFT] = currentItemId;
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_LEFT] = slot;
|
||||
DPAD_SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_D_LEFT, currentItemId);
|
||||
DPAD_SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_LEFT, slot);
|
||||
Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_LEFT);
|
||||
}
|
||||
if (ImGui::MenuItem("D-Down")) {
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_DOWN] = currentItemId;
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_DOWN] = slot;
|
||||
DPAD_SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_D_DOWN, currentItemId);
|
||||
DPAD_SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_DOWN, slot);
|
||||
Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_DOWN);
|
||||
}
|
||||
if (ImGui::MenuItem("D-Up")) {
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_UP] = currentItemId;
|
||||
gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_UP] = slot;
|
||||
DPAD_SET_CUR_FORM_BTN_ITEM(EQUIP_SLOT_D_UP, currentItemId);
|
||||
DPAD_SET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_UP, slot);
|
||||
Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_UP);
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
@@ -512,9 +677,13 @@ void DrawSlot(InventorySlot slot) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 1.0f, 1.0f, 0.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.0f, 1.0f, 1.0f, 0.2f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 1.0f, 1.0f, 0.1f));
|
||||
if (gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_LEFT] == slot ||
|
||||
gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_DOWN] == slot ||
|
||||
gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_RIGHT] == slot) {
|
||||
if (GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_LEFT) == slot || GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_DOWN) == slot ||
|
||||
GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_C_RIGHT) == slot ||
|
||||
(CVarGetInteger("gEnhancements.Dpad.DpadEquips", 0) &&
|
||||
(DPAD_GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_RIGHT) == slot ||
|
||||
DPAD_GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_LEFT) == slot ||
|
||||
DPAD_GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_DOWN) == slot ||
|
||||
DPAD_GET_CUR_FORM_BTN_SLOT(EQUIP_SLOT_D_UP) == slot))) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, UIWidgets::Colors::White);
|
||||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(1.0f, 1.0f, 1.0f, 0.0f));
|
||||
@@ -1244,7 +1413,7 @@ void DrawFlagsTab() {
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(1.0f, 1.0f));
|
||||
switch (selectedFlagSection) {
|
||||
case 0:
|
||||
case 0: // currentSceneFlags
|
||||
if (gPlayState == NULL) {
|
||||
ImGui::Text("Play state is NULL, cannot display scene flags");
|
||||
break;
|
||||
@@ -1421,7 +1590,7 @@ void DrawFlagsTab() {
|
||||
UIWidgets::DrawFlagArray32("##collectible3", gPlayState->actorCtx.sceneFlags.collectible[3]);
|
||||
ImGui::EndGroup();
|
||||
break;
|
||||
case 1:
|
||||
case 1: // weekEventReg
|
||||
for (int i = 0; i < 100; i++) {
|
||||
ImGui::PushID(i);
|
||||
ImGui::Text("%02d", i);
|
||||
@@ -1430,7 +1599,7 @@ void DrawFlagsTab() {
|
||||
ImGui::PopID();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 2: // eventInf
|
||||
for (int i = 0; i < 8; i++) {
|
||||
ImGui::PushID(i);
|
||||
ImGui::Text("%02d", i);
|
||||
@@ -1439,7 +1608,7 @@ void DrawFlagsTab() {
|
||||
ImGui::PopID();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 3: // scenesVisible
|
||||
if (UIWidgets::Button("All##scenesVisible",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
for (int i = 0; i < 7; i++) {
|
||||
@@ -1459,19 +1628,20 @@ void DrawFlagsTab() {
|
||||
ImGui::PopID();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (UIWidgets::Button("All##scenesVisible",
|
||||
case 4: // owlActivation
|
||||
if (UIWidgets::Button("All##owlActivationFlags",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.playerData.owlActivationFlags = UINT16_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##scenesVisible",
|
||||
if (UIWidgets::Button("Clear##owlActivationFlags",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.playerData.owlActivationFlags = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray16("##scenesVisible", gSaveContext.save.saveInfo.playerData.owlActivationFlags);
|
||||
UIWidgets::DrawFlagArray16("##owlActivationFlags",
|
||||
gSaveContext.save.saveInfo.playerData.owlActivationFlags);
|
||||
break;
|
||||
case 5:
|
||||
case 5: // permanentSceneFlags
|
||||
ImGui::BeginGroup();
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("chest");
|
||||
@@ -1586,19 +1756,19 @@ void DrawFlagsTab() {
|
||||
UIWidgets::DrawFlagArray32("##rooms", gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].rooms);
|
||||
ImGui::EndGroup();
|
||||
break;
|
||||
case 6:
|
||||
case 6: // cycleSceneFlags
|
||||
ImGui::BeginGroup();
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("chest");
|
||||
ImGui::SameLine(110);
|
||||
if (UIWidgets::Button("All##chest",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].chest = UINT32_MAX;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].chest = UINT32_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##chest",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].chest = 0;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].chest = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray32("##chest", gSaveContext.cycleSceneFlags[selectedScene].chest);
|
||||
ImGui::EndGroup();
|
||||
@@ -1609,12 +1779,12 @@ void DrawFlagsTab() {
|
||||
ImGui::SameLine(110);
|
||||
if (UIWidgets::Button("All##switch0",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].switch0 = UINT32_MAX;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].switch0 = UINT32_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##switch0",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].switch0 = 0;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].switch0 = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray32("##switch0", gSaveContext.cycleSceneFlags[selectedScene].switch0);
|
||||
ImGui::EndGroup();
|
||||
@@ -1624,12 +1794,12 @@ void DrawFlagsTab() {
|
||||
ImGui::SameLine(110);
|
||||
if (UIWidgets::Button("All##collectible",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].collectible = UINT32_MAX;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].collectible = UINT32_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##collectible",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].collectible = 0;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].collectible = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray32("##collectible", gSaveContext.cycleSceneFlags[selectedScene].collectible);
|
||||
ImGui::EndGroup();
|
||||
@@ -1640,12 +1810,12 @@ void DrawFlagsTab() {
|
||||
ImGui::SameLine(110);
|
||||
if (UIWidgets::Button("All##switch1",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].switch1 = UINT32_MAX;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].switch1 = UINT32_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##switch1",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].switch1 = 0;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].switch1 = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray32("##switch1", gSaveContext.cycleSceneFlags[selectedScene].switch1);
|
||||
ImGui::EndGroup();
|
||||
@@ -1655,12 +1825,12 @@ void DrawFlagsTab() {
|
||||
ImGui::SameLine(110);
|
||||
if (UIWidgets::Button("All##clearedRoom",
|
||||
{ .color = UIWidgets::Colors::Gray, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].clearedRoom = UINT32_MAX;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].clearedRoom = UINT32_MAX;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button("Clear##clearedRoom",
|
||||
{ .color = UIWidgets::Colors::Red, .size = UIWidgets::Sizes::Inline })) {
|
||||
gSaveContext.save.saveInfo.permanentSceneFlags[selectedScene].clearedRoom = 0;
|
||||
gSaveContext.cycleSceneFlags[selectedScene].clearedRoom = 0;
|
||||
}
|
||||
UIWidgets::DrawFlagArray32("##clearedRoom", gSaveContext.cycleSceneFlags[selectedScene].clearedRoom);
|
||||
ImGui::EndGroup();
|
||||
|
||||
@@ -67,6 +67,7 @@ void RenderWarpPointSection() {
|
||||
CVarGetInteger(CV "Room", 0), PLAYER_PARAMS(0xFF, PLAYER_INITMODE_D), &pos,
|
||||
CVarGetFloat(CV "Rotation", 0.0f));
|
||||
func_80169EFC(&gPlayState->state);
|
||||
gSaveContext.respawnFlag = -8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,24 +21,26 @@ extern s32 sCameraInterfaceFlags;
|
||||
static bool sCanFreeLook = false;
|
||||
|
||||
void UpdateFreeLookState(Camera* camera) {
|
||||
if (CAM_MODE_TARGET <= camera->mode && camera->mode <= CAM_MODE_BATTLE) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
|
||||
if (CAM_MODE_FIRSTPERSON <= camera->mode && camera->mode <= CAM_MODE_CLIMBZ) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
|
||||
if (camera->mode == CAM_MODE_HANGZ) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
|
||||
if (CAM_MODE_BOOMERANG <= camera->mode && camera->mode <= CAM_MODE_ZORAFINZ) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
|
||||
if (gPlayState != nullptr && Player_InCsMode(gPlayState)) {
|
||||
sCanFreeLook = false;
|
||||
switch (camera->mode) {
|
||||
case CAM_MODE_BOWARROWZ:
|
||||
case CAM_MODE_FIRSTPERSON:
|
||||
case CAM_MODE_FOLLOWBOOMERANG:
|
||||
case CAM_MODE_ZORAFIN:
|
||||
case CAM_MODE_FOLLOWTARGET:
|
||||
case CAM_MODE_TARGET:
|
||||
case CAM_MODE_TALK:
|
||||
case CAM_MODE_SLINGSHOT:
|
||||
case CAM_MODE_BOWARROW:
|
||||
case CAM_MODE_BATTLE:
|
||||
case CAM_MODE_DEKUHIDE:
|
||||
case CAM_MODE_CLIMBZ:
|
||||
case CAM_MODE_HOOKSHOT:
|
||||
case CAM_MODE_HANGZ:
|
||||
case CAM_MODE_DEKUFLYZ:
|
||||
case CAM_MODE_BOOMERANG:
|
||||
case CAM_MODE_CHARGEZ:
|
||||
case CAM_MODE_ZORAFINZ:
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +143,15 @@ bool Camera_CanFreeLook(Camera* camera) {
|
||||
if (!sCanFreeLook && (fabsf(camX) >= 15.0f || fabsf(camY) >= 15.0f)) {
|
||||
sCanFreeLook = true;
|
||||
}
|
||||
// Pressing Z will "Reset" Camera
|
||||
if (CHECK_BTN_ALL(sCamPlayState->state.input[0].press.button, BTN_Z)) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
// Reset camera during cutscenes
|
||||
if (gPlayState != nullptr && Player_InCsMode(gPlayState)) {
|
||||
sCanFreeLook = false;
|
||||
}
|
||||
|
||||
return sCanFreeLook;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void RegisterMoonJumpOnL() {
|
||||
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
|
||||
if (CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) {
|
||||
if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) {
|
||||
player->actor.velocity.y = 6.34375f;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,10 +7,13 @@ extern "C" {
|
||||
}
|
||||
|
||||
SaveInfo saveInfoCopy;
|
||||
ShipSaveInfo shipSaveInfoCopy;
|
||||
|
||||
void RegisterEndOfCycleSaveHooks() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::BeforeEndOfCycleSave>(
|
||||
[]() { memcpy(&saveInfoCopy, &gSaveContext.save.saveInfo, sizeof(SaveInfo)); });
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::BeforeEndOfCycleSave>([]() {
|
||||
memcpy(&saveInfoCopy, &gSaveContext.save.saveInfo, sizeof(SaveInfo));
|
||||
memcpy(&shipSaveInfoCopy, &gSaveContext.save.shipSaveInfo, sizeof(ShipSaveInfo));
|
||||
});
|
||||
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::AfterEndOfCycleSave>([]() {
|
||||
if (CVarGetInteger("gEnhancements.Cycle.DoNotResetRupees", 0)) {
|
||||
@@ -68,14 +71,27 @@ void RegisterEndOfCycleSaveHooks() {
|
||||
SET_CUR_FORM_BTN_ITEM(j, saveInfoCopy.equips.buttonItems[0][j]);
|
||||
}
|
||||
}
|
||||
for (int j = EQUIP_SLOT_D_RIGHT; j <= EQUIP_SLOT_D_UP; j++) {
|
||||
if (DPAD_GET_CUR_FORM_BTN_ITEM(j) == ITEM_BOTTLE) {
|
||||
DPAD_SET_CUR_FORM_BTN_ITEM(j, shipSaveInfoCopy.dpadEquips.dpadItems[0][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gEnhancements.Cycle.DoNotResetRazorSword", 0) &&
|
||||
((saveInfoCopy.equips.equipment & gEquipMasks[EQUIP_TYPE_SWORD]) >> gEquipShifts[EQUIP_TYPE_SWORD]) ==
|
||||
EQUIP_VALUE_SWORD_RAZOR) {
|
||||
if (CVarGetInteger("gEnhancements.Cycle.DoNotResetRazorSword", 0)) {
|
||||
u8 curSword =
|
||||
(saveInfoCopy.equips.equipment & gEquipMasks[EQUIP_TYPE_SWORD]) >> gEquipShifts[EQUIP_TYPE_SWORD];
|
||||
|
||||
SET_EQUIP_VALUE(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_RAZOR);
|
||||
CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_SWORD_RAZOR;
|
||||
// Check for razor sword equipped, stolen, or turned into the smithy
|
||||
if (curSword == EQUIP_VALUE_SWORD_RAZOR ||
|
||||
(curSword == EQUIP_VALUE_SWORD_NONE &&
|
||||
((saveInfoCopy.permanentSceneFlags[SCENE_KAJIYA].unk_14 & 4) ||
|
||||
(((saveInfoCopy.stolenItems & 0xFF000000) >> 0x18) == ITEM_SWORD_RAZOR) ||
|
||||
(((saveInfoCopy.stolenItems & 0x00FF0000) >> 0x10) == ITEM_SWORD_RAZOR)))) {
|
||||
|
||||
SET_EQUIP_VALUE(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_RAZOR);
|
||||
BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_B) = ITEM_SWORD_RAZOR;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user