Can no longer see other players' IDs in a multiplayer game through the new game screen

Moved the building mod check to all mods, not only ruleset mods
This commit is contained in:
Yair Morgenstern 2020-11-02 23:00:45 +02:00
parent d42b93c705
commit f957dee357
6 changed files with 22 additions and 18 deletions

View File

@ -6,10 +6,12 @@ AI can no longer raze capital cities
Stats unique can no longer crash badly defined mods Stats unique can no longer crash badly defined mods
Added mod check for unit promotions and upgrades Added mod check for unit promotions and upgrades, and building costs
"Unable to capture cities" unique prevents the unit from conquering/capturing a city - By givehub99 "Unable to capture cities" unique prevents the unit from conquering/capturing a city - By givehub99
Translation updates
## 3.11.8 ## 3.11.8
Improved performance, especially in the City screen Improved performance, especially in the City screen

View File

@ -228,6 +228,11 @@ class Ruleset {
} }
} }
for(building in buildings.values){
if (building.requiredTech == null && building.cost == 0)
lines += "${building.name} must either have an explicit cost or reference an existing tech!"
}
if (!modOptions.isBaseRuleset) return lines.joinToString("\n") if (!modOptions.isBaseRuleset) return lines.joinToString("\n")
@ -256,8 +261,6 @@ class Ruleset {
lines += "${building.name} requires resource ${building.requiredResource} which does not exist!" lines += "${building.name} requires resource ${building.requiredResource} which does not exist!"
if (building.replaces != null && !buildings.containsKey(building.replaces!!)) if (building.replaces != null && !buildings.containsKey(building.replaces!!))
lines += "${building.name} replaces ${building.replaces} which does not exist!" lines += "${building.name} replaces ${building.replaces} which does not exist!"
if (building.requiredTech == null && building.cost == 0)
lines += "${building.name} must either have an explicit cost or reference an existing tech!"
} }
for (resource in tileResources.values) { for (resource in tileResources.values) {

View File

@ -13,16 +13,16 @@ class MutableInt(var value: Int = 0) {
} }
fun formatDuration(d: Duration): String { fun formatDuration(d: Duration): String {
var d = d var newDuration = d
val days = d.toDays() val days = newDuration.toDays()
d = d.minusDays(days) newDuration = newDuration.minusDays(days)
val hours = d.toHours() val hours = newDuration.toHours()
d = d.minusHours(hours) newDuration = newDuration.minusHours(hours)
val minutes = d.toMinutes() val minutes = newDuration.toMinutes()
d = d.minusMinutes(minutes) newDuration = newDuration.minusMinutes(minutes)
val seconds = d.seconds val seconds = newDuration.seconds
d = d.minusSeconds(seconds) newDuration = newDuration.minusSeconds(seconds)
val millis = d.toMillis() val millis = newDuration.toMillis()
return (if (days == 0L) "" else "$days"+"d ") + return (if (days == 0L) "" else "$days"+"d ") +
(if (hours == 0L) "" else "$hours"+"h ") + (if (hours == 0L) "" else "$hours"+"h ") +
(if (minutes == 0L) "" else "$minutes"+"m ") + (if (minutes == 0L) "" else "$minutes"+"m ") +

View File

@ -83,10 +83,6 @@ object TranslationFileWriter {
val existingTranslationKeys = HashSet<String>() val existingTranslationKeys = HashSet<String>()
for (line in linesFromTemplates) { for (line in linesFromTemplates) {
if(line.contains("G&K")) {
val x = line.length
}
if (!line.contains(" = ")) { if (!line.contains(" = ")) {
// small hack to insert empty lines // small hack to insert empty lines
if (line.startsWith(specialNewLineCode)) { if (line.startsWith(specialNewLineCode)) {

View File

@ -18,7 +18,7 @@ class SpecialistAllocationTable(val cityScreen: CityScreen): Table(CameraStageBa
continue continue
val newSpecialists = cityInfo.population.getNewSpecialists() val newSpecialists = cityInfo.population.getNewSpecialists()
val assignedSpecialists = newSpecialists[specialistName]!! val assignedSpecialists = newSpecialists[specialistName]!!
val maxSpecialists = cityInfo.population.getMaxSpecialists()[specialistName]!! val maxSpecialists = amount
if (cityScreen.canChangeState) add(getUnassignButton(assignedSpecialists, specialistName)) if (cityScreen.canChangeState) add(getUnassignButton(assignedSpecialists, specialistName))
add(getAllocationTable(assignedSpecialists, maxSpecialists, specialistName)).pad(10f) add(getAllocationTable(assignedSpecialists, maxSpecialists, specialistName)).pad(10f)

View File

@ -44,6 +44,9 @@ class PlayerPickerTable(val previousScreen: IPreviousScreen, var gameParameters:
var noRandom = false var noRandom = false
init { init {
for (player in gameParameters.players)
player.playerId = "" // This is to stop people from getting other users' IDs and cheating with them in multiplayer games
top() top()
add("Civilizations".toLabel(fontSize = 24)).padBottom(20f).row() add("Civilizations".toLabel(fontSize = 24)).padBottom(20f).row()
add(ScrollPane(playerListTable).apply { setOverscroll(false, false) }).width(civBlocksWidth) add(ScrollPane(playerListTable).apply { setOverscroll(false, false) }).width(civBlocksWidth)