Skip to content

Commit

Permalink
Search Enhancement (#2)
Browse files Browse the repository at this point in the history
* 90% complete, Commit for review.

* Updated remaining Menu Entries, Reverted Backends and other Window Buttons for now.

Motion Blur copied to Search Menu.

* Did I mention I dislike this clang thing? lol

* Updating MotionBlur options and reverting soem things.

* Integrates .disabled and .disabledTooltip to the constructors. Allows for multiple qualifications to be checked against for disabling widgets and for setting the tooltip accordingly.

* Updated Disabled Reasoning

* Better Disabled State registration system

* Clean up from testing
  • Loading branch information
Caladius authored Aug 11, 2024
1 parent 304f0b4 commit 2570bf5
Show file tree
Hide file tree
Showing 3 changed files with 1,412 additions and 427 deletions.
15 changes: 6 additions & 9 deletions mm/2s2h/Enhancements/Graphics/MotionBlur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ void MotionBlur_RenderMenuOptions() {
"This notably reduces the overall motion blur strength but smooths out the trails." });

if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 0) {
UIWidgets::Checkbox("On/Off", (bool*)&R_MOTION_BLUR_ENABLED);
if (R_MOTION_BLUR_ENABLED) {
int32_t motionBlurStrength = R_MOTION_BLUR_ALPHA;
if (UIWidgets::SliderInt("Strength", &motionBlurStrength, 0, 255)) {
R_MOTION_BLUR_ALPHA = motionBlurStrength;
}
}
UIWidgets::CVarCheckbox("On/Off", "gEnhancements.Graphics.MotionBlur.Toggle",
{ .tooltip = "Enables Motion Blur." });
}
if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 2) {
if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 2 ||
CVarGetInteger("gEnhancements.Graphics.MotionBlur.Toggle", 0) == 1) {
UIWidgets::CVarSliderInt("Strength", "gEnhancements.Graphics.MotionBlur.Strength", 0, 255, 180);
}
}
Expand All @@ -40,7 +36,8 @@ extern "C" void MotionBlur_Override(u8* status, s32* alpha) {
if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 1) {
*status = 0;
*alpha = 0;
} else if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 2) {
} else if (CVarGetInteger("gEnhancements.Graphics.MotionBlur.Mode", 0) == 2 ||
CVarGetInteger("gEnhancements.Graphics.MotionBlur.Toggle", 0) == 1) {
if (*status == 0)
*status = 2;
*alpha = CVarGetInteger("gEnhancements.Graphics.MotionBlur.Strength", 180);
Expand Down
Loading

0 comments on commit 2570bf5

Please sign in to comment.