Material Editor: Allow intentional 0 gloss

This commit is contained in:
Exter-N 2023-09-27 03:15:18 +02:00
parent 6ca8ad2385
commit 6799bdbb03

View file

@ -347,10 +347,11 @@ public partial class ModEditWindow
ImGui.TableNextColumn();
tmpFloat = row.GlossStrength;
ImGui.SetNextItemWidth(floatSize);
if (ImGui.DragFloat("##GlossStrength", ref tmpFloat, Math.Max(0.1f, tmpFloat * 0.025f), HalfEpsilon, HalfMaxValue, "%.1f")
float glossStrengthMin = ImGui.GetIO().KeyCtrl ? 0.0f : HalfEpsilon;
if (ImGui.DragFloat("##GlossStrength", ref tmpFloat, Math.Max(0.1f, tmpFloat * 0.025f), glossStrengthMin, HalfMaxValue, "%.1f")
&& FixFloat(ref tmpFloat, row.GlossStrength))
{
row.GlossStrength = Math.Max(tmpFloat, HalfEpsilon);
row.GlossStrength = Math.Max(tmpFloat, glossStrengthMin);
ret = true;
tab.UpdateColorTableRowPreview(rowIdx);
}