Skip to content

Commit

Permalink
change config value getting
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Sep 24, 2024
1 parent dd8b7d5 commit 38207c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/main/kotlin/gay/j10a1n15/sillygames/SillyGames.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gay.j10a1n15.sillygames

import gay.j10a1n15.sillygames.commands.CommandManager
import gay.j10a1n15.sillygames.config.Config
import gay.j10a1n15.sillygames.events.EventHandler
import gay.j10a1n15.sillygames.rpc.RpcManager
import gay.j10a1n15.sillygames.screens.PictureInPicture
Expand All @@ -20,10 +19,6 @@ class SillyGames {
const val MODID = "sillygames"
const val VERSION = "1.0.0"
const val NAME = "Silly Games"

val config by lazy {
Config
}
}

@Mod.EventHandler
Expand Down
13 changes: 7 additions & 6 deletions src/main/kotlin/gay/j10a1n15/sillygames/data/KeybindSet.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gay.j10a1n15.sillygames.data

import gay.j10a1n15.sillygames.SillyGames
import gay.j10a1n15.sillygames.config.Config
import gay.j10a1n15.sillygames.utils.Vector2d

class KeybindSet(
Expand All @@ -21,11 +21,12 @@ class KeybindSet(
}

companion object {
private val config get() = SillyGames.config

fun configPrimary() = KeybindSet(config.keybindUp, config.keybindDown, config.keybindLeft, config.keybindRight)
fun configPrimary() = with(Config) {
KeybindSet(keybindUp, keybindDown, keybindLeft, keybindRight)
}

fun configSecondary() =
KeybindSet(config.keybindUpSecondary, config.keybindDownSecondary, config.keybindLeftSecondary, config.keybindRightSecondary)
fun configSecondary() = with(Config) {
KeybindSet(keybindUpSecondary, keybindDownSecondary, keybindLeftSecondary, keybindRightSecondary)
}
}
}

0 comments on commit 38207c3

Please sign in to comment.