Skip to content

Commit

Permalink
fix: fix FoV casing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrMilchmann committed Oct 24, 2023
1 parent 0e74c96 commit c9aee27
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/kotlin/com/gw2tb/apigen/internal/spec/MumbleLink.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,27 @@ import com.gw2tb.apigen.model.Optionality

@OptIn(LowLevelApiGenApi::class)
internal val MUMBLE_IDENTITY by lazy {
operator fun String.invoke(type: DeferredPrimitiveType<*>, description: String, serialName: String? = null): IRProperty {
val name = Name.derive(titleCase = this, snakeCase = serialName)

operator fun Name.invoke(type: DeferredPrimitiveType<*>, description: String, serialName: String? = null): IRProperty {
return IRProperty(
name = name,
name = this,
type = type.getFlat(),
description = description,
isDeprecated = false,
isInline = false,
isLenient = false,
isLocalized = false,
optionality = Optionality.REQUIRED,
serialName = name.toSnakeCase(),
serialName = serialName ?: this.toSnakeCase(),
since = null,
until = null
)
}

operator fun String.invoke(type: DeferredPrimitiveType<*>, description: String, serialName: String? = null): IRProperty {
val name = Name.derive(titleCase = this, snakeCase = serialName)
return name(type, description, serialName)
}

IRRecord(
name = Name.deriveFromTitleCase("MumbleLink"),
description = "The information exposed by MumbleLink's \"identity\" buffer.",
Expand All @@ -59,7 +62,7 @@ internal val MUMBLE_IDENTITY by lazy {
"TeamColorId"(INTEGER, "the ID of the current team", serialName = "team_color_id"),
"Commander"(BOOLEAN, "a flag indicating whether the player currently is commanding a squad"),
"Map"(MAP_ID, "the ID of the current map"),
"FoV"(DECIMAL, "the scaling of the FOV"),
Name("FoV")(DECIMAL, "the scaling of the FOV"),
"UISize"(INTEGER, "the selected UI size", serialName = "uisz")
)
)
Expand Down

0 comments on commit c9aee27

Please sign in to comment.