def __init__(self, mcedit): Dialog.__init__(self) self.mcedit = mcedit fieldOfViewRow = mceutils.FloatInputRow("Field of View: ", ref=config.settings.fov, width=100, min=25, max=120) targetFPSRow = mceutils.IntInputRow("Target FPS: ", ref=config.settings.targetFPS, width=100, min=1, max=60) bufferLimitRow = mceutils.IntInputRow("Vertex Buffer Limit (MB): ", ref=config.settings.vertexBufferLimit, width=100, min=0) fastLeavesRow = mceutils.CheckBoxLabel("Fast Leaves", ref=config.settings.fastLeaves, tooltipText="Leaves are solid, like Minecraft's 'Fast' graphics") roughGraphicsRow = mceutils.CheckBoxLabel("Rough Graphics", ref=config.settings.roughGraphics, tooltipText="All blocks are drawn the same way (overrides 'Fast Leaves')") enableMouseLagRow = mceutils.CheckBoxLabel("Enable Mouse Lag", ref=config.settings.enableMouseLag, tooltipText="Enable choppy mouse movement for faster loading.") packs = resource_packs.packs.get_available_resource_packs() packs.remove('Default') packs.sort() packs.insert(0, 'Default') self.resourcePackButton = mceutils.ChoiceButton(packs, choose=self.change_texture) self.resourcePackButton.selectedChoice = resource_packs.packs.get_selected_resource_pack_name() settingsColumn = albow.Column((fastLeavesRow, roughGraphicsRow, enableMouseLagRow, # texturePackRow, fieldOfViewRow, targetFPSRow, bufferLimitRow, self.resourcePackButton, ), align='r') settingsColumn = albow.Column((albow.Label("Settings"), settingsColumn)) settingsRow = albow.Row((settingsColumn,)) optionsColumn = albow.Column((settingsRow, albow.Button("OK", action=self.dismiss))) self.add(optionsColumn) self.shrink_wrap()
def initComponents(self): """Initilize the window components. Call this after translation hs been loaded.""" autoBrakeRow = mceutils.CheckBoxLabel("Autobrake", ref=config.controls.autobrake, tooltipText="Apply brake when not pressing movement keys") swapAxesRow = mceutils.CheckBoxLabel("Swap Axes Looking Down", ref=config.controls.swapAxes, tooltipText="Change the direction of the Forward and Backward keys when looking down") cameraAccelRow = mceutils.FloatInputRow("Camera Acceleration: ", ref=config.controls.cameraAccel, width=100, min=5.0) cameraDragRow = mceutils.FloatInputRow("Camera Drag: ", ref=config.controls.cameraDrag, width=100, min=1.0) cameraMaxSpeedRow = mceutils.FloatInputRow("Camera Max Speed: ", ref=config.controls.cameraMaxSpeed, width=100, min=1.0) cameraBrakeSpeedRow = mceutils.FloatInputRow("Camera Braking Speed: ", ref=config.controls.cameraBrakingSpeed, width=100, min=1.0) mouseSpeedRow = mceutils.FloatInputRow("Mouse Speed: ", ref=config.controls.mouseSpeed, width=100, min=0.1, max=20.0) undoLimitRow = mceutils.IntInputRow("Undo Limit: ", ref=config.settings.undoLimit, width=100, min=0) maxCopiesRow = mceutils.IntInputRow("Copy Stack Size: ", ref=config.settings.maxCopies, width=100, min=0, tooltipText="Maximum number of copied objects.") compassSizeRow = mceutils.IntInputRow("Compass Size (%): ", ref=config.settings.compassSize, width=100, min=0, max=100) # FONT SIZE fontProportion = mceutils.IntInputRow("Fonts Proportion (%): ", ref=config.settings.fontProportion, width=100, min=0, tooltipText="Fonts sizing proportion. The number is a percentage.\nRestart needed!") albow.resource.font_proportion = config.settings.fontProportion.get() invertRow = mceutils.CheckBoxLabel("Invert Mouse", ref=config.controls.invertMousePitch, tooltipText="Reverse the up and down motion of the mouse.") spaceHeightRow = mceutils.IntInputRow(_("Low Detail Height"), ref=config.settings.spaceHeight, tooltipText="When you are this far above the top of the world, move fast and use low-detail mode.") blockBufferRow = mceutils.IntInputRow("Block Buffer (MB):", ref=albow.AttrRef(self, 'blockBuffer'), min=1, tooltipText="Amount of memory used for temporary storage. When more than this is needed, the disk is used instead.") setWindowPlacementRow = mceutils.CheckBoxLabel("Set Window Placement", ref=config.settings.setWindowPlacement, tooltipText="Try to save and restore the window position.") rotateBlockBrushRow = mceutils.CheckBoxLabel("Rotate block with brush", ref=config.settings.rotateBlockBrush, tooltipText="When rotating your brush, also rotate the orientation of the block your brushing with") compassToggleRow =mceutils.CheckBoxLabel("Toggle compass", ref=config.settings.compassToggle) windowSizeRow = mceutils.CheckBoxLabel("Window Resize Alert", ref=config.settings.shouldResizeAlert, tooltipText="Reminds you that the cursor won't work correctly after resizing the window.") superSecretSettingsRow = mceutils.CheckBoxLabel("Super Secret Settings", ref=config.settings.superSecretSettings, tooltipText="Weird stuff happen!") longDistanceRow = mceutils.CheckBoxLabel("Long-Distance Mode", ref=config.settings.longDistanceMode, tooltipText="Always target the farthest block under the cursor, even in mouselook mode.") flyModeRow = mceutils.CheckBoxLabel("Fly Mode", ref=config.settings.flyMode, tooltipText="Moving forward and Backward will not change your altitude in Fly Mode.") lng = config.settings.langCode.get() langs = sorted(self.getLanguageChoices().items()) langNames = [k for k, v in langs] self.languageButton = mceutils.ChoiceButton(langNames, choose=self.changeLanguage) if self.sgnal[lng] in self.languageButton.choices: self.languageButton.selectedChoice = self.sgnal[lng] langButtonRow = albow.Row((albow.Label("Language", tooltipText="Choose your language."), self.languageButton)) staticCommandsNudgeRow = mceutils.CheckBoxLabel("Static Coords While Nudging", ref=config.settings.staticCommandsNudge, tooltipText="Change static coordinates in command blocks while nudging.") moveSpawnerPosNudgeRow = mceutils.CheckBoxLabel("Change Spawners While Nudging", ref=config.settings.moveSpawnerPosNudge, tooltipText="Change the position of the mobs in spawners while nudging.") self.goPortableButton = goPortableButton = albow.Button("Change", action=self.togglePortable) goPortableButton.tooltipText = self.portableButtonTooltip() goPortableRow = albow.Row( (albow.ValueDisplay(ref=self.portableVar, width=250, align='r'), goPortableButton)) # Disabled Crash Reporting Option # reportRow = mceutils.CheckBoxLabel("Report Errors", # ref=config.settings.reportCrashes, # tooltipText="Automatically report errors to the developer.") inputs = ( spaceHeightRow, cameraAccelRow, cameraDragRow, cameraMaxSpeedRow, cameraBrakeSpeedRow, blockBufferRow, mouseSpeedRow, undoLimitRow, maxCopiesRow, compassSizeRow, fontProportion, # FONT SIZE ) options = ( longDistanceRow, flyModeRow, autoBrakeRow, swapAxesRow, invertRow, superSecretSettingsRow, staticCommandsNudgeRow, moveSpawnerPosNudgeRow, rotateBlockBrushRow, compassToggleRow, langButtonRow, ) + ( ((sys.platform == "win32" and pygame.version.vernum == (1, 9, 1)) and (windowSizeRow,) or ()) ) + ( (sys.platform == "win32") and (setWindowPlacementRow,) or () ) + ( (not sys.platform == "darwin") and (goPortableRow,) or () ) rightcol = albow.Column(options, align='r') leftcol = albow.Column(inputs, align='r') optionsColumn = albow.Column((albow.Label("Options"), albow.Row((leftcol, rightcol), align="t"))) settingsRow = albow.Row((optionsColumn,)) buttonsRow = albow.Row((albow.Button("OK", action=self.dismiss), albow.Button("Cancel", action=self.cancel))) resetToDefaultRow = albow.Row((albow.Button("Reset to default", action=self.resetDefault),)) optionsColumn = albow.Column((settingsRow, buttonsRow, resetToDefaultRow)) optionsColumn.key_down = self.key_down self.add(optionsColumn) self.shrink_wrap()