Resolved #2794 - Save games and maps cannot have slashes/backslashes, to avoid foldername/filename confusion

This commit is contained in:
Yair Morgenstern 2020-07-03 16:01:09 +03:00
parent 329cad660e
commit 0271fdead2
2 changed files with 12 additions and 12 deletions

View File

@ -24,6 +24,7 @@ class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorS
private val mapNameEditor: TextField = TextField(mapEditorScreen.mapName, skin) private val mapNameEditor: TextField = TextField(mapEditorScreen.mapName, skin)
init { init {
mapNameEditor.textFieldFilter = TextField.TextFieldFilter { _, char -> char != '\\' && char != '/' }
add(mapNameEditor).fillX().row() add(mapNameEditor).fillX().row()
mapNameEditor.selectAll() mapNameEditor.selectAll()
mapNameEditor.maxLength = 240 // A few under max for most filesystems mapNameEditor.maxLength = 240 // A few under max for most filesystems

View File

@ -22,6 +22,7 @@ class SaveGameScreen : PickerScreen() {
init { init {
setDefaultCloseAction() setDefaultCloseAction()
textField.textFieldFilter = TextField.TextFieldFilter { _, char -> char != '\\' && char != '/' }
currentSaves.add("Current saves".toLabel()).row() currentSaves.add("Current saves".toLabel()).row()
updateShownSaves(false) updateShownSaves(false)
topTable.add(ScrollPane(currentSaves)).height(stage.height * 2 / 3) topTable.add(ScrollPane(currentSaves)).height(stage.height * 2 / 3)
@ -78,5 +79,3 @@ class SaveGameScreen : PickerScreen() {
} }
} }