Пример #1
0
def PreMainScript():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    targetPath = inst.path + u"/scene/프리메인.lnx"

    if not os.path.isfile(targetPath):
        SceneListController.getInstance().New(targetPath)

    SceneListController.getInstance().Open(targetPath)
Пример #2
0
    def bookmarkSelChanged(self, idx):

        path = ProjectController(
        ).path + "/scene/" + self.tabSelected[0].replace(".obj", ".lnx")
        SceneListController.getInstance().Open(path)

        def ___():
            SceneScriptWindowManager.getInstance().getActive(
            ).editor.moveToLineNumber(self.tabSelected[1][idx]["line"])
            SceneScriptWindowManager.getInstance().getActive().editor.setFocus(
            )

        QTimer.singleShot(30, ___)
Пример #3
0
def OpenScene():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    path, ext = QFileDialog.getOpenFileName(parent=NoriterMain(),
                                            caption="Open Scene",
                                            dir=inst.sceneDirectory)
    if path.startswith(inst.sceneDirectory):
        fi = QFileInfo(path)
        if fi.suffix() == "lnx":
            SceneListController.getInstance().Open(path)
        else:
            print "can not open scene"
    else:
        print "can not open scene"
Пример #4
0
def NewScene():
    inst = ProjectController()
    if len(inst.path) == 0:
        return
    path, ext = QFileDialog.getSaveFileName(parent=NoriterMain(),
                                            caption="New Scene",
                                            dir=inst.sceneDirectory)
    if len(path) > 0:
        fi = QFileInfo(path)
        if len(fi.suffix()) == 0:
            path = path + ".lnx"
        elif fi.suffix() != "lnx":
            path = fi.path() + QDir.separator() + fi.baseName() + ".lnx"

        SceneListController.getInstance().New(path)
        SceneListController.getInstance().Open(path)
Пример #5
0
 def __init__(self):
     self.windows = {}
     self.activateQueue = []
     self.active = None
     print "9_2_2"
     self.sceneListCtrl = SceneListController.getInstance()
     print "9_2_3"
     self.sceneListCtrl.SceneOpen.connect(self.openScene)
     print "9_2_4"
Пример #6
0
    def __init__(self, parent=None):
        self.view = None
        super(SceneDocument, self).__init__(parent)

        self.sceneListCtrl = SceneListController.getInstance()
        self.sceneListCtrl.SceneOpen.connect(self.openScene)
        self.sceneListCtrl.SceneLoaded.connect(self.loadScene)

        self.sceneCtrl = None

        OutputWindow().noticed.connect(self.noticeLog)
Пример #7
0
	def step12(self):
		from view.Launcher import LauncherView
		m = NoriterMain()
		launcher = LauncherView(m)
		self.close()
		
		m.hide()

		def fileOpen(fileName):
			fp = QFile(fileName)
			fp.open(QIODevice.ReadOnly | QIODevice.Text)

			fin = QTextStream(fp)
			fin.setCodec("UTF-8")
			FILEDATA = fin.readAll()
			fin = None
			fp.close()

			return FILEDATA

		def PJOIN(*paths):
			path = []
			for v in paths:
				v = v.replace("/","\\")
				path.append(v.encode(locale.getpreferredencoding()))
			ret = os.path.join(*path).replace("/","\\")
			return ret

		tmp_path_master = PJOIN(".","tempSave","PROJ")
		if os.path.exists(tmp_path_master):
			from controller.SceneListController import SceneListController
			from view.SceneScriptWindow import SceneScriptWindowManager

			DAT = json.loads(fileOpen(tmp_path_master))

			if not os.path.exists(DAT["PROJ"]):
				print "NO BACKUP PROJECT FOUND"
				return

			launcher.close()

			ProjectController().path = DAT["PROJ"]
			PROJPATH = DAT["PROJ"]

			QMessageBox.warning(self,u"피니엔진",u"저장되지 않은 파일이 감지되었습니다. 임시파일을 불러옵니다.")
			NoriterMain().show()

			for root, dirs, files in os.walk(PJOIN(".","tempSave"), topdown=False):
				for backupFileName in files:
					if backupFileName != "PROJ":
						backupFileName = backupFileName.decode('mbcs')
						BACK = json.loads(fileOpen(PJOIN(".","tempSave",backupFileName).decode('mbcs')))
						targetFileName = backupFileName.replace(u"__!_",u"/").replace(u".tmp",u".lnx")
						relativePath = u"scene/"+targetFileName
						SceneListController.getInstance().Open(PROJPATH+"/scene/"+targetFileName)

						SceneScriptWindowManager.getInstance().windows[relativePath].editor.setPlainText(BACK["PLAIN"])
						SceneScriptWindowManager.getInstance().windows[relativePath].editor.compileAll()
						SceneScriptWindowManager.getInstance().windows[relativePath].editor.commitGraphics()

		def _Update_Updator_():
			updateThread = UpdatorUpdateThread(NoriterMain())
			updateThread.start()

		QTimer.singleShot(1500,_Update_Updator_)