From 5ecd386ad486501e669c6607a11b978587474275 Mon Sep 17 00:00:00 2001 From: way-zer Date: Tue, 1 Mar 2022 18:11:13 +0800 Subject: [PATCH] =?UTF-8?q?(core)=20=E4=BF=AE=E5=A4=8D=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=BB=98=E5=9B=BE=E4=B8=ADcontent=E5=9B=BE=E6=A0=87=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/cf/wayzer/ContentsLoader.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/src/cf/wayzer/ContentsLoader.kt b/core/src/cf/wayzer/ContentsLoader.kt index da86758..4e25483 100644 --- a/core/src/cf/wayzer/ContentsLoader.kt +++ b/core/src/cf/wayzer/ContentsLoader.kt @@ -1,5 +1,6 @@ package cf.wayzer +import arc.Core import arc.Events import arc.files.Fi import arc.func.Cons @@ -8,10 +9,7 @@ import arc.struct.Seq import mindustry.Vars import mindustry.content.* import mindustry.core.ContentLoader -import mindustry.ctype.Content -import mindustry.ctype.ContentList -import mindustry.ctype.ContentType -import mindustry.ctype.MappableContent +import mindustry.ctype.* import mindustry.game.EventType import mindustry.io.SaveVersion import mindustry.logic.LExecutor @@ -207,6 +205,16 @@ object ContentsLoader : ContentLoader() { doMeasureTimeLog("Vars.schematics.load") { Vars.schematics.load() } + doMeasureTimeLog("Set UnlockableContent.iconId") { + //copy from mindustry.ui.Fonts.loadContentIcons + var lastCid = 1 + each { + if (it is UnlockableContent && Core.atlas.find(it.name + "-icon-logic").found()) { + it.iconId = lastCid + lastCid++ + } + } + } } }