/** * Pulses the highlight effect on, and then off, in a continuous cycle. */ public void Pulse() { highlightState = HighlightState.Pulse; //highlight = minHighlight; direction = 1; currentTimer = 0f; }
public void UnhighlightAllNodes(HighlightState removeFlags) { // Kludge cast to avoid a "Collection was modified" exception. var keys = _nodeHighlights.Keys.ToArray(); foreach (SkillNode node in keys) UnhighlightNode(node, removeFlags); }
public void HighlightOnInstant() { highlightState = HighlightState.On; highlight = maxHighlight; UpdateMaterials(); }
/** * Turns the highlight effect on. The effect will occur over time. */ public void HighlightOn() { if (highlightState == HighlightState.On || (highlightState == HighlightState.Normal && direction == 1)) { return; } highlightState = HighlightState.Normal; direction = 1; fadeStartTime = Time.time; if (highlight > minHighlight) { fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime; } else { highlight = minHighlight; } if (callEvents && onHighlightOn != null) { onHighlightOn.Invoke(); } }
public void DeHighlightOtherTeamTilePieces(List <PieceEV> alteredPieces, PlayerColor pieceTeam, IEntitiesDB entitiesDB) { HighlightState highlightStateToRemove = HighlightService.CalcClickHighlightState(pieceTeam); // TODO Remove team highlights based on Team Color, not piece ref id List <TileEV> tiles = tileService.FindAllTileEVs(entitiesDB) .Where(tile => tile.Highlight.IsHighlighted && tile.Highlight.CurrentColorStates.Contains(highlightStateToRemove) ).ToList(); foreach (TileEV tile in tiles) { entitiesDB.ExecuteOnEntity( tile.ID, (ref TileEV tileToChange) => { tileToChange.Highlight.CurrentColorStates.Remove(highlightStateToRemove); tileToChange.Tile.PieceRefEntityId = null; if (!tileToChange.Highlight.CurrentColorStates.Any()) { tileToChange.Highlight.IsHighlighted = false; } }); tile.ChangeColorTrigger.PlayChangeColor = true; } }
public void Unhighlight() { highlightFX.SetActive(false); arrowOrDotMesh.material.color = normalColor; highlightState = HighlightState.None; }
public void HighlightNodes(IEnumerable <PassiveNodeViewModel> nodes, HighlightState newFlags) { foreach (PassiveNodeViewModel node in nodes) { HighlightNode(node, newFlags); } }
private void ChangeTileColor(List <TileEV> tilesToChange, ref PressStepState token) { bool isClicked = token.PiecePressState == PiecePressState.CLICKED; PieceEV piece = pieceFindService.FindPieceEV(token.PieceEntityId, entitiesDB); int pieceIdtoken = token.PieceEntityId; HighlightState newHighlightState = HighlightService.CalcClickHighlightState(piece.PlayerOwner.PlayerColor); TurnEV currentTurn = turnService.GetCurrentTurnEV(entitiesDB); bool doesPieceBelongToTurnPlayer = currentTurn.TurnPlayer.PlayerColor == piece.PlayerOwner.PlayerColor; foreach (TileEV tileEV in tilesToChange) { entitiesDB.ExecuteOnEntity( tileEV.ID, (ref TileEV tileToChange) => { tileToChange.Highlight.IsHighlighted = isClicked; if (doesPieceBelongToTurnPlayer) { tileToChange.Tile.PieceRefEntityId = isClicked ? (int?)pieceIdtoken : null; } if (isClicked) { tileToChange.Highlight.CurrentColorStates.Add(newHighlightState); } else { tileToChange.Highlight.CurrentColorStates.Remove(newHighlightState); } }); tileEV.ChangeColorTrigger.PlayChangeColor = true; } }
private HighlightState FindHightlightObject() { IEnumerator enumerator = base.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; HighlightState component = current.gameObject.GetComponent <HighlightState>(); if (component != null) { return(component); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } return(null); }
/** * Pulses the highlight effect on, and then off, in a continuous cycle. */ public void Pulse() { highlightState = HighlightState.Pulse; highlight = minHighlight; direction = 1; fadeStartTime = Time.time; }
async Task <HighlightState> GetStateAsync(IDocumentLine line, CancellationToken cancellationToken = default) { var pl = line?.PreviousLine; if (pl == null) { return(HighlightState.CreateNewState(this)); } if (stateCache.Count == 0) { stateCache.Add(HighlightState.CreateNewState(this)); } var ln = line.LineNumber; if (ln <= stateCache.Count) { return(stateCache [ln - 1].Clone()); } var lastState = stateCache [stateCache.Count - 1]; var cur = Document.GetLine(stateCache.Count); if (cur != null && cur.Offset < line.Offset) { do { var high = new Highlighter(this, lastState.Clone()); await high.GetColoredSegments(Document, cur.Offset, cur.LengthIncludingDelimiter, cancellationToken); stateCache.Add(lastState = high.State); cur = cur.NextLine; } while (cur != null && cur.Offset < line.Offset); } return(lastState.Clone()); }
public void HighlightNode(SkillNode node, HighlightState newFlags) { if (newFlags == 0) return; if (nodeHighlights.ContainsKey(node)) nodeHighlights[node] |= newFlags; else nodeHighlights.Add(node, newFlags); }
/** * Turns the highlight effect on. The effect will occur over time. */ public void HighlightOn() { if (highlightState == HighlightState.On || (highlightState == HighlightState.Normal && direction == 1)) { return; } if (direction == -1 && currentTimer > 0f) { currentTimer = fadeTime - currentTimer; } else if (direction != 1) { //highlight = minHighlight; currentTimer = 0f; } highlightState = HighlightState.Normal; direction = 1; if (callEvents && onHighlightOn != null) { onHighlightOn.Invoke(); } }
protected override void Awake() { base.Awake(); SoundManager.Get().Load("play_button_mouseover"); this.m_playButtonHighlightState = base.gameObject.GetComponentInChildren <HighlightState>(); base.SetOriginalLocalPosition(); }
HighlightState GetState(IDocumentLine line) { var pl = line.PreviousLine; if (pl == null) { return(HighlightState.CreateNewState(this)); } if (stateCache.Count == 0) { stateCache.Add(HighlightState.CreateNewState(this)); } var ln = line.LineNumber; if (ln <= stateCache.Count) { return(stateCache [ln - 1].Clone()); } var lastState = stateCache [stateCache.Count - 1]; var cur = Document.GetLine(stateCache.Count); if (cur != null && cur.Offset < line.Offset) { do { var high = new Highlighter(this, lastState.Clone()); high.GetColoredSegments(Document, cur.Offset, cur.LengthIncludingDelimiter).Wait(); stateCache.Add(lastState = high.State); cur = cur.NextLine; } while (cur != null && cur.Offset < line.Offset); } return(lastState.Clone()); }
public void ApplyHighlight(HighlightState highlight) { if (activeHighlight != null) { Destroy(activeHighlight); } switch (highlight) { case HighlightState.NoHighlight: break; case HighlightState.Simple: activeHighlight = Instantiate(highlights[0], transform.position, Quaternion.identity, transform) as GameObject; break; case HighlightState.Specific: activeHighlight = Instantiate(highlights[1], transform.position, Quaternion.identity, transform) as GameObject; break; case HighlightState.Uninteractable: activeHighlight = Instantiate(highlights[2], transform.position, Quaternion.identity, transform) as GameObject; break; default: break; } }
/// <summary> /// Highlights the element. /// Default value is from configuration: <see cref="IBrowserProfile.IsElementHighlightEnabled"/> /// </summary> public void HighlightElement(HighlightState highlightState = HighlightState.Default) { if (browserProfile.IsElementHighlightEnabled || highlightState.Equals(HighlightState.Highlight)) { ExecuteScript(JavaScript.BorderElement); } }
public void HighlightItem(int _id, HighlightType _type) { highlightItem = GetItem(_id); if (highlightItem == null) { return; } if (_type == HighlightType.Enable) { highlightState = HighlightState.Normal; pulseDirection = 1; } else if (_type == HighlightType.Disable) { highlightState = HighlightState.Normal; pulseDirection = -1; } else if (_type == HighlightType.PulseOnce) { highlightState = HighlightState.Flash; pulse = 0f; pulseDirection = 1; } else if (_type == HighlightType.PulseContinually) { highlightState = HighlightState.Pulse; pulse = 0f; pulseDirection = 1; } }
public void HighlightNodes(IEnumerable <SkillNode> nodes, HighlightState newFlags) { foreach (SkillNode node in nodes) { HighlightNode(node, newFlags); } }
/// <summary> /// Returns flags without HighlightState.Tags if the node is an ascendancy node. /// Returns flags unchanged if it is not. /// </summary> private static HighlightState CleanFlags(PassiveNodeViewModel node, HighlightState flags) { if (!node.IsAscendancyNode) { return(flags); } return(flags & ~HighlightState.Tags); }
/// <summary> /// Returns flags without HighlightState.Tags if the node is an ascendancy node. /// Returns flags unchanged if it is not. /// </summary> private static HighlightState CleanFlags(SkillNode node, HighlightState flags) { if (node.ascendancyName == null) { return(flags); } return(flags & ~HighlightState.Tags); }
public bool NodeHasHighlights(PassiveNodeViewModel node, HighlightState flags) { if (_nodeHighlights.ContainsKey(node)) { return(_nodeHighlights[node].HasFlag(flags)); } return(false); }
public bool NodeHasHighlights(SkillNode node, HighlightState flags) { if (_nodeHighlights.ContainsKey(node)) { return _nodeHighlights[node].HasFlag(flags); } return false; }
public void HighlightNode(SkillNode node, HighlightState newFlags) { var flags = CleanFlags(node, newFlags); if (flags == 0) return; if (_nodeHighlights.ContainsKey(node)) _nodeHighlights[node] |= flags; else _nodeHighlights.Add(node, flags); }
public highlight(NoteWithDuration Note, int Ticks, Transform Trans, HighlightState State, float ZHigh) { note = Note; ticks = Ticks; trans = Trans; state = State; zHigh = ZHigh; }
public void HighlightOffInstant() { minHighlight = 1f; highlightState = HighlightState.None; highlight = minHighlight; UpdateMaterials(); }
public Highlight(HighlightState state, string gridBackground, string gridForeground, System.Drawing.FontStyle gridFontStyle, string panelBackground) { this.State = state; this.GridBackground = gridBackground; this.GridForeground = gridForeground; this.GridFontStyle = gridFontStyle; this.PanelBackground = panelBackground; }
public bool NodeHasHighlights(SkillNode node, HighlightState flags) { if (nodeHighlights.ContainsKey(node)) { return(nodeHighlights[node].HasFlag(flags)); } return(false); }
/// <summary> /// Returns flags without HighlightState.Tags if the node is an ascendancy node. /// Returns flags unchanged if it is not. /// </summary> private static HighlightState CleanFlags(SkillNode node, HighlightState flags) { if (!node.IsAscendancyNode) { return(flags); } return(flags & ~HighlightState.Tags); }
public string GetAttribute(string attr, HighlightState highlightState = HighlightState.Default) { LogElementAction("loc.el.getattr", attr); JsActions.HighlightElement(highlightState); var value = DoWithRetry(() => GetElement().GetAttribute(attr)); LogElementAction("loc.el.attr.value", attr, value); return(value); }
public string GetCssValue(string propertyName, HighlightState highlightState = HighlightState.Default) { LogElementAction("loc.el.cssvalue", propertyName); JsActions.HighlightElement(highlightState); var value = DoWithRetry(() => GetElement().GetCssValue(propertyName)); LogElementAction("loc.el.attr.value", propertyName, value); return(value); }
/// <summary> /// For all nodes that have at least one of the ifFlags: /// Removes flags not in ifFlags, adds newFlags. /// </summary> public void HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags) { var pairs = nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray(); foreach (var pair in pairs) { nodeHighlights[pair.Key] &= ifFlags; nodeHighlights[pair.Key] |= newFlags; } }
public string GetText(HighlightState highlightState = HighlightState.Default) { LogElementAction("loc.get.text"); JsActions.HighlightElement(highlightState); var value = DoWithRetry(() => GetElement().Text); LogElementAction("loc.text.value", value); return(value); }
/** * Flashes the highlight effect on, and then off, once. */ public void Flash() { if (highlightState != HighlightState.Flash && (highlightState == HighlightState.None || direction == -1)) { highlightState = HighlightState.Flash; highlight = minHighlight; direction = 1; fadeStartTime = Time.time; } }
public void UnhighlightAllNodes(HighlightState removeFlags) { // Kludge cast to avoid a "Collection was modified" exception. var keys = nodeHighlights.Keys.ToArray(); foreach (SkillNode node in keys) { UnhighlightNode(node, removeFlags); } }
public void ToggleHighlightNode(SkillNode node, HighlightState toggleFlags) { if (toggleFlags == 0) return; if (nodeHighlights.ContainsKey(node)) { nodeHighlights[node] ^= toggleFlags; if (nodeHighlights[node] == 0) nodeHighlights.Remove(node); } else nodeHighlights.Add(node, toggleFlags); }
/// <summary> /// For all nodes that have at least one of the ifFlags: /// Removes flags not in ifFlags, adds newFlags. /// </summary> public void HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags) { var pairs = nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray(); foreach (var pair in pairs) { nodeHighlights[pair.Key] &= ifFlags; nodeHighlights[pair.Key] |= CleanFlags(pair.Key, newFlags); } }
public void UnhighlightNode(SkillNode node, HighlightState removeFlags) { if (_nodeHighlights.ContainsKey(node)) { // Each flag only remains set if it's not one of the flags to be removed. HighlightState newState = _nodeHighlights[node] & ~removeFlags; if (newState == 0) _nodeHighlights.Remove(node); else _nodeHighlights[node] = newState; } }
public void SetHighlighMode(HighlightState highlight) { CancelCurrentTransforms(); if(highlight == HighlightState.Choosen) SoundManager.Instance.PlaySound("sfx_slot_aktyw_ID18"); switch(highlight) { case HighlightState.None: SetAlpha(Glow, 0.0f); SetAlpha(Diagram, DiagramNormalAlpa); break; case HighlightState.Active: SetAlpha(Glow, 1.0f); SetAlpha(Diagram, DiagramNormalAlpa); break; case HighlightState.Choosen: SetAlpha(Glow, 1.0f); SetAlpha(Diagram, DiagramGlowAlpha); break; } }
public void SetHighlighModeImmediately(HighlightState highlight) { CancelCurrentTransforms(); switch(highlight) { case HighlightState.None: SetAlphaImmediately(Glow, 0.0f); SetAlphaImmediately(Diagram, DiagramNormalAlpa); break; case HighlightState.Active: SetAlphaImmediately(Glow, 1.0f); SetAlphaImmediately(Diagram, DiagramNormalAlpa); break; case HighlightState.Choosen: SetAlphaImmediately(Glow, 1.0f); SetAlphaImmediately(Diagram, DiagramGlowAlpha); break; } }
public static object GetHighlightValue(HighlightState state, string explicitValue, string valueKind) { if (!string.IsNullOrEmpty(explicitValue)) { return _brushConverter.ConvertFromString(explicitValue); } else { var resource = System.Windows.Application.Current.TryFindResource(string.Format("HighlightState_{0}_{1}", state.ToString(), valueKind)); return resource ?? DependencyProperty.UnsetValue; } }
public void HighlightOffInstant () { highlightState = HighlightState.None; highlight = 1f; UpdateMaterials (); }
public void HighlightNodes(IEnumerable<SkillNode> nodes, HighlightState newFlags) { foreach (SkillNode node in nodes) HighlightNode(node, newFlags); }
/// <summary> /// Returns flags without HighlightState.Tags if the node is an ascendancy node. /// Returns flags unchanged if it is not. /// </summary> private static HighlightState CleanFlags(SkillNode node, HighlightState flags) { if (node.ascendancyName == null) return flags; return flags & ~HighlightState.Tags; }
public void HighlightOn () { highlightState = HighlightState.Normal; direction = 1; fadeStartTime = Time.time; if (highlight > 1f) { fadeStartTime -= (highlight - 1f) / (maxHighlight - 1f) * fadeTime; } else { highlight = 1f; } }
public void HighlightOnInstant () { highlightState = HighlightState.None; highlight = maxHighlight; UpdateMaterials (); }
public void ReplaceHighlights(List<SkillNode> newNodes, HighlightState replaceFlags) { UnhighlightAllNodes(replaceFlags); HighlightNodes(newNodes, replaceFlags); }
/// <summary> /// Removes <paramref name="replaceFlags"/> from all nodes and then adds them to all nodes /// in <paramref name="newNodes"/>. /// </summary> public void ResetHighlights(IEnumerable<SkillNode> newNodes, HighlightState replaceFlags) { UnhighlightAllNodes(replaceFlags); HighlightNodes(newNodes, replaceFlags); }
/** * Turns the highlight effect on. The effect will occur over time. */ public void HighlightOn() { highlightState = HighlightState.Normal; direction = 1; fadeStartTime = Time.time; if (highlight > minHighlight) { fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime; } else { highlight = minHighlight; } }
/** * Removes all highlighting from the inventory item curently being highlighted. */ public void HighlightItemOffInstant() { highlightItem = null; highlightState = HighlightState.None; pulse = 0f; }
public Highlight(HighlightState state) : this(state, null, null, System.Drawing.FontStyle.Regular, null) { }
/** * <summary>Fully highlights an inventory item instantly.</summary> * <param name = "_id">The ID number of the inventory item (see InvItem) to highlight</param> */ public void HighlightItemOnInstant(int _id) { highlightItem = GetItem (_id); highlightState = HighlightState.None; pulse = 1f; }
/** * Instantly turns the highlight effect on, to its maximum intensity. */ public void HighlightOnInstant() { highlightState = HighlightState.On; highlight = maxHighlight; UpdateMaterials (); if (callEvents && onHighlightOn != null) { onHighlightOn.Invoke(); } }
/** * Turns the highlight effect on. The effect will occur over time. */ public void HighlightOn() { highlightState = HighlightState.Normal; direction = 1; fadeStartTime = Time.time; if (highlight > minHighlight) { fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime; } else { highlight = minHighlight; } if (callEvents && onHighlightOn != null) { onHighlightOn.Invoke(); } }
/** * Instantly turns the highlight effect off. */ public void HighlightOffInstant() { minHighlight = 1f; highlightState = HighlightState.None; highlight = minHighlight; UpdateMaterials (); if (callEvents && onHighlightOff != null) { onHighlightOff.Invoke(); } }
public void HighlightOff () { highlightState = HighlightState.Normal; direction = -1; fadeStartTime = Time.time; if (highlight < maxHighlight) { fadeStartTime -= (maxHighlight - highlight) / (maxHighlight - 1) * fadeTime; } else { highlight = maxHighlight; } }
private void FixedUpdate () { if (highlightState != HighlightState.None) { if (direction == 1) { // Add highlight highlight = Mathf.Lerp (1f, maxHighlight, AdvGame.Interpolate (fadeStartTime, fadeTime, MoveMethod.Linear, null)); if (highlight >= maxHighlight) { highlight = maxHighlight; if (highlightState == HighlightState.Flash || highlightState == HighlightState.Pulse) { direction = -1; fadeStartTime = Time.time; } else { highlightState = HighlightState.None; } } } else { // Remove highlight highlight = Mathf.Lerp (maxHighlight, 1f, AdvGame.Interpolate (fadeStartTime, fadeTime, AC.MoveMethod.Linear, null)); if (highlight <= 1f) { highlight = 1f; if (highlightState == HighlightState.Pulse) { direction = 1; fadeStartTime = Time.time; } else { highlightState = HighlightState.None; } } } if (brightenMaterials) { UpdateMaterials (); } } }
/// <summary> /// For all nodes that have at least one of the ifFlags: /// Removes flags not in ifFlags, adds newFlags. /// </summary> /// <returns>All affected nodes.</returns> public IEnumerable<SkillNode> HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags) { var pairs = _nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray(); foreach (var pair in pairs) { _nodeHighlights[pair.Key] &= ifFlags; _nodeHighlights[pair.Key] |= CleanFlags(pair.Key, newFlags); } return pairs.Select(p => p.Key); }
public void Pulse () { highlightState = HighlightState.Pulse; highlight = 1f; direction = 1; fadeStartTime = Time.time; }