From 18c837a7ed240d4706f5fe60808cad16efff4735 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 8 Oct 2020 12:21:43 +0300 Subject: [PATCH] More informative alert for tech modders --- core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index 4e751afa42..6b94615723 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -8,6 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.Constants import com.unciv.UncivGame import com.unciv.logic.civilization.CivilizationInfo +import com.unciv.logic.civilization.PopupAlert import com.unciv.logic.civilization.TechManager import com.unciv.models.UncivSound import com.unciv.models.ruleset.tech.Technology @@ -173,8 +174,10 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec lines.clear() for (tech in civInfo.gameInfo.ruleSet.technologies.values) { - if (!techNameToButton.containsKey(tech.name)) - throw Exception("tech ${tech.name} not found!") + if (!techNameToButton.containsKey(tech.name)) { + ResponsePopup("Tech [${tech.name}] appears to be missing - perhaps two techs have the same row & column", this) + continue + } val techButton = techNameToButton[tech.name]!! for (prerequisite in tech.prerequisites) { val prerequisiteButton = techNameToButton[prerequisite]!!