- Both linked Rooms are now linked together via the Doorway Manager now. However the 2nd Room does not show the linked effects until the Zone is re-loaded. This will be addressed shortly.
- Rooms no longer install duplicate doorways. If a doorway exists, it removes it and installs the new door.
This commit is contained in:
parent
7da8fcfea9
commit
968ab21e5a
2 changed files with 37 additions and 0 deletions
|
@ -168,6 +168,35 @@ namespace MudDesigner.Editors
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Delete the door if it already exists, so we can re-install
|
||||||
|
//the new door for this direction
|
||||||
|
foreach (Door d in linkedRoom.InstalledDoors)
|
||||||
|
{
|
||||||
|
if (d.TravelDirection == TravelDirection)
|
||||||
|
{
|
||||||
|
linkedRoom.InstalledDoors.Remove(d);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create a link to the currently loaded room within the Zone Builder
|
||||||
|
Door.ConnectedRoom connected = new Door.ConnectedRoom();
|
||||||
|
connected.Realm = Program.Realm.Name;
|
||||||
|
connected.Zone = Program.Zone.Name;
|
||||||
|
connected.Room = Program.Room.Name;
|
||||||
|
|
||||||
|
//Create a new door, add our link and set its travel direction
|
||||||
|
Door door = new Door();
|
||||||
|
door.TravelRoom = connected;
|
||||||
|
door.TravelDirection = TravelDirections.GetTravelDirectionValue(TravelDirection.ToString());
|
||||||
|
|
||||||
|
//install the door
|
||||||
|
linkedRoom.InstalledDoors.Add(door);
|
||||||
|
//save the linked room
|
||||||
|
string realmPath = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), linkedRealm.Name);
|
||||||
|
string zonePath = Path.Combine(realmPath, linkedZone.Name);
|
||||||
|
string roomFile = Path.Combine(zonePath, linkedRoom.Filename);
|
||||||
|
FileManager.Save(roomFile, linkedRoom);
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,6 +427,14 @@ namespace MudDesigner.Editors
|
||||||
d.Room = form.linkedRoom.Name;
|
d.Room = form.linkedRoom.Name;
|
||||||
d.Zone = form.linkedZone.Name;
|
d.Zone = form.linkedZone.Name;
|
||||||
door.TravelRoom = d;
|
door.TravelRoom = d;
|
||||||
|
foreach (Door obj in Program.Room.InstalledDoors)
|
||||||
|
{
|
||||||
|
if (obj.TravelDirection == door.TravelDirection)
|
||||||
|
{
|
||||||
|
Program.Room.InstalledDoors.Remove(obj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
Program.Room.InstalledDoors.Add(door);
|
Program.Room.InstalledDoors.Add(door);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue