Skip to content

Commit e58c0d2

Browse files
committed
quick fix
1 parent 179d03e commit e58c0d2

File tree

88 files changed

+559
-3076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+559
-3076
lines changed

common/src/main/kotlin/com/lambda/Lambda.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ package com.lambda
2020
import com.google.gson.Gson
2121
import com.google.gson.GsonBuilder
2222
import com.lambda.config.serializer.*
23-
import com.lambda.config.serializer.gui.CustomModuleWindowSerializer
24-
import com.lambda.config.serializer.gui.ModuleTagSerializer
25-
import com.lambda.config.serializer.gui.TagWindowSerializer
2623
import com.lambda.core.Loader
27-
import com.lambda.gui.impl.clickgui.windows.tag.CustomModuleWindow
28-
import com.lambda.gui.impl.clickgui.windows.tag.TagWindow
2924
import com.lambda.module.tag.ModuleTag
3025
import com.lambda.util.KeyCode
3126
import com.mojang.authlib.GameProfile
@@ -52,9 +47,6 @@ object Lambda {
5247

5348
val gson: Gson = GsonBuilder()
5449
.setPrettyPrinting()
55-
.registerTypeAdapter(ModuleTag::class.java, ModuleTagSerializer)
56-
.registerTypeAdapter(CustomModuleWindow::class.java, CustomModuleWindowSerializer)
57-
.registerTypeAdapter(TagWindow::class.java, TagWindowSerializer)
5850
.registerTypeAdapter(KeyCode::class.java, KeyCodeSerializer)
5951
.registerTypeAdapter(Color::class.java, ColorSerializer)
6052
.registerTypeAdapter(BlockPos::class.java, BlockPosSerializer)

common/src/main/kotlin/com/lambda/config/serializer/gui/CustomModuleWindowSerializer.kt

Lines changed: 0 additions & 82 deletions
This file was deleted.

common/src/main/kotlin/com/lambda/config/serializer/gui/ModuleTagSerializer.kt

Lines changed: 0 additions & 40 deletions
This file was deleted.

common/src/main/kotlin/com/lambda/config/serializer/gui/TagWindowSerializer.kt

Lines changed: 0 additions & 79 deletions
This file was deleted.

common/src/main/kotlin/com/lambda/gui/api/GuiEvent.kt renamed to common/src/main/kotlin/com/lambda/event/events/GuiEvent.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,26 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
package com.lambda.gui.api
18+
package com.lambda.event.events
1919

2020
import com.lambda.event.Event
2121
import com.lambda.util.KeyCode
2222
import com.lambda.util.Mouse
2323
import com.lambda.util.math.Vec2d
2424

25-
abstract class GuiEvent : Event {
26-
class Show : GuiEvent()
27-
class Hide : GuiEvent()
28-
class Tick : GuiEvent()
29-
class Render : GuiEvent()
25+
sealed class GuiEvent : Event {
26+
data object Show : GuiEvent()
27+
data object Hide : GuiEvent()
28+
data object Tick : GuiEvent()
29+
data object Render : GuiEvent()
3030

31-
@Deprecated("Deprecated key press event", replaceWith = ReplaceWith("com.lambda.event.events.KeyboardEvent.Press"))
3231
class KeyPress(val key: KeyCode) : GuiEvent()
3332

34-
@Deprecated("Deprecated char event", replaceWith = ReplaceWith("com.lambda.event.events.KeyboardEvent.Char"))
3533
class CharTyped(val char: Char) : GuiEvent()
3634

37-
@Deprecated("Use the new global mouse events", replaceWith = ReplaceWith("com.lambda.event.events.MouseEvent.Click"))
3835
class MouseClick(val button: Mouse.Button, val action: Mouse.Action, val mouse: Vec2d) : GuiEvent()
3936

40-
@Deprecated("Use the new global mouse events", replaceWith = ReplaceWith("com.lambda.event.events.MouseEvent.Move"))
4137
class MouseMove(val mouse: Vec2d) : GuiEvent()
4238

43-
@Deprecated("Use the new global mouse events", replaceWith = ReplaceWith("com.lambda.event.events.MouseEvent.Scroll"))
4439
class MouseScroll(val mouse: Vec2d, val delta: Double) : GuiEvent()
4540
}

common/src/main/kotlin/com/lambda/event/events/RenderEvent.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ import com.lambda.Lambda.mc
2121
import com.lambda.event.Event
2222
import com.lambda.event.callback.Cancellable
2323
import com.lambda.event.callback.ICancellable
24-
import com.lambda.graphics.RenderPipeline
24+
import com.lambda.graphics.pipeline.UIPipeline
25+
import com.lambda.graphics.renderer.esp.global.DynamicESP
26+
import com.lambda.graphics.renderer.esp.global.StaticESP
2527
import com.lambda.util.math.Vec2d
2628

2729
sealed class RenderEvent {
2830
class World : Event
2931

3032
class StaticESP : Event {
31-
val renderer = RenderPipeline.STATIC_ESP
33+
val renderer = StaticESP
3234
}
3335

3436
class DynamicESP : Event {
35-
val renderer = RenderPipeline.DYNAMIC_ESP
37+
val renderer = DynamicESP
3638
}
3739

3840
sealed class GUI(val scale: Double) : Event {

common/src/main/kotlin/com/lambda/graphics/RenderMain.kt

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,39 @@ package com.lambda.graphics
2020
import com.lambda.Lambda.mc
2121
import com.lambda.event.EventFlow.post
2222
import com.lambda.event.events.RenderEvent
23-
import com.lambda.event.events.TickEvent
24-
import com.lambda.event.listener.SafeListener.Companion.listen
25-
import com.lambda.graphics.animation.Animation.Companion.exp
26-
import com.lambda.graphics.animation.AnimationTicker
2723
import com.lambda.graphics.buffer.FrameBuffer
2824
import com.lambda.graphics.gl.GlStateUtils.setupGL
2925
import com.lambda.graphics.gl.Matrices
3026
import com.lambda.graphics.gl.Matrices.resetMatrices
27+
import com.lambda.graphics.pipeline.UIPipeline
3128
import com.lambda.graphics.shader.Shader
32-
import com.lambda.gui.impl.hudgui.LambdaHudGui
33-
import com.lambda.module.modules.client.ClickGui
3429
import com.lambda.module.modules.client.GuiSettings
3530
import com.lambda.util.math.Vec2d
3631
import com.mojang.blaze3d.systems.RenderSystem.getProjectionMatrix
3732
import org.joml.Matrix4f
3833

3934
object RenderMain {
40-
val projectionMatrix = Matrix4f()
41-
val modelViewMatrix: Matrix4f get() = Matrices.peek()
42-
var screenSize = Vec2d.ZERO
43-
44-
private val showHud get() = mc.currentScreen == null || LambdaHudGui.isOpen
35+
private val projectionMatrix = Matrix4f()
36+
private val modelViewMatrix get() = Matrices.peek()
37+
val projModel get() = Matrix4f(projectionMatrix).mul(modelViewMatrix)
4538

46-
private val hudAnimation0 = with(AnimationTicker()) {
47-
listen<TickEvent.Pre> {
48-
tick()
49-
}
50-
51-
exp(0.0, 1.0, {
52-
if (showHud) ClickGui.closeSpeed else ClickGui.openSpeed
53-
}) { showHud }
54-
}
55-
56-
private val frameBuffer = FrameBuffer()
57-
private val shader = Shader("post/cgui_animation", "renderer/pos_tex")
58-
private val hudAnimation by hudAnimation0
39+
var screenSize = Vec2d.ZERO
5940

6041
@JvmStatic
6142
fun render2D() {
6243
resetMatrices(Matrix4f().translate(0f, 0f, -3000f))
6344

6445
setupGL {
46+
UIPipeline.reset()
47+
6548
rescale(1.0)
6649
RenderEvent.GUI.Fixed().post()
6750

6851
rescale(GuiSettings.scale)
69-
drawHUD()
52+
RenderEvent.GUI.HUD(GuiSettings.scale).post()
7053
RenderEvent.GUI.Scaled(GuiSettings.scale).post()
54+
55+
UIPipeline.render()
7156
}
7257
}
7358

@@ -91,19 +76,4 @@ object RenderMain {
9176
screenSize = Vec2d(scaledWidth, scaledHeight)
9277
projectionMatrix.setOrtho(0f, scaledWidth.toFloat(), scaledHeight.toFloat(), 0f, 1000f, 21000f)
9378
}
94-
95-
private fun drawHUD() {
96-
if (hudAnimation < 0.001) return
97-
98-
if (hudAnimation > 0.999) {
99-
RenderEvent.GUI.HUD(GuiSettings.scale).post()
100-
return
101-
}
102-
103-
frameBuffer.write {
104-
RenderEvent.GUI.HUD(GuiSettings.scale).post()
105-
}.read(shader) {
106-
it["u_Progress"] = hudAnimation
107-
}
108-
}
10979
}

0 commit comments

Comments
 (0)