@@ -5,9 +5,13 @@ import com.lambda.client.gui.AbstractLambdaGui
5
5
import com.lambda.client.gui.rgui.Component
6
6
import com.lambda.client.gui.rgui.InteractiveComponent
7
7
import com.lambda.client.module.modules.client.ClickGUI
8
+ import com.lambda.client.module.modules.client.CustomFont
9
+ import com.lambda.client.module.modules.client.GuiColors
8
10
import com.lambda.client.util.TickTimer
11
+ import com.lambda.client.util.color.ColorHolder
9
12
import com.lambda.client.util.graphics.GlStateUtils
10
13
import com.lambda.client.util.graphics.VertexHelper
14
+ import com.lambda.client.util.graphics.font.FontRenderAdapter
11
15
import com.lambda.client.util.math.Vec2f
12
16
import org.lwjgl.input.Mouse
13
17
import org.lwjgl.opengl.GL11.*
@@ -21,7 +25,8 @@ open class ListWindow(
21
25
width : Float ,
22
26
height : Float ,
23
27
saveToConfig : SettingGroup ,
24
- vararg childrenIn : Component
28
+ vararg childrenIn : Component ,
29
+ val drawHandle : Boolean = false
25
30
) : TitledWindow(name, posX, posY, width, height, saveToConfig) {
26
31
val children = ArrayList <Component >()
27
32
@@ -147,6 +152,17 @@ open class ListWindow(
147
152
override fun onRender (vertexHelper : VertexHelper , absolutePos : Vec2f ) {
148
153
super .onRender(vertexHelper, absolutePos)
149
154
155
+ if (drawHandle) {
156
+ val handleText = " ....."
157
+ val scale = 0.75f
158
+ val posX = renderWidth / 2 - FontRenderAdapter .getStringWidth(handleText, scale) / 2
159
+ val posY = renderHeight - 5 - FontRenderAdapter .getFontHeight(scale) / 2
160
+ val color = with (GuiColors .text) {
161
+ ColorHolder (r, g, b, (a * 0.6f ).toInt())
162
+ }
163
+ FontRenderAdapter .drawString(handleText, posX, posY, CustomFont .shadow, color, scale)
164
+ }
165
+
150
166
synchronized(this ) {
151
167
renderChildren {
152
168
it.onRender(vertexHelper, absolutePos.plus(it.renderPosX, it.renderPosY - renderScrollProgress))
@@ -171,14 +187,15 @@ open class ListWindow(
171
187
((renderPosX + ClickGUI .horizontalMargin) * ClickGUI .getScaleFactor()).toInt(),
172
188
mc.displayHeight - ((renderPosY + renderHeight - ClickGUI .resizeBar) * ClickGUI .getScaleFactor()).toInt(),
173
189
((renderWidth - ClickGUI .horizontalMargin) * ClickGUI .getScaleFactor()).toInt(),
174
- ((renderHeight - draggableHeight - ClickGUI .resizeBar)* ClickGUI .getScaleFactor()).toInt().coerceAtLeast(0 )
190
+ ((renderHeight - draggableHeight - ClickGUI .resizeBar) * ClickGUI .getScaleFactor()).toInt().coerceAtLeast(0 )
175
191
)
176
192
glEnable(GL_SCISSOR_TEST )
177
193
glTranslatef(0.0f , - renderScrollProgress, 0.0f )
178
194
179
- children.filter { it.visible
180
- && it.renderPosY + it.renderHeight - renderScrollProgress > draggableHeight
181
- && it.renderPosY - renderScrollProgress < renderHeight
195
+ children.filter {
196
+ it.visible
197
+ && it.renderPosY + it.renderHeight - renderScrollProgress > draggableHeight
198
+ && it.renderPosY - renderScrollProgress < renderHeight
182
199
}.forEach {
183
200
glPushMatrix()
184
201
glTranslatef(it.renderPosX, it.renderPosY, 0.0f )
@@ -211,7 +228,6 @@ open class ListWindow(
211
228
|| relativeMousePos.x < ClickGUI .horizontalMargin
212
229
|| relativeMousePos.x > renderWidth - ClickGUI .horizontalMargin
213
230
) null
214
-
215
231
else children.firstOrNull { it.visible && relativeMousePos.y in it.posY.. it.posY + it.height }
216
232
}
217
233
0 commit comments