public EditPistonDialog(int data, Action <int> handler) { XElement node = ContentManager.Get <XElement>("Dialogs/EditPistonDialog"); LoadContents(this, node); m_title = Children.Find <LabelWidget>("EditPistonDialog.Title"); m_slider1 = Children.Find <SliderWidget>("EditPistonDialog.Slider1"); m_panel2 = Children.Find <ContainerWidget>("EditPistonDialog.Panel2"); m_slider2 = Children.Find <SliderWidget>("EditPistonDialog.Slider2"); m_slider3 = Children.Find <SliderWidget>("EditPistonDialog.Slider3"); m_okButton = Children.Find <ButtonWidget>("EditPistonDialog.OK"); m_cancelButton = Children.Find <ButtonWidget>("EditPistonDialog.Cancel"); m_handler = handler; m_data = data; m_mode = PistonBlock.GetMode(data); m_maxExtension = PistonBlock.GetMaxExtension(data); m_pullCount = PistonBlock.GetPullCount(data); m_speed = PistonBlock.GetSpeed(data); m_title.Text = "Edit " + BlocksManager.Blocks[237].GetDisplayName(null, Terrain.MakeBlockValue(237, 0, data)); m_slider1.Granularity = 1f; m_slider1.MinValue = 1f; m_slider1.MaxValue = 8f; m_slider2.Granularity = 1f; m_slider2.MinValue = 1f; m_slider2.MaxValue = 8f; m_slider3.Granularity = 1f; m_slider3.MinValue = 0f; m_slider3.MaxValue = 3f; m_panel2.IsVisible = (m_mode != PistonMode.Pushing); UpdateControls(); }
public SettingsAudioScreen() { XElement node = ContentManager.Get <XElement>("Screens/SettingsAudioScreen"); LoadContents(this, node); m_soundsVolumeSlider = Children.Find <SliderWidget>("SoundsVolumeSlider"); m_musicVolumeSlider = Children.Find <SliderWidget>("MusicVolumeSlider"); }
public SettingsGraphicsScreen() { XElement node = ContentManager.Get <XElement>("Screens/SettingsGraphicsScreen"); LoadContents(this, node); m_virtualRealityButton = Children.Find <BevelledButtonWidget>("VirtualRealityButton"); m_brightnessSlider = Children.Find <SliderWidget>("BrightnessSlider"); m_vrPanel = Children.Find <ContainerWidget>("VrPanel"); m_vrPanel.IsVisible = false; }
public EditBatteryDialog(int voltageLevel, Action <int> handler) { XElement node = ContentManager.Get <XElement>("Dialogs/EditBatteryDialog"); LoadContents(this, node); m_okButton = Children.Find <ButtonWidget>("EditBatteryDialog.OK"); m_cancelButton = Children.Find <ButtonWidget>("EditBatteryDialog.Cancel"); m_voltageSlider = Children.Find <SliderWidget>("EditBatteryDialog.VoltageSlider"); m_handler = handler; m_voltageLevel = voltageLevel; UpdateControls(); }
public EditAdjustableDelayGateDialog(int delay, Action <int> handler) { XElement node = ContentManager.Get <XElement>("Dialogs/EditAdjustableDelayGateDialog"); LoadContents(this, node); m_delaySlider = Children.Find <SliderWidget>("EditAdjustableDelayGateDialog.DelaySlider"); m_plusButton = Children.Find <ButtonWidget>("EditAdjustableDelayGateDialog.PlusButton"); m_minusButton = Children.Find <ButtonWidget>("EditAdjustableDelayGateDialog.MinusButton"); m_delayLabel = Children.Find <LabelWidget>("EditAdjustableDelayGateDialog.Label"); m_okButton = Children.Find <ButtonWidget>("EditAdjustableDelayGateDialog.OK"); m_cancelButton = Children.Find <ButtonWidget>("EditAdjustableDelayGateDialog.Cancel"); m_handler = handler; m_delay = delay; UpdateControls(); }
public WorldOptionsScreen() { XElement node = ContentManager.Get <XElement>("Screens/WorldOptionsScreen"); LoadContents(this, node); m_creativeModePanel = Children.Find <Widget>("CreativeModePanel"); m_newWorldOnlyPanel = Children.Find <Widget>("NewWorldOnlyPanel"); m_continentTerrainPanel = Children.Find <Widget>("ContinentTerrainPanel"); m_islandTerrainPanel = Children.Find <Widget>("IslandTerrainPanel"); m_islandSizeNS = Children.Find <SliderWidget>("IslandSizeNS"); m_islandSizeEW = Children.Find <SliderWidget>("IslandSizeEW"); m_flatTerrainPanel = Children.Find <Widget>("FlatTerrainPanel"); m_blocksTextureIcon = Children.Find <RectangleWidget>("BlocksTextureIcon"); m_blocksTextureLabel = Children.Find <LabelWidget>("BlocksTextureLabel"); m_blocksTextureDetails = Children.Find <LabelWidget>("BlocksTextureDetails"); m_blocksTextureButton = Children.Find <ButtonWidget>("BlocksTextureButton"); m_seaLevelOffsetSlider = Children.Find <SliderWidget>("SeaLevelOffset"); m_temperatureOffsetSlider = Children.Find <SliderWidget>("TemperatureOffset"); m_humidityOffsetSlider = Children.Find <SliderWidget>("HumidityOffset"); m_biomeSizeSlider = Children.Find <SliderWidget>("BiomeSize"); m_paletteButton = Children.Find <ButtonWidget>("Palette"); m_supernaturalCreaturesButton = Children.Find <ButtonWidget>("SupernaturalCreatures"); m_friendlyFireButton = Children.Find <ButtonWidget>("FriendlyFire"); m_environmentBehaviorButton = Children.Find <ButtonWidget>("EnvironmentBehavior"); m_timeOfDayButton = Children.Find <ButtonWidget>("TimeOfDay"); m_weatherEffectsButton = Children.Find <ButtonWidget>("WeatherEffects"); m_adventureRespawnButton = Children.Find <ButtonWidget>("AdventureRespawn"); m_adventureSurvivalMechanicsButton = Children.Find <ButtonWidget>("AdventureSurvivalMechanics"); m_terrainGenerationButton = Children.Find <ButtonWidget>("TerrainGeneration"); m_flatTerrainLevelSlider = Children.Find <SliderWidget>("FlatTerrainLevel"); m_flatTerrainShoreRoughnessSlider = Children.Find <SliderWidget>("FlatTerrainShoreRoughness"); m_flatTerrainBlock = Children.Find <BlockIconWidget>("FlatTerrainBlock"); m_flatTerrainBlockLabel = Children.Find <LabelWidget>("FlatTerrainBlockLabel"); m_flatTerrainBlockButton = Children.Find <ButtonWidget>("FlatTerrainBlockButton"); m_flatTerrainMagmaOceanCheckbox = Children.Find <CheckboxWidget>("MagmaOcean"); m_descriptionLabel = Children.Find <LabelWidget>("Description"); m_islandSizeEW.MinValue = 0f; m_islandSizeEW.MaxValue = m_islandSizes.Length - 1; m_islandSizeEW.Granularity = 1f; m_islandSizeNS.MinValue = 0f; m_islandSizeNS.MaxValue = m_islandSizes.Length - 1; m_islandSizeNS.Granularity = 1f; m_biomeSizeSlider.MinValue = 0f; m_biomeSizeSlider.MaxValue = m_biomeSizes.Length - 1; m_biomeSizeSlider.Granularity = 1f; }
public SettingsPerformanceScreen() { XElement node = ContentManager.Get <XElement>("Screens/SettingsPerformanceScreen"); LoadContents(this, node); m_resolutionButton = Children.Find <ButtonWidget>("ResolutionButton"); m_visibilityRangeSlider = Children.Find <SliderWidget>("VisibilityRangeSlider"); m_visibilityRangeWarningLabel = Children.Find <LabelWidget>("VisibilityRangeWarningLabel"); m_viewAnglesButton = Children.Find <ButtonWidget>("ViewAnglesButton"); m_terrainMipmapsButton = Children.Find <ButtonWidget>("TerrainMipmapsButton"); m_skyRenderingModeButton = Children.Find <ButtonWidget>("SkyRenderingModeButton"); m_objectShadowsButton = Children.Find <ButtonWidget>("ObjectShadowsButton"); m_framerateLimitSlider = Children.Find <SliderWidget>("FramerateLimitSlider"); m_displayFpsCounterButton = Children.Find <ButtonWidget>("DisplayFpsCounterButton"); m_displayFpsRibbonButton = Children.Find <ButtonWidget>("DisplayFpsRibbonButton"); m_visibilityRangeSlider.MinValue = 0f; m_visibilityRangeSlider.MaxValue = m_visibilityRanges.Count - 1; }
public SettingsControlsScreen() { XElement node = ContentManager.Get <XElement>("Screens/SettingsControlsScreen"); LoadContents(this, node); m_moveControlModeButton = Children.Find <ButtonWidget>("MoveControlMode"); m_lookControlModeButton = Children.Find <ButtonWidget>("LookControlMode"); m_leftHandedLayoutButton = Children.Find <ButtonWidget>("LeftHandedLayout"); m_flipVerticalAxisButton = Children.Find <ButtonWidget>("FlipVerticalAxis"); m_autoJumpButton = Children.Find <ButtonWidget>("AutoJump"); m_horizontalCreativeFlightButton = Children.Find <ButtonWidget>("HorizontalCreativeFlight"); m_horizontalCreativeFlightPanel = Children.Find <ContainerWidget>("HorizontalCreativeFlightPanel"); m_moveSensitivitySlider = Children.Find <SliderWidget>("MoveSensitivitySlider"); m_lookSensitivitySlider = Children.Find <SliderWidget>("LookSensitivitySlider"); m_gamepadCursorSpeedSlider = Children.Find <SliderWidget>("GamepadCursorSpeedSlider"); m_gamepadDeadZoneSlider = Children.Find <SliderWidget>("GamepadDeadZoneSlider"); m_creativeDigTimeSlider = Children.Find <SliderWidget>("CreativeDigTimeSlider"); m_creativeReachSlider = Children.Find <SliderWidget>("CreativeReachSlider"); m_holdDurationSlider = Children.Find <SliderWidget>("HoldDurationSlider"); m_dragDistanceSlider = Children.Find <SliderWidget>("DragDistanceSlider"); m_horizontalCreativeFlightPanel.IsVisible = false; }
public EditColorDialog(Color color, Action <Color?> handler) { WidgetsList children = Children; CanvasWidget obj = new CanvasWidget { Size = new Vector2(660f, 420f), HorizontalAlignment = WidgetAlignment.Center, VerticalAlignment = WidgetAlignment.Center, Children = { (Widget) new RectangleWidget { FillColor = new Color(0, 0, 0, 255), OutlineColor = new Color(128, 128, 128, 128), OutlineThickness = 2f } } }; WidgetsList children2 = obj.Children; StackPanelWidget obj2 = new StackPanelWidget { Direction = LayoutDirection.Vertical, Margin = new Vector2(15f), HorizontalAlignment = WidgetAlignment.Center, Children = { (Widget) new LabelWidget { Text = "Edit Color", HorizontalAlignment = WidgetAlignment.Center }, (Widget) new CanvasWidget { Size = new Vector2(0f, float.PositiveInfinity) } } }; WidgetsList children3 = obj2.Children; StackPanelWidget obj3 = new StackPanelWidget { Direction = LayoutDirection.Horizontal }; WidgetsList children4 = obj3.Children; StackPanelWidget obj4 = new StackPanelWidget { Direction = LayoutDirection.Vertical, VerticalAlignment = WidgetAlignment.Center }; WidgetsList children5 = obj4.Children; StackPanelWidget obj5 = new StackPanelWidget { Direction = LayoutDirection.Horizontal, HorizontalAlignment = WidgetAlignment.Far, Margin = new Vector2(0f, 10f), Children = { (Widget) new LabelWidget { Text = "Red:", Color = Color.Gray, VerticalAlignment = WidgetAlignment.Center, Font = ContentManager.Get <BitmapFont>("Fonts/Pericles") }, (Widget) new CanvasWidget { Size = new Vector2(10f, 0f) } } }; WidgetsList children6 = obj5.Children; SliderWidget obj6 = new SliderWidget { Size = new Vector2(300f, 50f), IsLabelVisible = false, MinValue = 0f, MaxValue = 255f, Granularity = 1f, SoundName = "" }; SliderWidget widget = obj6; m_sliderR = obj6; children6.Add(widget); children5.Add(obj5); WidgetsList children7 = obj4.Children; StackPanelWidget obj7 = new StackPanelWidget { Direction = LayoutDirection.Horizontal, HorizontalAlignment = WidgetAlignment.Far, Margin = new Vector2(0f, 10f), Children = { (Widget) new LabelWidget { Text = "Green:", Color = Color.Gray, VerticalAlignment = WidgetAlignment.Center, Font = ContentManager.Get <BitmapFont>("Fonts/Pericles") }, (Widget) new CanvasWidget { Size = new Vector2(10f, 0f) } } }; WidgetsList children8 = obj7.Children; SliderWidget obj8 = new SliderWidget { Size = new Vector2(300f, 50f), IsLabelVisible = false, MinValue = 0f, MaxValue = 255f, Granularity = 1f, SoundName = "" }; widget = obj8; m_sliderG = obj8; children8.Add(widget); children7.Add(obj7); WidgetsList children9 = obj4.Children; StackPanelWidget obj9 = new StackPanelWidget { Direction = LayoutDirection.Horizontal, HorizontalAlignment = WidgetAlignment.Far, Margin = new Vector2(0f, 10f), Children = { (Widget) new LabelWidget { Text = "Blue:", Color = Color.Gray, VerticalAlignment = WidgetAlignment.Center, Font = ContentManager.Get <BitmapFont>("Fonts/Pericles") }, (Widget) new CanvasWidget { Size = new Vector2(10f, 0f) } } }; WidgetsList children10 = obj9.Children; SliderWidget obj10 = new SliderWidget { Size = new Vector2(300f, 50f), IsLabelVisible = false, MinValue = 0f, MaxValue = 255f, Granularity = 1f, SoundName = "" }; widget = obj10; m_sliderB = obj10; children10.Add(widget); children9.Add(obj9); children4.Add(obj4); obj3.Children.Add(new CanvasWidget { Size = new Vector2(20f, 0f) }); WidgetsList children11 = obj3.Children; CanvasWidget canvasWidget = new CanvasWidget(); WidgetsList children12 = canvasWidget.Children; BevelledButtonWidget obj11 = new BevelledButtonWidget { Size = new Vector2(200f, 240f), AmbientLight = 1f, HorizontalAlignment = WidgetAlignment.Center, VerticalAlignment = WidgetAlignment.Center }; BevelledButtonWidget widget2 = obj11; m_rectangle = obj11; children12.Add(widget2); WidgetsList children13 = canvasWidget.Children; LabelWidget obj12 = new LabelWidget { HorizontalAlignment = WidgetAlignment.Center, VerticalAlignment = WidgetAlignment.Center, Font = ContentManager.Get <BitmapFont>("Fonts/Pericles") }; LabelWidget widget3 = obj12; m_label = obj12; children13.Add(widget3); children11.Add(canvasWidget); children3.Add(obj3); obj2.Children.Add(new CanvasWidget { Size = new Vector2(0f, float.PositiveInfinity) }); WidgetsList children14 = obj2.Children; StackPanelWidget obj13 = new StackPanelWidget { Direction = LayoutDirection.Horizontal, HorizontalAlignment = WidgetAlignment.Center }; WidgetsList children15 = obj13.Children; BevelledButtonWidget obj14 = new BevelledButtonWidget { Size = new Vector2(160f, 60f), Text = LanguageControl.Get("Usual", "ok") }; ButtonWidget widget4 = obj14; m_okButton = obj14; children15.Add(widget4); obj13.Children.Add(new CanvasWidget { Size = new Vector2(50f, 0f) }); WidgetsList children16 = obj13.Children; BevelledButtonWidget obj15 = new BevelledButtonWidget { Size = new Vector2(160f, 60f), Text = "Cancel" }; widget4 = obj15; m_cancelButton = obj15; children16.Add(widget4); children14.Add(obj13); children2.Add(obj2); children.Add(obj); m_handler = handler; m_color = color; UpdateControls(); }