mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 14:57:58 +07:00
Removed empty translations (very bad for people who play the game in that language)
Added a way to copy game info directly from files, and also a popup when encountering a certain error, for debugging purposes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,7 @@ import com.unciv.models.gamebasics.GameBasics
|
|||||||
import com.unciv.models.gamebasics.tech.Technology
|
import com.unciv.models.gamebasics.tech.Technology
|
||||||
import com.unciv.models.gamebasics.tr
|
import com.unciv.models.gamebasics.tr
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
|
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.HashSet
|
import kotlin.collections.HashSet
|
||||||
|
|
||||||
@ -69,7 +70,16 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
|||||||
|
|
||||||
techNameToButton[tech.name] = techButton
|
techNameToButton[tech.name] = techButton
|
||||||
techButton.onClick {
|
techButton.onClick {
|
||||||
selectTechnology(tech)
|
try {
|
||||||
|
selectTechnology(tech)
|
||||||
|
}catch (ex:Exception){
|
||||||
|
val popup = PopupTable(this)
|
||||||
|
popup.addGoodSizedLabel("You've encountered an error that I've been trying to pin down for a while.")
|
||||||
|
popup.addGoodSizedLabel("If you could copy your game data (menu-save game-copy to clipboard - paste into an email to yairm210@hotmail.com)")
|
||||||
|
popup.addGoodSizedLabel("That would be really helpful to me, thanks!")
|
||||||
|
popup.addGoodSizedLabel("If you also add what tech you clicked on to get this error that would be even better!")
|
||||||
|
popup.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
topTable.add(techButton)
|
topTable.add(techButton)
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import java.util.*
|
|||||||
|
|
||||||
class LoadScreen : PickerScreen() {
|
class LoadScreen : PickerScreen() {
|
||||||
lateinit var selectedSave:String
|
lateinit var selectedSave:String
|
||||||
|
val copySavedGameToClipboardButton = TextButton("Copy saved game to clipboard",skin)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setDefaultCloseAction()
|
setDefaultCloseAction()
|
||||||
@ -36,7 +37,7 @@ class LoadScreen : PickerScreen() {
|
|||||||
val textButton = TextButton(save,skin)
|
val textButton = TextButton(save,skin)
|
||||||
textButton.onClick {
|
textButton.onClick {
|
||||||
selectedSave=save
|
selectedSave=save
|
||||||
|
copySavedGameToClipboardButton.enable()
|
||||||
var textToSet = save
|
var textToSet = save
|
||||||
|
|
||||||
val savedAt = Date(GameSaver().getSave(save).lastModified())
|
val savedAt = Date(GameSaver().getSave(save).lastModified())
|
||||||
@ -59,8 +60,10 @@ class LoadScreen : PickerScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val rightSideTable = Table()
|
val rightSideTable = Table()
|
||||||
val loadFromClipboardButton = TextButton("Load copied data".tr(),skin)
|
|
||||||
val errorLabel = "".toLabel().setFontColor(Color.RED)
|
val errorLabel = "".toLabel().setFontColor(Color.RED)
|
||||||
|
|
||||||
|
val loadFromClipboardButton = TextButton("Load copied data".tr(),skin)
|
||||||
loadFromClipboardButton.onClick {
|
loadFromClipboardButton.onClick {
|
||||||
try{
|
try{
|
||||||
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
||||||
@ -75,7 +78,16 @@ class LoadScreen : PickerScreen() {
|
|||||||
|
|
||||||
rightSideTable.add(loadFromClipboardButton).row()
|
rightSideTable.add(loadFromClipboardButton).row()
|
||||||
rightSideTable.add(errorLabel).row()
|
rightSideTable.add(errorLabel).row()
|
||||||
rightSideTable.add(deleteSaveButton)
|
rightSideTable.add(deleteSaveButton).row()
|
||||||
|
|
||||||
|
copySavedGameToClipboardButton.disable()
|
||||||
|
copySavedGameToClipboardButton.onClick {
|
||||||
|
val gameText = GameSaver().getSave(selectedSave).readString()
|
||||||
|
val gzippedGameText = Gzip.zip(gameText)
|
||||||
|
Gdx.app.clipboard.contents = gzippedGameText
|
||||||
|
}
|
||||||
|
rightSideTable.add(copySavedGameToClipboardButton)
|
||||||
|
|
||||||
topTable.add(rightSideTable)
|
topTable.add(rightSideTable)
|
||||||
|
|
||||||
rightSideButton.onClick {
|
rightSideButton.onClick {
|
||||||
|
Reference in New Issue
Block a user