mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
new inventory design: is it good?
See work_files/inventory_nouveau_2.psd
This commit is contained in:
Binary file not shown.
@@ -747,11 +747,11 @@ fun Float.round(): Float {
|
||||
fun SpriteBatch.fillRect(x: Float, y: Float, w: Float, h: Float) {
|
||||
this.draw(Terrarum.textureWhiteSquare, x, y, w, h)
|
||||
}
|
||||
inline fun SpriteBatch.drawStraightLine(x: Float, y: Float, p2: Float, thickness: Float, isVertical: Boolean) {
|
||||
inline fun SpriteBatch.drawStraightLine(x: Float, y: Float, length: Float, thickness: Float, isVertical: Boolean) {
|
||||
if (!isVertical)
|
||||
this.fillRect(x, y, p2 - x, thickness)
|
||||
this.fillRect(x, y, length - x, thickness)
|
||||
else
|
||||
this.fillRect(x, y, thickness, p2 - y)
|
||||
this.fillRect(x, y, thickness, length - y)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ object CommandDict {
|
||||
"actorslist" to ActorsList,
|
||||
"setscale" to SetScale,
|
||||
"kill" to KillActor,
|
||||
"money" to MoneyDisp,
|
||||
|
||||
// Test codes
|
||||
"bulletintest" to SetBulletin,
|
||||
|
||||
18
src/net/torvald/terrarum/console/MoneyDisp.kt
Normal file
18
src/net/torvald/terrarum/console/MoneyDisp.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.random.HQRNG
|
||||
|
||||
object MoneyDisp : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
Echo("¤${0x3000.toChar()}${args[1]}")
|
||||
}
|
||||
else {
|
||||
Echo("¤${0x3000.toChar()}${HQRNG().nextInt(100000)}")
|
||||
}
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
Echo("Usage: money [amount] — Prints given or random amount of money")
|
||||
}
|
||||
}
|
||||
BIN
work_files/UI/inventory_nouveau_2.psd
LFS
Normal file
BIN
work_files/UI/inventory_nouveau_2.psd
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user