Exemplo n.º 1
0
        void MakeWorldMap()
        {
            MapPictureBox.LoadWorldMap();
            MapPictureBox.ClearStaticItem();

            int pathid = this.AddressList.SelectedIndex;

            if (pathid >= 0)
            {
                //道の描画
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath((uint)pathid);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + pathid.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
            }

            //拠点を追加
            List <U.AddrResult> arlist = WorldMapPointForm.MakeWorldMapPointList();

            for (int i = 0; i < arlist.Count; i++)
            {
                MapPictureBox.StaticItem item = WorldMapPointForm.DrawBasePointAddr(arlist[i].addr);
                MapPictureBox.SetStaticItem("base" + i.ToString(), item.x, item.y, item.bitmap, item.draw_x_add, item.draw_y_add);
            }

            MapPictureBox.InvalidateMap();
        }
Exemplo n.º 2
0
        static List <U.AddrResult> MakeShopListLow()
        {
            List <U.AddrResult> ret = new List <U.AddrResult>();
            uint p;

            //編成準備店.
            p = Program.ROM.RomInfo.item_shop_hensei_pointer;
            if (p != 0)
            {
                ret.Add(new U.AddrResult(
                            Program.ROM.p32(p)
                            , R._("編成準備店")
                            , p));
            }
            if (Program.ROM.RomInfo.version >= 8)
            {
                //まずワールドマップイベントをスキャン.
                List <U.AddrResult> worldmaplist = WorldMapPointForm.MakeWorldMapPointList();
                for (uint i = 0; i < worldmaplist.Count; i++)
                {
                    List <U.AddrResult> shops =
                        WorldMapPointForm.GetShopAddr(U.toOffset(worldmaplist[(int)i].addr));
                    foreach (U.AddrResult shop in shops)
                    {
                        if (Program.ROM.u8(shop.addr) == 0)
                        {//店に品物がない.
                            continue;
                        }

                        ret.Add(shop);
                    }
                }
            }
            List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList();

            for (int n = 0; n < maplist.Count; n++)
            {
                uint addr = MapSettingForm.GetEventAddrWhereMapID((uint)n);
                if (!U.isSafetyOffset(addr))
                {
                    continue;
                }
                string mapname = MapSettingForm.GetMapName((uint)n);

                List <U.AddrResult> shops = EventCondForm.MakeShopPointerListBox(addr);
                foreach (U.AddrResult shop in shops)
                {
                    if (Program.ROM.u8(shop.addr) == 0)
                    {//店に品物がない.
                        continue;
                    }
                    shop.name = mapname + " " + shop.name;
                    ret.Add(shop);
                }
            }

            return(ret);
        }
        void MakeWorldMap()
        {
            ImageUtil.BitBlt(this.MapCache
                             , 0, 0
                             , this.MapCache.Width, this.MapCache.Height
                             , this.WorldmapBGCache
                             , 0, 0);

            //道のパレット追加.
            int pathPaletteMapping = ImageUtil.AppendPalette(MapCache, PathCacheImage);

            int index = this.PathType.SelectedIndex;

            if (index <= -1)
            {
                this.WorldMap.Image = MapCache;
                return;
            }
            for (int i = 0; i < PathList.Count; i++)
            {
                int    flip = PathList[i].path_x / 8;
                Bitmap pathOne;
                if (flip == 0)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, false, false);
                }
                else if (flip == 1)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, true, false);
                }
                else if (flip == 2)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, false, true);
                }
                else
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, true, true);
                }

                ImageUtil.BitBlt(MapCache
                                 , PathList[i].worldmap_x
                                 , PathList[i].worldmap_y
                                 , 8
                                 , 8
                                 , pathOne, 0, 0
                                 , pathPaletteMapping);
            }

            //拠点を追加.
            List <U.AddrResult> arlist = WorldMapPointForm.MakeWorldMapPointList();

            for (int i = 0; i < arlist.Count; i++)
            {
                WorldMapPointForm.DrawBasePointAddr(MapCache, arlist[i].addr);
            }

            this.WorldMap.Image = MapCache;
        }