Skip to content

Use rendered imgui in code for settings (and more...)#57

Open
mgavin wants to merge 9 commits into
NitrOP7674:mainfrom
mgavin:use_imgui_for_settings
Open

Use rendered imgui in code for settings (and more...)#57
mgavin wants to merge 9 commits into
NitrOP7674:mainfrom
mgavin:use_imgui_for_settings

Conversation

@mgavin

@mgavin mgavin commented Nov 12, 2025

Copy link
Copy Markdown

Added IMGUI libraries to the plugin, inherited pluginsettings, rewrote settings into plugin

  • Removes need for SettingsFile.cpp and writeSettingsFile function
  • Enables for more customization of the plugin menu layout and look
  • Added a more reactive way to capture key input
    • RL's HWND is captured and used to clear mouse inputs that get stuck due to bakkesmod. (it still happens but it's an extra protection 🙄)
    • opened menus are closed and reopened after a bind has been captured
    • rewind and fast forward are the only ones able to capture inputs that have axes
    • removes the need to loop through all keys to find which one was captured
  • made links out of the links in the text at the bottom

Decoupled rewind and fast-foward from the Steer parameter of ControllerInput

  • added a value to the rewindState that tracks it
  • code hooked during rewind mode allows for an axis input on one and another input on another

Enabled address sanitation, removed console entry point, disabled bakkesmod-caused warning `4251`, enabled string pooling
Updated the set language standard to `stdcpplatest`
Removed the reliance (and files) on the `fmt` library in favor of `std::format`
Added IMGUI files to the project's filters for building alongside the project
Needs layout cleanup.
Needs keybinding to be better.

@NitrOP7674 NitrOP7674 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. This sounds really cool! I'll want to try it out for sure - please give me a few days. In the meantime I have some small comments. Thanks!

Comment thread CheckpointPlugin.cpp Outdated
Comment thread CheckpointPlugin.cpp Outdated
Comment thread CheckpointPlugin.cpp Outdated

std::string line = get_prev_line();
std::transform(begin(line), end(line), begin(line), [](unsigned char c) { return std::toupper(c); });
//log::log_debug("liNE: {}", line);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to be constrained by the case of the string that I searched for,

        if (line.contains("CURRENTLY ACTIVE WINDOWS")) {

so I put that transforming insurance there... I'll remove the commented out log lines, if that's what you meant.

Comment thread bindings.cpp Outdated
Comment thread CheckpointPlugin.cpp Outdated
loadCurCheckpoint();
}

/**

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to move all the settings UI stuff to another file, maybe Settings.cpp or something?

@mgavin mgavin Nov 30, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved things around to decouple them from the class itself in the latest update. IMGUI stuff stays with the class, but other stuff was just moved outside of it. I moved the IMGUI related stuff (related to the plugin) to another source file. Check whatever commit follows this one (this one 8a68486).

Comment thread CheckpointPlugin.cpp Outdated
Comment thread CheckpointPlugin.cpp Outdated
Comment thread CheckpointPlugin.h Outdated
Comment thread CheckpointPlugin.h Outdated
Made refactors of different parts that weren't really related to where they were. So they were put in the pch.
Improved the little popup that appears when binding a key.
@mgavin mgavin marked this pull request as draft November 30, 2025 18:41
- Removed `cpt_capture_key` because key inputs are captured differently now.
- Set defaults to what they should be given what they were previously
- Put bindings related functions are `bindings.cpp`
- Separated out stuff into a header file `bindings.h`
- Put IMGUI stuff related to the plugin class in its own file `PluginSettings.cpp`

The biggest contentious thing IMO is around `CheckpointPlugin.cpp`L578 where I discriminate against binds that would affect steer and pitch.
@mgavin mgavin marked this pull request as ready for review November 30, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants