Use HSLA scrollbar color picker for 0.7 tee settings

Use the same HSLA scrollbar color picker for the 0.7 tee settings as for the 0.6 tee settings. Use the correct darkest lighting value for 0.7 skin color pickers instead of not clamping the lighting value in the color picker.
This commit is contained in:
Robert Müller 2024-08-18 15:12:24 +02:00
parent ce0e52851c
commit 992f235f05

View file

@ -312,7 +312,7 @@ void CMenus::RenderSettingsTeeBasic7(CUIRect MainView)
void CMenus::RenderSettingsTeeCustom7(CUIRect MainView) void CMenus::RenderSettingsTeeCustom7(CUIRect MainView)
{ {
CUIRect Label, Patterns, Button, Left, Right, Picker, Palette; CUIRect Label, Patterns, Button, Left, Right;
// render skin preview background // render skin preview background
float SpacingH = 2.0f; float SpacingH = 2.0f;
@ -344,33 +344,31 @@ void CMenus::RenderSettingsTeeCustom7(CUIRect MainView)
MainView.HSplitTop(SpacingH, 0, &MainView); MainView.HSplitTop(SpacingH, 0, &MainView);
MainView.VSplitMid(&Left, &Right, SpacingW); MainView.VSplitMid(&Left, &Right, SpacingW);
Right.Margin(5.0f, &Right);
// part selection
RenderSkinPartSelection7(Left); RenderSkinPartSelection7(Left);
// use custom color checkbox CUIRect CustomColorsButton;
Right.HSplitTop(ButtonHeight, &Button, &Right); Right.HSplitTop(20.0f, &CustomColorsButton, &Right);
Right.HSplitBottom(45.0f, &Picker, &Palette);
static CButtonContainer s_ColorPicker; int *pUseCustomColor = CSkins7::ms_apUCCVariables[(int)m_Dummy][m_TeePartSelected];
DoLine_ColorPicker( if(DoButton_CheckBox(pUseCustomColor, Localize("Custom colors"), *pUseCustomColor, &CustomColorsButton))
&s_ColorPicker,
25.0f, // LineSize
13.0f, // LabelSize
5.0f, // BottomMargin
&Right,
Localize("Custom colors"),
CSkins7::ms_apColorVariables[(int)m_Dummy][m_TeePartSelected],
ColorRGBA(1.0f, 1.0f, 0.5f), // DefaultColor
true, // CheckBoxSpacing
CSkins7::ms_apUCCVariables[(int)m_Dummy][m_TeePartSelected], // CheckBoxValue
m_TeePartSelected == protocol7::SKINPART_MARKING); // use alpha
static int s_OldColor = *CSkins7::ms_apColorVariables[(int)m_Dummy][m_TeePartSelected];
int NewColor = *CSkins7::ms_apColorVariables[(int)m_Dummy][m_TeePartSelected];
if(s_OldColor != NewColor)
{ {
s_OldColor = NewColor; *pUseCustomColor = !*pUseCustomColor;
SetNeedSendInfo(); SetNeedSendInfo();
} }
if(*pUseCustomColor)
{
CUIRect CustomColors;
Right.HSplitTop(5.0f, nullptr, &Right);
Right.HSplitTop(95.0f, &CustomColors, &Right);
if(RenderHslaScrollbars(&CustomColors, CSkins7::ms_apColorVariables[(int)m_Dummy][m_TeePartSelected], m_TeePartSelected == protocol7::SKINPART_MARKING, CSkins7::DARKEST_COLOR_LGT))
{
SetNeedSendInfo();
}
}
} }
void CMenus::RenderSkinSelection7(CUIRect MainView) void CMenus::RenderSkinSelection7(CUIRect MainView)