Exemple #1
0
        public void DrawSelectedUnit()
        {
            uint unit_id  = (uint)B0.Value;
            uint class_id = (uint)B1.Value;

            if (class_id == 0)
            {//クラスIDが0だったらユーザIDで補完する
                class_id = UnitForm.GetClassID(unit_id);
            }

            List <MapPictureBox.StaticItem> list =
                EventUnitFE7Form.DrawUnit(
                    class_id
                    , (uint)B3.Value
                    , (int)B4.Value
                    , (int)B5.Value
                    , (int)B6.Value
                    , (int)B7.Value
                    );

            for (int n = list.Count - 1; n >= 0; n--)
            {
                MapPictureBox.SetStaticItem("c" + n.ToString(), list[n].x, list[n].y, list[n].bitmap, list[n].draw_x_add, list[n].draw_y_add);
            }
        }
        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();
        }
Exemple #3
0
        private void WorldMapPointForm_Load(object sender, EventArgs e)
        {
            MapPictureBox.HideCommandBar();
            MapPictureBox.LoadWorldMap();
            MapPictureBox.SetChipSize(1);

            for (uint i = 0; i < WorldMapPathForm.DataCount(); i++)
            {
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath(i);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + i.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
                MapPictureBox.Invalidate();
            }

            //拡張ボタンを表示するかどうか
            if (WorldMapPointForm.IsShowWorldmapPointExetdns(AddressList.Items.Count))
            {
                AddressListExpandsButton_255.Show();
            }
            else
            {
                this.AddressList.Height += AddressListExpandsButton_255.Height;
                AddressListExpandsButton_255.Hide();
            }
        }
        public void DrawUnits(uint topaddr, int max)
        {
            const uint RAMUnitSizeOf = 72; //構造体のサイズ
            bool       isFE6         = (Program.ROM.RomInfo.version == 6);

            uint addr = topaddr;

            for (int i = 0; i < max; i++, addr += RAMUnitSizeOf)
            {
                uint unitPointer  = Program.RAM.u32(addr + 0);
                uint classPointer = Program.RAM.u32(addr + 4);

                if (unitPointer == 0)
                {
                    continue;
                }

                if (!U.isSafetyPointer(unitPointer))
                {
                    continue;
                }
                if (!U.isSafetyPointer(classPointer))
                {
                    continue;
                }

                uint classid = Program.ROM.u8(U.toOffset(classPointer) + 4);

                uint   unit_number  = Program.RAM.u8(addr + 11);
                int    palette_type = GetShowPartyClassPaletteType(unit_number);
                Bitmap bitmap       = ClassForm.DrawWaitIcon(classid, palette_type);
                U.MakeTransparent(bitmap);

                uint x, y;
                if (isFE6)
                {
                    x = Program.RAM.u8(addr + 14);
                    y = Program.RAM.u8(addr + 15);
                }
                else
                {
                    x = Program.RAM.u8(addr + 16);
                    y = Program.RAM.u8(addr + 17);
                }

                MapPictureBox.StaticItem st = new MapPictureBox.StaticItem();
                st.bitmap     = bitmap;
                st.x          = (int)x;
                st.y          = (int)y;
                st.draw_x_add = 0;
                st.draw_y_add = 0;

                MapPictureBox.SetStaticItem(U.To0xHexString(addr), st.x, st.y, st.bitmap, st.draw_x_add, st.draw_y_add);
            }
        }
Exemple #5
0
        public void DrawAllUnits()
        {
            MapPictureBox.ClearStaticItem();
            List <U.AddrResult> list = InputFormRef.MakeList();

            for (int i = 0; i < list.Count; i++)
            {
                if (AddressList.SelectedIndex == i)
                {//選択しているものは別ルーチンで詳細に描画する.
                    DrawSelectedUnit();
                }
                else
                {//選択していないものは、移動後座標だけ描画する.
                    MapPictureBox.StaticItem sitem = DrawAfterPosUnit(list[i].addr);
                    MapPictureBox.SetStaticItem("o" + i.ToString(), sitem.x, sitem.y, sitem.bitmap, sitem.draw_x_add, sitem.draw_y_add);
                }
            }
            MapPictureBox.Invalidate();
        }