SHARE
TWEET

Untitled

a guest May 6th, 2019 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Component_ChangeSceneFixInterpreter extends gs.Component_CommandInterpreter
  2.     ###*
  3.     * @method commandChangeScene
  4.     * @protected
  5.     ###
  6.     commandChangeScene: ->
  7.         if GameManager.inLivePreview then return
  8.         GameManager.tempSettings.skip = no
  9.  
  10.         if !@params.savePrevious
  11.             SceneManager.clear()
  12.  
  13.         scene = SceneManager.scene
  14.         if !@params.erasePictures and !@params.savePrevious
  15.             scene.removeObject(scene.pictureContainer)
  16.             for picture in scene.pictures
  17.                 ResourceManager.context.remove("#{picture.imageFolder}/#{picture.image}") if picture
  18.         if !@params.eraseTexts and !@params.savePrevious
  19.             scene.removeObject(scene.textContainer)
  20.         if !@params.eraseVideos and !@params.savePrevious
  21.             scene.removeObject(scene.videoContainer)
  22.             for video in scene.videos
  23.                 ResourceManager.context.remove("#{video.videoFolder}/#{video.video}") if video
  24.  
  25.         if @params.scene
  26.             paramScene = uid: @interpreter.stringValueOf(@params.scene.uid || @params.scene)
  27.             if @params.savePrevious
  28.                 GameManager.sceneData = uid: uid = paramScene.uid, pictures: [], texts: [], videos: []
  29.             else
  30.                 GameManager.sceneData = {
  31.                     uid: uid = paramScene.uid,
  32.                     pictures: scene.pictureContainer.subObjectsByDomain,
  33.                     texts: scene.textContainer.subObjectsByDomain,
  34.                     videos: scene.videoContainer.subObjectsByDomain
  35.                 }
  36.  
  37.             flags = @params.fieldFlags || {}
  38.             isLocked = gs.CommandFieldFlags.isLocked
  39.             newScene = new vn.Object_Scene()
  40.             if @params.savePrevious
  41.                 newScene.sceneData = uid: uid = paramScene.uid, pictures: [], texts: [], videos: [], backlog: GameManager.backlog
  42.             else
  43.                 newScene.sceneData = uid: uid = paramScene.uid, pictures: scene.pictureContainer.subObjectsByDomain, texts: scene.textContainer.subObjectsByDomain, videos: scene.videoContainer.subObjectsByDomain
  44.  
  45.             SceneManager.switchTo(newScene, @params.savePrevious, => @interpreter.isWaiting = no)
  46.         else
  47.             SceneManager.switchTo(null)
  48.  
  49.         @interpreter.isWaiting = yes
  50.        
  51. window.CommandInterpreter = Component_ChangeSceneFixInterpreter
  52. gs.Component_CommandInterpreter = Component_ChangeSceneFixInterpreter
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top