Exemple #1
0
        public void DrawPrimitives()
        {
            for (int i = 0; i < FlverSkeleton.Count; i++)
            {
                var prevBoneColor = DBG.COLOR_FLVER_BONE;

                if (DebugDrawTransformOfFlverBoneIndex >= 0)
                {
                    if (DebugDrawTransformOfFlverBoneIndex == i)
                    {
                        DBG.COLOR_FLVER_BONE = Main.Colors.ColorHelperFlverBoneBoundingBox * 0.75f;
                    }
                    else
                    {
                        DBG.COLOR_FLVER_BONE = Main.Colors.ColorHelperFlverBone * 0.5f;
                    }
                }

                FlverSkeleton[i].DrawPrim(MODEL.CurrentTransform.WorldMatrix);

                DBG.COLOR_FLVER_BONE = Main.Colors.ColorHelperFlverBone = prevBoneColor;

                if (i == DebugDrawTransformOfFlverBoneIndex || (FlverSkeleton[i].EnablePrimDraw && DebugDrawTransformOfFlverBoneIndex < 0))
                {
                    if (DBG.GetCategoryEnableDraw(DebugPrimitives.DbgPrimCategory.FlverBone))
                    {
                        DebugDrawTransformOfFlverBonePrim.Transform = new Transform(
                            Matrix.CreateRotationY(MathHelper.Pi) *
                            Matrix.CreateScale(0.1f, 0.1f, 0.1f) * FlverSkeleton[i].CurrentMatrix);

                        if (DebugDrawTransformOfFlverBoneIndex == i)
                        {
                            DebugDrawTransformOfFlverBonePrim.OverrideColor = Main.Colors.ColorHelperFlverBone;
                        }
                        else
                        {
                            DebugDrawTransformOfFlverBonePrim.OverrideColor = new Color(Main.Colors.ColorHelperFlverBone.R,
                                                                                        Main.Colors.ColorHelperFlverBone.G, Main.Colors.ColorHelperFlverBone.B, (byte)(255 / 4));
                        }
                        DebugDrawTransformOfFlverBonePrim.Draw(null, MODEL.CurrentTransform.WorldMatrix);
                    }

                    if (i == DebugDrawTransformOfFlverBoneIndex || DBG.GetCategoryEnableNameDraw(DebugPrimitives.DbgPrimCategory.FlverBone))
                    {
                        DebugDrawTransformOfFlverBoneTextDrawer.Clear();

                        DebugDrawTransformOfFlverBoneTextDrawer.AppendLine(
                            FlverSkeleton[i].Name,
                            Main.Colors.ColorHelperFlverBone);

                        DebugDrawTransformOfFlverBoneTextDrawer.Position3D =
                            Vector3.Transform(Vector3.Zero,
                                              FlverSkeleton[i].CurrentMatrix
                                              * MODEL.CurrentTransform.WorldMatrix);

                        GFX.SpriteBatchBeginForText();
                        DebugDrawTransformOfFlverBoneTextDrawer.Draw();
                        GFX.SpriteBatchEnd();
                    }
                }
            }
        }
Exemple #2
0
        public static void DrawAllTasks()
        {
            lock (_lock_TaskDictEdit)
            {
                if (TaskDict.Count > 0)
                {
                    GFX.SpriteBatchBegin();

                    //int i = 0;
                    int currentVerticalOffset = 0;
                    foreach (var kvp in TaskDict)
                    {
                        int taskRectHeight = GuiTaskRectHeightWithBar;

                        if (kvp.Value.ProgressRatio < 0)
                        {
                            taskRectHeight = GuiTaskRectHeightNoBar;
                        }

                        // Draw Task Rect
                        Rectangle thisTaskRect = new Rectangle(
                            GFX.Device.Viewport.Width - GuiTaskRectWidth - GuiDistFromEdgesOfScreenX,
                            GuiDistFromEdgesOfScreenY + currentVerticalOffset,
                            GuiTaskRectWidth, taskRectHeight);

                        GFX.SpriteBatch.Draw(Main.DEFAULT_TEXTURE_DIFFUSE, thisTaskRect, Color.Black * 0.85f);

                        if (kvp.Value.ProgressRatio >= 0)
                        {
                            // Draw Progress Background Rect

                            Rectangle progBackgroundRect = new Rectangle(thisTaskRect.X + GuiProgBarDistFromRectEdge,
                                                                         thisTaskRect.Y + taskRectHeight - GuiProgBarDistFromRectEdge - GuiProgBarHeight,
                                                                         thisTaskRect.Width - (GuiProgBarDistFromRectEdge * 2), GuiProgBarHeight);

                            GFX.SpriteBatch.Draw(Main.DEFAULT_TEXTURE_DIFFUSE, progBackgroundRect, new Color(0.25f, 0.25f, 0.25f) * 0.95f);

                            // Draw Progress Foreground Rect

                            Rectangle progForegroundRect = new Rectangle(
                                progBackgroundRect.X + GuiProgBarEdgeThickness,
                                progBackgroundRect.Y + GuiProgBarEdgeThickness,
                                (int)((progBackgroundRect.Width - (GuiProgBarEdgeThickness * 2)) * kvp.Value.ProgressRatio),
                                progBackgroundRect.Height - (GuiProgBarEdgeThickness * 2));

                            GFX.SpriteBatch.Draw(Main.DEFAULT_TEXTURE_DIFFUSE, progForegroundRect,
                                                 kvp.Value.IsBeingKilledManually ? Color.Red : Color.White);
                        }

                        // Draw Task Name

                        Vector2 taskNamePos = new Vector2(thisTaskRect.X + GuiProgNameDistFromEdge, thisTaskRect.Y + GuiProgNameDistFromEdge);

                        DBG.DrawOutlinedText(kvp.Value.DisplayString, taskNamePos,
                                             Color.White, DBG.DEBUG_FONT_SMALL, startAndEndSpriteBatchForMe: false);

                        currentVerticalOffset += (GuiDistBetweenProgressRects + taskRectHeight);
                    }

                    GFX.SpriteBatchEnd();
                }
            }
        }