Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f48b989
Tag windows
bladekt Apr 13, 2024
99ea78f
Freecam vertical movement fixes
bladekt Apr 13, 2024
12745d6
ClickGui:
bladekt Apr 19, 2024
7a174ae
Raw CustomModuleWindow impl
bladekt Apr 19, 2024
ec4c3c0
Broken blur
bladekt Apr 21, 2024
f6f8068
Faster texture upload
emyfops Apr 21, 2024
d2d3792
Better gaussian blur
emyfops Apr 21, 2024
d7b2f18
Get rid of the mojang's rendering utilities
emyfops Apr 21, 2024
f990d67
Merge branch 'master' into feature/renderer
emyfops Apr 21, 2024
dd59c3f
Tag windows
bladekt Apr 13, 2024
8bb83c1
Freecam vertical movement fixes
bladekt Apr 13, 2024
dd2a14e
ClickGui:
bladekt Apr 19, 2024
3e4a9c8
Raw CustomModuleWindow impl
bladekt Apr 19, 2024
1aebc83
Broken blur
bladekt Apr 21, 2024
71dfaab
Faster texture upload
emyfops Apr 21, 2024
83e53e5
Better gaussian blur
emyfops Apr 21, 2024
3e4eaa1
Merge branch 'feature/renderer' of https://github.com/Avanatiker/NeoL…
emyfops Apr 21, 2024
77c4bf1
Fix: Single tag
emyfops Apr 21, 2024
fb77000
Make the blur stronger
emyfops Apr 21, 2024
975e1ec
Use our matrix
emyfops Apr 21, 2024
60e821f
Merge branch 'master' into feature/renderer
emyfops Apr 22, 2024
8d50d96
Make GuiConfig loadable
emyfops Apr 22, 2024
fd4100a
Fix: Wrong loadable
emyfops Apr 22, 2024
b07fe53
Fix: Tags
emyfops Apr 23, 2024
7a58391
Blur Optimization & Refactor
bladekt Apr 24, 2024
b50967a
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Apr 24, 2024
2a92af9
Removed useless coerce
emyfops Apr 27, 2024
5edcf06
didn't meant to remove this
emyfops Apr 27, 2024
da76b29
Merge branch 'master' into feature/renderer
emyfops Apr 27, 2024
2f8d91d
Fix: VAO buffer leak
emyfops Apr 27, 2024
6fcc348
DirectionMask
bladekt Apr 28, 2024
de70f73
Optimization tweak
bladekt Apr 29, 2024
0e807d4
Quick refactor
bladekt Apr 29, 2024
4e8599f
Fix: Texture upload doesn't work on other architectures
emyfops Apr 30, 2024
4492ba7
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Apr 30, 2024
2f6bf5c
Fix double destroying
Avanatiker Apr 30, 2024
84ddc4e
Dynamic, Static BlockESPs and Tracers
bladekt Apr 30, 2024
0cfaed1
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Apr 30, 2024
f53baca
Refucktor
bladekt May 1, 2024
1ff8730
Added position iterator
emyfops May 1, 2024
6b01d57
Revert "Added position iterator"
emyfops May 1, 2024
4e66aae
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt May 2, 2024
13e1ca2
Scissor fix
bladekt May 2, 2024
67b2d99
Children system rework
bladekt May 2, 2024
81b4bde
oopsie
bladekt May 2, 2024
49eb6d4
Window creation tests
bladekt May 2, 2024
498b5af
Button action refactor
bladekt May 2, 2024
e2e434f
Single settings window
bladekt May 2, 2024
363bb61
Pool spam fix
bladekt May 2, 2024
9e4ae2c
Settings open animation & refactor
bladekt May 2, 2024
63021f7
Misc stuff
bladekt May 2, 2024
ab4107a
Added boolean button
bladekt May 3, 2024
6170a30
Outline renderer & many misc stuff
bladekt May 3, 2024
9ade9f7
Child logic rework(again), dropdown buttons
bladekt May 5, 2024
9babf6f
Setting animations rework
bladekt May 9, 2024
83ce0a6
Sexy animations & many fixes
bladekt May 9, 2024
6a8b2bc
Slider progress rendering
bladekt May 9, 2024
991d9a1
Rect sharpness & misc
bladekt May 9, 2024
ef6567f
Merge branch 'master' into feature/renderer
Avanatiker May 9, 2024
bd35875
Added SoundManager
Avanatiker May 9, 2024
3db39f0
Fixed sound manager
Avanatiker May 9, 2024
b3829c2
Font artifacts fix
bladekt May 9, 2024
168e705
Added alpha check
bladekt May 9, 2024
d249ba3
Removed useless setting
bladekt May 9, 2024
3128295
Setting space shadow
bladekt May 9, 2024
4b1e263
Gui sounds
bladekt May 10, 2024
cb519a2
Color banding dithering
bladekt May 10, 2024
3d0a549
Crash fix
bladekt May 11, 2024
cc38ff9
InputBar
bladekt May 11, 2024
d876309
String setting
bladekt May 12, 2024
179a54e
Enum setting & misc
bladekt May 12, 2024
b9bfa68
Fix: Empty click gui at first launch
bladekt May 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Button action refactor
  • Loading branch information
bladekt committed May 2, 2024
commit 498b5afcf46a4989f18dfdd12a611d33cfb4bbde
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ import com.lambda.util.Mouse

abstract class InteractiveComponent : IComponent, IRectComponent {
protected var hovered = false
protected var pressed = false; set(value) {
if (field == value) return
field = value
protected var pressed = false

if (value) onPress()
else onRelease()
}

protected var activeMouseButton: Mouse.Button? = null

protected open fun onPress() {}
protected open fun onRelease() {}
protected open fun onPress(e: GuiEvent.MouseClick) {}
protected open fun onRelease(e: GuiEvent.MouseClick) {}

override fun onEvent(e: GuiEvent) {
when (e) {
Expand All @@ -32,11 +24,12 @@ abstract class InteractiveComponent : IComponent, IRectComponent {
}

is GuiEvent.MouseClick -> {
activeMouseButton = e.button.takeUnless {
it.isMainButton && e.action == Mouse.Action.Click
}

val prevPressed = pressed
pressed = hovered && e.button.isMainButton && e.action == Mouse.Action.Click

if (prevPressed == pressed) return
if (pressed) onPress(e)
else onRelease(e)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.lambda.gui.api.component.WindowComponent
import com.lambda.gui.api.component.core.list.ChildComponent
import com.lambda.module.modules.client.ClickGui
import com.lambda.module.modules.client.GuiSettings
import com.lambda.util.Mouse
import com.lambda.util.math.ColorUtils.multAlpha
import com.lambda.util.math.MathUtils.lerp
import com.lambda.util.math.Rect
Expand Down Expand Up @@ -91,7 +90,7 @@ abstract class ButtonComponent(
}
}

abstract fun performClickAction(mouse: Mouse.Button)
abstract fun performClickAction(e: GuiEvent.MouseClick)

override fun onEvent(e: GuiEvent) {
super.onEvent(e)
Expand All @@ -106,8 +105,8 @@ abstract class ButtonComponent(
}
}

override fun onRelease() {
activeMouseButton?.let(::performClickAction)
override fun onRelease(e: GuiEvent.MouseClick) {
performClickAction(e)
}

override fun onRemove() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.gui.impl.clickgui.buttons

import com.lambda.gui.api.GuiEvent
import com.lambda.gui.api.component.WindowComponent
import com.lambda.gui.api.component.button.ListButton
import com.lambda.gui.impl.clickgui.windows.SettingsWindow
Expand All @@ -9,16 +10,18 @@ import com.lambda.util.Mouse
class ModuleButton(val module: Module, owner: WindowComponent<*>) : ListButton(owner) {
override val text get() = module.name
override val active get() = module.isEnabled
private val gui = owner.owner

override fun performClickAction(mouse: Mouse.Button) {
when (mouse) {
private val settingsWindow = SettingsWindow(this, gui)

override fun performClickAction(e: GuiEvent.MouseClick) {
when (e.button) {
Mouse.Button.Left -> if (hovered) module.toggle()
Mouse.Button.Right -> {
val gui = owner.owner

gui.scheduleAction {
val settingsWindow = SettingsWindow(this, gui)
gui.windows.addChild(settingsWindow)
gui.windows.addChild(settingsWindow.apply {
position = e.mouse
})
}
}
}
Expand Down