Example #1
0
        private jobTextLayout GetJobTextLayout(int JobId, Rect rect, bool IsCasting)
        {
            jobTextLayout job = new jobTextLayout();

            switch (JobId)
            {
            case 19:
            case 21:
            case 32:
                job.job = "TANK"; job.brush = Brushes.DodgerBlue;  job.left = rect.Left + 5; break;

            case 20:
            case 22:
            case 30:
                job.job = "MELE"; job.brush = Brushes.Orange; job.left = rect.Left + 5; break;

            case 23:
            case 31:
                job.job = "RENG"; job.brush = Brushes.Green; job.left = rect.Left + 5; break;

            case 24:
            case 28:
            case 33:
                if (IsCasting)
                {
                    job.job = "HEA●"; job.brush = Brushes.LightGreen; job.left = rect.Left + 5; break;
                }
                else
                {
                    job.job = "HEAL"; job.brush = Brushes.LightGreen; job.left = rect.Left + 5; break;
                }

            case 25:
            case 27:
                if (IsCasting)
                {
                    job.job = "CAS●"; job.brush = Brushes.Yellow; job.left = rect.Left + 5; break;
                }
                else
                {
                    job.job = "CAS"; job.brush = Brushes.Yellow; job.left = rect.Left + 5; break;
                }

            default:
                job.job = ""; job.brush = Brushes.Black; job.left = rect.Left + 5; break;
            }
            return(job);
        }
Example #2
0
        private void namePlate(List <Combatant> searchObjects, DrawingContext dc)
        {
            foreach (Combatant mob in searchObjects)
            {
                bool flag      = isFlag(mob.ID);
                int  hpPar     = (mob.CurrentHP * 100 / mob.MaxHP);
                bool shortName = true;
                if (model.SelectChecked)
                {
                    shortName = false;
                }
                else if (!RadardataInstance.viewOptionData.IsShortNameView(RadarViewOrder.radarZoomSelect))
                {
                    shortName = false;
                }

                Rect rect = RadarViewOrder.MobRect(RadarViewOrder.myData.PosX, RadarViewOrder.myData.PosY, mob.PosX, mob.PosY);
                if (mob.ID != RadarViewOrder.myData.ID)
                {
                    if (rect.X < 20)
                    {
                        continue;
                    }
                    if (rect.Y < 20)
                    {
                        continue;
                    }
                    if (rect.X > img.Width - (40 + (RadarViewOrder.FontSize * 5)))
                    {
                        continue;
                    }
                    if (rect.Y > img.Height)
                    {
                        continue;
                    }

                    if (model.IdModeCheckrd && mob.type == 1)
                    {
                        dc.DrawEllipse(getBrush(hpPar, true), null, new Point(rect.Left, rect.Top), (double)rect.Width, (double)rect.Height);
                    }
                    else
                    {
                        if (model.IdModeCheckrd && mob.Name == "トラップ")
                        {
                            if (mob.CurrentHP > 0)
                            {
                                dc.DrawRectangle(Brushes.Yellow, null, rect);
                            }
                            else
                            {
                                dc.DrawRectangle(Brushes.Brown, null, rect);
                            }
                            this.TextOut(dc, mob.type.ToString(), Brushes.LightGray, rect.X - 4, rect.Y + RadarViewOrder.fontTop, flag, false);
                        }
                        else
                        {
                            dc.DrawEllipse(getBrush(hpPar, flag), null, new Point(rect.Left, rect.Top), (double)rect.Width, (double)rect.Height);
                        }
                    }
                }

                if (RadardataInstance.viewOptionData.IsNameView(RadarViewOrder.radarZoomSelect))
                {
                    if (model.IdModeCheckrd)
                    {
                        if (mob.type != 1)
                        {
                            this.TextOut(dc, mob.Name, Brushes.LightGray, rect.X - 4, rect.Y + RadarViewOrder.fontTop, flag, shortName);
                        }
                    }
                    else
                    {
                        this.TextOut(dc, mob.Name, Brushes.LightGray, rect.X - 4, rect.Y + RadarViewOrder.fontTop, flag, shortName);
                    }
                }
                float vX = 0;
                float vY = 0;

                if (mob.PosX < 0)
                {
                    vX = 22 - 22 * ((mob.PosX * -1) / 1100);
                }
                else
                {
                    vX = 22 + 22 * ((mob.PosX) / 1100);
                }
                if (mob.PosY < 0)
                {
                    vY = 22 - 22 * ((mob.PosY * -1) / 1100);
                }
                else
                {
                    vY = 22 + 22 * ((mob.PosY) / 1100);
                }


                if (RadardataInstance.viewOptionData.IsPositionView(RadarViewOrder.radarZoomSelect))
                {
                    dc.DrawText(new FormattedText(((int)(vX)).ToString() + "," + ((int)(vY)).ToString(),
                                                  System.Globalization.CultureInfo.CurrentUICulture,
                                                  FlowDirection.LeftToRight, new Typeface("Verdana"),
                                                  RadarViewOrder.FontSize + 2, Brushes.Red), new Point(rect.X - 4, rect.Y + 4));
                }


                if (model.IdModeCheckrd)
                {
                    if (model.ViewAreaCheckrd && RadarViewOrder.myData.ID != mob.ID)
                    {
                        switch (mob.Job)
                        {
                        case 24:
                        case 28:
                        case 33: DrawingArea(dc, rect, 30, 15, areaPen, Color.FromArgb(100, 40, 148, 80)); break;   //ケアル、メディカラ
                        }
                    }
                    continue;
                }

                if (RadardataInstance.viewOptionData.IsJobView(RadarViewOrder.radarZoomSelect))
                {
                    jobTextLayout job = GetJobTextLayout(mob.Job, rect, mob.IsCasting);
                    // JOBテキスト

                    //HP表示と重なるときは、Job表示をずらす
                    int plusX = 2;
                    if (RadardataInstance.viewOptionData.IsHpView(RadarViewOrder.radarZoomSelect))
                    {
                        plusX = -28;
                    }

                    dc.DrawText(new FormattedText(job.job,
                                                  System.Globalization.CultureInfo.CurrentUICulture,
                                                  FlowDirection.LeftToRight, new Typeface("Verdana"),
                                                  RadarViewOrder.FontSize, job.brush), new Point(job.left + plusX, rect.Y - 4));
                }
                if (RadardataInstance.viewOptionData.IsHpView(RadarViewOrder.radarZoomSelect))
                {
                    dc.DrawText(new FormattedText(mob.MaxHP.ToString(),
                                                  System.Globalization.CultureInfo.CurrentUICulture,
                                                  FlowDirection.LeftToRight, new Typeface("Verdana"),
                                                  RadarViewOrder.FontSize, Brushes.Aqua), new Point(rect.X + 4, rect.Y - 4));
                }
            }
        }