protected void InitControls(int slidersUsed) { this.sliders = new SliderControl[6]; for (int i = 0; i < 6; i++) { if (3 > i || i > 5 || (!this.useTurretGroup && !this.useStorageGroup)) { string num; switch (i) { case 3: num = "1Bottom"; break; case 4: num = "2Bottom"; break; case 5: num = "3Bottom"; break; default: num = (i + 1).ToString(); break; } SliderControl sliderControl = new SliderControl(this, num, this.useStorageGroup, this.useTurretGroup, this.useUpgradeGroup); if (i >= slidersUsed) { sliderControl.HideAll(); } this.sliders[i] = sliderControl; } } }
protected virtual void InitRelocationStarSlider(int sliderIndex) { SliderControl sliderControl = this.sliders[sliderIndex]; CurrentPlayer currentPlayer = Service.CurrentPlayer; sliderControl.DescLabel.Visible = true; sliderControl.NextLabel.Visible = false; sliderControl.NextSlider.Visible = false; sliderControl.CurrentSlider.Visible = true; sliderControl.Background.Visible = true; int displayRelocationStarsCount = currentPlayer.GetDisplayRelocationStarsCount(); int requiredRelocationStars = currentPlayer.GetRequiredRelocationStars(); if (displayRelocationStarsCount < requiredRelocationStars) { sliderControl.CurrentLabel.Visible = true; float num = (float)currentPlayer.GetRequiredRelocationStars(); sliderControl.CurrentSlider.Value = ((num > 0f) ? ((float)displayRelocationStarsCount / num) : 1f); sliderControl.CurrentLabel.Text = displayRelocationStarsCount + "/" + currentPlayer.GetRequiredRelocationStars(); sliderControl.DescLabel.Text = this.lang.Get("PLANETS_GNC_RELOCATION_STATUS", new object[0]); base.GetElement <UXSprite>("SpritepBar3MasteryStar").Visible = true; } else { sliderControl.CurrentSlider.Value = 1f; sliderControl.CurrentLabel.Enabled = false; sliderControl.DescLabel.Text = this.lang.Get("PLANETS_GNC_RELOCATION_STATUS_AVAILABLE", new object[0]); base.GetElement <UXSprite>("SpritepBar3MasteryStar").Visible = false; } }
// Start is called before the first frame update void Start() { // Инициализировать необходимые компоненты цветного круга ColorCircle = transform.GetChild(0) as RectTransform; // Инициализировать необходимые компоненты маркера PickerTransform = ColorCircle.GetChild(0) as RectTransform; Picker = PickerTransform.GetComponent <Image>(); // Создать регулировку яркости Brightness = new SliderControl(transform, "BrightnessSlider"); // Создать регулировку насыщенности Saturation = new SliderControl(transform, "SaturationSlider"); SelectedColor = transform.Find("SelectedColor").GetComponent <Image>(); // Инициализировать радиусы цветного круга и маркера CircleRadius = 0.5f * ColorCircle.sizeDelta.x; PickerRadius = 0.5f * PickerTransform.sizeDelta.x; // Кватернион поворота на 120 градусов по часовой стрелке вокруг оси Z Quaternion rotateQuaternion = Quaternion.Euler(0, 0, -120); // Инициализировать массив с координатами точек R, G и B RGBpoints[0] = new Vector2(0, CircleRadius); for (int p = 1; p < RGBpoints.Length; p++) { RGBpoints[p] = rotateQuaternion * RGBpoints[p - 1]; } // Создать массив под угловые расстояния заданной точки до точек R, G и B Angles = new float[RGBpoints.Length]; // Обновить текущий цвет маркера Picker.color = CalcColor(PickerTransform.anchoredPosition); // Обновить текущий цвет регулировки насыщенности Saturation.Color = Color.Lerp(Color.white, Picker.color, Saturation.Slider.value); // Обновить текущий цвет регулировки яркости Brightness.Color = SelectedColor.color = Color.Lerp(Color.black, Saturation.Color, Brightness.Slider.value); // При изменении насыщенности - обновлять цвет Saturation.Slider.onValueChanged.AddListener((float value) => { Saturation.Color = Color.Lerp(Color.white, Picker.color, Saturation.Slider.value); Brightness.Color = SelectedColor.color = Color.Lerp(Color.black, Saturation.Color, Brightness.Slider.value); }); // При изменении яркости - обновлять цвет Brightness.Slider.onValueChanged.AddListener((float value) => { Brightness.Color = SelectedColor.color = Color.Lerp(Color.black, Saturation.Color, Brightness.Slider.value); }); // Зарегистрироваться в TouchController-е, чтобы отслеживать перемещения пальцев или мыши по экрану TouchController.RegListener(this); }
public static SliderControl InstantiateStepSlider2(string name, int X, int Y, string Part) { SliderControl tempSlider = InstantiateSlider2(name, X, Y, Part); tempSlider.stepSlider = true; return(tempSlider); }
void Awake() { if (sld == null) { sld = this; playerVisible = 0; } }
public SliderControl InstantiateStepSlider(string name, int X, int Y) { SliderControl tempSlider = InstantiateSlider(name, X, Y); tempSlider.stepSlider = true; return(tempSlider); }
private LayoutControl BuildEngineGroupControls(EngineGroup group) { var root = new LayoutControl { Direction = LayoutDirection.Horizontal }; //root.Children.Add(new LabelControl { Text = group.GroupId, Width = 100.0f}); var cbx = new ToggleControl { Text = group.GroupId, Width = 100.0f, IsChecked = group.IsEnabled }; root.Children.Add(cbx); var valTextBox = new TextBoxControl { Enabled = false, Width = 40.0f, Text = group.Throttle.ToString("f0") }; var slider = new SliderControl { Direction = LayoutDirection.Horizontal, LeftValue = 1.0f, RightValue = 100.0f, Width = 140.0f, Height = 10.0f, Value = group.Throttle, Enabled = group.IsEnabled, }; slider.ValueChanged += x => { group.Throttle = x; group.ThrottleChanged = true; valTextBox.Text = x.ToString("f0"); }; root.Children.Add(slider); root.Children.Add(valTextBox); cbx.CheckChanged += x => { if (!x) { group.Throttle = 100.0f; group.ThrottleChanged = true; /*slider.Value = 100.0f; * valTextBox.Text = "100";*/ } else { //slider.Enabled = true; group.Throttle = slider.Value; group.ThrottleChanged = true; } slider.Enabled = x; group.IsEnabled = x; }; return(root); }
public ConfigDialog() { InitializeComponent(); this.brushcombobox.ComboBox.DrawMode = DrawMode.OwnerDrawVariable; this.brushcombobox.ComboBox.MeasureItem += new MeasureItemEventHandler(brushcombobox_MeasureItem); this.brushcombobox.ComboBox.ItemHeight = 16; this.brushcombobox.ComboBox.DrawItem += new DrawItemEventHandler(brushcombobox_DrawItem); this.brushcombobox.DropDownHeight = this.Height - 100; pressure = new SliderControl(); jitter = new SliderControl(); this.brushSize.ComboBox.SuspendLayout(); for (int i = 0; i < this.brushSizes.Length; ++i) { this.brushSize.Items.Add(this.brushSizes[i].ToString()); } this.brushSize.ComboBox.ResumeLayout(false); settingStrip.Items.Insert( settingStrip.Items.IndexOf(pressureLabel) + 1, new ToolStripControlHost(pressure) { AutoSize = false }); settingStrip.Items.Insert( settingStrip.Items.IndexOf(densityLabel) + 1, new ToolStripControlHost(jitter) { AutoSize = false }); this.zoom.ComboBox.SuspendLayout(); string percent100 = null; for (int i = 0; i < CanvasPanel.ZoomFactors.Length; i++) { string zoomValueString = (CanvasPanel.ZoomFactors[i] * 100).ToString(); string zoomItemString = string.Format("{0}%", zoomValueString); if (CanvasPanel.ZoomFactors[i] == 1.0) { percent100 = zoomItemString; } this.zoom.Items.Add(zoomItemString); } this.zoom.ComboBox.ResumeLayout(false); this.zoom.Text = percent100; InitializeTooltips(); InitializeUIImages(); }
void Start() { tileGenerator = GameObject.Find("Tile Generator"); tileGenerator.SetActive(false); AssignBuildingHeights(); BuildTower(); TowerTop(); sliderControl = FindObjectOfType <SliderControl>(); }
public Slider() { this.Name = "Slider"; this.Description = "Will render a slider"; sc = new SliderControl(); _value = new List <object>(); }
public AudioToFLAC() : base() { SliderControl slider = new SliderControl("compression"); slider.Description = "Compression Level"; slider.Minimum = 1; slider.Maximum = 12; slider.Value = 8; slider.IntegersOnly = true; Controls.Add(slider); }
private void menuBlur_Click(object sender, RoutedEventArgs e) { SliderControl sliderControl = new SliderControl("Blur options", 0, 100, 10, 0, 10); SetOptionsControl(sliderControl); sliderControl.ValueChanged += (double delta) => { imageData.BlurEffect((int)delta); UpdateImageContainer(); }; }
private void menulightness_Click(object sender, RoutedEventArgs e) { SliderControl sliderControl = new SliderControl("Lightness options", -100, 100, 10, 0, 10); SetOptionsControl(sliderControl); sliderControl.ValueChanged += (double delta) => { imageData.IncreaseLightness(delta); UpdateImageContainer(); }; }
public void SliderTextResfresh(SliderControl ctr) { LabelControl infoLabel = (LabelControl)ctr.Tag; infoLabel.Text = ctr.Value.ToString(); if ((int)((ParamRow)ctr.Tag2).FieldData.Value != ctr.Value) { ((ParamRow)ctr.Tag2).FieldData.Value = ctr.Value; SaveChange(); } }
public AudioToMp3() : base() { SliderControl slider = new SliderControl("bitrate") { Description = "Audio Bitrate in kBps", Minimum = 64, Maximum = 320, Value = 320 }; slider.FixedStops.AddRange(new double[] { 64, 96, 128, 160, 192, 224, 256, 320 }); Controls.Add(slider); }
private void UpdateSlider(int sliderIndex, string descText, int capacity, int capacityNext, int capacityTotal) { SliderControl sliderControl = this.sliders[sliderIndex]; sliderControl.DescLabel.Text = descText; sliderControl.CurrentLabel.Text = this.lang.ThousandsSeparated(capacity); sliderControl.NextLabel.Text = this.lang.Get("PLUS", new object[] { this.lang.ThousandsSeparated(capacityNext - capacity) }); sliderControl.CurrentSlider.Value = ((capacityTotal == 0) ? 0f : ((float)capacity / (float)capacityTotal)); sliderControl.NextSlider.Value = ((capacityTotal == 0) ? 0f : ((float)capacityNext / (float)capacityTotal)); }
public AudioToAC3() : base() { SliderControl slider = new SliderControl("bitrate") { Description = "Audio Bitrate in kBps", Minimum = 160, IntegersOnly = true, Maximum = 640, Value = 448 }; Controls.Add(slider); }
private void UpdateCapacity(int sliderIndex) { BuildingUpgradeCatalog buildingUpgradeCatalog = Service.BuildingUpgradeCatalog; int storage = this.buildingInfo.Storage; int storage2 = buildingUpgradeCatalog.GetNextLevel(this.buildingInfo).Storage; int storage3 = buildingUpgradeCatalog.GetMaxLevel(this.buildingInfo.UpgradeGroup).Storage; DeliveryType deliveryType = this.deliveryType; string id; if (deliveryType != DeliveryType.Vehicle) { if (deliveryType != DeliveryType.Starship) { if (deliveryType != DeliveryType.Mercenary) { id = "UPGRADE_FIELD_CAPACITY"; } else { id = "UPGRADE_FIELD_MERCENARY_CAPACITY"; } } else { id = "UPGRADE_FIELD_STARSHIP_CAPACITY"; } } else { id = "UPGRADE_FIELD_VEHICLE_CAPACITY"; } SliderControl sliderControl = this.sliders[sliderIndex]; sliderControl.DescLabel.Text = this.lang.Get(id, new object[0]); sliderControl.CurrentLabel.Text = this.lang.ThousandsSeparated(storage); sliderControl.CurrentSlider.Value = ((storage3 != 0) ? ((float)storage / (float)storage3) : 0f); if (storage2 > storage) { sliderControl.NextLabel.Text = this.lang.Get("PLUS", new object[] { this.lang.ThousandsSeparated(storage2 - storage) }); sliderControl.NextSlider.Value = ((storage3 != 0) ? ((float)storage2 / (float)storage3) : 0f); } else { sliderControl.NextLabel.Visible = false; sliderControl.NextSlider.Visible = false; } }
protected virtual void InitPlanetSlider(int sliderIndex) { float num = (float)this.maxBuildingInfo.Lvl + 1f; SliderControl sliderControl = this.sliders[sliderIndex]; sliderControl.DescLabel.Visible = true; sliderControl.DescLabel.Text = this.lang.Get("PLANETS_GNC_SLOTS", new object[0]); sliderControl.NextLabel.Visible = false; sliderControl.NextSlider.Visible = false; sliderControl.CurrentSlider.Visible = true; sliderControl.CurrentLabel.Visible = true; sliderControl.CurrentSlider.Value = (float)(this.buildingInfo.Lvl + 1) / num; sliderControl.CurrentLabel.Text = this.buildingInfo.Lvl + 1 + "/" + num; sliderControl.Background.Visible = true; }
public SliderControl InstantiateSlider(string name, int X, int Y) { Transform TempSlider; TempSlider = Instantiate(sliderPrefab, Vector3.zero, Quaternion.identity) as Transform; TempSlider.parent = transform; TempSlider.gameObject.name = name; SliderControl tempSlider = TempSlider.GetComponent("SliderControl") as SliderControl; tempSlider.actualValue = 0.5f; tempSlider.descriptionText.text = name; tempSlider.sliderOffset.x = 20 + X * 100; tempSlider.sliderOffset.y = -20 - Y * 60; return(tempSlider); }
void Prepared(UnityEngine.Video.VideoPlayer vPlayer) { //Assign the Texture from Video to RawImage to be displayed SliderControl l_sliderControl = GetComponentInChildren <SliderControl>(); if (l_sliderControl != null) { l_sliderControl.Initialize(videoPlayer, audioSource); } image.texture = videoPlayer.texture; image.CrossFadeAlpha(1.0f, 1.5f, false); PlayVideo(); }
private void ungrabItem() { isGrabbing = false; if (currentGrabbable == null) { return; } currentGrabbableRb.isKinematic = false; resetLaser(); currentGrabbable.Ungrabbed(); constrainPosition = null; sliderControl = null; }
public void InitStorage(int sliderIndex, string description) { BuildingUpgradeCatalog buildingUpgradeCatalog = Service.BuildingUpgradeCatalog; int storage = this.buildingInfo.Storage; BuildingTypeVO nextLevel = buildingUpgradeCatalog.GetNextLevel(this.buildingInfo); int num = (nextLevel != null) ? nextLevel.Storage : storage; int storage2 = buildingUpgradeCatalog.GetMaxLevel(this.buildingInfo.UpgradeGroup).Storage; SliderControl sliderControl = this.sliders[sliderIndex]; sliderControl.DescLabel.Text = this.lang.Get(description, new object[0]); sliderControl.CurrentLabel.Text = this.lang.ThousandsSeparated(storage); sliderControl.CurrentSlider.Value = ((storage2 != 0) ? ((float)storage / (float)storage2) : 0f); sliderControl.NextLabel.Text = this.lang.Get("PLUS", new object[] { this.lang.ThousandsSeparated(num - storage) }); sliderControl.NextSlider.Value = ((storage2 != 0) ? ((float)num / (float)storage2) : 0f); }
/// <summary> /// At run-time, this method is called during the node /// creation. Here you can create custom UI elements and /// add them to the node view, but we recommend designing /// your UI declaratively using xaml, and binding it to /// properties on this node as the DataContext. /// </summary> /// <param name="model">The NodeModel representing the node's core logic.</param> /// <param name="nodeView">The NodeView representing the node in the graph.</param> public void CustomizeView(SliderCustomNodeModel model, NodeView nodeView) { // The view variable is a reference to the node's view. // In the middle of the node is a grid called the InputGrid. // We reccommend putting your custom UI in this grid, as it has // been designed for this purpose. // Create an instance of our custom UI class (defined in xaml), // and put it into the input grid. var sliderControl = new SliderControl(); nodeView.inputGrid.Children.Add(sliderControl); // Set the data context for our control to be the node model. // Properties in this class which are data bound will raise // property change notifications which will update the UI. sliderControl.DataContext = model; }
private void UpdateRadius() { int trapMaxRadius = (int)TrapUtils.GetTrapMaxRadius(this.trapVO); int trapMaxRadius2 = (int)TrapUtils.GetTrapMaxRadius(this.maxTrapVO); SliderControl sliderControl = this.sliders[1]; sliderControl.DescLabel.Text = this.lang.Get("TRAP_TRIGGER_RADIUS", new object[0]); sliderControl.CurrentLabel.Text = this.lang.ThousandsSeparated(trapMaxRadius); sliderControl.CurrentSlider.Value = ((trapMaxRadius2 == 0) ? 0f : ((float)trapMaxRadius / (float)trapMaxRadius2)); if (this.useUpgradeGroup && this.nextTrapVO != null) { int trapMaxRadius3 = (int)TrapUtils.GetTrapMaxRadius(this.maxTrapVO); sliderControl.NextLabel.Text = this.lang.Get("PLUS", new object[] { this.lang.ThousandsSeparated(trapMaxRadius3 - trapMaxRadius) }); sliderControl.NextSlider.Value = ((trapMaxRadius2 == 0) ? 0f : ((float)trapMaxRadius3 / (float)trapMaxRadius2)); } }
private void grabItem() { // get current object targeted by raycast InteractiveItem currentInteractible = controllerRayCaster.CurrentInteractible; // get it's Grabbable component currentGrabbable = currentInteractible.gameObject.GetComponent <Grabbable>(); if (currentGrabbable == null) { return; } // don't grab it if it has IsGrabbable = false; if (!currentGrabbable.IsGrabbable) { return; } // make kinematic currentGrabbableRb = currentGrabbable.gameObject.GetComponent <Rigidbody>(); currentGrabbableRb.isKinematic = true; // calculate distance to obj Vector3 controllerPos = OVRInput.GetLocalControllerPosition(KosmosStatics.Controller); localToWorld = trackingSpace.localToWorldMatrix; Vector3 controllerPosWorld = localToWorld.MultiplyPoint(controllerPos); Vector3 objectPos = currentGrabbable.transform.position; DistanceToObj = Vector3.Distance(controllerPosWorld, objectPos); isGrabbing = true; currentGrabbable.Grabbed(); // check if it has a ConstrainPosition component constrainPosition = currentInteractible.gameObject.GetComponent <ConstrainPosition>(); // check if it has a SliderControl component sliderControl = currentInteractible.gameObject.GetComponent <SliderControl>(); }
public DVDMpeg2() : base() { OptionList aspect = new OptionList("aspect"); aspect.Description = "Video Aspect ratio"; aspect.Values.Add("16:9 (Widescreen)", "16:9"); aspect.Values.Add("4:3 (Letterbox)", "4:3"); aspect.SelectedIndex = 0; Controls.Add(aspect); OptionList standard = new OptionList("standard"); standard.Description = "DVD standard"; standard.Values.Add("PAL", "pal"); standard.Values.Add("NTSC", "ntsc"); standard.SelectedIndex = 0; Controls.Add(standard); SliderControl video = new SliderControl("videobitrate") { Description = "Video Bitrate in kBps", IntegersOnly = true, Minimum = 1500, Maximum = 9800, Value = 4000 }; Controls.Add(video); SliderControl audio = new SliderControl("audiobitrate") { Description = "Audio Bitrate in kBps", IntegersOnly = true, Minimum = 160, Maximum = 448, Value = 448 }; Controls.Add(audio); }
private void Awake() { attrControls = new Dictionary <string, AttrUIControl>(); skillIcon = new List <Transform>(); Transform skills = this.transform.Find("skills"); for (int i = 0; i < skills.childCount; i++) { skillIcon.Add(skills.GetChild(i)); UIEventListener.Get(skills.GetChild(i).gameObject).onHover = (go, state) => { if (state) { UITooltip.Show(go.name); } else { UITooltip.Hide(); } }; } lv = this.transform.Find("lv").Find("value").GetComponent <UILabel>(); killed = this.transform.Find("kill").Find("value").GetComponent <UILabel>(); soul = this.transform.Find("soul").Find("value").GetComponent <UILabel>(); iconFocus = this.transform.Find("focus").GetComponent <UITexture>(); iconFocus.enabled = false; attrControls["hp"] = new SliderControl(this.transform.FindChild("hp"), null); attrControls["mp"] = new SliderControl(this.transform.FindChild("mp"), null); attrControls["exp"] = new SliderControl(this.transform.FindChild("exp"), null); attrControls["atk"] = new IconControl(this.transform.FindChild("atk"), null); attrControls["def"] = new IconControl(this.transform.FindChild("def"), null); attrControls["speed"] = new IconControl(this.transform.FindChild("speed"), null); attrControls["luck"] = new IconControl(this.transform.FindChild("luck"), null); attrControls["mind"] = new IconControl(this.transform.FindChild("mind"), null); //Transform hd = this.transform.FindChild("HUDText"); //this.attacker.GetComponent<ChracterBase>().SetHudText(hd.GetComponent<HUDText>()); //GameManager.gameMain.RegStateUI(this); }
private void UpdateDps() { SliderControl sliderControl = this.sliders[0]; TrapController trapController = Service.Get <TrapController>(); int trapDamageForUIDisplay = trapController.GetTrapDamageForUIDisplay(this.trapVO); int trapDamageForUIDisplay2 = trapController.GetTrapDamageForUIDisplay(this.maxTrapVO); sliderControl.DescLabel.Text = this.lang.Get("DAMAGE_DPS", new object[] { "" }); sliderControl.CurrentLabel.Text = this.lang.ThousandsSeparated(trapDamageForUIDisplay); sliderControl.CurrentSlider.Value = ((trapDamageForUIDisplay2 == 0) ? 0f : ((float)trapDamageForUIDisplay / (float)trapDamageForUIDisplay2)); if (this.useUpgradeGroup && this.nextTrapVO != null) { int trapDamageForUIDisplay3 = trapController.GetTrapDamageForUIDisplay(this.nextTrapVO); sliderControl.NextLabel.Text = this.lang.Get("PLUS", new object[] { this.lang.ThousandsSeparated(trapDamageForUIDisplay3 - trapDamageForUIDisplay) }); sliderControl.NextSlider.Value = ((trapDamageForUIDisplay2 == 0) ? 0f : ((float)trapDamageForUIDisplay3 / (float)trapDamageForUIDisplay2)); } }
/* * [Button(ButtonSizes.Large)] * void ClearSprites() * { * var loadables = FindObjectsOfType<Loadable>(); * foreach (var item in loadables) * { * if (item.image!=null) item.image.sprite=null; * if(item.spriteRenderer!=null) item.spriteRenderer.sprite=null; * } * } * * [Button(ButtonSizes.Large)] * void LoadSprites() * { * var loadables = FindObjectsOfType<Loadable>(); * foreach (var item in loadables) * { * item.LoadSprite(); * } * } */ void Awake() { //Screen.SetResolution( //Screen.currentResolution.width, //Screen.currentResolution.height,false); //WebGLInput.captureAllKeyboardInput = false; if (SliderControl.master == null) { SliderControl.master = this; } else { Destroy(this.gameObject); } cameraZ = 75; camera = Camera.main.transform; inputField.text = "0"; if (formFactor != FormFactor.Lite) { TruckCamera(); } foreach (var item in chartObjs) { if (item.transformNull != null) { item.transformNull.gameObject.SetActive(false); } } lastInputFieldValue = inputField.text; lastSliderValue = impactSlider.value; }