Skip to content

Commit

Permalink
Porting and fixing and such
Browse files Browse the repository at this point in the history
  • Loading branch information
Deftu committed Jan 2, 2025
1 parent 8bbbc3c commit 4437735
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/org/polyfrost/polytime/PolyTime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ object PolyTime {
calculateMoonPhases()
}

const val MODID: String = "@ID@"
const val NAME: String = "@NAME@"
const val VERSION: String = "@VER@"
const val MODID: String = "@MOD_ID@"
const val NAME: String = "@MOD_NAME@"
const val VERSION: String = "@MOD_VERSION@"

var lunarPhase: Int = 0
private var gotData = false
Expand Down
12 changes: 7 additions & 5 deletions src/main/kotlin/org/polyfrost/polytime/config/ModConfig.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.polyfrost.polytime.config

import org.polyfrost.oneconfig.api.config.v1.Config
import org.polyfrost.oneconfig.api.config.v1.Property
import org.polyfrost.oneconfig.api.config.v1.annotations.Checkbox
import org.polyfrost.oneconfig.api.config.v1.annotations.Keybind
import org.polyfrost.oneconfig.api.config.v1.annotations.Slider
import org.polyfrost.oneconfig.api.config.v1.annotations.Switch
import org.polyfrost.oneconfig.api.ui.v1.keybind.KeybindManager.registerKeybind
import org.polyfrost.polytime.PolyTime
import org.polyfrost.polyui.input.KeybindHelper
import org.polyfrost.universal.UKeyboard

object ModConfig : Config("${PolyTime.MODID}.json", PolyTime.NAME, Category.QOL) { // TODO: Fix mod
Expand Down Expand Up @@ -61,25 +63,25 @@ object ModConfig : Config("${PolyTime.MODID}.json", PolyTime.NAME, Category.QOL)
title = "Forward Key Bind",
description = "Moves time forwards when pressed.",
)
var forwardKeyBind = KeybindHelper.builder().keys(UKeyboard.KEY_RBRACKET).does(Runnable { if (time < 24) time += 0.5f }).register()
var forwardKeyBind = KeybindHelper.builder().keys(UKeyboard.KEY_RBRACKET).does { if (time < 24) time += 0.5f }.build()

@Keybind(
title = "Backward Key Bind",
description = "Moves time backwards when pressed.",
)
var backwardKeybind = KeybindHelper.builder().keys(UKeyboard.KEY_LBRACKET).does(Runnable { if (time > 0) time -= 0.5f }).register()
var backwardKeybind = KeybindHelper.builder().keys(UKeyboard.KEY_LBRACKET).does { if (time > 0) time -= 0.5f }.build()

init {
// initialize()
addDependency("time", "IRL Time") { !irlTime }
addDependency("time", "IRL Time") { if (!irlTime) Property.Display.DISABLED else Property.Display.SHOWN }
//addDependency("irlTime", "Fast Time") { !fastTime }
//addDependency("time", "IRL Time / Fast Time") { !irlTime && !fastTime }
//addDependency("fastTime", "IRL Time") { !irlTime }
//addDependency("fastSpeed", "IRL Time / Fast Time") { !irlTime && fastTime }

registerKeybind(forwardKeyBind)
addDependency("forwardKeyBind", "IRL Time") { !irlTime }
addDependency("forwardKeyBind", "IRL Time") { if (!irlTime) Property.Display.DISABLED else Property.Display.SHOWN }
registerKeybind(backwardKeybind)
addDependency("backwardKeybind", "IRL Time") { !irlTime }
addDependency("backwardKeybind", "IRL Time") { if (!irlTime) Property.Display.DISABLED else Property.Display.SHOWN }
}
}
6 changes: 3 additions & 3 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"modid": "${id}",
"name": "${name}",
"modid": "${mod_id}",
"name": "${mod_name}",
"description": "",
"version": "${version}",
"version": "${mod_version}",
"mcversion": "1.8.9",
"url": "https://github.com/Polyfrost/PolyTime",
"updateUrl": "https://github.com/Polyfrost/PolyTime",
Expand Down

0 comments on commit 4437735

Please sign in to comment.