public override void Click(MouseEventArgs e, GUIContainer container) { int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex; if (selected != -1) { FMODUtil.RaiseEvent(SoundsTable.UIClick); World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient; RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected]; WorldStorage.LoadWorld(selectedItem.Text); Server.Load(); ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient)); ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient)); Client.Load(); Server.StartGame(); BoundHandler.RemoveContainer(LoadGameMenu.Menu); MenuHandler.Clear(); BoundHandler.HideAll(); InGameGUI.Initialize(); BoundHandler.Popup(InGameGUI.InGame); } }
private void LoadSaveButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e) { int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex; if (selected != -1) { FMODUtil.RaiseEvent(SoundsTable.UIClick); World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient; RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected]; WorldStorage.LoadWorld(selectedItem.Text); Server.Load(); ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient)); ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient)); Client.Load(); Server.StartGame(); BoundHandler.RemoveContainer(LoadGameMenu.Menu); MenuHandler.Clear(); BoundHandler.HideAll(); InGameGUI.Initialize(); BoundHandler.Popup(InGameGUI.InGame); RenderInfo.Camera2D.InitializeForDimension(0); } }
/// <summary> /// Handles when we are done receiving the world. /// </summary> private static void HandleCompletion() { WorldStorage.LoadWorld(SaveName); MagicalLifeAPI.World.Data.World.RaiseChangeCameraDimension(0); }
/// <summary> /// Handles when we are done receiving the world. /// </summary> private static void HandleCompletion() { WorldStorage.LoadWorld(SaveName); }