mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +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.
|
||||
*/
|
||||
|
||||
object UnsafeHelper {
|
||||
internal object UnsafeHelper {
|
||||
val unsafe: Unsafe
|
||||
|
||||
init {
|
||||
@@ -43,7 +43,7 @@ object UnsafeHelper {
|
||||
*
|
||||
* 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
|
||||
private set
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ object DefaultConfig {
|
||||
// so these keys are treated as the same.
|
||||
// FOR ~~FUCKS~~ERGONOMICS' SAKE DON'T USE CTRL AND ALT AS A KEY!
|
||||
jsonObject.add("keyquickselalt", keyquickselalt)
|
||||
jsonObject.addProperty("mousequicksel", Input.Buttons.MIDDLE) // middle click to open pie menu
|
||||
|
||||
jsonObject.addProperty("keyjump", Input.Keys.SPACE)
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
||||
}
|
||||
|
||||
// pie menu
|
||||
if (button == AppLoader.getConfigInt("mousesecondary")) {
|
||||
if (button == AppLoader.getConfigInt("mousequicksel")) {
|
||||
terrarumIngame.uiPieMenu.setAsClose()
|
||||
terrarumIngame.uiQuickBar.setAsOpen()
|
||||
}
|
||||
@@ -206,7 +206,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
|
||||
terrarumIngame.uiContainer.forEach { it.touchDown(screenX, screenY, pointer, button) }
|
||||
|
||||
// pie menu
|
||||
if (button == AppLoader.getConfigInt("mousesecondary")) {
|
||||
if (button == AppLoader.getConfigInt("mousequicksel")) {
|
||||
terrarumIngame.uiPieMenu.setAsOpen()
|
||||
terrarumIngame.uiQuickBar.setAsClose()
|
||||
}
|
||||
|
||||
@@ -247,14 +247,14 @@ fun main(args: Array<String>) {
|
||||
LwjglApplication(WorldgenNoiseSandbox(), appConfig)
|
||||
}
|
||||
|
||||
interface NoiseMaker {
|
||||
internal interface NoiseMaker {
|
||||
fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr)
|
||||
fun getGenerator(seed: Long, params: Any): List<Joise>
|
||||
}
|
||||
|
||||
val locklock = java.lang.Object()
|
||||
|
||||
object BiomeMaker : NoiseMaker {
|
||||
internal object BiomeMaker : NoiseMaker {
|
||||
|
||||
override fun draw(x: Int, y: Int, noiseValue: List<Double>, outTex: UnsafePtr) {
|
||||
val colPal = biomeColors
|
||||
@@ -303,7 +303,7 @@ object BiomeMaker : NoiseMaker {
|
||||
}
|
||||
|
||||
// http://accidentalnoise.sourceforge.net/minecraftworlds.html
|
||||
object AccidentalCave {
|
||||
internal object AccidentalCave {
|
||||
|
||||
private infix fun Color.mul(other: Color) = this.mul(other)
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ object LightmapRenderer {
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user