public static MapPictureBox.StaticItem DrawBasePointAddr(uint addr) { MapPictureBox.StaticItem item = new MapPictureBox.StaticItem(); uint icon = Program.ROM.u8(addr + 2); item.x = (int)Program.ROM.u16(addr + 24); item.y = (int)Program.ROM.u16(addr + 26); item.bitmap = WorldMapImageForm.DrawWorldMapIcon(icon); item.draw_x_add -= item.bitmap.Width / 2; item.draw_y_add -= item.bitmap.Height / 2; return(item); }
public static void DrawBasePointAddr(Bitmap map, uint addr) { uint icon = Program.ROM.u8(addr + 2); uint x = Program.ROM.u16(addr + 24); uint y = Program.ROM.u16(addr + 26); Bitmap basepoint = WorldMapImageForm.DrawWorldMapIcon(icon); int paletteMapping = ImageUtil.FindPalette(map, basepoint); if (paletteMapping <= -1) { paletteMapping = ImageUtil.AppendPalette(map, basepoint); } ImageUtil.BitBlt(map , (int)x - (basepoint.Width / 2), (int)y - (basepoint.Height / 2) , basepoint.Width, basepoint.Height , basepoint, 0, 0 , paletteMapping, 0); }
public static Point GetWorldMapPointPosstion(uint baseid, bool isCenter) { InputFormRef InputFormRef = Init(null); uint addr = InputFormRef.IDToAddr(baseid); if (!U.isSafetyOffset(addr)) { return(new Point()); } uint x = Program.ROM.u16(addr + 24); uint y = Program.ROM.u16(addr + 26); if (isCenter) { uint icon = Program.ROM.u8(addr + 2); Bitmap basepoint = WorldMapImageForm.DrawWorldMapIcon(icon); x = (uint)(x + basepoint.Width / 2); y = (uint)(y + basepoint.Height / 2); } return(new Point((int)x, (int)y)); }
void CheckXY() { if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock) { this.L_24_MAPXY_26.ErrorMessage = ""; this.J_26.ErrorMessage = ""; return; } Bitmap icon = WorldMapImageForm.DrawWorldMapIcon((uint)B2.Value); int width = icon.Width; int height = icon.Height; if (width <= 8) { int modx = ((int)W24.Value - (width / 2)) % 16; if (modx >= 1 && modx <= 8) { this.L_24_MAPXY_26.ErrorMessage = ""; } else { this.L_24_MAPXY_26.ErrorMessage = R._("この座標はカーソルで選択しにくい可能性があります。\r\nカーソルは16ドット単位で移動します。\r\nそのため、16ドットより幅が小さいオブジェクトは、設置位地を調整する必要があります。"); } } if (height <= 8) { int mody = ((int)W26.Value - (height / 2)) % 16; if (mody >= 1 && mody <= 8) { this.J_26.ErrorMessage = ""; } else { this.J_26.ErrorMessage = R._("この座標はカーソルで選択しにくい可能性があります。\r\nカーソルは16ドット単位で移動します。\r\nそのため、16ドットより幅が小さいオブジェクトは、設置位地を調整する必要があります。"); } } icon.Dispose(); }
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)); }