From c9aee27e75fa97925e6dbbd0d2bafef663e33485 Mon Sep 17 00:00:00 2001 From: Leon Linhart Date: Tue, 24 Oct 2023 21:46:41 +0200 Subject: [PATCH] fix: fix FoV casing --- .../com/gw2tb/apigen/internal/spec/MumbleLink.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/gw2tb/apigen/internal/spec/MumbleLink.kt b/src/main/kotlin/com/gw2tb/apigen/internal/spec/MumbleLink.kt index f9cb40cc..d397b754 100644 --- a/src/main/kotlin/com/gw2tb/apigen/internal/spec/MumbleLink.kt +++ b/src/main/kotlin/com/gw2tb/apigen/internal/spec/MumbleLink.kt @@ -28,11 +28,9 @@ 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, @@ -40,12 +38,17 @@ internal val MUMBLE_IDENTITY by lazy { 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.", @@ -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") ) )