mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Temp fixes for controls
This commit is contained in:
parent
b8ba2b226a
commit
38e6878c48
|
@ -3162,8 +3162,8 @@ void CMenus::SetMenuPage(int NewPage)
|
|||
bool CMenus::HandleListInputs(const CUIRect &View, float &ScrollValue, const float ScrollAmount, int *pScrollOffset, const float ElemHeight, int &SelectedIndex, const int NumElems)
|
||||
{
|
||||
int NewIndex = -1;
|
||||
int Num = (int)(View.h / ElemHeight) + 1;
|
||||
int ScrollNum = maximum(NumElems - Num + 1, 0);
|
||||
int Num = (int)(View.h / ElemHeight);
|
||||
int ScrollNum = maximum(NumElems - Num, 0);
|
||||
if(ScrollNum > 0)
|
||||
{
|
||||
if(pScrollOffset && *pScrollOffset >= 0)
|
||||
|
|
|
@ -543,8 +543,9 @@ void CMenus::UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHe
|
|||
// do the scrollbar
|
||||
View.HSplitTop(gs_ListBoxRowHeight, &Row, 0);
|
||||
|
||||
int NumViewable = (int)(gs_ListBoxOriginalView.h / Row.h) + 1;
|
||||
int Num = (NumItems + gs_ListBoxItemsPerRow - 1) / gs_ListBoxItemsPerRow - NumViewable + 1;
|
||||
int NumViewable = (int)(gs_ListBoxOriginalView.h / Row.h) * gs_ListBoxItemsPerRow;
|
||||
//int Num = (NumItems + gs_ListBoxItemsPerRow - 1) / gs_ListBoxItemsPerRow - NumViewable + 1;
|
||||
int Num = NumItems - NumViewable;
|
||||
if(Num <= 0)
|
||||
{
|
||||
Num = 0;
|
||||
|
|
|
@ -884,7 +884,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
static int s_SelectedControl = -1;
|
||||
static float s_ScrollValue = 0;
|
||||
int OldSelected = s_SelectedControl;
|
||||
UiDoListboxStart(&s_ControlsList, &MainView, 475.0f, Localize("Controls"), "", 1, 1, s_SelectedControl, s_ScrollValue);
|
||||
UiDoListboxStart(&s_ControlsList, &MainView, 500.0f, Localize("Controls"), "", 1, 1, s_SelectedControl, s_ScrollValue);
|
||||
|
||||
CUIRect MovementSettings, WeaponSettings, VotingSettings, ChatSettings, DummySettings, MiscSettings, ResetButton;
|
||||
CListboxItem Item = UiDoListboxNextItem(&OldSelected, false, false, true);
|
||||
|
|
Loading…
Reference in a new issue