@@ -21,7 +21,7 @@ global function UpdateMouseDeltaBuffer
21
21
// Follow pointer, let scrollOffset be it's own thing -> will look more fluid; fix the sync issue?
22
22
23
23
const int BUTTONS_PER_PAGE = 15
24
- const int DOUBLE_CLICK_TIME_MS = 20 // unsure what the ideal value is
24
+ const float DOUBLE_CLICK_TIME_MS = 0.2 // unsure what the ideal value is
25
25
26
26
27
27
struct {
@@ -67,14 +67,15 @@ array<serverStruct> serversArrayFiltered
67
67
68
68
struct {
69
69
var menu
70
- int lastSelectedServer = 0
70
+ int lastSelectedServer = 1
71
71
int focusedServerIndex = 0
72
72
int scrollOffset = 0
73
73
bool serverListRequestFailed = false
74
74
float serverSelectedTime = 0
75
75
float serverSelectedTimeLast = 0
76
76
// array<string> serverButtons
77
77
int serverButtonFocusedID = 0
78
+ bool shouldFocus = true
78
79
} file
79
80
80
81
@@ -127,7 +128,6 @@ void function SliderBarUpdate()
127
128
Hud_SetPos ( sliderPanel , 2 , newPos )
128
129
Hud_SetPos ( movementCapture , 2 , newPos )
129
130
130
- printt (" scrollOffset: " , - int ( ( (newPos - minYPos) / useableSpace ) * (serversArrayFiltered. len () - 15 ) ), " max: " , serversArrayFiltered. len () - 15 )
131
131
file. scrollOffset = - int ( ( (newPos - minYPos) / useableSpace ) * (serversArrayFiltered. len () - 15 ) )
132
132
UpdateShownPage ()
133
133
}
@@ -403,8 +403,6 @@ void function UpdateListSliderPosition( int servers )
403
403
Hud_SetPos ( sliderButton , 2 , jump )
404
404
Hud_SetPos ( sliderPanel , 2 , jump )
405
405
Hud_SetPos ( movementCapture , 2 , jump )
406
-
407
- printt (" scrollOffset: " , file. scrollOffset )
408
406
}
409
407
410
408
@@ -633,7 +631,11 @@ void function FilterAndUpdateList( var n )
633
631
printt ( " How the f did you get here" )
634
632
}
635
633
636
- // Hud_SetFocused( Hud_GetChild( file.menu, "BtnServer1" ) )
634
+ if ( file. shouldFocus )
635
+ {
636
+ file. shouldFocus = false
637
+ Hud_SetFocused ( Hud_GetChild ( file. menu , " BtnServer1" ) )
638
+ }
637
639
}
638
640
639
641
@@ -820,26 +822,10 @@ void function OnServerButtonFocused( var button )
820
822
void function OnServerFocused ( var button )
821
823
{
822
824
DisplayFocusedServerInfo (int ( Hud_GetScriptID ( button ) ))
823
-
824
- file. focusedServerIndex = serversArrayFiltered[ file. scrollOffset + int ( Hud_GetScriptID ( button ) ) ]. serverIndex
825
- int serverIndex = file. scrollOffset + int ( Hud_GetScriptID ( button ) )
826
-
827
- bool sameServer = false
828
- if (file. lastSelectedServer == serverIndex) sameServer = true
829
-
830
-
831
- file. lastSelectedServer = serverIndex
832
-
833
- file. serverSelectedTimeLast = file. serverSelectedTime
834
- file. serverSelectedTime = Time ()
835
-
836
- if ((file. serverSelectedTime - file. serverSelectedTimeLast < DOUBLE_CLICK_TIME_MS) && sameServer && ( serverIndex >= 0 && serverIndex <= 14 ) )
837
- OnServerSelected (0 )
838
825
}
839
826
840
827
void function DisplayFocusedServerInfo ( int scriptID )
841
828
{
842
- printt ( scriptID )
843
829
if ( scriptID == 999 ) return
844
830
845
831
@@ -851,6 +837,20 @@ void function DisplayFocusedServerInfo( int scriptID )
851
837
file. focusedServerIndex = serversArrayFiltered[ file. scrollOffset + scriptID ]. serverIndex
852
838
int serverIndex = file. scrollOffset + scriptID
853
839
840
+ bool sameServer = false
841
+ if (file. lastSelectedServer == serverIndex) sameServer = true
842
+
843
+
844
+ file. lastSelectedServer = serverIndex
845
+
846
+ file. serverSelectedTimeLast = file. serverSelectedTime
847
+ file. serverSelectedTime = Time ()
848
+
849
+ printt (file. serverSelectedTime - file. serverSelectedTimeLast ," ;" , file. lastSelectedServer ," ;" , serverIndex, " ;" ,sameServer)
850
+
851
+ if ((file. serverSelectedTime - file. serverSelectedTimeLast < DOUBLE_CLICK_TIME_MS) && sameServer )
852
+ OnServerSelected (0 )
853
+
854
854
855
855
856
856
0 commit comments