@@ -39,102 +39,114 @@ class Core: GuiScreen() {
3939// topLevelUI = verticalBox {
4040// relX = 300.0
4141// relY = 300.0
42- // padding = 0.0
43- // spacing = 0.0
4442// + text("Very Large") { scale = UIText.Scale.VERY_LARGE }
4543// + text("Large") { scale = UIText.Scale.LARGE }
4644// + text("Medium") { scale = UIText.Scale.MEDIUM }
4745// + text("Small") { scale = UIText.Scale.SMALL }
4846// + text("Very Small") { scale = UIText.Scale.VERY_SMALL }
4947// }
5048
49+ topLevelUI = verticalBox {
50+ val ka = GlobalManager .clientInstance!! .moduleMap.module(" killaura" ) as Killaura
51+
52+ + centerBox {
53+ child = text(" Killaura" ) {
54+ scale = UIText .Scale .SMALL
55+ }
56+ width = 200.0
57+ }
58+
59+ + verticalBox {
60+ padding = 0.0
61+ hidden = true
62+
63+ + horizontalBox {
64+ placeLeft()
65+ + text(" Toggled" ) {
66+ scale = UIText .Scale .SMALL
67+ }
68+ placeRight()
69+ + checkbox {
70+ checked = ka.toggled
71+ child.scale = UIIcon .Scale .SMALL
72+ onCheck = { ka.toggle() }
73+ }
74+ }
75+
76+ + verticalBox {
77+ spacing = 5.0
78+
79+ val minReach = 3.0
80+ val maxReach = 6.0
81+
82+ + horizontalBox {
83+ padding = 0.0
84+ hidden = true
85+ placeLeft()
86+ + text(" Reach" ) {
87+ scale = UIText .Scale .SMALL
88+ }
89+ placeRight()
90+ + text {
91+ scale = UIText .Scale .SMALL
92+ source = { ka.limiter.maxReach.toString() }
93+ }
94+ }
95+ + horizontalBox {
96+ padding = 0.0
97+ hidden = true
98+ placeLeft()
99+ + text {
100+ source = { minReach.toString() }
101+ scale = UIText .Scale .SMALL
102+ baseColor = UIColorEnum .TEXT_SECONDARY
103+ }
104+ placeRight()
105+ + text {
106+ source = { maxReach.toString() }
107+ scale = UIText .Scale .SMALL
108+ baseColor = UIColorEnum .TEXT_SECONDARY
109+ }
110+ }
111+ + slider {
112+ minValue = minReach
113+ maxValue = maxReach
114+ segmented = true
115+ segmentCount = 6
116+ selectedValue = ka.limiter.maxReach
117+ clickAction = { ka.limiter.maxReach = selectedValue }
118+ }
119+ }
120+ }
121+ }
122+
123+
51124// topLevelUI = verticalBox {
52- // val ka = GlobalManager.clientInstance!!.moduleMap.module("killaura") as Killaura
53- //
54- // + centerBox {
55- // child = text("Killaura") {
56- // scale = UIText.Scale.SMALL
57- // }
58- // width = 200.0
125+ // canBeMoved = true
126+ // + verticalBox {
127+ // baseColor = UIColorEnum.BOX_SECONDARY
128+ // + text { source = {"Mouse Info Info"}; scale = UIText.Scale.LARGE }
59129// }
60- //
61130// + verticalBox {
62- // padding = 0.0
63- // hidden = true
64- //
65- // + horizontalBox {
66- // placeLeft()
67- // + text("Toggled") {
68- // scale = UIText.Scale.SMALL
69- // }
70- // placeRight()
71- // + checkbox {
72- // checked = ka.toggled
73- // child.scale = UIIcon.Scale.SMALL
74- // onCheck = { ka.toggle() }
75- // }
76- // }
77- //
78- // + verticalBox {
79- // spacing = 5.0
80- //
81- // val minReach = 3.0
82- // val maxReach = 6.0
83- //
84- // + horizontalBox {
85- // padding = 0.0
86- // hidden = true
87- // placeLeft()
88- // + text("Reach") {
89- // scale = UIText.Scale.SMALL
90- // }
91- // placeRight()
92- // + text {
93- // scale = UIText.Scale.SMALL
94- // source = { ka.limiter.maxReach.toString() }
95- // }
96- // }
97- // + horizontalBox {
98- // padding = 0.0
99- // hidden = true
100- // placeLeft()
101- // + text {
102- // source = { minReach.toString() }
103- // scale = UIText.Scale.SMALL
104- // baseColor = UIColorEnum.TEXT_SECONDARY
105- // }
106- // placeRight()
107- // + text {
108- // source = { maxReach.toString() }
109- // scale = UIText.Scale.SMALL
110- // baseColor = UIColorEnum.TEXT_SECONDARY
111- // }
112- // }
113- // // + slider {
114- // // minValue = minReach
115- // // maxValue = maxReach
116- // // segmented = true
117- // // segmentCount = 6
118- // // selectedValue = ka.limiter.maxReach
119- // // clickAction = { ka.limiter.maxReach = selectedValue }
120- // // }
121- // }
131+ // + text { source = {"DX: ${mouseInfo.dX}"} }
132+ // + text { source = {"DY: ${mouseInfo.dY}"} }
133+ // + text { source = {"LastX: ${mouseInfo.lastX}"} }
134+ // + text { source = {"LastY: ${mouseInfo.lastY}"} }
135+ // + text { source = {"Left Click"} }
136+ // + text { source = {"Hold time: ${mouseInfo.lcmHoldTime}"} }
137+ // + text { source = {"Instant: ${mouseInfo.lcmInstant?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
138+ // + text { source = {"Current: ${mouseInfo.lcmCurrent?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
139+ // + text { source = {"Grabbed: ${mouseInfo.lcmGrabbed?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
140+ // + text { source = {"Hovered: ${mouseInfo.lcmHovered?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
141+ // + text { source = {"Right Click"} }
142+ // + text { source = {"Hold time: ${mouseInfo.rcmHoldTime}"} }
143+ // + text { source = {"Instant: ${mouseInfo.rcmInstant?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
144+ // + text { source = {"Current: ${mouseInfo.rcmCurrent?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
145+ // + text { source = {"Grabbed: ${mouseInfo.rcmGrabbed?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
146+ // + text { source = {"Hovered: ${mouseInfo.rcmHovered?.ui?.hashCode()}"}; scale = UIText.Scale.SMALL }
122147// }
123148// }
124149
125- topLevelUI = verticalBox {
126- canBeMoved = true
127- + text { source = {" Mouse Info Info" }; scale = UIText .Scale .LARGE }
128- + text { source = {" DX: ${mouseInfo.dX} " } }
129- + text { source = {" DY: ${mouseInfo.dY} " } }
130- + text { source = {" LastX: ${mouseInfo.lastX} " } }
131- + text { source = {" LastY: ${mouseInfo.lastY} " } }
132- + text { source = {" Last left clicked:" } }
133- + text { source = {" ${mouseInfo.lastLeftClicked?.ui} " }; scale = UIText .Scale .SMALL }
134- + text { source = {" Current hovered:" } }
135- + text { source = {" ${mouseInfo.currentHovered?.ui} " }; scale = UIText .Scale .SMALL }
136- }
137-
138150 interactionManager = InteractionManager (mouseInfo, topLevelUI, config)
139151 renderer = UINewRenderer (config)
140152 }
@@ -146,6 +158,8 @@ class Core: GuiScreen() {
146158
147159 JavaNativeRendering .nUpdateScreenSize(width.toFloat(), height.toFloat())
148160
161+ interactionManager.handleMouseInput()
162+
149163 if (topLevelUI is ILayout )
150164 (topLevelUI as ILayout ).applyLayout()
151165
@@ -154,10 +168,6 @@ class Core: GuiScreen() {
154168 renderer.renderEverything(topLevelUI)
155169 }
156170
157- override fun handleMouseInput () {
158- interactionManager.handleMouseInput()
159- }
160-
161171 override fun keyTyped (typedChar : Char , keyCode : Int ) {
162172 super .keyTyped(typedChar, keyCode)
163173 interactionManager.handleKeyTyped(typedChar, keyCode)
0 commit comments