This commit is contained in:
Scionwest_cp 2009-12-08 10:34:20 -08:00
parent dbe4a45738
commit c7f5a9b2a7
24 changed files with 566 additions and 1315 deletions

View file

@ -11,71 +11,24 @@ using System.Windows.Forms;
using MudDesigner.MudEngine;
using MudDesigner.MudEngine.Attributes;
using MudDesigner.MudEngine.FileSystem;
using MudDesigner.MudEngine.Objects;
using MudDesigner.MudEngine.Objects.Environment;
using MudDesigner.MudEngine.GameObjects;
using MudDesigner.MudEngine.GameObjects.Environment;
namespace MudDesigner.Editors
{
public partial class ProjectSettings : Form
{
List<Zone> zones;
List<Room> rooms;
public ProjectSettings()
{
InitializeComponent();
zones = new List<Zone>();
rooms = new List<Room>();
}
private void frmMain_Load(object sender, EventArgs e)
{
//Aquire the Project settings and show them.
propertyGrid1.SelectedObject = Program.Project;
propertySettings.SelectedObject = Program.Project;
txtStory.Text = Program.Project.Story;
string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms);
string[] realms = System.IO.Directory.GetFiles(realmPath, "*.realm");
foreach (string file in realms)
{
Realm realm = new Realm();
realm = (Realm)FileManager.Load(file, realm);
comRealms.Items.Add(realm.Name);
}
if (comRealms.Items.Count != 0)
comRealms.SelectedIndex = 0;
}
private void comRealms_SelectedIndexChanged(object sender, EventArgs e)
{
if (comRealms.SelectedIndex == -1)
return;
string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms);
string realmFile = System.IO.Path.Combine(realmPath, comRealms.SelectedItem.ToString() + ".realm");
Realm realm = new Realm();
realm = (Realm)FileManager.Load(realmFile, realm);
foreach (Zone zone in realm.Zones)
{
lstZones.Items.Add(zone.Name);
}
}
private void lstZones_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstZones.SelectedIndex == -1)
return;
string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones);
string zoneFile = System.IO.Path.Combine(zonePath, lstZones.SelectedItem.ToString() + ".zone");
Zone zone = new Zone();
zone = (Zone)FileManager.Load(zoneFile, zone);
foreach (Room room in zone.Rooms)
{
lstRooms.Items.Add(room.Name);
}
}
private void txtStory_TextChanged(object sender, EventArgs e)
@ -88,25 +41,5 @@ namespace MudDesigner.Editors
string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Root), "Project.xml");
FileManager.Save(filename, Program.Project);
}
private void lstRooms_SelectedIndexChanged(object sender, EventArgs e)
{
string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms);
string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones);
string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms);
string roomFile = System.IO.Path.Combine(roomPath, lstRooms.SelectedItem.ToString() + ".room");
string zoneFile = System.IO.Path.Combine(zonePath, lstZones.SelectedItem.ToString() + ".zone");
string realmFile = System.IO.Path.Combine(realmPath, comRealms.SelectedItem.ToString() + ".realm");
Room room = new Room();
Zone zone = new Zone();
Realm realm = new Realm();
room = (Room)FileManager.Load(roomFile, room);
zone = (Zone)FileManager.Load(zoneFile, zone);
realm = (Realm)FileManager.Load(realmFile, realm);
//TODO: Fix broken InitialLocation
}
}
}