Beispiel #1
0
    public void SetHeaderState(HeaderState newState)
    {
        headerState = newState;

        switch (newState)
        {
        case HeaderState.WAIT_TO_APPEAR:
            levelHeaderGroup.alpha = 0;
            waitTimer = waitToAppearLength;
            break;

        case HeaderState.APPEAR:
            levelHeaderGroup.alpha = 0;
            break;

        case HeaderState.VISIBLE:
            levelHeaderGroup.alpha = 1;
            waitTimer = stayVisibleLength;
            break;

        case HeaderState.DISAPPREAR:
            levelHeaderGroup.alpha = 1;
            break;

        case HeaderState.INACTIVE:
            levelHeaderGroup.alpha = 0;
            break;
        }
    }
Beispiel #2
0
        public override void DrawTuxBarItemHeaderBK(Graphics gfx, Rectangle dest, HeaderState state)
        {
            gfx.SmoothingMode = SmoothingMode.HighQuality;

            GraphicsPath path = new GraphicsPath();

            int right  = (dest.X + dest.Width);
            int left   = dest.X;
            int bottom = dest.X + dest.Height + 1;

            path.AddArc(left, dest.Y, 20, 20, 180, 90);
            path.AddArc(right - 20, 0, 20, 20, 270, 90);
            path.AddLine(right, 20, right, bottom);


            path.AddLine(right, bottom, 0, bottom);


            //else



            path.AddLine(left, bottom, left, 20);
            path.CloseFigure();

            Color color2 = TuxBar.Graphic.Utils.GetLightColor(BaseColor, 220.5f);

            LinearGradientBrush lnb = new LinearGradientBrush(dest, BaseColor, color2, 45);

            //gfx.FillRectangle( Brushes.Green,dest);
            gfx.FillPath(lnb, path);

            //if (state == HeaderState.Collapsed)
            gfx.DrawPath(Pens.Black, path);

            /*else
             *      gfx.DrawPath(Pens.DarkBlue, path);*/

            /*if (state == HeaderState.Collapsed)
             *      gfx.DrawLine(new Pen(Utils.GetLightColor(Color.Black,100.0f)), 2, bottom - 1, right-1, bottom - 1);*/


            path = new GraphicsPath();

            dest.Y++;
            right  = (dest.X + dest.Width) - 2;
            left   = dest.X + 1;
            bottom = dest.X + dest.Height + 2;

            path.AddArc(left, dest.Y, 20, 20, 180, 90);
            path.AddArc(right - 20, dest.Y, 20, 20, 270, 90);
            path.AddLine(right, 20, right, bottom);
            path.AddLine(right, bottom, 0, bottom);
            path.AddLine(left, bottom, left, 20);
            path.CloseFigure();


            gfx.DrawPath(Pens.White, path);
        }
Beispiel #3
0
        public override void DrawTuxBarItemHeaderBK(Graphics gfx, Rectangle dest, HeaderState state)
        {
            gfx.SmoothingMode = SmoothingMode.HighQuality;

            GraphicsPath path = new GraphicsPath();

            int right = (dest.X + dest.Width);
            int left = dest.X;
            int bottom = dest.X + dest.Height + 1;

            path.AddArc(left, dest.Y, 20, 20, 180, 90);
            path.AddArc(right - 20, 0, 20, 20, 270, 90);
            path.AddLine(right, 20, right, bottom);

                path.AddLine(right, bottom, 0, bottom);

            //else

            path.AddLine(left, bottom, left, 20);
            path.CloseFigure();

            Color color2 = TuxBar.Graphic.Utils.GetLightColor(BaseColor, 220.5f);

            LinearGradientBrush lnb = new LinearGradientBrush(dest, BaseColor, color2, 45);

            //gfx.FillRectangle( Brushes.Green,dest);
            gfx.FillPath(lnb, path);

            //if (state == HeaderState.Collapsed)
            gfx.DrawPath(Pens.Black, path);
            /*else
                gfx.DrawPath(Pens.DarkBlue, path);*/

            /*if (state == HeaderState.Collapsed)
                gfx.DrawLine(new Pen(Utils.GetLightColor(Color.Black,100.0f)), 2, bottom - 1, right-1, bottom - 1);*/

            path = new GraphicsPath();

            dest.Y++;
            right = (dest.X + dest.Width) - 2;
            left = dest.X + 1;
            bottom = dest.X + dest.Height + 2;

            path.AddArc(left, dest.Y, 20, 20, 180, 90);
            path.AddArc(right - 20, dest.Y, 20, 20, 270, 90);
            path.AddLine(right, 20, right, bottom);
            path.AddLine(right, bottom, 0, bottom);
            path.AddLine(left, bottom, left, 20);
            path.CloseFigure();

            gfx.DrawPath(Pens.White, path);
        }
Beispiel #4
0
        public TimelineAssetEditionMode()
        {
            headerState = new HeaderState
            {
                breadCrumb       = TimelineModeGUIState.Enabled,
                options          = TimelineModeGUIState.Enabled,
                sequenceSelector = TimelineModeGUIState.Enabled
            };

            trackOptionsState = new TrackOptionsState
            {
                newButton         = TimelineModeGUIState.Enabled,
                editAsAssetButton = TimelineModeGUIState.Enabled
            };
        }
Beispiel #5
0
 public BdiFileState()
 {
     //InitializeCotacoes();
     Header               = new HeaderState();
     Indices              = new List <IndiceState>();
     Cotacoes             = new List <CotacaoState>();
     ResumoPorCodBdi      = new List <ResumoBdiState>();
     MaiorOsilacaoAvista  = new List <MaiorOscilacaoVistaState>();
     MaiorOsilacaoIbov    = new List <MaiorOscilacaoIbovState>();
     MaisNegociadasAVista = new List <MaisNegociadasVistaState>();
     MaisNegociadas       = new List <MaisNegociadasState>();
     Iopv    = new List <ResumoDiarioIopvState>();
     BDR     = new List <BdrState>();
     Trailer = new TrailerState();
 }
        public TimelineReadOnlyMode()
        {
            headerState = new HeaderState()
            {
                breadCrumb       = TimelineModeGUIState.Enabled,
                options          = TimelineModeGUIState.Enabled,
                sequenceSelector = TimelineModeGUIState.Enabled,
            };

            trackOptionsState = new TrackOptionsState()
            {
                newButton         = TimelineModeGUIState.Disabled,
                editAsAssetButton = TimelineModeGUIState.Disabled,
            };
            mode = TimelineModes.ReadOnly;
        }
Beispiel #7
0
        public TimelineActiveMode()
        {
            headerState = new HeaderState
            {
                breadCrumb       = TimelineModeGUIState.Enabled,
                options          = TimelineModeGUIState.Enabled,
                sequenceSelector = TimelineModeGUIState.Enabled
            };

            trackOptionsState = new TrackOptionsState
            {
                newButton         = TimelineModeGUIState.Enabled,
                editAsAssetButton = TimelineModeGUIState.Hidden
            };
            mode = TimelineModes.Active;
        }
        HeaderState TransitionAdornmentLine(HeaderState state)
        {
            switch (state)
            {
                case HeaderState.Start:
                    heading = lineText[0];
                    overline = line;
                    return HeaderState.Overline;

                case HeaderState.Text1:
                    if (line.Length >= title.Length)
                    {
                        underline = line;
                        heading = lineText[0];
                        return HeaderState.Underline;
                    }
                    else
                    {
                        return HeaderState.Text;
                    }

                case HeaderState.Title:
                    if (lineText[0] == heading && 
                        line.Length == overline.Length && 
                        line.Length >= title.Length)
                    {
                        underline = line;
                        return HeaderState.Underline;
                    }
                    else
                    {
                        return HeaderState.Text;  // Overline does not match underline or is too short
                    }

                default:   // If state is overline or underline, then we have two consecutive adornment lines 
                    return HeaderState.Text;
            }
        }
Beispiel #9
0
 public virtual void DrawTuxBarItemHeaderButton(Graphics gfx, Rectangle bounds, HeaderState state)
 {
 }
Beispiel #10
0
 public virtual void DrawTuxBarItemHeaderBK(Graphics gfx, Rectangle dest, HeaderState state)
 {
 }
Beispiel #11
0
		public virtual void DrawTuxBarItemHeaderButton(Graphics gfx, Rectangle bounds,HeaderState state)
		{
		}
Beispiel #12
0
		public virtual void DrawTuxBarItemHeaderBK(Graphics gfx, Rectangle dest, HeaderState state)
		{
		}
Beispiel #13
0
 public override void DrawTuxBarItemHeaderButton(Graphics gfx, Rectangle bounds, HeaderState state)
 {
     //gfx.FillRectangle( Brushes.Red,bounds);
     if (state == HeaderState.Collapsed)
     {
         gfx.DrawImage(FireIcons.ButtonDown34, bounds);
     }
     else
     {
         gfx.DrawImage(FireIcons.ButtonUp34, bounds);
     }
 }
Beispiel #14
0
        public override void Start()
        {
            base.Start();

            if (debugButton != null)
            {
                debugButton.SetListener(() => ViewService.Show(ViewType.DebugView));
            }



            gameScroll = FindObjectOfType <GameScrollView>();
            totalCountActiveGenerators = gameScroll.GetComponentsInChildren <PlanetGeneratorView>().Length;
            if (totalCountActiveGenerators == 0)
            {
                totalCountActiveGenerators = 1;
            }
            //Debug.Log($"founded total count of active generators => {totalCountActiveGenerators}".BoldItalic().Colored(ConsoleTextColor.navy));

            Color startColor = rectangularBackgroundImage.color;

            leftModuleFrameInData = new Vector2AnimationData {
                StartValue = new Vector2(-641, -380),
                EndValue   = new Vector2(-1056, -380),
                Duration   = duration * 0.5f,
                EaseType   = easeType,
                Target     = leftModuleTransform.gameObject,
                OnStart    = (pos, go) => leftModuleTransform.anchoredPosition = pos,
                OnEnd      = (pos, go) => {
                    leftModuleTransform.anchoredPosition = pos;
                    Vector2AnimationData smallData = new Vector2AnimationData {
                        StartValue = new Vector2(-1053, -253.4f),
                        EndValue   = new Vector2(-903, -253.4f),
                        Duration   = duration * 0.5f,
                        EaseType   = easeType,
                        Target     = leftModuleSmallTransform.gameObject,
                        OnStart    = (pos2, go2) => leftModuleSmallTransform.anchoredPosition = pos2,
                        OnEnd      = (pos2, go2) => leftModuleSmallTransform.anchoredPosition = pos2,
                        OnUpdate   = (pos2, t2, go2) => leftModuleSmallTransform.anchoredPosition = pos2
                    };
                    leftModuleSmallTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        smallData
                    });
                },
                OnUpdate = (pos, t, go) => leftModuleTransform.anchoredPosition = pos
            };

            leftModuleFrameSmallOutData = new Vector2AnimationData {
                StartValue = new Vector2(-903, -253.4f),
                EndValue   = new Vector2(-1053, -253.4f),
                Duration   = duration * 0.5f,
                EaseType   = easeType,
                Target     = leftModuleSmallTransform.gameObject,
                OnStart    = (pos, go) => leftModuleSmallTransform.anchoredPosition = pos,
                OnEnd      = (pos, go) => {
                    leftModuleSmallTransform.anchoredPosition = pos;
                    Vector2AnimationData leftData = new Vector2AnimationData {
                        StartValue = new Vector2(-1056, -380),
                        EndValue   = new Vector2(-641, -380),
                        EaseType   = EaseType.EaseOutCubic,
                        Duration   = duration,
                        OnStart    = (pos2, go2) => leftModuleTransform.anchoredPosition = pos2,
                        OnEnd      = (pos2, go2) => leftModuleTransform.anchoredPosition = pos2,
                        OnUpdate   = (pos2, t2, go2) => leftModuleTransform.anchoredPosition = pos2
                    };
                    leftModuleTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        leftData
                    });
                },
                OnUpdate = (pos, t, go) => leftModuleSmallTransform.anchoredPosition = pos,
            };

            rightPlanetFrameInData = new Vector2AnimationData {
                StartValue = new Vector2(640, -380),
                EndValue   = new Vector2(1050, -380),
                Duration   = duration * 0.5f,
                EaseType   = easeType,
                OnStart    = (pos, go) => rightPlanetFrameTransform.anchoredPosition = pos,
                OnEnd      = (pos, go) => {
                    rightPlanetFrameTransform.anchoredPosition = pos;
                    Vector2AnimationData smallData = new Vector2AnimationData {
                        StartValue = new Vector2(1056, -253.4f),
                        EndValue   = new Vector2(900, -253.4f),
                        Duration   = 0.5f * duration,
                        EaseType   = easeType,
                        OnStart    = (pos2, go2) => rightPlanetSmallTransform.anchoredPosition = pos2,
                        OnEnd      = (pos2, go2) => rightPlanetSmallTransform.anchoredPosition = pos2,
                        OnUpdate   = (pos2, t2, go2) => rightPlanetSmallTransform.anchoredPosition = pos2,
                        Target     = rightPlanetSmallTransform.gameObject
                    };
                    rightPlanetSmallTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        smallData
                    });
                },
                OnUpdate = (pos, t, go) => rightPlanetFrameTransform.anchoredPosition = pos,
                Target   = rightPlanetFrameTransform.gameObject
            };



            rightPlanetFrameSmallOutData = new Vector2AnimationData {
                StartValue = new Vector2(900, -253.4f),
                EndValue   = new Vector2(1056, -253.4f),
                Duration   = 0.5f * duration,
                EaseType   = easeType,
                OnStart    = (pos2, gos2) => rightPlanetSmallTransform.anchoredPosition = pos2,
                OnEnd      = (pos2, go2) => {
                    rightPlanetSmallTransform.anchoredPosition = pos2;
                    Vector2AnimationData rightData = new Vector2AnimationData {
                        StartValue = new Vector2(1050, -380),
                        EndValue   = new Vector2(640, -380),
                        Duration   = duration,
                        EaseType   = EaseType.EaseOutCubic,
                        Target     = rightPlanetFrameTransform.gameObject,
                        OnStart    = (pos, go) => rightPlanetFrameTransform.anchoredPosition = pos,
                        OnEnd      = (pos, go) => rightPlanetFrameTransform.anchoredPosition = pos,
                        OnUpdate   = (pos, t, go) => rightPlanetFrameTransform.anchoredPosition = pos
                    };
                    rightPlanetFrameTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        rightData
                    });
                },
                OnUpdate = (pos2, t2, go2) => rightPlanetSmallTransform.anchoredPosition = pos2
            };



            rectangularBackgroundInData = new Vector2AnimationData {
                StartValue = new Vector2(0, 0),
                EndValue   = new Vector2(0, 383),
                Duration   = duration,
                EaseType   = easeType,
                Target     = rectangularBackgroundTransform.gameObject,
                OnStart    = (pos, go) => {
                    rectangularBackgroundTransform.anchoredPosition = pos;
                    rightPlanetFrameTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        rightPlanetFrameInData
                    });
                    leftModuleTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        leftModuleFrameInData
                    });
                },
                OnEnd = (pos, go) => {
                    State       = HeaderState.Collapsed;
                    isAnimating = false;
                    rectangularBackgroundTransform.anchoredPosition = pos;
                },
                OnUpdate = (pos, t, go) => {
                    rectangularBackgroundTransform.anchoredPosition = pos;
                },
                Events = new List <AnimationEvent <Vector2> > {
                    new AnimationEvent <Vector2> {
                        Mode    = AnimationEventMode.Single,
                        IsValid = (pos, t, go) => {
                            if (pos.y >= 0f)
                            {
                                return(true);
                            }
                            return(false);
                        },
                        OnEvent = (pos, t, go) => {
                            Color sourceColor            = rectangularBackgroundImage.color;
                            ColorAnimationData colorData = new ColorAnimationData {
                                Duration   = duration * Mathf.Clamp01(60 / rectangularBackgroundTransform.sizeDelta.y) * 0.2f,
                                EaseType   = easeType,
                                StartValue = sourceColor,
                                EndValue   = new Color(sourceColor.r, sourceColor.g, sourceColor.b, 0),
                                Target     = rectangularBackgroundImage.gameObject,
                                OnStart    = (c, go2) => rectangularBackgroundImage.color = c,
                                OnEnd      = (c, go2) => rectangularBackgroundImage.color = c,
                                OnUpdate   = (c, t2, go2) => rectangularBackgroundImage.color = c
                            };
                            rectangularBackgroundImage.GetComponent <ColorAnimator>().StartAnimation(new List <ColorAnimationData> {
                                colorData
                            });
                        }
                    }
                }
            };

            rectangularBackgroundOutData = new Vector2AnimationData {
                StartValue = new Vector2(0, 383),
                EndValue   = new Vector2(0, 0),
                Duration   = duration,
                EaseType   = easeType,
                OnStart    = (pos, go) => {
                    rectangularBackgroundTransform.anchoredPosition = pos;

                    /*
                     * rightPlanetFrameTransform.GetComponent<Vector2Animator>().StartAnimation(new List<Vector2AnimationData> {
                     *  rightPlanetFrameOutData
                     * });*/
                    rightPlanetSmallTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        rightPlanetFrameSmallOutData
                    });
                    leftModuleSmallTransform.GetComponent <Vector2Animator>().StartAnimation(new List <Vector2AnimationData> {
                        leftModuleFrameSmallOutData
                    });
                },
                OnEnd = (pos, go) => {
                    State       = HeaderState.Expanded;
                    isAnimating = false;
                    rectangularBackgroundTransform.anchoredPosition = pos;
                },
                OnUpdate = (pos, t, go) => rectangularBackgroundTransform.anchoredPosition = pos,
                Target   = rectangularBackgroundTransform.gameObject,
                Events   = new List <AnimationEvent <Vector2> > {
                    new AnimationEvent <Vector2> {
                        Mode    = AnimationEventMode.Single,
                        IsValid = (pos, t, go) => {
                            if (pos.y <= 60)
                            {
                                return(true);
                            }
                            return(false);
                        },
                        OnEvent = (pos, t, go) => {
                            ColorAnimationData colorData = new ColorAnimationData {
                                Duration   = (1.0f - t) * duration,
                                EaseType   = easeType,
                                StartValue = new Color(0, 0, 0, 0),
                                EndValue   = startColor,
                                Target     = rectangularBackgroundImage.gameObject,
                                OnStart    = (c, go2) => rectangularBackgroundImage.color = c,
                                OnEnd      = (c, go2) => rectangularBackgroundImage.color = c,
                                OnUpdate   = (c, t2, go2) => rectangularBackgroundImage.color = c
                            };
                            rectangularBackgroundImage.GetComponent <ColorAnimator>().StartAnimation(new List <ColorAnimationData> {
                                colorData
                            });
                        }
                    }
                }
            };

            updateTimer.Setup(0.4f, (delta) => {
                if (gameScroll.VerticalNormalizedPosition >= MaxVerticalNormalizedPositionWhenEnableHiding)
                {
                    if (State == HeaderState.Collapsed && !isAnimating)
                    {
                        Expand();
                    }
                }
                else
                {
                    if (State == HeaderState.Expanded && !isAnimating)
                    {
                        Collapse();
                    }
                }
            }, true);
        }
        HeaderState TransitionTextLine(HeaderState state)
        {
            switch (state)
            {
                case HeaderState.Start:
                    title = line;  // May be a title
                    return state = HeaderState.Text1;

                case HeaderState.Overline:
                    title = line;
                    return HeaderState.Title;

                case HeaderState.Underline:
                    CreateClassificationSpan();
                    title = line;  // This may be the start of another title
                    return HeaderState.Text1;

                case HeaderState.Text1:
                    title = null;   // First line was not a title
                    return HeaderState.Text;

                case HeaderState.Text:
                    // no-op
                    return HeaderState.Text;

                case HeaderState.Title:
                    return HeaderState.Text; // Multi-line titles are not allowed

                default:
                    return HeaderState.Text;
            }
        }
Beispiel #16
0
 private void OnScrollHeaderStateChanged(HeaderState State)
 {
     LastState = State;
     ScrollHeaderStateChanged?.Invoke(this, new ScrollHeaderStateChangedEventArgs(State));
 }
Beispiel #17
0
		public override void DrawTuxBarItemHeaderButton(Graphics gfx, Rectangle bounds,HeaderState state)
		{
			//gfx.FillRectangle( Brushes.Red,bounds);
			if(state == HeaderState.Collapsed)
			{
				gfx.DrawImage(FireIcons.ButtonDown34,bounds);
			}
			else
			{
				gfx.DrawImage(FireIcons.ButtonUp34,bounds);
			}
		}
 internal ScrollHeaderStateChangedEventArgs(HeaderState HeaderState)
 {
     State = HeaderState;
 }