//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public virtual void Build(IHovercastMenuState pMenuState, IBaseItemState pItemState, float pArcAngle, IItemVisualSettings pSettings) { vMenuState = pMenuState; vItemState = pItemState; vSelItem = (vItemState.Item as ISelectableItem); vSettings = (ItemVisualSettingsStandard)pSettings; //// vHoverSlice = new UiHoverMeshSlice(gameObject); vHoverSlice.DrawOuterEdge = true; vHoverSlice.UpdateSize(InnerRadius, OuterRadius, pArcAngle); //// vIcon = new GameObject("Icon"); vIcon.transform.SetParent(gameObject.transform, false); vIcon.transform.localRotation = Quaternion.FromToRotation(Vector3.forward, Vector3.up)* Quaternion.FromToRotation(Vector3.right, Vector3.up); vIcon.AddComponent<MeshRenderer>(); MeshFilter iconFilt = vIcon.AddComponent<MeshFilter>(); vIconMeshBuilder = new MeshBuilder(); MeshUtil.BuildQuadMesh(vIconMeshBuilder); Materials.SetMeshIconCoords(vIconMeshBuilder, Materials.IconOffset.Parent); vIconMeshBuilder.Commit(); vIconMeshBuilder.CommitColors(Color.clear); iconFilt.sharedMesh = vIconMeshBuilder.Mesh; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(ISelectableItem pItem) { Debug.Log ("pItem.Label=" + pItem.Label); if ( pItem.Label == "^" ) { return; } if ( pItem.Label.Length == 1 ) { //vEnviro.AddLetter(pItem.Label[0]); vTextField.AddLetter(pItem.Label[0]); return; } if ( pItem.Label.ToLower() == "back" ) { //vEnviro.RemoveLatestLetter(); vTextField.RemoveLatestLetter(); } if ( pItem.Label.ToLower() == "enter" ) { GameObject LeftPanel = GameObject.Find("LeftPanel"); GameObject RightPanel = GameObject.Find("RightPanel"); if (ItemRenameListener.inBreak && ItemRenameListener.grabbed_ != null && LeftPanel != null && RightPanel != null) { LeftPanel.transform.position = new Vector3(-6f, 4f, -200f); RightPanel.transform.position = new Vector3(-1f, 4f, -200f); ItemRenameListener.grabbed_.name = vTextField.GetLetters(); ItemRenameListener.grabbed_ = null; ItemRenameListener.inBreak = false; } vTextField.ClearLetters(); } }
private void BuildItemAsPerType() { switch (_itemType) { case (ItemType.Parent) : ParentItem parentItem = gameObject.AddComponent<ParentItem>(); parentItem.Layer = _curLayer; parentItem.ItemObject = _itemObject; parentItem.CancelItemLabel = _cancelItemLabel; parentItem.Build (_sSettings, _parentObj); _selectableItem = parentItem; break; case (ItemType.NormalButton) : NormalButtonItem normalItem = gameObject.AddComponent<NormalButtonItem>(); normalItem.Layer = _curLayer; normalItem.Action = _action; normalItem.IsCancelItem = _isCancelItem; normalItem.CancelItemLabel = _cancelItemLabel; normalItem.Build (_sSettings, _parentObj); _selectableItem = normalItem; break; default : break; } }
/*--------------------------------------------------------------------------------------------*/ private void HandleRadioValueChanged(ISelectableItem<bool> pSelData) { IRadioItem radData = (IRadioItem)pSelData; if ( !radData.Value ) { return; } DeselectRemainingRadioGroupMembers(radData); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem pItem) { Color col = DemoEnvironment.HsvToColor(vHueSlider.RangeValue, 1, 0.666f); Color colFade = col; colFade.a = 0.25f; vHueSettings.FillWith(vDefaultSettings, false); vHueSettings.Renderer = typeof(UiItemSliderRenderer); vHueSettings.SelectionColor = col; vHueSettings.SliderTrackColor = colFade; vHueSettings.SliderFillColor = colFade; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(IItemGroup pLevel, ISelectableItem pItem) { OnItemSelection(pLevel, pItem); IParentItem parItem = (pItem as IParentItem); if ( parItem != null ) { vHistory.Push(vCurrLevel); SetNewLevel(parItem.ChildGroup, 1); return; } if ( pItem.NavigateBackUponSelect ) { Back(); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(ISelectableItem pItem) { if ( pItem.Label == "^" ) { return; } if ( pItem.Label.Length == 1 ) { vEnviro.AddLetter(pItem.Label[0]); vTextField.AddLetter(pItem.Label[0]); return; } if ( pItem.Label.ToLower() == "back" ) { vEnviro.RemoveLatestLetter(); vTextField.RemoveLatestLetter(); } if ( pItem.Label.ToLower() == "enter" ) { vTextField.ClearLetters(); } }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderCrimesMethod(DataMapper.loadCrimes(), "OTHERS"); }
/*--------------------------------------------------------------------------------------------*/ public bool UpdateSelectionProcess() { ISelectableItem selItem = (Item as ISelectableItem); if (selItem == null) { return(false); } //// float selectProg = SelectionProgress; if (selectProg <= 0) { selItem.DeselectStickySelections(); } if (!IsNearestHighlight || !selItem.AllowSelection) { IsSelectionPrevented = false; vSelectionStart = null; return(false); } //// bool allNearestCursorsHavePartialHighlight = true; foreach (CursorType cursorType in vCursorWorldPosMap.Keys) { if (vIsNearestHighlightMap[cursorType] && vHighlightProgressMap[cursorType] >= 1) { allNearestCursorsHavePartialHighlight = false; } } if (allNearestCursorsHavePartialHighlight) { IsSelectionPrevented = false; vSelectionStart = null; return(false); } //// if (IsSelectionPrevented) { vSelectionStart = null; return(false); } if (vSelectionStart == null) { vSelectionStart = DateTime.UtcNow; return(false); } if (selectProg < 1) { return(false); } vSelectionStart = null; IsSelectionPrevented = true; vDistanceUponSelection = MinHighlightDistance; selItem.Select(); return(true); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <bool> pItem) { ItemToHide.GetItem().IsVisible = !pItem.Value; }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderPopulationHighSchoolDegree(DataMapper.loadPopulation()); }
/*--------------------------------------------------------------------------------------------*/ public bool UpdateSelectionProcess() { ISelectableItem selItem = (Item as ISelectableItem); if (selItem == null) { return(false); } //// float selectProg = SelectionProgress; if (selectProg <= 0 || !IsNearestHighlight) { selItem.DeselectStickySelections(); } if (!IsNearestHighlight || !selItem.AllowSelection) { IsSelectionPrevented = false; vSelectionStart = null; return(false); } //// bool allNearestCursorsHavePartialHighlight = true; //where "partial" == "not 100%" for (int i = 0; i < vCursorWorldPosMap.KeysReadOnly.Count; i++) { CursorType cursorType = vCursorWorldPosMap.KeysReadOnly[i]; if (vIsNearestHighlightMap[cursorType] && vHighlightProgressMap[cursorType] >= 1) { allNearestCursorsHavePartialHighlight = false; } } if (allNearestCursorsHavePartialHighlight) { IsSelectionPrevented = false; vSelectionStart = null; return(false); } //// if (IsSelectionPrevented) { vSelectionStart = null; return(false); } if (vSelectionStart == null) { vSelectionStart = DateTime.UtcNow; return(false); } if (selectProg < 1) { return(false); } vSelectionStart = null; IsSelectionPrevented = true; vDistanceUponSelection = MinHighlightDistance; selItem.Select(); return(true); }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderTotalPopulation(DataMapper.loadPopulation()); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <float> pItem) { Enviro.SetColorMode(Enviro.GetColorMode(), Item.RangeValue); }
private static void PersonVM_IsSelectedChanged(ISelectableItem <ISelectablePersonVM> obj) { // make sure that the IsSelectedChanged event fires. Console.WriteLine("Is Selected Changed"); }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderPopulationMedianHouseholdIncome(DataMapper.loadPopulation()); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleSelected(ISelectableItem pItem) { InteractSett.IsMenuOnLeftSide = !InteractSett.IsMenuOnLeftSide; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void BuildItem() { switch (Type) { case SelectableItemType.Checkbox: var checkItem = new CheckboxItem(); checkItem.Value = CheckboxValue; vItem = checkItem; break; case SelectableItemType.Parent: vItem = new ParentItem(GetChildItems); break; case SelectableItemType.Radio: var radItem = new RadioItem(); radItem.Value = RadioValue; vItem = radItem; break; case SelectableItemType.Selector: vItem = new SelectorItem(); break; case SelectableItemType.Slider: var sliderItem = new SliderItem(); sliderItem.Ticks = SliderTicks; sliderItem.Snaps = SliderSnaps; sliderItem.RangeMin = SliderRangeMin; sliderItem.RangeMax = SliderRangeMax; sliderItem.Value = Mathf.InverseLerp(SliderRangeMin, SliderRangeMax, SliderValue); sliderItem.AllowJump = SliderAllowJump; vItem = sliderItem; break; case SelectableItemType.Sticky: vItem = new StickyItem(); break; default: throw new Exception("Unhandled item type: " + Type); } if (!string.IsNullOrEmpty(Id)) { vItem.Id = Id; } vItem.DisplayContainer = gameObject; vItem.Label = (string.IsNullOrEmpty(Label) ? gameObject.name : Label); vItem.Height = RelativeSize; vItem.IsVisible = IsVisible; vItem.IsEnabled = IsEnabled; ISelectableItem selItem = (vItem as ISelectableItem); if (selItem != null && !(vItem is IParentItem)) { selItem.NavigateBackUponSelect = NavigateBackUponSelect; } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <float> pItem) { Enviro.SetMotionSpeed(Item.RangeValue); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <float> pItem) { Enviro.SetLightIntensitiy(Item.RangeValue); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <bool> pItem) { vInteractSett.Cursors = (pItem.Value ? vThumbCursors : vNoThumbCursors); }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderCrimesShift(DataMapper.loadCrimes(), "DAY"); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <float> pItem) { BgAlpha = Item.RangeValue; ItemSett.UpdateAllSettings(x => UpdateSettingsWithBgAlpha((ItemVisualSettingsStandard)x)); }
public bool Contains(ISelectableItem item) { return(groupContainer.Contains(item.element)); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(IItemGroup pGroup, ISelectableItem pItem) { OnItemSelection(pGroup, pItem); }
public static void SelectItem <T>(this ISelectableItem <T> selectableItem) where T : ISelectableItem <T> { selectableItem.IsSelected = true; }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderCrimesTotal(DataMapper.loadCrimes()); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleValueChanged(ISelectableItem <float> pItem) { int size = (int)Math.Round(Item.RangeValue); ItemSett.UpdateAllSettings((x => ((ItemVisualSettingsStandard)x).TextSize = size)); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleRadioItemSelected(ISelectableItem pItem) { Debug.Log("Radio Item Selected! "+pItem.Label); }
public ToggleableItemAutomationPeer(object item, SelectorAutomationPeer selectorAutomationPeer) : base(item, selectorAutomationPeer) { _owner = item as ISelectableItem; _ownerParent = selectorAutomationPeer.Owner as ISelectableItemsControl; }
public SelectableItemsEventArgs(ISelectableItem item) { Item = item; }
/*--------------------------------------------------------------------------------------------*/ private void HandleDeselected(ISelectableItem pItem) { Enviro.ShowSpotlight(false); }
/*--------------------------------------------------------------------------------------------*/ private void HandleNavigateBackItemSelected(ISelectableItem pItem) { Back(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleRadioItemSelected(ISelectableItem pItem) { Debug.Log("Radio Item Selected! " + pItem.Label); }
public static void ToggleSelection <T>(this ISelectableItem <T> selectableItem) where T : ISelectableItem <T> { selectableItem.IsSelected = !selectableItem.IsSelected; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleSelected(ISelectableItem pItem) { Enviro.ReorientCamera(); }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderImmunizationsTotal(DataMapper.loadImmunizations()); }
/*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(ISelectableItem pItem) { SendMessageUpwards("OnRowSwitched", this, SendMessageOptions.RequireReceiver); }
private void HandleSelected(ISelectableItem pItem) { DataMapper.renderCrimesOffense(DataMapper.loadCrimes(), "HOMICIDE"); }