more postal codes

This commit is contained in:
minjaesong
2025-02-20 19:41:41 +09:00
parent 37d6d3004b
commit 8a26f328c7
6 changed files with 43 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -60,7 +60,7 @@ data class Post(
} }
data class PostContents( data class PostContents(
val type: String, // "text", "btex" val type: String, // "text"(read from LANG), "textcustom"(custom string), "btex"(always custom)
val contentsRaw: String, // plain text for "text"; xml for "btex" val contentsRaw: String, // plain text for "text"; xml for "btex"
val encryption: String = "none", // "none", "end2end" val encryption: String = "none", // "none", "end2end"
val contentsExtra: Any? = null, val contentsExtra: Any? = null,

View File

@@ -0,0 +1,37 @@
package net.torvald.terrarum.modulebasegame.gameworld
/**
* Created by minjaesong on 2025-02-16.
*/
object PostAutogenContentFactory {
operator fun invoke(type: String, args: List<Any>?): PostContents {
TODO()
}
@PostContentAutogenFunction
private fun moneyorder(args: List<Any>?): PostContents {
val UUID_SENDER = args!![0].toString()
val UUID_RECIPIENT = args!![1].toString()
val xml = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE btexdoc SYSTEM "btexdoc.dtd">
<btexdoc cover="post" inner="post" papersize="post">
<cover hue="210">
<title><v fromgame="POSTAL_TITLE_MONEY_ORDER"/></title>
<postsender>${UUID_SENDER}</postsender>
<postrecipient>${UUID_RECIPIENT}</postrecipient>
</cover>
<manuscript>
<v fromgame="POSTAL_CONTENT_MONEY_ORDER"/>
</manuscript>
</btexdoc>
""".trimIndent()
return PostContents("btex", xml)
}
}
annotation class PostContentAutogenFunction

View File

@@ -57,7 +57,7 @@ class UIRedeemCodeMachine : UICanvas(
private val thisOffsetX = UIInventoryFull.INVENTORY_CELLS_OFFSET_X() + UIItemInventoryElemSimple.height + UIItemInventoryItemGrid.listGap - halfSlotOffset private val thisOffsetX = UIInventoryFull.INVENTORY_CELLS_OFFSET_X() + UIItemInventoryElemSimple.height + UIItemInventoryItemGrid.listGap - halfSlotOffset
private val yEnd = -UIInventoryFull.YPOS_CORRECTION + (App.scr.height + UIInventoryFull.internalHeight).div(2).toFloat() private val yEnd = -UIInventoryFull.YPOS_CORRECTION + (App.scr.height + UIInventoryFull.internalHeight).div(2).toFloat()
private val alphnums = (('0'..'9') + ('a'..'z') + ('A'..'Z')).map { "$it" }.toHashSet() private val alphnums = (('0'..'9') + ('a'..'z') + ('A'..'Z') + '@').map { "$it" }.toHashSet()
override fun inputStrobed(e: TerrarumKeyboardEvent) { override fun inputStrobed(e: TerrarumKeyboardEvent) {
super.inputStrobed(e) super.inputStrobed(e)