mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-08 18:42:27 -04:00
Merge with origin/main
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <aurora/aurora.h>
|
||||
#include <chrono>
|
||||
#include <numeric>
|
||||
#include <string_view>
|
||||
#include <chrono>
|
||||
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include "imgui.h"
|
||||
@@ -20,6 +21,7 @@
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/livesplit.h"
|
||||
#include "dusk/main.h"
|
||||
#include "dusk/presentation.hpp"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/ui/ui.hpp"
|
||||
#include "dusk/gamemode.hpp"
|
||||
@@ -38,6 +40,8 @@ using namespace std::string_literals;
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
namespace {
|
||||
constexpr float kTurboTimeScale = 4.f;
|
||||
|
||||
ImGuiWindow* FindDragScrollWindow(ImGuiWindow* window) {
|
||||
while (window != nullptr) {
|
||||
const bool canScrollX = window->ScrollMax.x > 0.0f;
|
||||
@@ -236,10 +240,32 @@ namespace dusk {
|
||||
}
|
||||
|
||||
void ImGuiConsole::UpdateSettings() {
|
||||
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind &&
|
||||
(ImGui::IsKeyDown(ImGuiKey_Tab) || getActionBindHoldAnyPort(ActionBinds::TURBO_SPEED_BUTTON));
|
||||
static bool previousTurboActive = false;
|
||||
static bool previousSlowActive = false;
|
||||
static float previousTimeScale = 1.0f;
|
||||
|
||||
if (dusk::frame_interp::get_ui_tick_pending() && mDoMain::developmentMode == 1 && (mDoCPd_c::getHold(PAD_1) & (PAD_TRIGGER_R | PAD_TRIGGER_L)) == (PAD_TRIGGER_R | PAD_TRIGGER_L) && mDoCPd_c::getTrigY(PAD_1)) {
|
||||
const bool turboBound = isActionBoundAnyPort(ActionBinds::TURBO_SPEED_BUTTON);
|
||||
const bool turboActive =
|
||||
getSettings().game.enableTurboKeybind &&
|
||||
(turboBound ? getActionBindHoldAnyPort(ActionBinds::TURBO_SPEED_BUTTON) :
|
||||
ImGui::IsKeyDown(ImGuiKey_Tab));
|
||||
const bool slowDown = turboActive && ImGui::GetIO().KeyShift;
|
||||
if (turboActive != previousTurboActive) {
|
||||
getTransientSettings().turboMode = turboActive;
|
||||
presentation::update_frame_rate_preference();
|
||||
if (turboActive) {
|
||||
previousTimeScale = aurora_get_timescale();
|
||||
aurora_set_timescale(slowDown ? 1.f / kTurboTimeScale : kTurboTimeScale);
|
||||
} else {
|
||||
aurora_set_timescale(previousTimeScale);
|
||||
}
|
||||
} else if (turboActive && slowDown != previousSlowActive) {
|
||||
aurora_set_timescale(slowDown ? 1.f / kTurboTimeScale : kTurboTimeScale);
|
||||
}
|
||||
previousTurboActive = turboActive;
|
||||
previousSlowActive = slowDown;
|
||||
|
||||
if (frame_interp::get_ui_tick_pending() && mDoMain::developmentMode == 1 && (mDoCPd_c::getHold(PAD_1) & (PAD_TRIGGER_R | PAD_TRIGGER_L)) == (PAD_TRIGGER_R | PAD_TRIGGER_L) && mDoCPd_c::getTrigY(PAD_1)) {
|
||||
getTransientSettings().moveLinkActive = !getTransientSettings().moveLinkActive;
|
||||
}
|
||||
if (mDoMain::developmentMode != 1) {
|
||||
@@ -271,7 +297,7 @@ namespace dusk {
|
||||
m_isHidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool showMenu = !m_isHidden;
|
||||
|
||||
// The menu bar renders with ImGuiCol_WindowBg behind it. We just want ImGuiCol_MenuBarBg,
|
||||
|
||||
Reference in New Issue
Block a user