mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-23 21:22:39 +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:
parent
c924052a12
commit
09b1446fea
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.tr
|
||||
import com.unciv.ui.utils.*
|
||||
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||
import java.util.*
|
||||
import kotlin.collections.HashSet
|
||||
|
||||
@ -69,7 +70,16 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
||||
|
||||
techNameToButton[tech.name] = techButton
|
||||
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)
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import java.util.*
|
||||
|
||||
class LoadScreen : PickerScreen() {
|
||||
lateinit var selectedSave:String
|
||||
val copySavedGameToClipboardButton = TextButton("Copy saved game to clipboard",skin)
|
||||
|
||||
init {
|
||||
setDefaultCloseAction()
|
||||
@ -36,7 +37,7 @@ class LoadScreen : PickerScreen() {
|
||||
val textButton = TextButton(save,skin)
|
||||
textButton.onClick {
|
||||
selectedSave=save
|
||||
|
||||
copySavedGameToClipboardButton.enable()
|
||||
var textToSet = save
|
||||
|
||||
val savedAt = Date(GameSaver().getSave(save).lastModified())
|
||||
@ -59,8 +60,10 @@ class LoadScreen : PickerScreen() {
|
||||
}
|
||||
|
||||
val rightSideTable = Table()
|
||||
val loadFromClipboardButton = TextButton("Load copied data".tr(),skin)
|
||||
|
||||
val errorLabel = "".toLabel().setFontColor(Color.RED)
|
||||
|
||||
val loadFromClipboardButton = TextButton("Load copied data".tr(),skin)
|
||||
loadFromClipboardButton.onClick {
|
||||
try{
|
||||
val clipboardContentsString = Gdx.app.clipboard.contents.trim()
|
||||
@ -75,7 +78,16 @@ class LoadScreen : PickerScreen() {
|
||||
|
||||
rightSideTable.add(loadFromClipboardButton).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)
|
||||
|
||||
rightSideButton.onClick {
|
||||
|
Loading…
Reference in New Issue
Block a user