Beispiel #1
0
    def addButtonPressed(self):
        inst = ProjectController()
        defines = inst.defines

        defines.append([self.defInputBox.text(), self.valInputBox.text()])
        inst.defines = defines

        self.updateList()
Beispiel #2
0
    def removeButtonPressed(self):
        if len(self.selectedIndices) > 0:
            inst = ProjectController()
            defines = inst.defines
            defines.pop(self.selectedIndices[0])
            inst.defines = defines

            self.updateList()
Beispiel #3
0
    def updateList(self, selIdx=None):
        inst = ProjectController()

        active = SceneScriptWindowManager.getInstance().getActive()
        if active != None:
            active.editor.compileAll()
            active.editor.cursorPositionChanged(None)

        inst.setRebuildFlag()
        self.updateDefList(selIdx)
Beispiel #4
0
 def moveDownPressed(self):
     if len(self.selectedIndices) > 0:
         inst = ProjectController()
         defines = inst.defines
         origData = None
         pos = self.selectedIndices[0]
         if pos < len(defines) - 1:
             origData = defines.pop(pos)
             defines.insert(pos + 1, origData)
             inst.defines = defines
             self.updateList(pos + 1)
	def exec_(self):
		super(FundingListWindow,self).exec_()
		try:
			if self.modify : 
				w = int(self.w.text())
				h = int(self.h.text())
				proCtrl = ProjectController()
				proCtrl.screenWidth = w
				proCtrl.screenHeight = h
				proCtrl.orientation = self.orientation.isChecked()
				#proCtrl.fullscreen = self.fullscreen.isChecked()
		except Exception, e:
			pass
Beispiel #6
0
def CleanTestRun():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    inst = ProjectController()
    BUILDPATH = inst.path + "/build/"

    AssetLibraryWindow().watcherOn = False
    AssetLibraryWindow().watcher = None

    try:
        shutil.rmtree(BUILDPATH)
    except Exception, e:
        pass
Beispiel #7
0
    def GUI(self):
        self.Layout.clear()

        inst = ProjectController()

        with Layout.VBox():
            with Layout.HBox():
                self.Layout.gap(3)
                self.Layout.label("정의").setAlignment(Qt.AlignHCenter)
                self.Layout.gap(3)
                self.Layout.vline()
                self.Layout.gap(3)
                self.Layout.label("값").setAlignment(Qt.AlignHCenter)
                self.Layout.gap(3)

            self.defineList = self.Layout.listbox(self.varListFactory, [])

            with Layout.HBox():
                self.Layout.gap(1)
                self.Layout.button("△", self.moveUpPressed)
                self.Layout.gap(1)
                self.Layout.button("▽", self.moveDownPressed)
                self.Layout.gap(1)
                self.defInputBox = self.Layout.input("", None)
                self.Layout.gap(1)
                self.valInputBox = self.Layout.input("", None)
                self.Layout.gap(1)
                self.Layout.button("추가", self.addButtonPressed)
                self.Layout.gap(1)
                self.Layout.button("삭제", self.removeButtonPressed)
                self.Layout.gap(1)
Beispiel #8
0
 def removeProject(self):
     if len(self.selectedIndices) > 0:
         idx = self.selectedIndices[0].data
         if not idx in self.list.data:
             return
         btn = QtGui.QMessageBox.question(
             self, u"피니엔진",
             idx + u"(을/를) 정말로 삭제하시겠습니까?\n프로젝트 삭제는 복원이 안됩니다.",
             QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
         if btn == QtGui.QMessageBox.Yes:
             idx = self.list.data.index(idx)
             fullpath = os.path.join(Settings()["workspace"],
                                     self.list.data[idx])
             if ProjectController().path == fullpath:
                 QtGui.QMessageBox.warning(
                     self, u"피니엔진",
                     u"현재 실행 중인 프로젝트는 삭제가 불가능합니다. 엔진을 완전 종료 한 뒤 삭제해주시기바랍니다."
                 )
                 return
             try:
                 shutil.rmtree(fullpath)
                 QtGui.QMessageBox.information(self, u"피니엔진",
                                               u"성공적으로 삭제했습니다.")
             except Exception, e:
                 QtGui.QMessageBox.warning(
                     self, u"피니엔진",
                     u"프로젝트를 완전히 삭제하지 못했습니다. 프로젝트를 엑세스하고 있는 모든 프로그램을 종료 한 뒤 삭제해주세요."
                 )
             self.loadingWorkspace(Settings()["workspace"])
Beispiel #9
0
    def refreshMap(self):
        self.view.clearObj()

        self.objMap = {}
        PROJPATH = ProjectController().path
        OBJECTPATH = (PROJPATH + "/build/obj/").replace("\\", "/")
        for root, dirs, files in os.walk(OBJECTPATH, topdown=False):
            for name in files:
                fullpath = os.path.join(root, name).replace("\\", "/")
                if fullpath.find("libdef") == -1:
                    idx = fullpath.replace(OBJECTPATH + "scene/", "")

                    fp = QFile(fullpath)
                    fp.open(QIODevice.ReadOnly | QIODevice.Text)

                    fin = QTextStream(fp)
                    fin.setCodec("UTF-8")

                    obj = json.loads(fin.readAll())

                    fin = None
                    fp.close()

                    self.objMap[idx + ".lnx"] = {
                        "obj": obj,
                        "parse": self.parseObj(obj)
                    }

        ####build!
        for k, v in self.objMap.iteritems():
            self.view.addObj(k.replace(".obj", ""), v)

        self.view.arrangement()
Beispiel #10
0
	def find_icon(self):
		path,ext = QFileDialog.getOpenFileName(parent=self,caption=u"아이콘으로 사용할 이미지를 선택해주세요.",filter="JPEG (*.jpg *.jpeg);;PNG (*.png);;" )
		if path : 
			self.appIcon.setPixmap(QPixmap(path))

			t = str(time.time()).replace(".","")
			distDir = "tmp_storage/icons/"
			
			
			if os.path.isdir( os.path.dirname(distDir) ) == False :
				os.makedirs( os.path.dirname(distDir) )
			
			distPNG = ""
			while 1: 		
				t = (str(time.time())+str(random.random()*100)).replace(".","")
				distPNG = distDir + t + ".png"
				if not os.path.isfile(distPNG) : 
					break

			bpng = Image.open(path)
			png5 = bpng.resize((128, 128), Image.ANTIALIAS) 

			png5.save(distPNG)

			inst = ProjectController()
			with Settings("WINDOW_EXPORT") :
				with Settings(inst.path) :
					Settings()["iconpath"] = distPNG
Beispiel #11
0
 def newproc():
     if sys.platform == "darwin":
         proc = subprocess.Popen(["open", APPPATH],
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
     else:
         if ProjectController().fullscreen:
             proc = subprocess.Popen(
                 [APPPATH + "/pini_remote.exe", "--fullscreen"],
                 cwd=APPPATH)
         else:
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             print[APPPATH + "/pini_remote.exe",
                   "--nonfullscreen"], APPPATH
             proc = subprocess.Popen([
                 APPPATH + "/pini_remote.exe", "--nonfullscreen",
                 "-workdir " + APPPATH
             ],
                                     cwd=APPPATH)
Beispiel #12
0
def OpenLaucher(showAleart=False, discard=None):
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    result = SceneScriptWindowManager.getInstance().reset()

    if not result:
        return

    BookmarkListWindow().hide()
    SceneMapWindow(NoriterMain()).hide()
    DefineSettingWindow().hide()
    ATLEditor().hide()
    FontManager().reset()

    m = NoriterMain()
    ret = m.close()

    if ret:

        def close():
            pass

        launcher = LauncherView(m)
        launcher.onClose = close
Beispiel #13
0
def Actors():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    SceneMapWindow(NoriterMain()).show()
    SceneMapWindow(NoriterMain()).refreshMap()
Beispiel #14
0
def DefineSetting():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    DefineSettingWindow().updateList()
    DefineSettingWindow().show()
Beispiel #15
0
    def refreshData(self):
        # self.view.clearObj()

        self.objMap = {}
        PROJPATH = ProjectController().path
        OBJECTPATH = (PROJPATH + "/build/obj/").replace("\\", "/")
        for root, dirs, files in os.walk(OBJECTPATH, topdown=False):
            for name in files:
                fullpath = os.path.join(root, name).replace("\\", "/")
                if fullpath.find("libdef") == -1:
                    idx = fullpath.replace(OBJECTPATH + "scene/", "")

                    fp = QFile(fullpath)
                    fp.open(QIODevice.ReadOnly | QIODevice.Text)

                    fin = QTextStream(fp)
                    fin.setCodec("UTF-8")

                    obj = json.loads(fin.readAll())

                    fin = None
                    fp.close()

                    self.bookmarkMap[idx] = self.parseObj(obj)

        self.GUI()
Beispiel #16
0
def OpenBookmarkListWindow():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    BookmarkListWindow().show()
    BookmarkListWindow().refreshData()
Beispiel #17
0
    def afterCompileProj(failFiles, inst):
        OutputWindow().notice(u"테스트 플레이를 위한 컴파일 끝.")
        OutputWindow().notice(u"파일 복사 중.")
        msgBox.setText(u"파일 복사중...")

        dispath = user_data_dir("pini_remote", "") + "/"
        BUILDPATH = ProjectController().path + "/build/"
        BUILDPATH = BUILDPATH.replace("\\", "/")

        print BUILDPATH

        if clean:
            try:
                shutil.rmtree(dispath)
            except Exception, e:
                pass
Beispiel #18
0
def OpenExportAndroid(showAleart=False, discard=None):
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    m = NoriterMain()
    text, ok = QInputDialog.getText(m, u"새로운 루아 모듈", u"모듈이름을 적어주세요.")
    if ok and text:
        fullpath = os.path.join(inst.path, "module", text + u".lua")
        if os.path.exists(fullpath):
            QMessageBox.warning(m, u"피니엔진", u"모듈명이 중복되었습니다. 다른 이름으로 해주세요.")
            return

        fp = QFile(fullpath)
        fp.open(QIODevice.WriteOnly | QIODevice.Text)

        out = QTextStream(fp)
        out.setCodec("UTF-8")
        out.setGenerateByteOrderMark(False)
        out << u"--함수 정의 코드는 여기에 적어주세요.\n\n"
        out << u"local function m(fileName)\n"
        out << u"	--[스크립트] 매크로가 불리는 시점에 실행 될 루아 코드를 적어주세요.\n\n\n"
        out << u"end\n"

        out << u"return m\n"
        out = None
        fp.close()

        QMessageBox.information(m, u"피니엔진", u"성공적으로 생성하였습니다.")
        filePath = fullpath.encode(locale.getpreferredencoding())
        os.system('start "" "' + filePath + '"')
Beispiel #19
0
    def clear(self):
        if self.XVM == None:
            return

        projCtrl = ProjectController()
        self.RefreshBuildPath()

        self.showDialog = False

        self.lua.execute("package.loaded['FILEMANS'] = nil")
        self.lua.execute("FILES = nil")
        self.lua.execute("require('FILEMANS')")

        self.lua.execute("_G._LOG_ = {}")
        self.Logs = self.lua.globals()._LOG_

        self.lua.globals().WIN_WIDTH = projCtrl.screenWidth
        self.lua.globals().WIN_HEIGHT = projCtrl.screenHeight
        self.lua.globals().PiniLuaHelper = GraphicsProtocolObject.LuaHelper()

        self.XVM.init(self.XVM)
        self.PiniAPI.Clear(self.PiniAPI)
        self.libDef(self.XVM)
        self.PiniLib(self.XVM)
        self.Display = self.PiniAPI._regist_.Display
        self.addIndex = 1
Beispiel #20
0
	def find_header(self):
		path,ext = QFileDialog.getOpenFileName(parent=self,caption=u"인스톨러 상단 이미지를 선택해주세요.",filter="JPEG (*.jpg *.jpeg);;PNG (*.png);;" )
		if path : 
			inst = ProjectController()
			with Settings("WINDOW_EXPORT") :
				with Settings(inst.path) :
					Settings()["header"] = path
					self.headerImg.setPixmap(path)
Beispiel #21
0
	def find_uninstall_side(self):
		path,ext = QFileDialog.getOpenFileName(parent=self,caption=u"언인스톨러 좌측 이미지를 선택해주세요.",filter="JPEG (*.jpg *.jpeg);;PNG (*.png);;" )
		if path : 
			inst = ProjectController()
			with Settings("WINDOW_EXPORT") :
				with Settings(inst.path) :
					Settings()["uninstall_side"] = path
					self.uninstallSideImg.setPixmap(path)
Beispiel #22
0
	def Open(self,path):
		inst = ProjectController()
		# ProjectController().compileProj(True)
		ProjectController().compileProj()
		curDir = QDir(ProjectController().path)
		with Settings("PROJECT_USER_SETTING") :
			with Settings(inst.path) :
				#temp파일은 2번파일 최신 연 파일은 3번파일 이렇게 되면 꼬이니까 temp파일 삭제해줌.
				try:
					os.remove(os.path.join(".","tmp_save_1"))
				except Exception, e:
					pass
				try:
					os.remove(os.path.join(".","tmp_save_2"))
				except Exception, e:
					pass
				Settings()["lastSceneLoaded"] = curDir.relativeFilePath(path)
Beispiel #23
0
	def find_install_icon(self):
		path,ext = QFileDialog.getOpenFileName(parent=self,caption=u"인스톨 아이콘으로 사용할 이미지를 선택해주세요.",filter="JPEG (*.jpg *.jpeg);;PNG (*.png);;" )
		if path : 
			inst = ProjectController()
			with Settings("WINDOW_EXPORT") :
				with Settings(inst.path) :
					Settings()["install_icon"] = path
					self.installIcon.setPixmap(path)
Beispiel #24
0
    def selectProject(self, idx):
        if u"생성된 프로젝트가 없습니다." == self.list.data[idx]:
            return

        ProjectController().path = os.path.join(Settings()["workspace"],
                                                self.list.data[idx])
        ScriptGraphicsProtocol().luaInit()
        NoriterMain().show()
        self.close()
    def remove(self, idx):
        if idx in self.windows:
            self.activateQueue.remove(self.windows[idx])
            del self.windows[idx]

            if len(self.activateQueue) > 0:
                self.activateQueue[-1].editor.setFocus()
            else:
                self.active = None
                ProjectController().workerController.terminate()
Beispiel #26
0
    def updateDefList(self, selIdx=None):
        inst = ProjectController()
        lists = inst.defines
        self.defineList.data = lists

        if selIdx != None:

            def doSelectIndex():
                self.defineList.selectIndex(selIdx)

            QTimer.singleShot(1, doSelectIndex)
Beispiel #27
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)
Beispiel #28
0
	def open_README_editor(self):
		README = self.DEFAULT_README()
		inst = ProjectController()
		with Settings("WINDOW_EXPORT") :
			with Settings(inst.path) :
				if Settings()["README"] : 
					README = Settings()["README"]
		text = EditWindow(u"리드미 텍스트(README)",README,self).exec_()

		with Settings("WINDOW_EXPORT") :
			with Settings(inst.path) :
				Settings()["README"] = text
Beispiel #29
0
def CurrentScriptCursorRun():
    inst = ProjectController()
    if len(inst.path) == 0:
        return

    activeSceneScriptWindow = SceneScriptWindowManager.getInstance().getActive(
    )
    if activeSceneScriptWindow != None:
        __run__(False, True,
                activeSceneScriptWindow.editor.textCursor().blockNumber())
    else:
        TestRun()
Beispiel #30
0
	def open_EUAL_editor(self):
		EUAL = self.DEFAULT_EULA()
		inst = ProjectController()
		with Settings("WINDOW_EXPORT") :
			with Settings(inst.path) :
				if Settings()["EUAL"] : 
					EUAL = Settings()["EUAL"]
		text = EditWindow(u"최종 사용자 사용권 계약(EUAL)",EUAL,self).exec_()
		
		with Settings("WINDOW_EXPORT") :
			with Settings(inst.path) :
				Settings()["EUAL"] = text