Beispiel #1
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            float nepX = RootExpansionProgress;
            float lepX = 1 - RootExpansionProgress;

            float iep0 = 1 - FloatMath.FunctionEaseOutCubic(ExpansionProgress[0]);
            float lep0 = 1 - ExpansionProgress[0];
            float nep0 = ExpansionProgress[0];

            float iep1 = 1 - FloatMath.FunctionEaseOutCubic(ExpansionProgress[1]);
            float lep1 = 1 - ExpansionProgress[1];
            float nep1 = ExpansionProgress[1];

            float iep2 = 1 - FloatMath.FunctionEaseOutCubic(ExpansionProgress[2]);
            float lep2 = 1 - ExpansionProgress[2];
            float nep2 = ExpansionProgress[2];

            float iep3 = 1 - FloatMath.FunctionEaseOutCubic(ExpansionProgress[3]);
            float lep3 = 1 - ExpansionProgress[3];
            float nep3 = ExpansionProgress[3];

            #region Expander

            if (State[(int)FractionDifficulty.DIFF_0] != BistateProgress.Closed)
            {
                FlatRenderHelper.DrawOutlinesBlurRectangle(
                    sbatch,
                    rectExpanderNorth.AsTranslated(0, HEIGHT_EXTENDER * iep0).LimitSingleCoordSouth(Position.Y),
                    2,
                    LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.COLOR_DIFFICULTY_0 : COLOR_DEACTIVATED,
                    COLOR_BORDER,
                    8,
                    10);
            }

            if (State[(int)FractionDifficulty.DIFF_1] != BistateProgress.Closed)
            {
                FlatRenderHelper.DrawOutlinesBlurRectangle(
                    sbatch,
                    rectExpanderEast.AsTranslated(-HEIGHT_EXTENDER * iep1, 0).LimitSingleCoordWest(Position.X),
                    2,
                    LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.COLOR_DIFFICULTY_1 : COLOR_DEACTIVATED,
                    COLOR_BORDER,
                    8,
                    10);
            }

            if (State[(int)FractionDifficulty.DIFF_2] != BistateProgress.Closed)
            {
                FlatRenderHelper.DrawOutlinesBlurRectangle(
                    sbatch,
                    rectExpanderSouth.AsTranslated(0, -HEIGHT_EXTENDER * iep2).LimitSingleCoordNorth(Position.Y),
                    2,
                    LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.COLOR_DIFFICULTY_2 : COLOR_DEACTIVATED,
                    COLOR_BORDER,
                    8,
                    10);
            }

            if (State[(int)FractionDifficulty.DIFF_3] != BistateProgress.Closed)
            {
                FlatRenderHelper.DrawOutlinesBlurRectangle(
                    sbatch,
                    rectExpanderWest.AsTranslated(HEIGHT_EXTENDER * iep3, 0).LimitSingleCoordEast(Position.X),
                    2,
                    LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.COLOR_DIFFICULTY_3 : COLOR_DEACTIVATED,
                    COLOR_BORDER,
                    8,
                    10);
            }

            #endregion

            #region Icons

            if (State[(int)FractionDifficulty.DIFF_0] != BistateProgress.Closed)
            {
                sbatch.DrawStretched(
                    Textures.TexDifficultyLine0,
                    rectExpanderNorth
                    .ToSquare(ICON_SIZE, FlatAlign9.NORTH)
                    .AsTranslated(0, +ICON_OFFSET)
                    .AsTranslated(0, HEIGHT_EXTENDER * iep0),
                    clickAreaD0.IsMouseDown() ? FlatColors.WetAsphalt : Color.White);
            }

            if (State[(int)FractionDifficulty.DIFF_1] != BistateProgress.Closed)
            {
                sbatch.DrawStretched(
                    Textures.TexDifficultyLine1,
                    rectExpanderEast
                    .ToSquare(ICON_SIZE, FlatAlign9.EAST)
                    .AsTranslated(-ICON_OFFSET, 0)
                    .AsTranslated(-HEIGHT_EXTENDER * iep1, 0),
                    clickAreaD1.IsMouseDown() ? FlatColors.WetAsphalt : Color.White);
            }

            if (State[(int)FractionDifficulty.DIFF_2] != BistateProgress.Closed)
            {
                sbatch.DrawStretched(
                    Textures.TexDifficultyLine2,
                    rectExpanderSouth
                    .ToSquare(ICON_SIZE, FlatAlign9.SOUTH)
                    .AsTranslated(0, -ICON_OFFSET)
                    .AsTranslated(0, -HEIGHT_EXTENDER * iep2),
                    clickAreaD2.IsMouseDown() ? FlatColors.WetAsphalt : Color.White);
            }

            if (State[(int)FractionDifficulty.DIFF_3] != BistateProgress.Closed)
            {
                sbatch.DrawStretched(
                    Textures.TexDifficultyLine3,
                    rectExpanderWest
                    .ToSquare(ICON_SIZE, FlatAlign9.WEST)
                    .AsTranslated(+ICON_OFFSET, 0)
                    .AsTranslated(HEIGHT_EXTENDER * iep3, 0),
                    clickAreaD3.IsMouseDown() ? FlatColors.WetAsphalt : Color.White);
            }

            #endregion

            #region Ground

            if (NodeEnabled)
            {
                sbatch.DrawCentered(Textures.TexCircle, Position, DIAMETER, DIAMETER, FlatColors.Asbestos);
            }
            else
            {
                sbatch.DrawCentered(Textures.TexCircle, Position, DIAMETER, DIAMETER, FlatColors.Silver);
            }

            #endregion

            #region Segments

            sbatch.DrawCentered(
                Textures.TexLevelNodeSegment,
                Position,
                DIAMETER,
                DIAMETER,
                LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.COLOR_DIFFICULTY_0.BlendTo(COLOR_DEACTIVATED, 0.3f * lepX) : COLOR_DEACTIVATED, FloatMath.RAD_POS_000 + FloatMath.TAU * nepX);

            sbatch.DrawCentered(
                Textures.TexLevelNodeSegment,
                Position,
                DIAMETER,
                DIAMETER,
                LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.COLOR_DIFFICULTY_1.BlendTo(COLOR_DEACTIVATED, 0.3f * lepX) : COLOR_DEACTIVATED, FloatMath.RAD_POS_090 + FloatMath.TAU * nepX);

            sbatch.DrawCentered(
                Textures.TexLevelNodeSegment,
                Position,
                DIAMETER,
                DIAMETER,
                LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.COLOR_DIFFICULTY_2.BlendTo(COLOR_DEACTIVATED, 0.3f * lepX) : COLOR_DEACTIVATED, FloatMath.RAD_POS_180 + FloatMath.TAU * nepX);

            sbatch.DrawCentered(
                Textures.TexLevelNodeSegment,
                Position,
                DIAMETER,
                DIAMETER,
                LevelData.HasCompletedOrBetter(FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.COLOR_DIFFICULTY_3.BlendTo(COLOR_DEACTIVATED, 0.3f * lepX) : COLOR_DEACTIVATED, FloatMath.RAD_POS_270 + FloatMath.TAU * nepX);

            #endregion

            #region Structure

            sbatch.DrawCentered(Textures.TexLevelNodeStructure, Position, DIAMETER, DIAMETER, FlatColors.MidnightBlue, FloatMath.TAU * nepX);

            #endregion

            #region Text

            FontRenderHelper.DrawTextCentered(sbatch, Textures.HUDFontBold, FONTSIZE, Blueprint.Name, ColorMath.Blend(FlatColors.Clouds, FlatColors.MidnightBlue, nepX), Position);

            #endregion
        }
Beispiel #2
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), clickAreaThis.IsMouseDown() ? FlatColors.WetAsphalt : FlatColors.Asbestos);
            SimpleRenderHelper.DrawSimpleRectOutline(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), 2, FlatColors.MidnightBlue);

            SimpleRenderHelper.DrawRoundedRect(sbatch, FRectangle.CreateByCenter(Position, INNER_DIAMETER, INNER_DIAMETER), NodeEnabled ? ColorMath.Blend(Color.Black, FlatColors.Background, ColorOverdraw) : FlatColors.Asbestos);

            FontRenderHelper.DrawTextCenteredWithBackground(
                sbatch,
                Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH,
                L10N.T(Levels.WORLD_NAMES[Target.ID]),
                FlatColors.TextHUD,
                Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH),
                FlatColors.BackgroundHUD2 * 0.5f);

            if (!NodeEnabled)
            {
                var scale = 1 + FloatMath.Sin(Lifetime) * 0.05f;
                sbatch.DrawCentered(Textures.TexIconLock, Position, INNER_DIAMETER * scale, INNER_DIAMETER * scale, Color.Black);
            }
        }
Beispiel #3
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), clickAreaThis.IsMouseDown() ? FlatColors.WetAsphalt : FlatColors.Asbestos);
            SimpleRenderHelper.DrawSimpleRectOutline(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), 2, FlatColors.MidnightBlue);

            SimpleRenderHelper.DrawRoundedRect(sbatch, FRectangle.CreateByCenter(Position, INNER_DIAMETER, INNER_DIAMETER), Color.Black);

            FontRenderHelper.DrawTextCenteredWithBackground(
                sbatch,
                Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH,
                L10N.T(L10NImpl.STR_GLOB_OVERWORLD),
                FlatColors.TextHUD,
                Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH),
                FlatColors.BackgroundHUD2 * 0.5f);
        }