mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 22:14:05 +09:00
modmgr to actually check dependency WIP
This commit is contained in:
@@ -58,10 +58,11 @@ internal object WeatherMixer : RNGConsumer {
|
||||
init {
|
||||
weatherList = HashMap<String, ArrayList<BaseModularWeather>>()
|
||||
|
||||
|
||||
// read weather descriptions from assets/weather (modular weather)
|
||||
val weatherRawValidList = ArrayList<File>()
|
||||
val weatherRaws = ModMgr.getFiles("basegame", "weathers")
|
||||
weatherRaws.forEach {
|
||||
val weatherRaws = ModMgr.getFilesFromEveryMod("weathers")
|
||||
weatherRaws.forEach { (modname, it) ->
|
||||
if (!it.isDirectory && it.name.endsWith(".json"))
|
||||
weatherRawValidList.add(it)
|
||||
}
|
||||
@@ -79,8 +80,20 @@ internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
|
||||
// initialise
|
||||
currentWeather = weatherList[WEATHER_GENERIC]!![0]
|
||||
nextWeather = getRandomWeather(WEATHER_GENERIC)
|
||||
try {
|
||||
currentWeather = weatherList[WEATHER_GENERIC]!![0]
|
||||
nextWeather = getRandomWeather(WEATHER_GENERIC)
|
||||
}
|
||||
catch (e: NullPointerException) {
|
||||
val defaultWeather = BaseModularWeather(
|
||||
GdxColorMap(Color(0x55aaffff), Color(0xaaffffff.toInt())),
|
||||
"default",
|
||||
ArrayList<Texture>()
|
||||
)
|
||||
|
||||
currentWeather = defaultWeather
|
||||
nextWeather = defaultWeather
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user