Skip to content

Commit

Permalink
Sync names with ddnet
Browse files Browse the repository at this point in the history
Mainly for increasing readability and confidence when working with both sources
  • Loading branch information
CherryEx committed Jul 19, 2024
1 parent 438541b commit 76a7f6b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/game/client/components/menus_callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ float CMenus::RenderSettingsControlsMouse(CUIRect View)

View.HSplitTop(Spacing, 0, &View);
View.HSplitTop(ButtonHeight, &Button, &View);
UI()->DoScrollbarOption(&Config()->m_InpMousesens, &Config()->m_InpMousesens, &Button, Localize("In-game mouse sens."), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_NO_STRICT_RANGE);
UI()->DoScrollbarOption(&Config()->m_InpMousesens, &Config()->m_InpMousesens, &Button, Localize("In-game mouse sens."), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_NOCLAMPVALUE);

View.HSplitTop(Spacing, 0, &View);
View.HSplitTop(ButtonHeight, &Button, &View);
UI()->DoScrollbarOption(&Config()->m_UiMousesens, &Config()->m_UiMousesens, &Button, Localize("Menu mouse sens."), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_NO_STRICT_RANGE);
UI()->DoScrollbarOption(&Config()->m_UiMousesens, &Config()->m_UiMousesens, &Button, Localize("Menu mouse sens."), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_NOCLAMPVALUE);

return BackgroundHeight;
}
Expand Down Expand Up @@ -217,12 +217,12 @@ float CMenus::RenderSettingsControlsJoystick(CUIRect View)
{
View.HSplitTop(Spacing, 0, &View);
View.HSplitTop(ButtonHeight, &Button, &View);
UI()->DoScrollbarOption(&Config()->m_JoystickSens, &Config()->m_JoystickSens, &Button, Localize("In-game joystick sensitivity"), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_NO_STRICT_RANGE);
UI()->DoScrollbarOption(&Config()->m_JoystickSens, &Config()->m_JoystickSens, &Button, Localize("In-game joystick sensitivity"), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_NOCLAMPVALUE);
}

View.HSplitTop(Spacing, 0, &View);
View.HSplitTop(ButtonHeight, &Button, &View);
UI()->DoScrollbarOption(&Config()->m_UiJoystickSens, &Config()->m_UiJoystickSens, &Button, Localize("Menu/Editor joystick sensitivity"), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_NO_STRICT_RANGE);
UI()->DoScrollbarOption(&Config()->m_UiJoystickSens, &Config()->m_UiJoystickSens, &Button, Localize("Menu/Editor joystick sensitivity"), 1, 500, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_NOCLAMPVALUE);

View.HSplitTop(Spacing, 0, &View);
View.HSplitTop(ButtonHeight, &Button, &View);
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
Config()->m_ClAutoDemoRecord ^= 1;

if(Config()->m_ClAutoDemoRecord)
UI()->DoScrollbarOption(&Config()->m_ClAutoDemoMax, &Config()->m_ClAutoDemoMax, &ClientRight, Localize("Max"), 0, 1000, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_INFINITE);
UI()->DoScrollbarOption(&Config()->m_ClAutoDemoMax, &Config()->m_ClAutoDemoMax, &ClientRight, Localize("Max"), 0, 1000, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_INFINITE);

Client.HSplitTop(Spacing, 0, &Client);
Client.HSplitTop(ButtonHeight, &ClientLeft, &Client);
Expand All @@ -986,7 +986,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
Config()->m_ClAutoScreenshot ^= 1;

if(Config()->m_ClAutoScreenshot)
UI()->DoScrollbarOption(&Config()->m_ClAutoScreenshotMax, &Config()->m_ClAutoScreenshotMax, &ClientRight, Localize("Max"), 0, 1000, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_INFINITE);
UI()->DoScrollbarOption(&Config()->m_ClAutoScreenshotMax, &Config()->m_ClAutoScreenshotMax, &ClientRight, Localize("Max"), 0, 1000, &CUI::ms_LogarithmicScrollbarScale, CUI::SCROLLBAR_OPTION_INFINITE);

MainView.HSplitTop(10.0f, 0, &MainView);

Expand Down
6 changes: 3 additions & 3 deletions src/game/client/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ float CUI::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current)

void CUI::DoScrollbarOption(const void *pID, int *pOption, const CUIRect *pRect, const char *pStr, int Min, int Max, const IScrollbarScale *pScale, unsigned char Options)
{
const bool Infinite = Options & CUI::SCROLLBAR_INFINITE;
const bool NoRangeEnforcement = Options & CUI::SCROLLBAR_NO_STRICT_RANGE;
const bool Infinite = Options & CUI::SCROLLBAR_OPTION_INFINITE;
const bool NoClampValue = Options & CUI::SCROLLBAR_OPTION_NOCLAMPVALUE;
int Value = *pOption;
if(Infinite)
{
Expand Down Expand Up @@ -738,7 +738,7 @@ void CUI::DoScrollbarOption(const void *pID, int *pOption, const CUIRect *pRect,

ScrollBar.VMargin(4.0f, &ScrollBar);
Value = pScale->ToAbsolute(DoScrollbarH(pID, &ScrollBar, pScale->ToRelative(Value, Min, Max)), Min, Max);
if (NoRangeEnforcement && ((Value == Min && *pOption < Min) || (Value == Max && *pOption > Max)))
if (NoClampValue && ((Value == Min && *pOption < Min) || (Value == Max && *pOption > Max)))
{
Value = *pOption;
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ class CUI

enum
{
SCROLLBAR_INFINITE = 1 << 0,
SCROLLBAR_NO_STRICT_RANGE = 1 << 1,
SCROLLBAR_OPTION_INFINITE = 1 << 0,
SCROLLBAR_OPTION_NOCLAMPVALUE = 1 << 1,
};

// tooltips
Expand Down

0 comments on commit 76a7f6b

Please sign in to comment.