mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-24 06:50:43 -04:00
Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer
This commit is contained in:
@@ -206,6 +206,11 @@ private:
|
||||
/* 0x6D3 */ u8 field_0x6d3;
|
||||
#if TARGET_PC
|
||||
f32 mSelectItemSlideElapsed[4];
|
||||
f32 mCursorInterpPrevX;
|
||||
f32 mCursorInterpPrevY;
|
||||
f32 mCursorInterpCurrX;
|
||||
f32 mCursorInterpCurrY;
|
||||
bool mCursorInterpInit;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,9 @@ public:
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
f32 getPositionX() const { return mPositionX; }
|
||||
f32 getPositionY() const { return mPositionY; }
|
||||
|
||||
void refreshAspectScale();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ struct UserSettings {
|
||||
ConfigVar<bool> invertCameraXAxis;
|
||||
ConfigVar<bool> disableMainHUD;
|
||||
ConfigVar<bool> pauseOnFocusLost;
|
||||
ConfigVar<bool> enableLinkDollRotation;
|
||||
|
||||
|
||||
// Graphics
|
||||
ConfigVar<BloomMode> bloomMode;
|
||||
|
||||
@@ -263,6 +263,9 @@ public:
|
||||
/* 0x9C */ u8 field_0x9c[4];
|
||||
/* 0xA0 */ OSTime mResetHoldStartTime;
|
||||
/* 0xA8 */ u8 field_0xa8;
|
||||
#if TARGET_PC
|
||||
u32 mResetHoldFrameCount;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,6 +64,9 @@ BOOL JUTGamePad::init() {
|
||||
void JUTGamePad::clear() {
|
||||
mButtonReset.mReset = false;
|
||||
field_0xa8 = 1;
|
||||
#if TARGET_PC
|
||||
mResetHoldFrameCount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
PADStatus JUTGamePad::mPadStatus[4];
|
||||
@@ -219,11 +222,19 @@ void JUTGamePad::update() {
|
||||
mButtonReset.mReset = false;
|
||||
} else if (!JUTGamePad::C3ButtonReset::sResetOccurred) {
|
||||
if (mButtonReset.mReset == true) {
|
||||
#if TARGET_PC
|
||||
checkResetCallback(++mResetHoldFrameCount * (OS_TIMER_CLOCK / 30));
|
||||
#else
|
||||
OSTime hold_time = OSGetTime() - mResetHoldStartTime;
|
||||
checkResetCallback(hold_time);
|
||||
#endif
|
||||
} else {
|
||||
mButtonReset.mReset = true;
|
||||
#if TARGET_PC
|
||||
mResetHoldFrameCount = 0;
|
||||
#else
|
||||
mResetHoldStartTime = OSGetTime();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2399,6 +2399,13 @@ void dMenu_Collect3D_c::_move(u8 param_0, u8 param_1) {
|
||||
posZ = 550.0f;
|
||||
}
|
||||
toItem3Dpos(linkPos.x, posY, posZ, &itemPos);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableLinkDollRotation) {
|
||||
const f32 angle = mDoCPd_c::getSubStickX3D(PAD_1) * 2048;
|
||||
ANGLE_ADD(mLinkAngle, angle);
|
||||
} else
|
||||
#endif
|
||||
if (param_0 == 0 && param_1 == 0) {
|
||||
f32 temp = 450.0f;
|
||||
ANGLE_ADD(mLinkAngle, temp);
|
||||
|
||||
@@ -185,6 +185,13 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
|
||||
field_0x682 = 0xc000;
|
||||
break;
|
||||
}
|
||||
#if TARGET_PC
|
||||
mCursorInterpPrevX = 0.0f;
|
||||
mCursorInterpPrevY = 0.0f;
|
||||
mCursorInterpCurrX = 0.0f;
|
||||
mCursorInterpCurrY = 0.0f;
|
||||
mCursorInterpInit = false;
|
||||
#endif
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x674[i] = 0;
|
||||
#if TARGET_PC
|
||||
@@ -631,6 +638,34 @@ void dMenu_Ring_c::_draw() {
|
||||
} else {
|
||||
drawSelectItem();
|
||||
drawItem2();
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled() && mAlphaRate >= 1.0f) {
|
||||
f32 cursorX = mpDrawCursor->getPositionX();
|
||||
f32 cursorY = mpDrawCursor->getPositionY();
|
||||
|
||||
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||
mCursorInterpPrevX = mCursorInterpCurrX;
|
||||
mCursorInterpPrevY = mCursorInterpCurrY;
|
||||
mCursorInterpCurrX = cursorX;
|
||||
mCursorInterpCurrY = cursorY;
|
||||
|
||||
if (!mCursorInterpInit) {
|
||||
mCursorInterpPrevX = mCursorInterpCurrX;
|
||||
mCursorInterpPrevY = mCursorInterpCurrY;
|
||||
mCursorInterpInit = true;
|
||||
}
|
||||
}
|
||||
if (mCursorInterpInit) {
|
||||
const f32 step = dusk::frame_interp::get_interpolation_step();
|
||||
mpDrawCursor->setPos(
|
||||
mCursorInterpPrevX + (mCursorInterpCurrX - mCursorInterpPrevX) * step,
|
||||
mCursorInterpPrevY + (mCursorInterpCurrY - mCursorInterpPrevY) * step
|
||||
);
|
||||
}
|
||||
} else {
|
||||
mCursorInterpInit = false;
|
||||
}
|
||||
#endif
|
||||
mpDrawCursor->draw();
|
||||
mpItemExplain->trans(mCenterPosX, mCenterPosY);
|
||||
mpItemExplain->draw((J2DOrthoGraph*)grafPort);
|
||||
|
||||
@@ -191,6 +191,11 @@ namespace dusk {
|
||||
ImGui::SetTooltip("Restores patched glitches from Wii USA 1.0,\n"
|
||||
"the first released version.");
|
||||
}
|
||||
|
||||
config::ImGuiCheckbox("Enable Rotating Link Doll", getSettings().game.enableLinkDollRotation);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Enables rotating Link in the collection menu with the C-Stick");
|
||||
}
|
||||
|
||||
ImGui::SeparatorText("Difficulty");
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace dusk {
|
||||
ImGui::Text("Link");
|
||||
ImGuiStringViewText(
|
||||
player != nullptr
|
||||
? fmt::format("Position: {: .2f}, {: .2f}, {: .2f}\n", player->current.pos.x, player->current.pos.y, player->current.pos.z)
|
||||
? fmt::format("Position: {: .4f}, {: .4f}, {: .4f}\n", player->current.pos.x, player->current.pos.y, player->current.pos.z)
|
||||
: "Position: ?, ?, ?\n"
|
||||
);
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace dusk {
|
||||
|
||||
ImGuiStringViewText(
|
||||
player != nullptr
|
||||
? fmt::format("Speed: {0}\n", player->speedF)
|
||||
? fmt::format("Speed: {: .4f}\n", player->speedF)
|
||||
: "Speed: ?\n"
|
||||
);
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace dusk {
|
||||
ImGui::Text("Epona");
|
||||
ImGuiStringViewText(
|
||||
horse != nullptr
|
||||
? fmt::format("Position: {: .2f}, {: .2f}, {: .2f}\n", horse->current.pos.x, horse->current.pos.y, horse->current.pos.z)
|
||||
? fmt::format("Position: {: .4f}, {: .4f}, {: .4f}\n", horse->current.pos.x, horse->current.pos.y, horse->current.pos.z)
|
||||
: "Position: ?, ?, ?\n"
|
||||
);
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace dusk {
|
||||
|
||||
ImGuiStringViewText(
|
||||
horse != nullptr
|
||||
? fmt::format("Speed: {0}\n", horse->speedF)
|
||||
? fmt::format("Speed: {: .4f}\n", horse->speedF)
|
||||
: "Speed: ?\n"
|
||||
);
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ UserSettings g_userSettings = {
|
||||
.invertCameraXAxis {"game.invertCameraXAxis", false},
|
||||
.disableMainHUD {"game.disableMainHUD", false},
|
||||
.pauseOnFocusLost {"game.pauseOnFocusLost", false},
|
||||
.enableLinkDollRotation = {"game.enableLinkDollRotation", false },
|
||||
|
||||
// Graphics
|
||||
.bloomMode {"game.bloomMode", BloomMode::Classic},
|
||||
@@ -150,6 +151,7 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.canTransformAnywhere);
|
||||
Register(g_userSettings.game.freeMagicArmor);
|
||||
Register(g_userSettings.game.restoreWiiGlitches);
|
||||
Register(g_userSettings.game.enableLinkDollRotation);
|
||||
Register(g_userSettings.game.noMissClimbing);
|
||||
Register(g_userSettings.game.noLowHpSound);
|
||||
Register(g_userSettings.game.midnasLamentNonStop);
|
||||
|
||||
Reference in New Issue
Block a user