Add Reset All button

This commit is contained in:
VoxelDoesCode 2022-09-16 21:06:20 -04:00
parent 5915d5531d
commit 4c7a29b430

View file

@ -2980,7 +2980,7 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
ColorHSLA LaserRifleInnerColor = DoLine_ColorPicker(&s_LaserRifleInResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Rifle Laser Inner Color"), &g_Config.m_ClLaserRifleInnerColor, ColorRGBA(0.498039f, 0.498039f, 1.0f, 1.0f), false);
ColorHSLA LaserShotgunOutlineColor = DoLine_ColorPicker(&s_LaserShotgunOutResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Shotgun Laser Outline Color"), &g_Config.m_ClLaserShotgunOutlineColor, ColorRGBA(0.125490f, 0.098039f, 0.043137f, 1.0f), false);
ColorHSLA LaserShotgunInnerColor = DoLine_ColorPicker(&s_LaserShotgunInResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Shotgun Laser Inner Color"), &g_Config.m_ClLaserShotgunInnerColor, ColorRGBA(0.764705f, 0.505882f, 0.0f, 1.0f), false);
// ***** Entities ***** //
LeftView.HSplitTop(MarginToNextSection * 2.0f, 0x0, &LeftView);
LeftView.HSplitTop(HeadlineAndVMargin, &Label, &LeftView);
@ -2992,12 +2992,12 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
static CButtonContainer s_LaserDoorOutResetID, s_LaserDoorInResetID, s_LaserFreezeOutResetID, s_LaserFreezeInResetID;
ColorHSLA LaserDoorOutlineColor = DoLine_ColorPicker(&s_LaserDoorOutResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Door Laser Outline Color"), &g_Config.m_ClLaserDoorOutlineColor, ColorRGBA(0.0f, 0.129411f, 0.094117f, 1.0f), false);
ColorHSLA LaserDoorOutlineColor = DoLine_ColorPicker(&s_LaserDoorOutResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Door Laser Outline Color"), &g_Config.m_ClLaserDoorOutlineColor, ColorRGBA(0.0f, 0.131372f, 0.096078f, 1.0f), false);
ColorHSLA LaserDoorInnerColor = DoLine_ColorPicker(&s_LaserDoorInResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Door Laser Inner Color"), &g_Config.m_ClLaserDoorInnerColor, ColorRGBA(0.262745f, 0.760784f, 0.639215f, 1.0f), false);
ColorHSLA LaserFreezeOutlineColor = DoLine_ColorPicker(&s_LaserFreezeOutResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Freeze Laser Outline Color"), &g_Config.m_ClLaserFreezeOutlineColor, ColorRGBA(0.129411f, 0.121568f, 0.180392f, 1.0f), false);
ColorHSLA LaserFreezeOutlineColor = DoLine_ColorPicker(&s_LaserFreezeOutResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Freeze Laser Outline Color"), &g_Config.m_ClLaserFreezeOutlineColor, ColorRGBA(0.131372f, 0.123529f, 0.182352f, 1.0f), false);
ColorHSLA LaserFreezeInnerColor = DoLine_ColorPicker(&s_LaserFreezeInResetID, ColorPickerLineSize, LeftViewColorPickerPosition, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Freeze Laser Inner Color"), &g_Config.m_ClLaserFreezeInnerColor, ColorRGBA(0.482352f, 0.443137f, 0.564705f, 1.0f), false);
static CButtonContainer s_AllToRifleResetID;
static CButtonContainer s_AllToRifleResetID, s_AllToDefaultResetID;
LeftView.HSplitTop(20.0f, 0x0, &LeftView);
LeftView.HSplitTop(20.0f, &Button, &LeftView);
@ -3011,6 +3011,21 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
g_Config.m_ClLaserFreezeInnerColor = g_Config.m_ClLaserRifleInnerColor;
}
// values taken from the CL commands
LeftView.HSplitTop(10.0f, 0x0, &LeftView);
LeftView.HSplitTop(20.0f, &Button, &LeftView);
if(DoButton_Menu(&s_AllToDefaultResetID, Localize("Reset all"), 0, &Button))
{
g_Config.m_ClLaserRifleOutlineColor = 11176233;
g_Config.m_ClLaserRifleInnerColor = 11206591;
g_Config.m_ClLaserShotgunOutlineColor = 1866773;
g_Config.m_ClLaserShotgunInnerColor = 1900385;
g_Config.m_ClLaserDoorOutlineColor = 7667473;
g_Config.m_ClLaserDoorInnerColor = 7701379;
g_Config.m_ClLaserFreezeOutlineColor = 11613223;
g_Config.m_ClLaserFreezeInnerColor = 12001153;
}
// ***** Laser Preview ***** //
RightView.HSplitTop(HeadlineAndVMargin, &Label, &RightView);
UI()->DoLabel(&Label, Localize("Preview"), HeadlineFontSize, TEXTALIGN_LEFT);