示例#1
0
 //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++;
         }
     }
 }
示例#2
0
 public SettingsForm(MapX map = null)
 {
     InitializeComponent();
     lvwColumnSorter = new ListViewAllColumnComparer(SortOrder.Ascending);
     listView1.ListViewItemSorter = lvwColumnSorter;
     SetForm(map);
 }
示例#3
0
 public static void UnloadMap()
 {
     map_path      = "";
     graphics_path = "";
     map           = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
示例#4
0
 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");
 }
示例#5
0
 public static void LoadMap()
 {
     map = RubyCore.LoadMap(map_path);
 }
示例#6
0
 public static void SetMap(MapX m)
 {
     map = m;
 }