no message

This commit is contained in:
minjaesong
2017-06-19 00:07:29 +09:00
parent 53f44f498c
commit 31c1adcee4

View File

@@ -260,31 +260,33 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
sheets = sheetsPack.toTypedArray()
}
private var localeBuffer = ""
fun reload(locale: String) {
if (locale.startsWith("ru")) {
if (!localeBuffer.startsWith("ru") && locale.startsWith("ru")) {
val pixmap = Pixmap(Gdx.files.internal(fontParentDir + fileList[SHEET_CYRILIC_VARW]))
val texture = Texture(pixmap)
sheets[SHEET_CYRILIC_VARW].dispose()
sheets[SHEET_CYRILIC_VARW] = TextureRegionPack(texture, W_VAR_INIT, H, HGAP_VAR, 0)
pixmap.dispose()
}
else if (locale.startsWith("bg")) {
else if (!localeBuffer.startsWith("bg") && locale.startsWith("bg")) {
val pixmap = Pixmap(Gdx.files.internal(fontParentDir + cyrilic_bg))
val texture = Texture(pixmap)
sheets[SHEET_CYRILIC_VARW].dispose()
sheets[SHEET_CYRILIC_VARW] = TextureRegionPack(texture, W_VAR_INIT, H, HGAP_VAR, 0)
pixmap.dispose()
}
else if (locale.startsWith("sr")) {
else if (!localeBuffer.startsWith("sr") && locale.startsWith("sr")) {
val pixmap = Pixmap(Gdx.files.internal(fontParentDir + cyrilic_sr))
val texture = Texture(pixmap)
sheets[SHEET_CYRILIC_VARW].dispose()
sheets[SHEET_CYRILIC_VARW] = TextureRegionPack(texture, W_VAR_INIT, H, HGAP_VAR, 0)
pixmap.dispose()
}
}
localeBuffer = locale
}
override fun getLineHeight(): Float = H.toFloat()