Quellcode durchsuchen

Merge branch 'fix-scene1-scene2-picture-not-display'

faterhenry vor 6 Jahren
Ursprung
Commit
391568b4e1

+ 1 - 1
src/main/java/com/bomostory/sceneeditmodule/ChooseThemeActivity.kt

@@ -52,7 +52,7 @@ class ChooseThemeActivity : AppCompatActivity() {
                     }
                     resourceObjectPath = java.util.ArrayList<String>().apply {
                         otherThemes.themes[i].themeAssetIndex.contains.obj.values.forEach {
-                            val path = "${otherThemes.themes[i].assetFolder.path}/${"asset"}/${it.smallFile}"
+                            val path = "${otherThemes.themes[i].assetFolder.path}/${"asset"}/${it.largeFile}"
                             add(path)
                         }
                     }

+ 19 - 3
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -165,19 +165,35 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     }
 
     private fun initResource(){
-        resourceThemeBitmap = project.sceneResource as ArrayList<String>
+        resourceThemeBitmap = ArrayList<String>().apply {
+            project.themeAssetIndex.contains.scene.values.forEach {
+                val path = "${project.assetFolder.path}/${it.largeFile}"
+                add(path)
+            }
+        }
         if (!resourceThemeBitmap.contains(File(Config.ASSETS_FOLDER, Config.PROJECT_WHITE_FILE_NAME).path)){
             resourceThemeBitmap.add(File(Config.ASSETS_FOLDER, Config.PROJECT_WHITE_FILE_NAME).path)
         }
         resourceActorBitmap = when(intent.getStringExtra("resource_actor")) {
-            null -> { project.actorResource as ArrayList<ArrayList<String>>}
+            null -> {
+                ArrayList<ArrayList<String>>().apply {
+                    project.themeAssetIndex.contains.actor.forEach {
+                        add(ArrayList<String>().apply {
+                            it.value.values.forEach {
+                                val path = "${project.assetFolder.path}/${it.smallFile}"
+                                add(path)
+                            }
+                        })
+                    }
+                }
+            }
             else -> { Gson().fromJson<ThemeActorResource>(intent.getStringExtra("resource_actor"), ThemeActorResource::class.java).actorPath}
         }
         resourceObjectPath = when(intent.getStringArrayListExtra("resource_object")) {
             null -> {
                 ArrayList<String>().apply {
                     project.themeAssetIndex.contains.obj.values.forEach {
-                        val path = "${project.assetFolder.path}/${it.smallFile}"
+                        val path = "${project.assetFolder.path}/${it.largeFile}"
                         add(path)
                     }
                 }