mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
Merge branch 'main' of https://github.com/TakaRikka/dusk into vmem
This commit is contained in:
@@ -76,6 +76,7 @@ struct UserSettings {
|
||||
ConfigVar<bool> fastClimbing;
|
||||
ConfigVar<bool> noMissClimbing;
|
||||
ConfigVar<bool> fastTears;
|
||||
ConfigVar<bool> no2ndFishForCat;
|
||||
ConfigVar<bool> instantSaves;
|
||||
ConfigVar<bool> instantText;
|
||||
ConfigVar<bool> sunsSong;
|
||||
|
||||
@@ -956,7 +956,7 @@ static void npc_ne_tame(npc_ne_class* i_this) {
|
||||
i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed);
|
||||
|
||||
/* dSv_event_flag_c::F_0470 - Fishing Pond - Reserved for fishing */
|
||||
if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[470])) {
|
||||
if (IF_DUSK(dusk::getSettings().game.no2ndFishForCat) || dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[470])) {
|
||||
if (fpcEx_Search(s_fish_sub, _this) != NULL) {
|
||||
i_this->mAction = npc_ne_class::ACT_HOME;
|
||||
i_this->mMode = 10;
|
||||
@@ -2948,8 +2948,7 @@ static int daNpc_Ne_Execute(npc_ne_class* i_this) {
|
||||
|
||||
if (i_this->mWantsFish && (i_this->mCounter & 0xf) == 0) {
|
||||
/* dSv_event_flag_c::F_0470 - Fishing Pond - Reserved for fishing */
|
||||
if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[470])
|
||||
&& i_this->mDistToTarget < 1500.0f) {
|
||||
if ((IF_DUSK(dusk::getSettings().game.no2ndFishForCat) || dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[470])) && i_this->mDistToTarget < 1500.0f) {
|
||||
if (fopAcM_SearchByName(fpcNm_MG_ROD_e) != NULL) {
|
||||
i_this->mNoFollow = false;
|
||||
} else {
|
||||
|
||||
+33
-20
@@ -794,16 +794,15 @@ void dCamera_c::updatePad() {
|
||||
|
||||
if (mTriggerLeftLast > mCamSetup.ManualEndVal()) {
|
||||
if (mLockLActive == 0) {
|
||||
#if TARGET_PC
|
||||
mCamParam.mManualMode = 0;
|
||||
#endif
|
||||
mLockLJustActivated = 1;
|
||||
} else {
|
||||
mLockLJustActivated = 0;
|
||||
}
|
||||
|
||||
mLockLActive = 1;
|
||||
|
||||
#if TARGET_PC
|
||||
mCamParam.mManualMode = 0;
|
||||
#endif
|
||||
} else {
|
||||
mLockLJustActivated = 0;
|
||||
mLockLActive = 0;
|
||||
@@ -1178,12 +1177,6 @@ bool dCamera_c::Run() {
|
||||
} else {
|
||||
sp0F = (this->*engine_tbl[mCamParam.Algorythmn(mCamStyle)])(mCamStyle);
|
||||
|
||||
#if TARGET_PC
|
||||
if (mCamParam.Algorythmn(mCamStyle) != 1) {
|
||||
mCamParam.mManualMode = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0x170++;
|
||||
field_0x160++;
|
||||
mCurCamStyleTimer++;
|
||||
@@ -3527,6 +3520,12 @@ void dCamera_c::checkGroundInfo() {
|
||||
}
|
||||
|
||||
bool dCamera_c::chaseCamera(s32 param_0) {
|
||||
#if TARGET_PC
|
||||
if (freeCamera()) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static f32 JumpCushion = 0.9f;
|
||||
f32 charge_latitude = mCamSetup.ChargeLatitude();
|
||||
int charge_timer = mCamSetup.ChargeTimer();
|
||||
@@ -4631,10 +4630,6 @@ bool dCamera_c::chaseCamera(s32 param_0) {
|
||||
sp110 = mViewCache.mDirection.R();
|
||||
mViewCache.mDirection.R(mViewCache.mDirection.R() + (fVar55 - mViewCache.mDirection.R()) * chase->field_0x74);
|
||||
|
||||
#if TARGET_PC
|
||||
freeCamera();
|
||||
#endif
|
||||
|
||||
chase->field_0x64 = mViewCache.mCenter + mViewCache.mDirection.Xyz();
|
||||
mViewCache.mEye = chase->field_0x64;
|
||||
|
||||
@@ -7482,6 +7477,9 @@ bool dCamera_c::freeCamera() {
|
||||
return false;
|
||||
}
|
||||
|
||||
mCamParam.freeXAngle = mViewCache.mDirection.mAzimuth.Degree();
|
||||
mCamParam.freeYAngle = mViewCache.mDirection.mInclination.Degree();
|
||||
|
||||
cXyz camMovement = {mPadInfo.mCStick.mLastPosX, mPadInfo.mCStick.mLastPosY, 0.0f};
|
||||
f32 magnitude = sqrt(mPadInfo.mCStick.mLastPosX * mPadInfo.mCStick.mLastPosX + mPadInfo.mCStick.mLastPosY * mPadInfo.mCStick.mLastPosY);
|
||||
|
||||
@@ -7498,14 +7496,29 @@ bool dCamera_c::freeCamera() {
|
||||
mCamParam.freeYAngle += camMovement.y * magnitude * dusk::getSettings().game.freeCameraSensitivity * 4.0f;
|
||||
}
|
||||
|
||||
if (mCamParam.mManualMode) {
|
||||
mCamParam.freeYAngle = std::clamp(mCamParam.freeYAngle, -35.0f, 60.0f);
|
||||
mViewCache.mDirection.mAzimuth = cSAngle(mCamParam.freeXAngle);
|
||||
mViewCache.mDirection.mInclination = cSAngle(mCamParam.freeYAngle);
|
||||
mViewCache.mDirection.mRadius = std::clamp((mCamParam.freeYAngle + 35.0f) * 10.0f, 300.0f, 10000.0f);
|
||||
if (!mCamParam.mManualMode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return mCamParam.mManualMode;
|
||||
f32 minYAngle = -10.0f;
|
||||
f32 maxAngle = 50.0f;
|
||||
|
||||
mCamParam.freeYAngle = std::clamp(mCamParam.freeYAngle, minYAngle, maxAngle);
|
||||
mViewCache.mDirection.mAzimuth = cSAngle(mCamParam.freeXAngle);
|
||||
mViewCache.mDirection.mInclination = cSAngle(mCamParam.freeYAngle);
|
||||
f32 currentLerp = (mCamParam.freeYAngle - minYAngle) / (maxAngle - minYAngle);
|
||||
mViewCache.mDirection.mRadius = std::lerp(200.0f, 1000.0f, currentLerp);
|
||||
|
||||
cXyz finalCenter = mpPlayerActor->current.pos;
|
||||
finalCenter.y += mIsWolf ? 90.0f : 100.0f;
|
||||
mViewCache.mCenter = finalCenter;
|
||||
|
||||
cXyz finalEye = finalCenter + mViewCache.mDirection.Xyz();
|
||||
mViewCache.mEye = finalEye;
|
||||
|
||||
mViewCache.mFovy = 60.0f;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+6
-6
@@ -312,6 +312,12 @@ int dMeter2_c::_execute() {
|
||||
}
|
||||
|
||||
int dMeter2_c::_draw() {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.disableMainHUD) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mpMap != NULL) {
|
||||
mpMap->_draw();
|
||||
}
|
||||
@@ -420,12 +426,6 @@ void dMeter2_c::setLifeZero() {
|
||||
void dMeter2_c::checkStatus() {
|
||||
mStatus = 0;
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.disableMainHUD) {
|
||||
mStatus |= 0xF0000000;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0x12c = field_0x128;
|
||||
|
||||
field_0x128 = daPy_py_c::checkNowWolf();
|
||||
|
||||
@@ -56,21 +56,6 @@ ImGuiWindow* FindDragScrollWindow(ImGuiWindow* window) {
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void FocusLastMenuBarItem() {
|
||||
ImGuiContext& g = *ImGui::GetCurrentContext();
|
||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||
const ImGuiID itemId = g.LastItemData.ID;
|
||||
if (window == nullptr || itemId == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::FocusWindow(window);
|
||||
ImGui::SetNavID(itemId, ImGuiNavLayer_Menu, g.CurrentFocusScopeId,
|
||||
ImGui::WindowRectAbsToRel(window, g.LastItemData.NavRect));
|
||||
ImGui::SetNavCursorVisibleAfterMove();
|
||||
g.NavHighlightItemUnderNav = true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace dusk {
|
||||
@@ -344,17 +329,7 @@ namespace dusk {
|
||||
}
|
||||
|
||||
m_isHidden = !getSettings().backend.duskMenuOpen;
|
||||
if (dusk::IsGameLaunched) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_F1)) {
|
||||
m_isHidden = !m_isHidden;
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_GamepadBack)) {
|
||||
m_isHidden = !m_isHidden;
|
||||
m_focusMenuBar = !m_isHidden;
|
||||
}
|
||||
}
|
||||
|
||||
bool showMenu = !dusk::IsGameLaunched || !m_isHidden;
|
||||
bool showMenu = !dusk::IsGameLaunched || !CheckMenuViewToggle(ImGuiKey_F1, m_isHidden);
|
||||
if (dusk::IsGameLaunched) {
|
||||
const bool menuOpen = !m_isHidden;
|
||||
if (getSettings().backend.duskMenuOpen != menuOpen) {
|
||||
@@ -368,10 +343,6 @@ namespace dusk {
|
||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
if (showMenu && ImGui::BeginMainMenuBar()) {
|
||||
m_menuGame.draw();
|
||||
if (m_focusMenuBar) {
|
||||
FocusLastMenuBarItem();
|
||||
m_focusMenuBar = false;
|
||||
}
|
||||
m_menuTools.draw();
|
||||
|
||||
const auto fpsLabel =
|
||||
@@ -396,7 +367,7 @@ namespace dusk {
|
||||
if (dusk::IsGameLaunched && !m_isLaunchInitialized) {
|
||||
m_toasts.emplace_back(ImGui::GetIO().MouseSource == ImGuiMouseSource_TouchScreen ?
|
||||
"Tap to toggle menu"s :
|
||||
"Press F1 or Minus/Back to toggle menu"s,
|
||||
"Press F1 to toggle menu"s,
|
||||
2.5f);
|
||||
m_isLaunchInitialized = true;
|
||||
if (getSettings().game.liveSplitEnabled) {
|
||||
|
||||
@@ -41,7 +41,6 @@ private:
|
||||
float mouseHideTimer = 0.0f;
|
||||
|
||||
bool m_isHidden = true;
|
||||
bool m_focusMenuBar = false;
|
||||
bool m_isLaunchInitialized = false;
|
||||
bool m_touchTapActive = false;
|
||||
bool m_touchTapMoved = false;
|
||||
|
||||
@@ -30,6 +30,7 @@ static void ApplyPresetHD() {
|
||||
s.game.biggerWallets.setValue(true);
|
||||
s.game.invertCameraXAxis.setValue(true);
|
||||
s.game.freeCamera.setValue(true);
|
||||
s.game.no2ndFishForCat.setValue(true);
|
||||
}
|
||||
|
||||
static void ApplyPresetDusk() {
|
||||
|
||||
@@ -23,15 +23,6 @@
|
||||
|
||||
namespace {
|
||||
constexpr int kInternalResolutionScaleMax = 12;
|
||||
|
||||
bool is_controller_neutral(int port) {
|
||||
if (port < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return PADGetNativeButtonPressed(port) == -1 &&
|
||||
PADGetNativeAxisPulled(port).nativeAxis == -1;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace aurora::gx {
|
||||
@@ -205,7 +196,7 @@ 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");
|
||||
@@ -276,6 +267,11 @@ namespace dusk {
|
||||
ImGui::SetTooltip("Link won't recoil when his sword hits walls.");
|
||||
}
|
||||
|
||||
config::ImGuiCheckbox("No 2nd Fish for Cat", getSettings().game.no2ndFishForCat);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Only need to fish once for Sera's cat to return.");
|
||||
}
|
||||
|
||||
config::ImGuiCheckbox("Skip TV Settings Screen", getSettings().game.hideTvSettingsScreen);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Skip the TV calibration screen shown when loading a save.");
|
||||
@@ -651,90 +647,39 @@ namespace dusk {
|
||||
|
||||
void ImGuiMenuGame::windowControllerConfig() {
|
||||
if (!m_showControllerConfig) {
|
||||
if (m_controllerConfig.m_isReading ||
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease)
|
||||
{
|
||||
m_controllerConfig.m_isReading = false;
|
||||
m_controllerConfig.m_pendingButtonMapping = nullptr;
|
||||
m_controllerConfig.m_pendingAxisMapping = nullptr;
|
||||
m_controllerConfig.m_pendingPort = -1;
|
||||
m_controllerConfig.m_waitForInputRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = -1;
|
||||
PADBlockInput(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool suppressRemapActivationThisFrame = m_controllerConfig.m_suppressRemapActivationUntilRelease;
|
||||
if (m_controllerConfig.m_suppressRemapActivationUntilRelease &&
|
||||
is_controller_neutral(m_controllerConfig.m_suppressRemapActivationPort))
|
||||
{
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = -1;
|
||||
PADBlockInput(false);
|
||||
}
|
||||
|
||||
if ((m_controllerConfig.m_pendingButtonMapping != nullptr ||
|
||||
m_controllerConfig.m_pendingAxisMapping != nullptr) &&
|
||||
m_controllerConfig.m_waitForInputRelease)
|
||||
{
|
||||
m_controllerConfig.m_waitForInputRelease =
|
||||
!is_controller_neutral(m_controllerConfig.m_pendingPort);
|
||||
}
|
||||
|
||||
// if pending for a button mapping, check to set new input
|
||||
if (m_controllerConfig.m_pendingButtonMapping != nullptr &&
|
||||
!m_controllerConfig.m_waitForInputRelease)
|
||||
{
|
||||
if (m_controllerConfig.m_pendingButtonMapping != nullptr) {
|
||||
s32 nativeButton = PADGetNativeButtonPressed(m_controllerConfig.m_pendingPort);
|
||||
if (nativeButton != -1) {
|
||||
const int suppressPort = m_controllerConfig.m_pendingPort;
|
||||
m_controllerConfig.m_pendingButtonMapping->nativeButton = nativeButton;
|
||||
m_controllerConfig.m_pendingButtonMapping = nullptr;
|
||||
m_controllerConfig.m_pendingPort = -1;
|
||||
m_controllerConfig.m_isReading = false;
|
||||
m_controllerConfig.m_waitForInputRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = true;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = suppressPort;
|
||||
suppressRemapActivationThisFrame = true;
|
||||
PADBlockInput(true);
|
||||
PADBlockInput(false);
|
||||
PADSerializeMappings();
|
||||
}
|
||||
}
|
||||
|
||||
// if pending for an axis mapping, check to set new input
|
||||
if (m_controllerConfig.m_pendingAxisMapping != nullptr &&
|
||||
!m_controllerConfig.m_waitForInputRelease)
|
||||
{
|
||||
if (m_controllerConfig.m_pendingAxisMapping != nullptr) {
|
||||
auto nativeAxis = PADGetNativeAxisPulled(m_controllerConfig.m_pendingPort);
|
||||
if (nativeAxis.nativeAxis != -1) {
|
||||
const int suppressPort = m_controllerConfig.m_pendingPort;
|
||||
m_controllerConfig.m_pendingAxisMapping->nativeAxis = nativeAxis;
|
||||
m_controllerConfig.m_pendingAxisMapping->nativeButton = -1;
|
||||
m_controllerConfig.m_pendingAxisMapping = nullptr;
|
||||
m_controllerConfig.m_pendingPort = -1;
|
||||
m_controllerConfig.m_isReading = false;
|
||||
m_controllerConfig.m_waitForInputRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = true;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = suppressPort;
|
||||
suppressRemapActivationThisFrame = true;
|
||||
PADBlockInput(true);
|
||||
PADBlockInput(false);
|
||||
PADSerializeMappings();
|
||||
} else {
|
||||
auto nativeButton = PADGetNativeButtonPressed(m_controllerConfig.m_pendingPort);
|
||||
if (nativeButton != -1) {
|
||||
const int suppressPort = m_controllerConfig.m_pendingPort;
|
||||
m_controllerConfig.m_pendingAxisMapping->nativeAxis = {-1, AXIS_SIGN_POSITIVE};
|
||||
m_controllerConfig.m_pendingAxisMapping->nativeButton = nativeButton;
|
||||
m_controllerConfig.m_pendingAxisMapping = nullptr;
|
||||
m_controllerConfig.m_pendingPort = -1;
|
||||
m_controllerConfig.m_isReading = false;
|
||||
m_controllerConfig.m_waitForInputRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = true;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = suppressPort;
|
||||
suppressRemapActivationThisFrame = true;
|
||||
PADBlockInput(true);
|
||||
PADBlockInput(false);
|
||||
PADSerializeMappings();
|
||||
}
|
||||
}
|
||||
@@ -770,10 +715,6 @@ namespace dusk {
|
||||
m_controllerConfig.m_pendingButtonMapping = nullptr;
|
||||
m_controllerConfig.m_pendingAxisMapping = nullptr;
|
||||
m_controllerConfig.m_pendingPort = -1;
|
||||
m_controllerConfig.m_waitForInputRelease = false;
|
||||
m_controllerConfig.m_isReading = false;
|
||||
m_controllerConfig.m_suppressRemapActivationUntilRelease = false;
|
||||
m_controllerConfig.m_suppressRemapActivationPort = -1;
|
||||
PADBlockInput(false);
|
||||
}
|
||||
|
||||
@@ -850,7 +791,7 @@ namespace dusk {
|
||||
|
||||
std::string dispName;
|
||||
if (m_controllerConfig.m_isReading && m_controllerConfig.m_pendingButtonMapping == &btnMappingList[i]) {
|
||||
dispName = fmt::format("{}##{}", m_controllerConfig.m_waitForInputRelease ? "Release..." : "Press a Key...", btnName);
|
||||
dispName = fmt::format("Press a Key...##{}", btnName);
|
||||
} else {
|
||||
const char* nativeName = GetNameForGamepadButton(gamepad, btnMappingList[i].nativeButton);
|
||||
if (nativeName == nullptr) {
|
||||
@@ -861,11 +802,10 @@ namespace dusk {
|
||||
bool pressed = ImGui::Button(dispName.c_str(),
|
||||
btnSize);
|
||||
|
||||
if (pressed && !m_controllerConfig.m_isReading && !suppressRemapActivationThisFrame) {
|
||||
if (pressed) {
|
||||
m_controllerConfig.m_isReading = true;
|
||||
m_controllerConfig.m_pendingPort = m_controllerConfig.m_selectedPort;
|
||||
m_controllerConfig.m_pendingButtonMapping = &btnMappingList[i];
|
||||
m_controllerConfig.m_waitForInputRelease = true;
|
||||
PADBlockInput(true);
|
||||
}
|
||||
}
|
||||
@@ -895,18 +835,17 @@ namespace dusk {
|
||||
|
||||
std::string dispName;
|
||||
if (m_controllerConfig.m_isReading && m_controllerConfig.m_pendingAxisMapping == &axisMappingList[trigger]) {
|
||||
dispName = fmt::format("{}##{}", m_controllerConfig.m_waitForInputRelease ? "Release..." : "Press a Key...", axisName);
|
||||
dispName = fmt::format("Press a Key...##{}", axisName);
|
||||
} else {
|
||||
dispName = fmt::format("{0}##-{1}", PADGetNativeAxisName(axisMappingList[trigger].nativeAxis), trigger);
|
||||
}
|
||||
bool pressed = ImGui::Button(dispName.c_str(),
|
||||
btnSize);
|
||||
|
||||
if (pressed && !m_controllerConfig.m_isReading && !suppressRemapActivationThisFrame) {
|
||||
if (pressed) {
|
||||
m_controllerConfig.m_isReading = true;
|
||||
m_controllerConfig.m_pendingPort = m_controllerConfig.m_selectedPort;
|
||||
m_controllerConfig.m_pendingAxisMapping = &axisMappingList[trigger];
|
||||
m_controllerConfig.m_waitForInputRelease = true;
|
||||
PADBlockInput(true);
|
||||
}
|
||||
}
|
||||
@@ -963,7 +902,7 @@ namespace dusk {
|
||||
|
||||
std::string dispName;
|
||||
if (m_controllerConfig.m_isReading && m_controllerConfig.m_pendingAxisMapping == &axisMappingList[axis]) {
|
||||
dispName = fmt::format("{}##{}", m_controllerConfig.m_waitForInputRelease ? "Release..." : "Press a Key...", label);
|
||||
dispName = fmt::format("Press a Key...##{}", label);
|
||||
} else {
|
||||
if (axisMappingList[axis].nativeAxis.nativeAxis != -1) {
|
||||
const char* signStr;
|
||||
@@ -982,11 +921,10 @@ namespace dusk {
|
||||
}
|
||||
bool pressed = ImGui::Button(dispName.c_str(), btnSize);
|
||||
|
||||
if (pressed && !m_controllerConfig.m_isReading && !suppressRemapActivationThisFrame) {
|
||||
if (pressed) {
|
||||
m_controllerConfig.m_isReading = true;
|
||||
m_controllerConfig.m_pendingPort = m_controllerConfig.m_selectedPort;
|
||||
m_controllerConfig.m_pendingAxisMapping = &axisMappingList[axis];
|
||||
m_controllerConfig.m_waitForInputRelease = true;
|
||||
PADBlockInput(true);
|
||||
}
|
||||
}
|
||||
@@ -1027,7 +965,7 @@ namespace dusk {
|
||||
|
||||
std::string dispName;
|
||||
if (m_controllerConfig.m_isReading && m_controllerConfig.m_pendingAxisMapping == &axisMappingList[axis]) {
|
||||
dispName = fmt::format("{}##sub{}", m_controllerConfig.m_waitForInputRelease ? "Release..." : "Press a Key...", label);
|
||||
dispName = fmt::format("Press a Key...##sub{}", label);
|
||||
} else {
|
||||
if (axisMappingList[axis].nativeAxis.nativeAxis != -1) {
|
||||
const char* signStr;
|
||||
@@ -1046,11 +984,10 @@ namespace dusk {
|
||||
}
|
||||
bool pressed = ImGui::Button(fmt::format("{0}##sub{1}", dispName, label).c_str(), btnSize);
|
||||
|
||||
if (pressed && !m_controllerConfig.m_isReading && !suppressRemapActivationThisFrame) {
|
||||
if (pressed) {
|
||||
m_controllerConfig.m_isReading = true;
|
||||
m_controllerConfig.m_pendingPort = m_controllerConfig.m_selectedPort;
|
||||
m_controllerConfig.m_pendingAxisMapping = &axisMappingList[axis];
|
||||
m_controllerConfig.m_waitForInputRelease = true;
|
||||
PADBlockInput(true);
|
||||
}
|
||||
}
|
||||
@@ -1081,7 +1018,7 @@ namespace dusk {
|
||||
PADSerializeMappings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (PADSupportsRumbleIntensity(m_controllerConfig.m_selectedPort)) {
|
||||
ImGuiBeginGroupPanel("Rumble Intensity", ImVec2(150 * scale, -1));
|
||||
u16 low;
|
||||
@@ -1100,7 +1037,7 @@ namespace dusk {
|
||||
if (ImGui::Button(fmt::format("{0}...##rumbleTest", m_controllerConfig.m_isRumbling ? "Stop": "Test").c_str(), {-1, 0})) {
|
||||
PADControlMotor(m_controllerConfig.m_selectedPort, !m_controllerConfig.m_isRumbling ? PAD_MOTOR_RUMBLE : PAD_MOTOR_STOP_HARD);
|
||||
m_controllerConfig.m_isRumbling ^= 1;
|
||||
}
|
||||
}
|
||||
ImGuiEndGroupPanel();
|
||||
}
|
||||
ImGuiEndGroupPanel();
|
||||
|
||||
@@ -68,9 +68,6 @@ namespace dusk {
|
||||
PADButtonMapping* m_pendingButtonMapping = nullptr;
|
||||
PADAxisMapping* m_pendingAxisMapping = nullptr;
|
||||
int m_pendingPort = -1;
|
||||
bool m_waitForInputRelease = false;
|
||||
bool m_suppressRemapActivationUntilRelease = false;
|
||||
int m_suppressRemapActivationPort = -1;
|
||||
bool m_isRumbling = false;
|
||||
} m_controllerConfig;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ UserSettings g_userSettings = {
|
||||
.fastClimbing {"game.fastClimbing", false},
|
||||
.noMissClimbing {"game.noMissClimbing", false},
|
||||
.fastTears {"game.fastTears", false},
|
||||
.no2ndFishForCat {"game.no2ndFishForCat", false},
|
||||
.instantSaves {"game.instantSaves", false},
|
||||
.instantText {"game.instantText", false},
|
||||
.sunsSong {"game.sunsSong", false},
|
||||
@@ -147,6 +148,7 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.instantDeath);
|
||||
Register(g_userSettings.game.fastClimbing);
|
||||
Register(g_userSettings.game.fastTears);
|
||||
Register(g_userSettings.game.no2ndFishForCat);
|
||||
Register(g_userSettings.game.instantSaves);
|
||||
Register(g_userSettings.game.instantText);
|
||||
Register(g_userSettings.game.sunsSong);
|
||||
|
||||
Reference in New Issue
Block a user