mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 04:54:05 +09:00
some organisation, Base32 password generator
This commit is contained in:
@@ -84,5 +84,7 @@ abstract class Actor(val renderOrder: RenderOrder) : Comparable<Actor>, Runnable
|
||||
*
|
||||
* @param value null if the key is deleted
|
||||
*/
|
||||
abstract fun actorValueChanged(key: String, value: Any?)
|
||||
}
|
||||
abstract @Event fun onActorValueChange(key: String, value: Any?)
|
||||
}
|
||||
|
||||
annotation class Event
|
||||
|
||||
@@ -335,8 +335,10 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
}
|
||||
|
||||
override fun keyPressed(key: Int, c: Char) {
|
||||
if (key in Key.NUM_1..Key.NUM_0) {
|
||||
actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = key - Key.NUM_1
|
||||
// quickslot (quickbar)
|
||||
val quickbarKeys = Terrarum.getConfigIntArray("keyquickbars")
|
||||
if (key in quickbarKeys) {
|
||||
actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = quickbarKeys.indexOf(key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,7 +476,7 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun actorValueChanged(key: String, value: Any?) {
|
||||
override fun onActorValueChange(key: String, value: Any?) {
|
||||
// quickslot implementation
|
||||
if (key == AVKey.__PLAYER_QUICKSLOTSEL && value != null) {
|
||||
// ONLY FOR HAND_GRIPs!!
|
||||
|
||||
@@ -13,13 +13,13 @@ class ActorValue(val actor: Actor) : KVHashMap() {
|
||||
|
||||
override fun set(key: String, value: Any) {
|
||||
super.set(key, value)
|
||||
actor.actorValueChanged(key, value) // fire the event handler
|
||||
actor.onActorValueChange(key, value) // fire the event handler
|
||||
}
|
||||
|
||||
override fun remove(key: String) {
|
||||
if (hashMap[key] != null) {
|
||||
hashMap.remove(key, hashMap[key]!!)
|
||||
actor.actorValueChanged(key, null)
|
||||
actor.onActorValueChange(key, null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1135,7 +1135,7 @@ open class ActorWithPhysics(renderOrder: RenderOrder, val immobileBody: Boolean
|
||||
}
|
||||
}
|
||||
|
||||
override fun actorValueChanged(key: String, value: Any?) {
|
||||
override fun onActorValueChange(key: String, value: Any?) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.JsonFetcher
|
||||
import net.torvald.random.Fudge3
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import com.google.gson.JsonObject
|
||||
import org.newdawn.slick.SlickException
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.JsonFetcher
|
||||
import net.torvald.terrarum.utils.JsonFetcher
|
||||
import net.torvald.random.Fudge3
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import com.google.gson.JsonObject
|
||||
import net.torvald.terrarum.gameactors.ActorValue
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.gameactors.ActorHumanoid
|
||||
import org.newdawn.slick.SlickException
|
||||
import java.io.IOException
|
||||
import java.security.SecureRandom
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.torvald.terrarum.gameactors.faction
|
||||
|
||||
import net.torvald.JsonFetcher
|
||||
import com.google.gson.JsonObject
|
||||
import net.torvald.terrarum.utils.JsonFetcher
|
||||
import net.torvald.terrarum.ModMgr
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
Reference in New Issue
Block a user