creates chatoverlay
All checks were successful
CI / deploy (push) Successful in 4m25s
CI / deploy (pull_request) Successful in 4m28s

This commit is contained in:
2025-02-12 15:48:24 +01:00
parent dd1497c432
commit 1eae3a8bbf
9 changed files with 294 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
package de.arindy.dicetower
import io.quarkus.qute.TemplateInstance
import jakarta.ws.rs.GET
import jakarta.ws.rs.Path
import jakarta.ws.rs.PathParam
import jakarta.ws.rs.Produces
import jakarta.ws.rs.QueryParam
import jakarta.ws.rs.core.MediaType
@Path("chatoverlay")
class ChatOverlayResource {
@GET
@Path("/{channel}")
@Produces(MediaType.TEXT_HTML)
fun get(
@PathParam("channel") channel: String,
@QueryParam("scale") scale: Int? = 7,
@QueryParam("maxDice") maxDice: Int? = 20,
@QueryParam("modsAllowed") modsAllowed: Boolean = false,
@QueryParam("vipAllowed") vipAllowed: Boolean = false,
@QueryParam("subsAllowed") subsAllowed: Boolean = false,
@QueryParam("cmd") cmd: String? = "roll",
@QueryParam("theme") theme: String? = "default",
@QueryParam("themeColor") themeColor: String? = "default",
@QueryParam("clearAfter") clearAfter: Long? = -1,
@QueryParam("timeout") timeout: Long? = -1
): TemplateInstance {
return Templates.chatoverlay(channel, scale ?: 7, maxDice ?: 20, modsAllowed, vipAllowed, subsAllowed, cmd ?: "roll", theme ?: "default", themeColor ?: "ff0202", clearAfter ?: 10, timeout ?: 60)
}
@GET
@Produces(MediaType.TEXT_HTML)
fun config(
): TemplateInstance {
return Templates.chatoverlayconfig()
}
}

View File

@@ -7,8 +7,28 @@ import io.quarkus.qute.TemplateInstance
object Templates {
@JvmStatic
external fun overlay(diceid: String, scale: Int?, clearAfter: Long?): TemplateInstance
@JvmStatic
external fun results(room: String, name: String?, user: String?): TemplateInstance
@JvmStatic
external fun index(version: String): TemplateInstance
@JvmStatic
external fun chatoverlayconfig(): TemplateInstance
@JvmStatic
external fun chatoverlay(
channel: String,
scale: Int?,
maxDice: Int?,
modsAllowed: Boolean,
vipAllowed: Boolean,
subsAllowed: Boolean,
cmd: String?,
theme: String?,
themeColor: String?,
clearAfter: Long?,
timeout: Long?
): TemplateInstance
}