• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python mceutils.setWindowCaption函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mceutils.setWindowCaption函数的典型用法代码示例。如果您正苦于以下问题:Python setWindowCaption函数的具体用法?Python setWindowCaption怎么用?Python setWindowCaption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setWindowCaption函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: confirm

    def confirm(self):
        box = self.selectionBox()
        if None is box:
            return

        with setWindowCaption("REPLACING - "):
            self.editor.freezeStatus("Replacing %0.1f million blocks" % (float(box.volume) / 1048576.,))

            self.blockInfo = self.panel.blockButton.blockInfo

            if self.replacing:
                self.replaceBlockInfo = self.panel.replaceBlockButton.blockInfo
                if self.blockInfo.wildcard:
                    print "Wildcard replace"
                    blocksToReplace = []
                    for i in range(16):
                        blocksToReplace.append(self.editor.level.materials.blockWithID(self.blockInfo.ID, i))
                else:
                    blocksToReplace = [self.blockInfo]

                op = BlockFillOperation(self.editor, self.editor.level, self.selectionBox(), self.replaceBlockInfo,
                                        blocksToReplace, noData=self.noData)

            else:
                blocksToReplace = []
                op = BlockFillOperation(self.editor, self.editor.level, self.selectionBox(), self.blockInfo,
                                        blocksToReplace)

        self.editor.addOperation(op)

        self.editor.addUnsavedEdit()
        self.editor.invalidateBox(box)
        self.editor.toolbar.selectTool(-1)
开发者ID:BossosaurusRex,项目名称:MCEdit-Unified,代码行数:33,代码来源:fill.py


示例2: confirm

    def confirm(self, tool):
        with setWindowCaption("Applying Macro..."):
            options = []
            filters = []
            for step in sorted(self._macro_data.keys()):
                if step != "Number of steps":
                    filters.append(tool.filterModules[self._macro_data[step]["Name"]])
                    for module_input in self._macro_data[step]["Inputs"].keys():
                        if not isinstance(self._macro_data[step]["Inputs"][module_input], (str, unicode)):
                            continue
                        if not self._macro_data[step]["Inputs"][module_input].startswith("block-"):
                            continue
                        toFind = self._macro_data[step]["Inputs"][module_input][6:].split(":")
                        block = tool.editor.materials.get((toFind[0], toFind[1]))
                        self._macro_data[step]["Inputs"][module_input] = block
                    options.append(self._macro_data[step]["Inputs"])

            op = MacroOperation(tool.editor, tool.editor.level, tool.selectionBox(), filters, options)

            tool.editor.level.showProgress = showProgress

            tool.editor.addOperation(op)
            tool.editor.addUnsavedEdit()

            tool.editor.invalidateBox(tool.selectionBox())
开发者ID:gwpantazes,项目名称:MCEdit-Unified,代码行数:25,代码来源:filter.py


示例3: perform

    def perform(self, recordUndo=True):
        if self.level.saving:
            alert(_("Cannot perform action while saving is taking place"))
            return

        if recordUndo:
            self.canUndo = True
            self.undoLevel = self.extractUndo(self.level, BoundingBox(self.destPoint, self.sourceBox.size))

        blocksToCopy = None
        if not (self.copyAir and self.copyWater):
            blocksToCopy = range(pymclevel.materials.id_limit)
            if not self.copyAir:
                blocksToCopy.remove(0)
            if not self.copyWater:
                blocksToCopy.remove(8)
            if not self.copyWater:
                blocksToCopy.remove(9)

        with setWindowCaption("Copying - "):
            i = self.level.copyBlocksFromIter(
                self.sourceLevel,
                self.sourceBox,
                self.destPoint,
                blocksToCopy,
                create=True,
                biomes=self.copyBiomes,
                staticCommands=self.staticCommands,
                moveSpawnerPos=self.moveSpawnerPos,
                regenerateUUID=self.regenerateUUID,
                first=False,
            )
            showProgress(_("Copying {0:n} blocks...").format(self.sourceBox.volume), i)
开发者ID:Crayder,项目名称:MCEdit-Unified,代码行数:33,代码来源:clone.py


示例4: destroyChunks

    def destroyChunks(self, chunks=None):
        if "No" == ask("Really delete these chunks? This cannot be undone.", ("Yes", "No")):
            return
        if chunks is None:
            chunks = self.selectedChunks()
        chunks = list(chunks)

        def _destroyChunks():
            i = 0
            chunkCount = len(chunks)

            for cx, cz in chunks:
                i += 1
                yield (i, chunkCount)
                if self.editor.level.containsChunk(cx, cz):
                    try:
                        self.editor.level.deleteChunk(cx, cz)
                    except Exception as e:
                        print "Error during chunk delete: ", e

        with setWindowCaption("DELETING - "):
            showProgress("Deleting chunks...", _destroyChunks())

        self.editor.renderer.invalidateChunkMarkers()
        self.editor.renderer.discardAllChunks()
开发者ID:Iciciliser,项目名称:MCEdit-Unified,代码行数:25,代码来源:chunk.py


示例5: updateSchematic

 def updateSchematic(self):
     # extract blocks
     with setWindowCaption("COPYING - "):
         self.editor.freezeStatus("Copying to clone buffer...")
         box = self.selectionBox()
         self.level = self.editor.level.extractSchematic(box)
         self.originalLevel = self.level
         # self.level.cloneToolScaleFactor = 1.0
         self.rescaleLevel(self.scaleFactor)
         self.setupPreview()
开发者ID:Crayder,项目名称:MCEdit-Unified,代码行数:10,代码来源:clone.py


示例6: perform

    def perform(self, recordUndo=True):
        with setWindowCaption("COPYING - "):
            self.editor.freezeStatus(_("Copying %0.1f million blocks") % (float(self._dirtyBox.volume) / 1048576.,))
            if recordUndo:
                chunks = set()
                for op in self.blockCopyOps:
                    chunks.update(op.dirtyBox().chunkPositions)
                self.undoLevel = self.extractUndoChunks(self.level, chunks)

            [i.perform(False) for i in self.blockCopyOps]
            [i.perform(recordUndo) for i in self.selectionOps]
开发者ID:LaChal,项目名称:MCEdit-Unified,代码行数:11,代码来源:clone.py


示例7: relightChunks

    def relightChunks(self):

        def _relightChunks():
            for i in self.editor.level.generateLightsIter(self.selectedChunks()):
                yield i

        with setWindowCaption("RELIGHTING - "):
            showProgress(_("Lighting {0} chunks...").format(len(self.selectedChunks())),
                         _relightChunks(), cancel=True)

            self.editor.invalidateChunks(self.selectedChunks())
            self.editor.addUnsavedEdit()
开发者ID:KevinKelley,项目名称:MCEdit-Unified,代码行数:12,代码来源:chunk.py


示例8: confirm

    def confirm(self):

        with setWindowCaption("APPLYING FILTER - "):
            filterModule = self.filterModules[self.panel.filterSelect.selectedChoice]

            op = FilterOperation(self.editor, self.editor.level, self.selectionBox(), filterModule, self.panel.filterOptionsPanel.options)

            self.editor.level.showProgress = showProgress

            self.editor.addOperation(op)
            self.editor.addUnsavedEdit()

            self.editor.invalidateBox(self.selectionBox())
开发者ID:18986064,项目名称:mcedit,代码行数:13,代码来源:filter.py


示例9: createChunks

    def createChunks(self):
        panel = GeneratorPanel()
        col = [panel]
        label = Label("Create chunks using the settings above? This cannot be undone.")
        col.append(Row([Label("")]))
        col.append(label)
        col = Column(col)
        if Dialog(client=col, responses=["OK", "Cancel"]).present() == "Cancel":
            return
        chunks = self.selectedChunks()

        createChunks = panel.generate(self.editor.level, chunks)

        try:
            with setWindowCaption("CREATING - "):
                showProgress("Creating {0} chunks...".format(len(chunks)), createChunks, cancel=True)
        except Exception, e:
            traceback.print_exc()
            alert(_("Failed to start the chunk generator. {0!r}").format(e))
开发者ID:KevinKelley,项目名称:MCEdit-Unified,代码行数:19,代码来源:chunk.py


示例10: perform

    def perform(self, recordUndo=True):
        sourceBox = self.sourceBox

        if recordUndo:
            self.undoLevel = self.extractUndo(self.level, BoundingBox(self.destPoint, self.sourceBox.size))


        blocksToCopy = None
        if not (self.copyAir and self.copyWater):
            blocksToCopy = range(256)
            if not self.copyAir:
                blocksToCopy.remove(0)
            if not self.copyWater:
                blocksToCopy.remove(8)
            if not self.copyWater:
                blocksToCopy.remove(9)

        with setWindowCaption("Copying - "):
            i = self.level.copyBlocksFromIter(self.sourceLevel, self.sourceBox, self.destPoint, blocksToCopy, create=True)
            showProgress("Copying {0:n} blocks...".format(self.sourceBox.volume), i)
开发者ID:s32ialx,项目名称:mcedit,代码行数:20,代码来源:clone.py


示例11: confirm

    def confirm(self):
        destPoint = self.destPoint
        if destPoint is None:
            return

        sourceLevel = self.sourceLevel()
        sourceBox = sourceLevel.bounds

        destLevel = self.editor.level
        destVolume = BoundingBox(destPoint, sourceBox.size).volume

        op = CloneOperation(editor=self.editor,
                            sourceLevel=sourceLevel,
                            sourceBox=sourceBox,
                            originSourceBox=self.selectionBox(),
                            destLevel=destLevel,
                            destPoint=self.destPoint,
                            copyAir=self.copyAir,
                            copyWater=self.copyWater,
                            copyBiomes=self.copyBiomes,
                            repeatCount=self.repeatCount)

        self.editor.toolbar.selectTool(-1)  # deselect tool so that the clone tool's selection change doesn't update its schematic

        with setWindowCaption("COPYING - "):
            self.editor.freezeStatus("Copying %0.1f million blocks" % (float(destVolume) / 1048576.,))
            self.performWithRetry(op)

        self.editor.addUnsavedEdit()

        self.editor.addOperation(op)

        dirtyBox = op.dirtyBox()
        if dirtyBox:
            self.editor.invalidateBox(dirtyBox)
        self.editor.renderer.invalidateChunkMarkers()

        self.editor.currentOperation = None

        self.destPoint = None
        self.level = None
开发者ID:DiEvAl,项目名称:mcedit,代码行数:41,代码来源:clone.py


示例12: pruneChunks

    def pruneChunks(self):
        if "No" == ask("Save these chunks and remove the rest? This cannot be undone.", ("Yes", "No")):
            return
        self.editor.saveFile()

        def _pruneChunks():
            maxChunks = self.editor.level.chunkCount
            selectedChunks = self.selectedChunks()
            for i, cPos in enumerate(list(self.editor.level.allChunks)):
                if cPos not in selectedChunks:
                    try:
                        self.editor.level.deleteChunk(*cPos)

                    except Exception as e:
                        print "Error during chunk delete: ", e

                yield i, maxChunks

        with setWindowCaption("PRUNING - "):
            showProgress("Pruning chunks...", _pruneChunks())

        self.editor.renderer.invalidateChunkMarkers()
        self.editor.discardAllChunks()
开发者ID:Iciciliser,项目名称:MCEdit-Unified,代码行数:23,代码来源:chunk.py


示例13: _pruneChunks

        self.editor.saveFile()

        def _pruneChunks():
            maxChunks = self.editor.level.chunkCount
            selectedChunks = self.selectedChunks()
            for i, cPos in enumerate(list(self.editor.level.allChunks)):
                if cPos not in selectedChunks:
                    try:
                        self.editor.level.deleteChunk(*cPos)

                    except Exception, e:
                        print "Error during chunk delete: ", e

                yield i, maxChunks

        with setWindowCaption("PRUNING - "):
            showProgress("Pruning chunks...", _pruneChunks())

        self.editor.renderer.invalidateChunkMarkers()
        self.editor.discardAllChunks()

        # self.editor.addUnsavedEdit()

    @alertException
    def relightChunks(self):

        def _relightChunks():
            for i in self.editor.level.generateLightsIter(self.selectedChunks()):
                yield i

        with setWindowCaption("RELIGHTING - "):
开发者ID:KevinKelley,项目名称:MCEdit-Unified,代码行数:31,代码来源:chunk.py



注:本文中的mceutils.setWindowCaption函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mceutils.showProgress函数代码示例发布时间:2022-05-27
下一篇:
Python mceutils.loadPNGTexture函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap