mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 07:49:17 +07:00
Autogenerated docs wraps conditionals and doesn't give examples for non-parameter-containing uniques
This commit is contained in:
@ -30,7 +30,7 @@ internal object DesktopLauncher {
|
||||
ImagePacker.packImages()
|
||||
|
||||
val config = Lwjgl3ApplicationConfiguration()
|
||||
config.setWindowIcon( "ExtraImages/Icon.png")
|
||||
config.setWindowIcon("ExtraImages/Icon.png")
|
||||
config.setTitle("Unciv")
|
||||
config.setHdpiMode(HdpiMode.Logical)
|
||||
if (FileHandle(GameSaver.settingsFileName).exists()) {
|
||||
@ -43,15 +43,15 @@ internal object DesktopLauncher {
|
||||
|
||||
val versionFromJar = DesktopLauncher.javaClass.`package`.specificationVersion ?: "Desktop"
|
||||
|
||||
if(versionFromJar == "Desktop") {
|
||||
if (versionFromJar == "Desktop") {
|
||||
UniqueDocsWriter().write()
|
||||
}
|
||||
|
||||
val desktopParameters = UncivGameParameters(
|
||||
versionFromJar,
|
||||
cancelDiscordEvent = { discordTimer?.cancel() },
|
||||
fontImplementation = NativeFontDesktop(Fonts.ORIGINAL_FONT_SIZE.toInt()),
|
||||
customSaveLocationHelper = CustomSaveLocationHelperDesktop()
|
||||
versionFromJar,
|
||||
cancelDiscordEvent = { discordTimer?.cancel() },
|
||||
fontImplementation = NativeFontDesktop(Fonts.ORIGINAL_FONT_SIZE.toInt()),
|
||||
customSaveLocationHelper = CustomSaveLocationHelperDesktop()
|
||||
)
|
||||
|
||||
val game = UncivGame(desktopParameters)
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.unciv.app.desktop
|
||||
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
import com.unciv.models.ruleset.unique.UniqueTarget
|
||||
import com.unciv.models.ruleset.unique.UniqueType
|
||||
import java.io.File
|
||||
|
||||
@ -44,13 +45,16 @@ class UniqueDocsWriter {
|
||||
|
||||
val deprecationAnnotation = uniqueType.declaringClass.getField(uniqueType.name)
|
||||
.getAnnotation(Deprecated::class.java)
|
||||
if (deprecationAnnotation != null){
|
||||
if (deprecationAnnotation != null) {
|
||||
deprecatedUniques += uniqueType
|
||||
continue
|
||||
}
|
||||
|
||||
lines += "#### " + uniqueType.text
|
||||
lines += "Example: \"${replaceExamples(uniqueType.text)}\"\n"
|
||||
val uniqueText = if (targetType.key == UniqueTarget.Conditional) "<${uniqueType.text}>"
|
||||
else uniqueType.text
|
||||
lines += "#### $uniqueText"
|
||||
if (uniqueType.text.contains('['))
|
||||
lines += "Example: \"${replaceExamples(uniqueText)}\"\n"
|
||||
lines += "Applicable to: " + uniqueType.targetTypes.joinToString()
|
||||
lines += ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user