void ReDraw()
        {
            Ctrl.Controls.Clear();
            Bitmap icon = ImageSystemIconForm.MusicIcon(12);

            U.MakeTransparent(icon);

            bool isFirst = true;

            int y = PADDING;
            int x = PADDING;

            foreach (Work work in WorkList)
            {
                if (x + (BUTTON_WIDTH) >= this.Width)
                {
                    x  = PADDING;
                    y += CELL_HEIGHT;
                }

                if (work.IsUpdateMark)
                {
                    PictureBox pic = new PictureBox();
                    pic.Image    = icon;
                    pic.SizeMode = PictureBoxSizeMode.StretchImage;
                    pic.Size     = new System.Drawing.Size(32, 32);
                    pic.Location = new Point(x + BUTTON_WIDTH - 24, y + BUTTON_HEIGHT - 24);
                    pic.Tag      = work;
                    pic.Click   += ToolAllWorkSupportForm_ClickTitle;
                    Ctrl.Controls.Add(pic);
                }

                Button b = new Button();
                b.BackgroundImageLayout = ImageLayout.Stretch;
                b.BackgroundImage       = ToolWorkSupportForm.MakeLogoLow(work.LogoFilename, work.ROMFilenme);
                b.Size     = new System.Drawing.Size(BUTTON_WIDTH, BUTTON_HEIGHT);
                b.Location = new Point(x, y);
                b.Tag      = work;
                b.Click   += ToolAllWorkSupportForm_ClickTitle;
                Ctrl.Controls.Add(b);

                Label l = new Label();
                l.Text         = work.Name;
                l.Size         = new System.Drawing.Size(BUTTON_WIDTH, FONT_HIGHT);
                l.Location     = new Point(x, y + BUTTON_HEIGHT + PADDING);
                l.TextAlign    = ContentAlignment.MiddleCenter;
                l.Tag          = work;
                l.DoubleClick += ToolAllWorkSupportForm_ClickTitle;
                Ctrl.Controls.Add(l);

                if (isFirst)
                {
                    isFirst = false;
                    b.Focus();
                }


                x += CELL_WIDTH;
            }
        }
Ejemplo n.º 2
0
 public static Bitmap FlagIcon()
 {
     if (Program.ROM.RomInfo.version() >= 7)
     {
         return(ImageSystemIconForm.MusicIcon(14));
     }
     else
     {
         return(ImageSystemIconForm.MusicIcon(0));
     }
 }
Ejemplo n.º 3
0
        void DrawIcon()
        {
            if (Program.ROM == null)
            {
                return;
            }
            Bitmap b;

            if (IconTypeEnum.Weapon == iconType)
            {
                b = ImageSystemIconForm.WeaponIcon(iconNumber);
            }
            else if (IconTypeEnum.Attribute == iconType)
            {
                b = ImageSystemIconForm.Attribute(iconNumber);
            }
            else if (IconTypeEnum.Cursol == iconType)
            {
                b = ImageSystemIconForm.Cursol();
            }
            else if (IconTypeEnum.Yubi == iconType)
            {
                if (iconNumber == 0)
                {
                    b = ImageSystemIconForm.YubiYoko();
                }
                else
                {
                    b = ImageSystemIconForm.YubiTate();
                }
            }
            else if (IconTypeEnum.Exit == iconType)
            {
                b = ImageSystemIconForm.ExitPoint();
            }
            else if (IconTypeEnum.Allow == iconType)
            {
                b = ImageSystemIconForm.Allows((int)iconNumber);
            }
            else if (IconTypeEnum.Music == iconType)
            {
                b = ImageSystemIconForm.MusicIcon(iconNumber);
            }
            else
            {
                b = ImageSystemIconForm.Blank16();
            }
            U.MakeTransparent(b);
            base.Image = b;
        }
Ejemplo n.º 4
0
        //アイコン
        public static Bitmap DrawIcon(uint id, int palette_type = 0, bool height16_limit = false)
        {
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(id);

            if (!U.isSafetyOffset(addr))
            {
                return(ImageUtil.BlankDummy());
            }
            uint icon_id = Program.ROM.u32(addr + 36);

            Bitmap bitmap = ImageSystemIconForm.MusicIcon(icon_id / 2);

            return(bitmap);
        }
Ejemplo n.º 5
0
        public static Size DrawEventCategory(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            string text = lb.Items[index].ToString();

            SolidBrush brush      = new SolidBrush(lb.ForeColor);
            Font       normalFont = lb.Font;
            Rectangle  bounds     = listbounds;

            int lineHeight = (int)lb.Font.Height;

            string[] sp = text.Split(new string[] { "[", "//" }, StringSplitOptions.None);
            bounds.X += U.DrawText(sp[0], g, normalFont, brush, isWithDraw, bounds);
            for (int i = 1; i < sp.Length - 1; i++)
            {
                bounds.X += U.DrawText("[", g, normalFont, brush, isWithDraw, bounds);

                string nn = sp[i];
                int    p  = nn.IndexOf(':');
                if (p < 0)
                {
                    bounds.X += U.DrawText(nn, g, normalFont, brush, isWithDraw, bounds);
                    continue;
                }

                string item = nn.Substring(0, p);

                Bitmap bitmap = null;
                if (item == "UNIT")
                {
                    bitmap = UnitForm.DrawUnitMapFacePicture(1);
                }
                else if (item == "CLASS")
                {
                    bitmap = ClassForm.DrawWaitIcon(3);
                }
                else if (item == "POINTER_PROCS")
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(4);
                }
                else if (item == "POINTER_ASM")
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(8);
                }
                else if (item == "POINTER_UNIT")
                {
                    bitmap = ClassForm.DrawWaitIcon(7);
                }
                else if (item == "POINTER_EVENT")
                {//サブルーチンは目立つ緑のアイコン
                    bitmap = ImageSystemIconForm.MusicIcon(3);
                }
                else if (item == "MUSIC")
                {
                    bitmap = ImageSystemIconForm.MusicIcon(6);
                }
                else if (item == "SOUND")
                {
                    bitmap = ImageSystemIconForm.MusicIcon(7);
                }
                else if (item == "ITEM")
                {//アイテムアイコン
                    bitmap = ImageSystemIconForm.WeaponIcon(8);
                }
                else if (item == "FLAG")
                {
                    bitmap = ImageSystemIconForm.FlagIcon();
                }
                else if (item == "WMLOCATION")
                {//拠点
                    bitmap = WorldMapImageForm.DrawWorldMapIcon(0xB);
                }
                else if (item == "WMPATH")
                {//道
                    bitmap = WorldMapImageForm.DrawWorldMapIcon(0xB);
                }
                if (bitmap != null)
                {
                    U.MakeTransparent(bitmap);

                    Rectangle b = bounds;
                    b.Width  = lineHeight;
                    b.Height = lineHeight;

                    bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b);
                    bitmap.Dispose();

                    bounds.X += U.DrawText(nn.Substring(p), g, normalFont, brush, isWithDraw, bounds);
                }
                else
                {
                    bounds.X += U.DrawText(nn.Substring(p + 1), g, normalFont, brush, isWithDraw, bounds);
                }
            }

            //コードをコメント形式で描画
            if (sp.Length > 0)
            {
                int        i            = sp.Length - 1;
                SolidBrush commentBrush = new SolidBrush(OptionForm.Color_Comment_ForeColor());
                if (bounds.X < 700)
                {
                    bounds.X = 700;
                }
                bounds.X += U.DrawText("//" + sp[i], g, normalFont, commentBrush, isWithDraw, bounds);
                commentBrush.Dispose();
            }
            brush.Dispose();
            bounds.Y += lineHeight;
            return(new Size(bounds.X, bounds.Y));
        }