|
@@ -6,6 +6,7 @@ import android.content.Context
|
|
|
import android.content.DialogInterface
|
|
|
import android.content.Intent
|
|
|
import android.graphics.Bitmap
|
|
|
+import android.graphics.Paint
|
|
|
import android.os.Bundle
|
|
|
import android.support.v7.app.AppCompatActivity
|
|
|
import android.support.v7.widget.LinearLayoutManager
|
|
@@ -206,7 +207,11 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
private fun initNavigationBarView(position: Int) {
|
|
|
project.story?.let {
|
|
|
it.scenes?.let {
|
|
|
- if (position != currentSceneIndex) {
|
|
|
+ var isSceneRecorded = when(it[currentSceneIndex].record){
|
|
|
+ null -> false
|
|
|
+ else -> true
|
|
|
+ }
|
|
|
+ if (position != currentSceneIndex && !isSceneRecorded) {
|
|
|
initNavigationFunction()
|
|
|
} else {
|
|
|
navigationBar.removeAllViews()
|
|
@@ -214,7 +219,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
navigationBar.addView(editSceneView)
|
|
|
setControlSceneView()
|
|
|
editSceneView.setOnClickDoneListener(View.OnClickListener {
|
|
|
- initNavigationFunction()
|
|
|
+ if (!isSceneRecorded) initNavigationFunction()
|
|
|
})
|
|
|
editSceneView.setOnClickStartOverListener(View.OnClickListener {
|
|
|
project.story?.let {
|
|
@@ -475,7 +480,41 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
controlSceneView.setonClickDuplicateBtn(View.OnClickListener {
|
|
|
project.story?.let {
|
|
|
it.scenes?.let {
|
|
|
- it.add(currentSceneIndex + 1, it[currentSceneIndex])
|
|
|
+ var scene = Scene().apply {
|
|
|
+ backgroundName = it[currentSceneIndex].backgroundName
|
|
|
+ backgroundPath = it[currentSceneIndex].backgroundPath
|
|
|
+ record = it[currentSceneIndex].record
|
|
|
+ sceneWidth = it[currentSceneIndex].sceneWidth
|
|
|
+ recordPath = it[currentSceneIndex].recordPath
|
|
|
+ for (layer in it[currentSceneIndex].layers) {
|
|
|
+ var newLayer = Layer()
|
|
|
+ newLayer.id = layer.id
|
|
|
+ newLayer.name = layer.name
|
|
|
+ for(actor in layer.actors) {
|
|
|
+ var newActor = Actor()
|
|
|
+ newActor.resourcePath = actor.resourcePath
|
|
|
+ newActor.positionX = actor.positionX
|
|
|
+ newActor.positionY = actor.positionY
|
|
|
+ newActor.positionZ = actor.positionZ
|
|
|
+ newActor.sideLength = actor.sideLength
|
|
|
+ newActor.sideHeight = actor.sideHeight
|
|
|
+ newActor.isSelect = actor.isSelect
|
|
|
+ newActor.parentLayerIndex = actor.parentLayerIndex
|
|
|
+ newActor.isMovable = actor.isMovable
|
|
|
+ newActor.text = actor.text
|
|
|
+ newActor.textColor = actor.textColor
|
|
|
+ newActor.textAlign = actor.textAlign
|
|
|
+ newActor.isDialogue = actor.isDialogue
|
|
|
+ newActor.isMirror = actor.isMirror
|
|
|
+ newActor.opacity = actor.opacity
|
|
|
+ newActor.dialogColor = actor.dialogColor
|
|
|
+ newActor.dialogType = actor.dialogType
|
|
|
+ newLayer.actors.add(newActor)
|
|
|
+ }
|
|
|
+ layers.add(newLayer)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ it.add(currentSceneIndex + 1, scene)
|
|
|
}
|
|
|
}
|
|
|
var sceneAdapter = controlSceneView.findViewById<RecyclerView>(R.id.scene_recycler_view).adapter as SceneAdapter
|
|
@@ -486,10 +525,11 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
for (i in 0 until it.size) {
|
|
|
onSceneSelectedArrayList.add(switchScene(i))
|
|
|
projectBitmaps.add(SceneDrawer.drawScene(this,it[i],0,200,100))
|
|
|
+ recordTimeArrayList.add(it[i].record?.period)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- sceneAdapter.update(projectBitmaps, onSceneSelectedArrayList)
|
|
|
+ sceneAdapter.update(projectBitmaps, onSceneSelectedArrayList,recordTimeArrayList)
|
|
|
})
|
|
|
val layoutManager = LinearLayoutManager(this)
|
|
|
layoutManager.orientation = LinearLayoutManager.HORIZONTAL
|
|
@@ -752,6 +792,9 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
initActorRecyclerView()
|
|
|
}
|
|
|
}
|
|
|
+ selectActorView.btn_choose_theme.setOnClickListener {
|
|
|
+ /////TFTA
|
|
|
+ }
|
|
|
viewContainer.addView(selectActorView)
|
|
|
}
|
|
|
}
|