diff --git a/Launcher2/LauncherMain.cs b/Launcher2/LauncherMain.cs index 376b92b44..d24cee5a8 100644 --- a/Launcher2/LauncherMain.cs +++ b/Launcher2/LauncherMain.cs @@ -181,6 +181,17 @@ namespace Launcher2 PlayerInput.Update(deltaTime); + if (GUIMessageBox.MessageBoxes.Count > 0) + { + var messageBox = GUIMessageBox.MessageBoxes.Peek(); + if (messageBox != null) + { + GUIComponent.MouseOn = messageBox; + messageBox.Update(deltaTime); + return; + } + } + guiRoot.Update(deltaTime); } @@ -297,6 +308,15 @@ namespace Launcher2 private bool CheckForUpdates() { + if (string.IsNullOrWhiteSpace(settings.MasterServerUrl)) + { + updateInfoText.Text = "Checking updates failed"; + updateInfoBox.Visible = true; + SetUpdateInfoBox("Update server URL not set"); + return false; + + } + updateInfoText.Text = "Checking for updates..."; XDocument doc = null; @@ -308,6 +328,9 @@ namespace Launcher2 catch (Exception e) { + updateInfoText.Text = "Checking updates failed"; + updateInfoBox.Visible = true; + SetUpdateInfoBox("Error while checking for updates: " + e.Message); return false; } @@ -416,6 +439,12 @@ namespace Launcher2 latestVersionFiles = UpdaterUtil.GetFileList(doc); filesToDownload = UpdaterUtil.GetRequiredFiles(doc); + string updaterVersion = ToolBox.GetAttributeString(doc.Root, "updaterversion", "1.0"); + if (updaterVersion!=UpdaterUtil.Version || true) + { + ShowError("Warning", "The update may contain changes which can't be installed by the autoupdater. If you receive any error messages during the install, please download and install the update manually."); + } + string dir = Directory.GetCurrentDirectory(); filesToDownloadCount = filesToDownload.Count; @@ -503,7 +532,8 @@ namespace Launcher2 { GUIFrame dummyFrame = new GUIFrame(new Rectangle(0,0,graphicsWidth,graphicsHeight)); - new GUIMessageBox(header, message, new string[] { "OK" }, 400, 250, Alignment.TopLeft, dummyFrame); + GUIMessageBox errorBox = new GUIMessageBox(header, message, new string[] { "OK" }, 400, 250, Alignment.TopLeft, dummyFrame); + errorBox.Buttons[0].OnClicked = errorBox.Close; } private void Completed(object sender, AsyncCompletedEventArgs e) diff --git a/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml b/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml index 03f133667..ad1761c38 100644 --- a/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml +++ b/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml @@ -8,12 +8,12 @@ - + - + diff --git a/Subsurface/Content/Items/Diving/divinggear.xml b/Subsurface/Content/Items/Diving/divinggear.xml index 13408a945..016106d69 100644 --- a/Subsurface/Content/Items/Diving/divinggear.xml +++ b/Subsurface/Content/Items/Diving/divinggear.xml @@ -1,17 +1,19 @@  + name="Oxygen Tank" + Tags="smallitem" + pickdistance="150" + price="50"> - - + + + + - - @@ -61,7 +61,6 @@ - diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml index 95cc3ae5b..cc3ef1d93 100644 --- a/Subsurface/Content/Items/Tools/tools.xml +++ b/Subsurface/Content/Items/Tools/tools.xml @@ -93,8 +93,10 @@ - + + + + 2000.0f); + AnimController.SimplePhysicsEnabled = (Character.controlled!=this && Vector2.Distance(cam.WorldViewCenter, Position)>5000.0f); if (isDead) return; diff --git a/Subsurface/Source/Characters/HumanoidAnimController.cs b/Subsurface/Source/Characters/HumanoidAnimController.cs index 0f19a120e..29af4ed48 100644 --- a/Subsurface/Source/Characters/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/HumanoidAnimController.cs @@ -34,6 +34,11 @@ namespace Subsurface Vector2 colliderPos = GetLimb(LimbType.Torso).SimPosition; + if (!MathUtils.IsValid(RefLimb.body.SimPosition)) + { + int a = 1; + } + //if (inWater) stairs = null; Vector2 rayStart = colliderPos; // at the bottom of the player sprite @@ -405,6 +410,11 @@ namespace Subsurface { movement = Vector2.Normalize(movement); } + + if (!MathUtils.IsValid(movement)) + { + int a = 1; + } RefLimb.pullJoint.Enabled = true; RefLimb.pullJoint.WorldAnchorB = @@ -412,6 +422,11 @@ namespace Subsurface RefLimb.body.SmoothRotate(0.0f); + if (!MathUtils.IsValid(RefLimb.body.SimPosition)) + { + int a = 1; + } + foreach (Limb l in Limbs) { if (l==RefLimb) continue; @@ -458,25 +473,30 @@ namespace Subsurface TargetDir = Direction.Right; } - if (TargetMovement == Vector2.Zero) return; - float targetSpeed = TargetMovement.Length(); if (targetSpeed > 0.0f) TargetMovement /= targetSpeed; - - //if trying to head to the opposite direction, apply torque - //to the torso to flip the ragdoll around - //if (Math.Sign(TargetMovement.X) != Dir && TargetMovement.X != 0.0f) - //{ - // float torque = torso.Mass * 10.0f; - // torque *= (rotation > 90 && rotation < 270) ? -Dir : Dir; - - // torso.body.ApplyTorque(torque); - //} - - if (targetSpeed > 0.1f && !aiming) + + if (targetSpeed > 0.1f) { - torso.body.SmoothRotate(MathUtils.VectorToAngle(TargetMovement)-MathHelper.PiOver2); + if (!aiming) + { + torso.body.SmoothRotate(MathUtils.VectorToAngle(TargetMovement)-MathHelper.PiOver2); + } } + else + { + if (aiming) + { + Vector2 mousePos = ConvertUnits.ToSimUnits(character.CursorPosition); + Vector2 diff = (mousePos - torso.SimPosition) * Dir; + + TargetMovement = new Vector2(0.0f, -0.1f); + + torso.body.SmoothRotate(MathUtils.VectorToAngle(diff)); + } + } + + if (TargetMovement == Vector2.Zero) return; movement = MathUtils.SmoothStep(movement, TargetMovement, 0.3f); @@ -503,9 +523,11 @@ namespace Subsurface movement.Y = movement.Y - (surfaceLimiter - 1.0f) * 0.01f; } + movement.Y -= 0.05f; + head.body.ApplyForce((new Vector2(movement.X, movement.Y / surfaceLimiter + 0.2f) - head.body.LinearVelocity * 0.2f) * - 20.0f * head.body.Mass); + 30.0f * head.body.Mass); torso.body.ApplyForce((new Vector2(movement.X, movement.Y / surfaceLimiter + 0.2f) - torso.body.LinearVelocity * 0.2f) * 10.0f * torso.body.Mass); @@ -513,30 +535,25 @@ namespace Subsurface walkPos += movement.Length() * 0.15f; footPos = (leftFoot.SimPosition + rightFoot.SimPosition) / 2.0f; - Vector2 transformedFootPos = new Vector2((float)Math.Sin(walkPos) * 0.3f, 0.0f); + var rightThigh = GetLimb(LimbType.RightThigh); + var leftThigh = GetLimb(LimbType.LeftThigh); + + rightThigh.body.SmoothRotate(torso.Rotation + (float)Math.Sin(walkPos) * 0.3f, 2.0f); + leftThigh.body.SmoothRotate(torso.Rotation - (float)Math.Sin(walkPos) * 0.3f, 2.0f); + + Vector2 transformedFootPos = new Vector2((float)Math.Sin(walkPos) * 0.5f, 0.0f); transformedFootPos = Vector2.Transform( transformedFootPos, Matrix.CreateRotationZ(torso.body.Rotation)); - MoveLimb(leftFoot, footPos + transformedFootPos, 2.5f); - MoveLimb(rightFoot, footPos - transformedFootPos, 2.5f); - - //float legCorrection = MathUtils.GetShortestAngle(leftLeg.Rotation, torso.body.Rotation); - - //leftLeg.body.ApplyTorque(legCorrection); - - //legCorrection = MathUtils.GetShortestAngle(rightLeg.Rotation, torso.body.Rotation); - - //rightLeg.body.ApplyTorque(legCorrection); - Vector2 feetExtendForce = new Vector2( - (float)-Math.Sin(torso.body.Rotation), - (float)Math.Cos(torso.body.Rotation)); - - leftFoot.body.ApplyForce(feetExtendForce); - rightFoot.body.ApplyForce(feetExtendForce); - - leftFoot.body.ApplyTorque(leftFoot.body.Mass * -Dir); - rightFoot.body.ApplyTorque(rightFoot.body.Mass * -Dir); + if (Math.Abs(MathUtils.GetShortestAngle(torso.Rotation, rightThigh.Rotation))<0.3f) + { + MoveLimb(rightFoot, footPos - transformedFootPos, 1.0f); + } + if (Math.Abs(MathUtils.GetShortestAngle(torso.Rotation, leftThigh.Rotation)) < 0.3f) + { + MoveLimb(leftFoot, footPos + transformedFootPos, 1.0f); + } handPos = (torso.SimPosition + head.SimPosition) / 2.0f; @@ -571,8 +588,8 @@ namespace Subsurface float handCyclePos = walkPos / 2.0f; float handPosX = (float)Math.Cos(handCyclePos * Dir) * 0.4f; - float handPosY = (float)Math.Sin(handCyclePos * Dir) * 0.7f; - handPosY = MathHelper.Clamp(handPosY, -0.6f, 0.6f); + float handPosY = (float)Math.Sin(handCyclePos * Dir) * 1.0f; + handPosY = MathHelper.Clamp(handPosY, -0.8f, 0.8f); Matrix rotationMatrix = Matrix.CreateRotationZ(torso.Rotation); @@ -582,7 +599,9 @@ namespace Subsurface rightHandPos.X = (Dir == 1.0f) ? Math.Max(0.2f, rightHandPos.X) : Math.Min(-0.2f, rightHandPos.X); rightHandPos = Vector2.Transform(rightHandPos, rotationMatrix); - MoveLimb(rightHand, handPos + rightHandPos, 3.5f); + //MoveLimb(rightHand, handPos + rightHandPos, 1.5f); + + HandIK(rightHand, handPos + rightHandPos, 0.5f); } if (!leftHand.Disabled) @@ -591,7 +610,8 @@ namespace Subsurface leftHandPos.X = (Dir == 1.0f) ? Math.Max(0.2f, leftHandPos.X) : Math.Min(-0.2f, leftHandPos.X); leftHandPos = Vector2.Transform(leftHandPos, rotationMatrix); - MoveLimb(leftHand, handPos + leftHandPos, 3.5f); + //MoveLimb(leftHand, handPos + leftHandPos,1.5f); + HandIK(leftHand, handPos + leftHandPos, 0.5f); } } diff --git a/Subsurface/Source/Characters/Limb.cs b/Subsurface/Source/Characters/Limb.cs index d76166327..f74c5b15d 100644 --- a/Subsurface/Source/Characters/Limb.cs +++ b/Subsurface/Source/Characters/Limb.cs @@ -364,11 +364,11 @@ namespace Subsurface { if (LinearVelocity.X>100.0f) { - DebugConsole.ThrowError("CHARACTER EXPLODED"); + //DebugConsole.ThrowError("CHARACTER EXPLODED"); foreach (Limb limb in character.AnimController.Limbs) { limb.body.ResetDynamics(); - limb.body.SetTransform(body.SimPosition, 0.0f); + limb.body.SetTransform(character.AnimController.RefLimb.SimPosition, 0.0f); } } @@ -390,15 +390,15 @@ namespace Subsurface Vector2 dragForce = Vector2.Zero; if (dragDot > 0) { - float vel = LinearVelocity.Length(); + float vel = LinearVelocity.Length()*2.0f; float drag = dragDot * vel * vel * ConvertUnits.ToSimUnits(sprite.size.Y); dragForce = drag * -velDir; - if (dragForce.Length() > 100.0f) { } + //if (dragForce.Length() > 100.0f) { } } body.ApplyForce(dragForce + buoyancy); - body.ApplyTorque(body.AngularVelocity * body.Mass * -0.05f); + body.ApplyTorque(body.AngularVelocity * body.Mass * -0.08f); } if (character.IsDead) return; diff --git a/Subsurface/Source/Characters/Ragdoll.cs b/Subsurface/Source/Characters/Ragdoll.cs index 849d84a57..fcb068497 100644 --- a/Subsurface/Source/Characters/Ragdoll.cs +++ b/Subsurface/Source/Characters/Ragdoll.cs @@ -655,12 +655,12 @@ namespace Subsurface { if (inWater) { - //foreach (Limb limb in Limbs) - //{ - // if (limb.body.TargetPosition == Vector2.Zero) continue; + foreach (Limb limb in Limbs) + { + //if (limb.body.TargetPosition == Vector2.Zero) continue; - // limb.body.SetTransform(limb.SimPosition + newMovement * 0.1f, limb.Rotation); - //} + limb.body.SetTransform(limb.SimPosition + newMovement * 0.1f, limb.Rotation); + } correctionMovement = Vector2.Normalize(newMovement) * Math.Min(0.1f + dist, 3.0f); } diff --git a/Subsurface/Source/GUI/TitleScreen.cs b/Subsurface/Source/GUI/TitleScreen.cs index 5908a09aa..1086fc4b3 100644 --- a/Subsurface/Source/GUI/TitleScreen.cs +++ b/Subsurface/Source/GUI/TitleScreen.cs @@ -152,6 +152,8 @@ namespace Subsurface } loadState = 100.0f; + + yield return CoroutineStatus.Success; } } } diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index 351812ead..3d27c205e 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -314,11 +314,11 @@ namespace Subsurface Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch); } - double elapsed = sw.Elapsed.TotalSeconds; - if (elapsed < Physics.step) - { - System.Threading.Thread.Sleep((int)((Physics.step - elapsed) * 1000.0)); - } + //double elapsed = sw.Elapsed.TotalSeconds; + //if (elapsed < Physics.step) + //{ + // System.Threading.Thread.Sleep((int)((Physics.step - elapsed) * 1000.0)); + //} sw.Restart(); } diff --git a/Subsurface/Source/Items/Components/ItemComponent.cs b/Subsurface/Source/Items/Components/ItemComponent.cs index b9c2e38d1..e1e21f037 100644 --- a/Subsurface/Source/Items/Components/ItemComponent.cs +++ b/Subsurface/Source/Items/Components/ItemComponent.cs @@ -38,7 +38,8 @@ namespace Subsurface.Items.Components /// /// The base class for components holding the different functionalities of the item /// - class ItemComponent : IPropertyObject + class + ItemComponent : IPropertyObject { protected Item item; @@ -86,8 +87,7 @@ namespace Subsurface.Items.Components { if (!value && isActive) { - StopSounds(ActionType.OnActive); - StopSounds(ActionType.OnUse); + StopSounds(ActionType.OnActive); } isActive = value; @@ -181,7 +181,10 @@ namespace Subsurface.Items.Components // initableProperty.TrySetValue(value); //} - + if (item.Name=="Welding Tool") + { + int a = 1; + } properties = ObjectProperty.InitProperties(this, element); diff --git a/Subsurface/Source/Items/Components/Projectile.cs b/Subsurface/Source/Items/Components/Projectile.cs index efae83239..956665a6c 100644 --- a/Subsurface/Source/Items/Components/Projectile.cs +++ b/Subsurface/Source/Items/Components/Projectile.cs @@ -81,8 +81,6 @@ namespace Subsurface.Items.Components //ApplyStatusEffects(ActionType.OnUse, 1.0f, character); - Debug.WriteLine(item.body.Rotation); - Launch(new Vector2( (float)Math.Cos(item.body.Rotation), (float)Math.Sin(item.body.Rotation)) * launchImpulse * item.body.Mass); diff --git a/Subsurface/Source/Items/Inventory.cs b/Subsurface/Source/Items/Inventory.cs index 708b5a40b..7a3c6a468 100644 --- a/Subsurface/Source/Items/Inventory.cs +++ b/Subsurface/Source/Items/Inventory.cs @@ -306,20 +306,6 @@ namespace Subsurface TryPutItem(item, i, false); } - - - //System.Diagnostics.Debug.WriteLine("Inventory update: "+itemId+" - "+slotIndex); - - //if (slotIndex==-1) - //{ - // if (item.inventory == this) item.Drop(); - //} - //else - //{ - // TryPutItem(item, slotIndex, false); - //} - - } } } diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 79966335d..1dd6b05a1 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -474,6 +474,8 @@ namespace Subsurface { if (ic.Parent != null) ic.IsActive = ic.Parent.IsActive; + if (ic.WasUsed) ic.StopSounds(ActionType.OnUse); + if (!ic.IsActive) continue; if (condition > 0.0f) @@ -745,7 +747,7 @@ namespace Subsurface foreach (Item item in itemList) { if (ignoredItems!=null && ignoredItems.Contains(item)) continue; - if (hull != item.CurrentHull) continue; + if (hull != item.CurrentHull && (hull==null || (item.Rect.Height(); diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index 2ccacad2f..243502db5 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -218,7 +218,7 @@ namespace Subsurface cell.edges.Add(ge); } } - + Debug.WriteLine("find cells: " + sw2.ElapsedMilliseconds + " ms"); sw2.Restart(); @@ -590,7 +590,7 @@ int currentTargetIndex = 1; tempVertices.Clear(); foreach (GraphEdge ge in cell.edges) { - if (ge.point1 == ge.point2) continue; + if (Math.Abs(Vector2.Distance(ge.point1, ge.point2))<0.1f) continue; if (!tempVertices.Contains(ge.point1)) tempVertices.Add(ge.point1); if (!tempVertices.Contains(ge.point2)) tempVertices.Add(ge.point2); @@ -686,7 +686,6 @@ int currentTargetIndex = 1; int i = 0; foreach (Body body in bodies) { - System.Diagnostics.Debug.WriteLine(i); i++; body.SetTransform(body.Position + simAmount, body.Rotation); } @@ -823,25 +822,28 @@ int currentTargetIndex = 1; pos.X += Position.X; pos.Y = -pos.Y - Position.Y; - int shaftWidth = 10000; + if (GameMain.GameScreen.Cam.WorldView.Y < -pos.Y-512) return; + + float x = GameMain.GameScreen.Cam.WorldView.X-512.0f; + int width = (int)(Math.Ceiling(GameMain.GameScreen.Cam.WorldView.Width/512.0f + 2.0f)*512.0f); spriteBatch.Draw(shaftTexture, - new Rectangle((int)(pos.X - shaftWidth / 2), (int)pos.Y, shaftWidth, 512), - new Rectangle(0, 0, shaftWidth, 256), + new Rectangle((int)(MathUtils.Round(x, 512.0f)), (int)pos.Y, width, 512), + new Rectangle(0, 0, width, 256), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f); - pos = startPosition; - pos.X += Position.X; - pos.Y = -pos.Y - Position.Y; + //pos = startPosition; + //pos.X += Position.X; + //pos.Y = -pos.Y - Position.Y; - spriteBatch.Draw(shaftTexture, - new Rectangle((int)(pos.X - shaftWidth/2), (int)pos.Y, shaftWidth, 512), - new Rectangle(0, 0, shaftWidth, 256), - Color.White, 0.0f, - Vector2.Zero, - SpriteEffects.None, 0.0f); + //spriteBatch.Draw(shaftTexture, + // new Rectangle((int)(pos.X - shaftWidth/2), (int)pos.Y, shaftWidth, 512), + // new Rectangle(0, 0, shaftWidth, 256), + // Color.White, 0.0f, + // Vector2.Zero, + // SpriteEffects.None, 0.0f); //List edges = GetCellEdges(observerPosition, 1, false); diff --git a/Subsurface/Source/Map/MapEntity.cs b/Subsurface/Source/Map/MapEntity.cs index c7ec8e9e4..78d29e55d 100644 --- a/Subsurface/Source/Map/MapEntity.cs +++ b/Subsurface/Source/Map/MapEntity.cs @@ -332,7 +332,6 @@ namespace Subsurface } selectionPos = Vector2.Zero; - Debug.WriteLine("zero"); selectionSize = Vector2.Zero; } } @@ -350,7 +349,6 @@ namespace Subsurface } selectionPos = position; - Debug.WriteLine("pos"); } diff --git a/Subsurface/Source/Map/Structure.cs b/Subsurface/Source/Map/Structure.cs index 886fea72d..808dd31f3 100644 --- a/Subsurface/Source/Map/Structure.cs +++ b/Subsurface/Source/Map/Structure.cs @@ -599,8 +599,6 @@ namespace Subsurface string name = element.Attribute("name").Value; - Debug.WriteLine(name+" - "+rect); - Structure s = null; foreach (MapEntityPrefab ep in MapEntityPrefab.list) diff --git a/Subsurface/Source/Map/StructurePrefab.cs b/Subsurface/Source/Map/StructurePrefab.cs index 055e1d4a7..978801100 100644 --- a/Subsurface/Source/Map/StructurePrefab.cs +++ b/Subsurface/Source/Map/StructurePrefab.cs @@ -60,9 +60,7 @@ namespace Subsurface foreach (XElement el in doc.Root.Elements()) { StructurePrefab sp = Load(el); - - Debug.WriteLine(sp.name); - + list.Add(sp); } } diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index 3ddf107f6..a67c2e7c2 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -250,7 +250,7 @@ namespace Subsurface /// Provides a snapshot of timing values. public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch) { - //cam.UpdateTransform(); + cam.UpdateTransform(); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, diff --git a/Subsurface/Source/Screens/GameScreen.cs b/Subsurface/Source/Screens/GameScreen.cs index 1451423ec..af6d5b60d 100644 --- a/Subsurface/Source/Screens/GameScreen.cs +++ b/Subsurface/Source/Screens/GameScreen.cs @@ -83,6 +83,7 @@ namespace Subsurface StatusEffect.UpdateAll((float)deltaTime); Physics.accumulator = Math.Min(Physics.accumulator, Physics.step * 4); + //Physics.accumulator = Physics.step; while (Physics.accumulator >= Physics.step) { cam.MoveCamera((float)Physics.step); @@ -119,6 +120,8 @@ namespace Subsurface { //if (!Physics.updated) return; + cam.UpdateTransform(); + DrawMap(graphics, spriteBatch); spriteBatch.Begin(); @@ -282,12 +285,12 @@ namespace Subsurface Submarine.DrawFront(spriteBatch); foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch); - - //if (GameMain.GameSession != null && GameMain.GameSession.Level != null) - //{ - // GameMain.GameSession.Level.Draw(spriteBatch); - // //Game1.GameSession.Level.SetObserverPosition(cam.WorldViewCenter); - //} + + if (GameMain.GameSession != null && GameMain.GameSession.Level != null) + { + GameMain.GameSession.Level.Draw(spriteBatch); + //Game1.GameSession.Level.SetObserverPosition(cam.WorldViewCenter); + } spriteBatch.End(); diff --git a/Subsurface/Source/Screens/LobbyScreen.cs b/Subsurface/Source/Screens/LobbyScreen.cs index c06a2ecf3..0ca926800 100644 --- a/Subsurface/Source/Screens/LobbyScreen.cs +++ b/Subsurface/Source/Screens/LobbyScreen.cs @@ -446,14 +446,15 @@ namespace Subsurface private bool StartShift(GUIButton button, object selection) { - GameMain.ShowLoading(ShiftLoading()); + //GameMain.ShowLoading(ShiftLoading()); + GameMain.GameSession.StartShift(TimeSpan.Zero, selectedLevel, false); + GameMain.GameScreen.Select(); return true; } private IEnumerable ShiftLoading() - { - + { GameMain.GameSession.StartShift(TimeSpan.Zero, selectedLevel, false); GameMain.GameScreen.Select(); diff --git a/Subsurface/Source/Screens/MainMenuScreen.cs b/Subsurface/Source/Screens/MainMenuScreen.cs index 1d9e4e416..eb718cf44 100644 --- a/Subsurface/Source/Screens/MainMenuScreen.cs +++ b/Subsurface/Source/Screens/MainMenuScreen.cs @@ -158,6 +158,8 @@ namespace Subsurface { base.Select(); + Submarine.Unload(); + SelectTab(null, 0); //selectedTab = 0; } diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index 7ca5533ee..e115819cb 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -546,11 +546,8 @@ namespace Subsurface { Gender gender = (Gender)obj; GameMain.NetworkMember.CharacterInfo.Gender = gender; - GameMain.Client.SendCharacterData(); + if (GameMain.Client != null) GameMain.Client.SendCharacterData(); - //CreatePreviewCharacter(); - - UpdatePreviewPlayer(GameMain.NetworkMember.CharacterInfo); return true; } diff --git a/Subsurface/Source/Sounds/AmbientSoundManager.cs b/Subsurface/Source/Sounds/AmbientSoundManager.cs index b2890ef65..0c2002499 100644 --- a/Subsurface/Source/Sounds/AmbientSoundManager.cs +++ b/Subsurface/Source/Sounds/AmbientSoundManager.cs @@ -273,7 +273,7 @@ namespace Subsurface { if (i == selectedSound) { - Debug.WriteLine(s.sound.Play(1.0f, 2000.0f, position)); + s.sound.Play(1.0f, 2000.0f, position); Debug.WriteLine("playing: " + s.sound); return; } diff --git a/Subsurface/Source/Sounds/Sound.cs b/Subsurface/Source/Sounds/Sound.cs index df1190f66..6ec1da84e 100644 --- a/Subsurface/Source/Sounds/Sound.cs +++ b/Subsurface/Source/Sounds/Sound.cs @@ -234,11 +234,11 @@ namespace Subsurface loadedSounds.Remove(this); - System.Diagnostics.Debug.WriteLine("Removing sound " + filePath + " (buffer id" + AlBufferId + ")"); - if (alSourceId>0 && SoundManager.IsPlaying(alSourceId)) { + ALHelper.Check(); SoundManager.Stop(alSourceId); + ALHelper.Check(); } foreach (Sound s in loadedSounds) @@ -246,6 +246,8 @@ namespace Subsurface if (s.oggSound == oggSound) return; } + System.Diagnostics.Debug.WriteLine("Removing sound " + filePath + " (buffer id" + AlBufferId + ")"); + SoundManager.ClearAlSource(AlBufferId); oggSound.Dispose(); } diff --git a/Subsurface/Source/Sounds/SoundManager.cs b/Subsurface/Source/Sounds/SoundManager.cs index 7df7098ee..10f818a4f 100644 --- a/Subsurface/Source/Sounds/SoundManager.cs +++ b/Subsurface/Source/Sounds/SoundManager.cs @@ -218,7 +218,6 @@ namespace Subsurface.Sounds if (AL.GetSourceState(alSources[sourceIndex]) != ALSourceState.Paused) return; - Debug.WriteLine("sourceplay"); AL.SourcePlay(alSources[sourceIndex]); ALHelper.Check(); } diff --git a/Subsurface/Source/Utils/UpdaterUtil.cs b/Subsurface/Source/Utils/UpdaterUtil.cs index 83e55b512..0c6fabbcc 100644 --- a/Subsurface/Source/Utils/UpdaterUtil.cs +++ b/Subsurface/Source/Utils/UpdaterUtil.cs @@ -10,6 +10,8 @@ namespace Subsurface { public static class UpdaterUtil { + public const string Version = "1.0"; + public static void SaveFileList(string filePath) { XDocument doc = new XDocument(CreateFileList()); diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index b6b8ebe6f..0babd0184 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ