Skip to content

Commit

Permalink
fixed replay system
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Oct 15, 2024
1 parent 7665abc commit 43fc270
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.7.6
- fixed replay system (again)

# 4.7.5
- Fixed input frame conflict that could have broken the macro
- Unlocked showcase video recording from 60 to 240 fps (Engine v2)
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"id": "tobyadd.gdh",
"name": "GDH",
"version": "v4.7.5",
"version": "v4.7.6",
"developer": "TobyAdd",
"description": "GDH is an open-source Geometry Dash mod menu that aims to improve the game's performance and add new features",
"early-load": true,
Expand Down
4 changes: 4 additions & 0 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ namespace imgui_popup {

ImGuiStyle& style = ImGui::GetStyle();
float textWidth = ImGui::CalcTextSize(message.caption.c_str()).x;
if (gui::scale != 1.f) {
textWidth /= gui::scale;
}

float windowWidth = (textWidth + style.WindowPadding.x * 2) * gui::scale;
float windowHeight = (40.0f * gui::scale);

Expand Down
26 changes: 13 additions & 13 deletions src/replayEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void ReplayEngine::handle_recording2(bool hold, int button, bool player) {

if (!input_buffer && !replay2.empty() && hold && !replay2.back().hold && replay2.back().frame == frame) {
replay2.pop_back();
return;
//return;
}

replay2.push_back({frame, hold, button, player});
Expand Down Expand Up @@ -378,13 +378,13 @@ void ReplayEngine::render() {
ImGui::SameLine();
}

if (ImGui::Checkbox("Practice Fix", &practice_fix)) {
if (ImGui::Checkbox("Practice Fix", &practice_fix, gui::scale)) {
if (!practice_fix) input_buffer = false;
}

if (practice_fix) {
ImGui::SameLine();
ImGui::Checkbox("Buffer click checkpoint (read desc)", &input_buffer);
ImGui::Checkbox("Buffer click checkpoint (read desc)", &input_buffer, gui::scale);

if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Could improve accuracy in platformer levels for Engine v2\nAvoid setting checkpoints while holding the mouse to prevent double-clicks that can mess up the macro (unnecessary hold inputs)\nKeep Replay Size even to maintain Hold/Release order.\nOr perhaps it would be better to disable this fix and record platformer levels under Engine v1, which will be maintained under the accuracy fix");
Expand Down Expand Up @@ -424,7 +424,7 @@ void ReplayEngine::render() {
}

if (ImGui::BeginTabItem("Spambot")) {
if (ImGui::Checkbox("Enable##Spambot", &spamBot.enabled))
if (ImGui::Checkbox("Enable##Spambot", &spamBot.enabled, gui::scale))
{
spamBot.reset_temp();
}
Expand All @@ -437,15 +437,15 @@ void ReplayEngine::render() {
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::DragInt("##spamrelease", &spamBot.release, 1, 1, INT_MAX, "Release: %i");

ImGui::Checkbox("Player 1", &spamBot.player_p1);
ImGui::Checkbox("Player 1", &spamBot.player_p1, gui::scale);
ImGui::SameLine();
ImGui::Checkbox("Player 2", &spamBot.player_p2);
ImGui::Checkbox("Player 2", &spamBot.player_p2, gui::scale);

ImGui::EndTabItem();
}

if (ImGui::BeginTabItem("Straight Fly Bot")) {
if (ImGui::Checkbox("Enable##Straight Fly Bot", &straightFly.enabled))
if (ImGui::Checkbox("Enable##Straight Fly Bot", &straightFly.enabled, gui::scale))
{
auto gjbgl = GJBaseGameLayer::get();
straightFly.start(gjbgl);
Expand Down Expand Up @@ -492,7 +492,7 @@ void ReplayEngine::render() {
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::InputText("##videoname", &recorder.video_name);

ImGui::Checkbox("Advanced Mode", &recorder.advanced_mode);
ImGui::Checkbox("Advanced Mode", &recorder.advanced_mode, gui::scale);

if (recorder.advanced_mode) {
ImGui::SameLine();
Expand Down Expand Up @@ -556,11 +556,11 @@ void ReplayEngine::render() {
ImGui::PushItemWidth(300 * gui::scale);
ImGui::InputText("VF Args", &recorder.vf_args);

if (ImGui::Checkbox("vflip", &recorder.vflip)) {
if (ImGui::Checkbox("vflip", &recorder.vflip, gui::scale)) {
recorder.compile_vf_args();
}

if (ImGui::Checkbox("Fade in", &recorder.fade_in)) {
if (ImGui::Checkbox("Fade in", &recorder.fade_in, gui::scale)) {
recorder.compile_vf_args();
}

Expand All @@ -578,7 +578,7 @@ void ReplayEngine::render() {
recorder.compile_vf_args();
}

ImGui::Checkbox("Fade out", &recorder.fade_out);
ImGui::Checkbox("Fade out", &recorder.fade_out, gui::scale);

ImGui::Text("Note: The length of the fade-out is calculated based on the value of \"Second to Render After\" (WIP)");

Expand Down Expand Up @@ -957,8 +957,8 @@ void ReplayEngine::render() {
}

if (ImGui::BeginTabItem("More Settings")) {
ImGui::Checkbox("Popup Messages", &imgui_popup::enabled);
ImGui::Checkbox("Synchronize Audio on Video Recording (Experimental Feature)", &recorder.sync_audio);
ImGui::Checkbox("Popup Messages", &imgui_popup::enabled, gui::scale);
ImGui::Checkbox("Synchronize Audio on Video Recording (Experimental Feature)", &recorder.sync_audio, gui::scale);
ImGui::EndTabItem();
}

Expand Down

0 comments on commit 43fc270

Please sign in to comment.