NewSceneTool.js 946 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * NewSceneTool.js
  3. *
  4. * @author realor
  5. */
  6. import { Tool } from './Tool.js'
  7. import { ConfirmDialog } from '../ui/ConfirmDialog.js'
  8. class NewSceneTool extends Tool {
  9. constructor(application, options) {
  10. super(application)
  11. this.name = 'new_scene'
  12. this.label = 'tool.new_scene.label'
  13. this.help = 'tool.new_scene.help'
  14. this.className = 'new_scene'
  15. this.immediate = true
  16. this.setOptions(options)
  17. }
  18. execute() {
  19. const application = this.application
  20. ConfirmDialog.create('tool.new_scene.label', 'question.create_new_scene')
  21. .setI18N(application.i18n)
  22. .setAcceptLabel('button.yes')
  23. .setCancelLabel('button.no')
  24. .setAction(() => {
  25. application.initScene()
  26. application.useTool(null)
  27. })
  28. .show()
  29. }
  30. }
  31. export { NewSceneTool }