From 31c1adcee40cc030c4e06aea177d101889f63b93 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Mon, 19 Jun 2017 00:07:29 +0900 Subject: [PATCH] no message --- terrarumsansbitmap/gdx/GameFontBase.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/terrarumsansbitmap/gdx/GameFontBase.kt b/terrarumsansbitmap/gdx/GameFontBase.kt index c539352..0b31191 100644 --- a/terrarumsansbitmap/gdx/GameFontBase.kt +++ b/terrarumsansbitmap/gdx/GameFontBase.kt @@ -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()