mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-22 08:08:53 -05:00
Add frame advance option to developer tools (#3435)
This commit is contained in:
parent
6a7bcc4a5e
commit
70e1017923
@ -1475,6 +1475,26 @@ void DrawDeveloperToolsMenu() {
|
||||
UIWidgets::Tooltip("Optimized debug warp screen, with the added ability to chose entrances and time of day");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Debug Warp Screen Translation", "gDebugWarpScreenTranslation", true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true);
|
||||
UIWidgets::Tooltip("Translate the Debug Warp Screen based on the game language");
|
||||
if (gPlayState != NULL) {
|
||||
UIWidgets::PaddedSeparator();
|
||||
ImGui::Checkbox("Frame Advance##frameAdvance", (bool*)&gPlayState->frameAdvCtx.enabled);
|
||||
if (gPlayState->frameAdvCtx.enabled) {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(12.0f, 6.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
|
||||
if (ImGui::Button("Advance 1", ImVec2(ImGui::GetContentRegionAvail().x / 2.0f, 0.0f))) {
|
||||
CVarSetInteger("gFrameAdvance", 1);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Button("Advance (Hold)");
|
||||
if (ImGui::IsItemActive()) {
|
||||
CVarSetInteger("gFrameAdvance", 1);
|
||||
}
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleColor(1);
|
||||
}
|
||||
}
|
||||
UIWidgets::PaddedSeparator();
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(12.0f, 6.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
|
||||
|
@ -18,9 +18,10 @@ s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, Input* input) {
|
||||
frameAdvCtx->enabled = !frameAdvCtx->enabled;
|
||||
}
|
||||
|
||||
if (!frameAdvCtx->enabled || (CHECK_BTN_ALL(input->cur.button, BTN_Z) &&
|
||||
if (!frameAdvCtx->enabled || CVarGetInteger("gFrameAdvance", 0) || (CHECK_BTN_ALL(input->cur.button, BTN_Z) &&
|
||||
(CHECK_BTN_ALL(input->press.button, BTN_R) ||
|
||||
(CHECK_BTN_ALL(input->cur.button, BTN_R) && (++frameAdvCtx->timer >= 9))))) {
|
||||
CVarClear("gFrameAdvance");
|
||||
frameAdvCtx->timer = 0;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user