Fixed silly regex bug which works differently on desktop and android

This commit is contained in:
Yair Morgenstern 2018-06-19 20:01:49 +03:00
parent 7c26daaed2
commit 3f87cfa3db
4 changed files with 5 additions and 6 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 86
versionName "2.5.2"
versionCode 87
versionName "2.5.3"
}
buildTypes {
release {

View File

@ -32,7 +32,7 @@ class GameSettings : LinkedHashMap<String, String>() {
var resolution:String
get() {
if(this.containsKey("Resolution")) return get("Resolution")!!
else return "900x600"
else return "1050x700"
}
set(value) {
this["Resolution"]=value

View File

@ -130,8 +130,7 @@ fun Actor.center(parent:Stage){ centerX(parent); centerY(parent)}
fun Label.setFontColor(color:Color): Label {style=Label.LabelStyle(style).apply { fontColor=color }; return this}
fun String.tr(): String {
if(contains("{")){ // sentence
var toReturn = this
return Regex("\\{(.*?)}").replace(this,{matchResult -> matchResult.groups[1]!!.value.tr() })
return Regex("\\{(.*?)\\}").replace(this,{matchResult -> matchResult.groups[1]!!.value.tr() })
}
else return GameBasics.Translations.get(this,UnCivGame.Current.settings.language) // single word
}

View File

@ -44,7 +44,7 @@ class WorldScreenDisplayOptionsTable() : OptionsTable(){
val resolutionSelectBox= SelectBox<String>(CameraStageBaseScreen.skin)
val resolutionArray = com.badlogic.gdx.utils.Array<String>()
resolutionArray.addAll("900x600","1200x800","1500x1000")
resolutionArray.addAll("900x600","1050x700","1200x800","1500x1000")
resolutionSelectBox.setItems(resolutionArray)
resolutionSelectBox.selected = UnCivGame.Current.settings.resolution
add(resolutionSelectBox).pad(10f).row()