示例#1
0
        public BuildingEditor(MainSave sav)
        {
            InitializeComponent();
            this.TranslateInterface(GameInfo.CurrentLanguage);
            Manager   = new MapTerrainStructure(sav);
            SAV       = sav;
            Buildings = Manager.Buildings;

            Scale1           = new int[Manager.Terrain.MapWidth * Manager.Terrain.MapHeight];
            ScaleX           = new int[Scale1.Length * scale * scale];
            Map              = new Bitmap(Manager.Terrain.MapWidth * scale, Manager.Terrain.MapHeight * scale);
            NUD_PlazaX.Value = sav.EventPlazaLeftUpX;
            NUD_PlazaY.Value = sav.EventPlazaLeftUpZ;

            foreach (var obj in Manager.Buildings)
            {
                LB_Items.Items.Add(obj.ToString());
            }

            LB_Items.SelectedIndex = 0;
            foreach (var entry in HelpDictionary)
            {
                CB_StructureType.Items.Add(entry.Key);
            }
            CB_StructureType.SelectedIndex = 0;

            DialogResult = DialogResult.Cancel;
        }
示例#2
0
        public static Bitmap GetMapWithBuildings(MapTerrainStructure m, Font?f, int[] scale1, int[] scaleX, Bitmap map, int scale = 4, int index = -1)
        {
            CreateMap(m.Terrain, scale1, scaleX, map, scale);
            using var gfx = Graphics.FromImage(map);

            gfx.DrawPlaza(m.Terrain, (ushort)m.PlazaX, (ushort)m.PlazaY, scale);
            gfx.DrawBuildings(m.Terrain, m.Buildings, f, scale, index);
            return(map);
        }