//Set Form private void SetForm(MapX map) { if (map == null) { new_map = true; this.Text = "新建地图"; _map = new MapX(); return; } this.Text = "地图设置"; _map = map; numericUpDown1.Value = map.Width; numericUpDown2.Value = map.Height; numericUpDown3.Value = map.ZIndex[0]; numericUpDown4.Value = map.ZIndex[1]; numericUpDown5.Value = map.ZIndex[2]; numericUpDown6.Value = map.ZIndex[3]; numericUpDown7.Value = map.ZIndex[4]; numericUpDown8.Value = map.ZIndex[5]; //Tilesets listView1.Items.Clear(); for (int i = 0; i < 6; i++) { int count = 0; foreach (string str in map.Tilesets[i]) { ListViewItem lvi = new ListViewItem(GetTileType(i)); lvi.SubItems.Add(count.ToString()); lvi.SubItems.Add(str); listView1.Items.Add(lvi); count++; } } }
public SettingsForm(MapX map = null) { InitializeComponent(); lvwColumnSorter = new ListViewAllColumnComparer(SortOrder.Ascending); listView1.ListViewItemSorter = lvwColumnSorter; SetForm(map); }
public static void UnloadMap() { map_path = ""; graphics_path = ""; map = null; GC.Collect(); GC.WaitForPendingFinalizers(); }
public static void SaveMap(MapX map, string path) { _scope.SetVariable("a", path); _engine.Execute(@"$map_path = a", _scope); _scope.SetVariable("a", map); _engine.Execute(@"$clr_map = a", _scope); _engine.ExecuteFile(@"rb\save_map.rb"); _engine.Execute("$map = nil; $clr_map = nil; GC.start"); }
public static void LoadMap() { map = RubyCore.LoadMap(map_path); }
public static void SetMap(MapX m) { map = m; }