diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2022-12-12 23:40:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-12 23:40:27 -0500 |
| commit | 9a9b4bd679acaab9c16f977e6749aabd72a40a56 (patch) | |
| tree | 97d01877dbf16a68adf739a5ba8fbe57599ee7a7 | |
| parent | 99c1f046a6dfdf7264faf2f58744edf0a5dac8b6 (diff) | |
fix: set color picker alpha on reset (#2173)
* fix: set color picker alpha on reset
Fixes a bug where the colour picker enhancement widget without alpha uses a garbage value for alpha on reset
Co-authored-by: sonoftunk <sonoftunk@gmail.com>
* formatting
Co-authored-by: sonoftunk <sonoftunk@gmail.com>
Co-authored-by: briaguya <briaguya@alice>
| -rw-r--r-- | soh/soh/UIWidgets.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/soh/soh/UIWidgets.cpp b/soh/soh/UIWidgets.cpp index ff8c318cb..651487551 100644 --- a/soh/soh/UIWidgets.cpp +++ b/soh/soh/UIWidgets.cpp @@ -528,13 +528,13 @@ namespace UIWidgets { colors->x = defaultcolors.x; colors->y = defaultcolors.y; colors->z = defaultcolors.z; - if (has_alpha) { colors->w = defaultcolors.w; }; + colors->w = has_alpha ? defaultcolors.w : 255.0f; Color_RGBA8 colorsRGBA; colorsRGBA.r = defaultcolors.x; colorsRGBA.g = defaultcolors.y; colorsRGBA.b = defaultcolors.z; - if (has_alpha) { colorsRGBA.a = defaultcolors.w; }; + colorsRGBA.a = has_alpha ? defaultcolors.w : 255.0f; CVar_SetRGBA(cvarName, colorsRGBA); CVar_SetS32(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. @@ -616,7 +616,7 @@ namespace UIWidgets { colors.r = ColorRGBA.x * 255.0; colors.g = ColorRGBA.y * 255.0; colors.b = ColorRGBA.z * 255.0; - colors.a = ColorRGBA.w * 255.0; + colors.a = 255.0; CVar_SetRGBA(cvarName, colors); SohImGui::RequestCvarSaveOnNextTick(); |
