mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
middle click to open pie menu
This commit is contained in:
@@ -7,7 +7,7 @@ import sun.misc.Unsafe
|
|||||||
* Created by minjaesong on 2019-06-21.
|
* Created by minjaesong on 2019-06-21.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
object UnsafeHelper {
|
internal object UnsafeHelper {
|
||||||
val unsafe: Unsafe
|
val unsafe: Unsafe
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -43,7 +43,7 @@ object UnsafeHelper {
|
|||||||
*
|
*
|
||||||
* Use of hashCode() is forbidden, use the pointer instead.
|
* Use of hashCode() is forbidden, use the pointer instead.
|
||||||
*/
|
*/
|
||||||
class UnsafePtr(pointer: Long, allocSize: Long) {
|
internal class UnsafePtr(pointer: Long, allocSize: Long) {
|
||||||
var destroyed = false
|
var destroyed = false
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ object DefaultConfig {
|
|||||||
// so these keys are treated as the same.
|
// so these keys are treated as the same.
|
||||||
// FOR ~~FUCKS~~ERGONOMICS' SAKE DON'T USE CTRL AND ALT AS A KEY!
|
// FOR ~~FUCKS~~ERGONOMICS' SAKE DON'T USE CTRL AND ALT AS A KEY!
|
||||||
jsonObject.add("keyquickselalt", keyquickselalt)
|
jsonObject.add("keyquickselalt", keyquickselalt)
|
||||||
|
jsonObject.addProperty("mousequicksel", Input.Buttons.MIDDLE) // middle click to open pie menu
|
||||||
|
|
||||||
jsonObject.addProperty("keyjump", Input.Keys.SPACE)
|
jsonObject.addProperty("keyjump", Input.Keys.SPACE)
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// pie menu
|
// pie menu
|
||||||
if (button == AppLoader.getConfigInt("mousesecondary")) {
|
if (button == AppLoader.getConfigInt("mousequicksel")) {
|
||||||
terrarumIngame.uiPieMenu.setAsClose()
|
terrarumIngame.uiPieMenu.setAsClose()
|
||||||
terrarumIngame.uiQuickBar.setAsOpen()
|
terrarumIngame.uiQuickBar.setAsOpen()
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
|||||||
terrarumIngame.uiContainer.forEach { it.touchDown(screenX, screenY, pointer, button) }
|
terrarumIngame.uiContainer.forEach { it.touchDown(screenX, screenY, pointer, button) }
|
||||||
|
|
||||||
// pie menu
|
// pie menu
|
||||||
if (button == AppLoader.getConfigInt("mousesecondary")) {
|
if (button == AppLoader.getConfigInt("mousequicksel")) {
|
||||||
terrarumIngame.uiPieMenu.setAsOpen()
|
terrarumIngame.uiPieMenu.setAsOpen()
|
||||||
terrarumIngame.uiQuickBar.setAsClose()
|
terrarumIngame.uiQuickBar.setAsClose()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,14 +247,14 @@ fun main(args: Array<String>) {
|
|||||||
LwjglApplication(WorldgenNoiseSandbox(), appConfig)
|
LwjglApplication(WorldgenNoiseSandbox(), appConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NoiseMaker {
|
internal interface NoiseMaker {
|
||||||
fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr)
|
fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr)
|
||||||
fun getGenerator(seed: Long, params: Any): List<Joise>
|
fun getGenerator(seed: Long, params: Any): List<Joise>
|
||||||
}
|
}
|
||||||
|
|
||||||
val locklock = java.lang.Object()
|
val locklock = java.lang.Object()
|
||||||
|
|
||||||
object BiomeMaker : NoiseMaker {
|
internal object BiomeMaker : NoiseMaker {
|
||||||
|
|
||||||
override fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr) {
|
override fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr) {
|
||||||
val colPal = biomeColors
|
val colPal = biomeColors
|
||||||
@@ -303,7 +303,7 @@ object BiomeMaker : NoiseMaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// http://accidentalnoise.sourceforge.net/minecraftworlds.html
|
// http://accidentalnoise.sourceforge.net/minecraftworlds.html
|
||||||
object AccidentalCave {
|
internal object AccidentalCave {
|
||||||
|
|
||||||
private infix fun Color.mul(other: Color) = this.mul(other)
|
private infix fun Color.mul(other: Color) = this.mul(other)
|
||||||
|
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ object LightmapRenderer {
|
|||||||
|
|
||||||
|
|
||||||
r3();r4();r1();r2();r3();
|
r3();r4();r1();r2();r3();
|
||||||
val for_x_middle = (for_x_start + for_x_end) / 2
|
//val for_x_middle = (for_x_start + for_x_end) / 2
|
||||||
//val for_y_middle = (for_y_start + for_y_end) / 2
|
//val for_y_middle = (for_y_start + for_y_end) / 2
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user