From 729108c7b928871ebbbc13ac11e0c155ef1fa934 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 28 Aug 2017 17:59:08 +0300 Subject: [PATCH] Replaced usages of "shift" with "round" for consistency --- .../Source/GameSession/CrewManager.cs | 4 +- .../GameSession/GameModes/SinglePlayerMode.cs | 48 +++++++++---------- .../GameModes/Tutorials/TutorialType.cs | 2 +- .../Source/GameSession/GameSession.cs | 7 ++- .../Source/GameSession/ShiftSummary.cs | 4 +- .../Source/Networking/GameClient.cs | 2 +- .../Source/Screens/LobbyScreen.cs | 10 ++-- .../Content/Sounds/sounds.xml | 2 +- .../Source/Events/EventManager.cs | 5 +- .../Source/GameSession/GameModes/GameMode.cs | 2 +- .../Source/GameSession/GameSession.cs | 18 +++---- .../Source/Networking/GameServer.cs | 2 +- 12 files changed, 52 insertions(+), 54 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index 44f80b7a8..53076d912 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -275,7 +275,7 @@ namespace Barotrauma // return true; //} - public void StartShift() + public void StartRound() { listBox.ClearChildren(); characters.Clear(); @@ -310,7 +310,7 @@ namespace Barotrauma if (characters.Any()) listBox.Select(0);// SelectCharacter(null, characters[0]); } - public void EndShift() + public void EndRound() { foreach (Character c in characters) { diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerMode.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerMode.cs index 796ed03d9..5b42c64ba 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerMode.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerMode.cs @@ -13,7 +13,7 @@ namespace Barotrauma //public readonly CrewManager CrewManager; //public readonly HireManager hireManager; - private GUIButton endShiftButton; + private GUIButton endRoundButton; public readonly CargoManager CargoManager; @@ -54,9 +54,9 @@ namespace Barotrauma CargoManager = new CargoManager(); - endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", null, Alignment.TopLeft, Alignment.Center, ""); - endShiftButton.Font = GUI.SmallFont; - endShiftButton.OnClicked = TryEndShift; + endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End round", null, Alignment.TopLeft, Alignment.Center, ""); + endRoundButton.Font = GUI.SmallFont; + endRoundButton.OnClicked = TryEndRound; for (int i = 0; i < 3; i++) { @@ -129,7 +129,7 @@ namespace Barotrauma isRunning = true; - CrewManager.StartShift(); + CrewManager.StartRound(); } public bool TryHireCharacter(HireManager hireManager, CharacterInfo characterInfo) @@ -191,26 +191,26 @@ namespace Barotrauma if (leavingSub == null) { - endShiftButton.Visible = false; + endRoundButton.Visible = false; } else if (leavingSub.AtEndPosition) { - endShiftButton.Text = ToolBox.LimitString("Enter " + Map.SelectedLocation.Name, endShiftButton.Font, endShiftButton.Rect.Width - 5); - endShiftButton.UserData = leavingSub; - endShiftButton.Visible = true; + endRoundButton.Text = ToolBox.LimitString("Enter " + Map.SelectedLocation.Name, endRoundButton.Font, endRoundButton.Rect.Width - 5); + endRoundButton.UserData = leavingSub; + endRoundButton.Visible = true; } else if (leavingSub.AtStartPosition) { - endShiftButton.Text = ToolBox.LimitString("Enter " + Map.CurrentLocation.Name, endShiftButton.Font, endShiftButton.Rect.Width - 5); - endShiftButton.UserData = leavingSub; - endShiftButton.Visible = true; + endRoundButton.Text = ToolBox.LimitString("Enter " + Map.CurrentLocation.Name, endRoundButton.Font, endRoundButton.Rect.Width - 5); + endRoundButton.UserData = leavingSub; + endRoundButton.Visible = true; } else { - endShiftButton.Visible = false; + endRoundButton.Visible = false; } - endShiftButton.Draw(spriteBatch); + endRoundButton.Draw(spriteBatch); } public override void AddToGUIUpdateList() @@ -221,7 +221,7 @@ namespace Barotrauma CrewManager.AddToGUIUpdateList(); - endShiftButton.AddToGUIUpdateList(); + endRoundButton.AddToGUIUpdateList(); } public override void Update(float deltaTime) @@ -232,7 +232,7 @@ namespace Barotrauma CrewManager.Update(deltaTime); - endShiftButton.Update(deltaTime); + endRoundButton.Update(deltaTime); if (!crewDead) { @@ -242,7 +242,7 @@ namespace Barotrauma { endTimer -= deltaTime; - if (endTimer <= 0.0f) EndShift(null, null); + if (endTimer <= 0.0f) EndRound(null, null); } } @@ -264,7 +264,7 @@ namespace Barotrauma } } - GameMain.GameSession.EndShift(""); + GameMain.GameSession.EndRound(""); if (success) { @@ -309,7 +309,7 @@ namespace Barotrauma } } - CrewManager.EndShift(); + CrewManager.EndRound(); for (int i = Character.CharacterList.Count - 1; i >= 0; i--) { Character.CharacterList[i].Remove(); @@ -318,7 +318,7 @@ namespace Barotrauma Submarine.Unload(); } - private bool TryEndShift(GUIButton button, object obj) + private bool TryEndRound(GUIButton button, object obj) { leavingSub = obj as Submarine; if (leavingSub != null) @@ -341,7 +341,7 @@ namespace Barotrauma } var msgBox = new GUIMessageBox("Warning", msg, new string[] {"Yes", "No"}); - msgBox.Buttons[0].OnClicked += EndShift; + msgBox.Buttons[0].OnClicked += EndRound; msgBox.Buttons[0].OnClicked += msgBox.Close; msgBox.Buttons[0].UserData = Submarine.Loaded.FindAll(s => !subsToLeaveBehind.Contains(s)); @@ -349,13 +349,13 @@ namespace Barotrauma } else { - EndShift(button, obj); + EndRound(button, obj); } return true; } - private bool EndShift(GUIButton button, object obj) + private bool EndRound(GUIButton button, object obj) { isRunning = false; @@ -364,7 +364,7 @@ namespace Barotrauma var cinematic = new TransitionCinematic(leavingSubs, GameMain.GameScreen.Cam, 5.0f); - SoundPlayer.OverrideMusicType = CrewManager.characters.Any(c => !c.IsDead) ? "endshift" : "crewdead"; + SoundPlayer.OverrideMusicType = CrewManager.characters.Any(c => !c.IsDead) ? "endround" : "crewdead"; CoroutineManager.StartCoroutine(EndCinematic(cinematic),"EndCinematic"); diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/TutorialType.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/TutorialType.cs index 9997caa28..6a969fe64 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/TutorialType.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/TutorialType.cs @@ -39,7 +39,7 @@ namespace Barotrauma.Tutorials GameMain.GameSession = new GameSession(Submarine.MainSub, "", GameModePreset.list.Find(gm => gm.Name.ToLowerInvariant() == "tutorial")); (GameMain.GameSession.gameMode as TutorialMode).tutorialType = this; - GameMain.GameSession.StartShift("tuto"); + GameMain.GameSession.StartRound("tuto"); GameMain.GameSession.TaskManager.Events.Clear(); diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs index f1a18b19c..198223404 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs @@ -20,11 +20,10 @@ namespace Barotrauma } } - private ShiftSummary shiftSummary; - - public ShiftSummary ShiftSummary + private RoundSummary roundSummary; + public RoundSummary RoundSummary { - get { return shiftSummary; } + get { return roundSummary; } } public bool LoadPrevious(GUIButton button, object obj) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/ShiftSummary.cs b/Barotrauma/BarotraumaClient/Source/GameSession/ShiftSummary.cs index 232a16cc8..c49037c77 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/ShiftSummary.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/ShiftSummary.cs @@ -3,7 +3,7 @@ using System.Linq; namespace Barotrauma { - class ShiftSummary + class RoundSummary { private Location startLocation, endLocation; @@ -11,7 +11,7 @@ namespace Barotrauma private Mission selectedMission; - public ShiftSummary(GameSession gameSession) + public RoundSummary(GameSession gameSession) { this.gameSession = gameSession; diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs index 649fe9980..5c0d192f6 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs @@ -704,7 +704,7 @@ namespace Barotrauma.Networking Rand.SetSyncedSeed(seed); GameMain.GameSession = new GameSession(GameMain.NetLobbyScreen.SelectedSub, "", gameMode, Mission.MissionTypes[missionTypeIndex]); - GameMain.GameSession.StartShift(levelSeed,loadSecondSub); + GameMain.GameSession.StartRound(levelSeed,loadSecondSub); if (respawnAllowed) respawnManager = new RespawnManager(this, GameMain.NetLobbyScreen.SelectedShuttle); diff --git a/Barotrauma/BarotraumaClient/Source/Screens/LobbyScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/LobbyScreen.cs index e0e75c142..24ae8e2ca 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/LobbyScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/LobbyScreen.cs @@ -114,7 +114,7 @@ namespace Barotrauma startButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, "", bottomPanel[(int)PanelTab.Map]); - startButton.OnClicked = StartShift; + startButton.OnClicked = StartRound; startButton.Enabled = false; //--------------------------------------- @@ -520,18 +520,18 @@ namespace Barotrauma return false; } - private bool StartShift(GUIButton button, object selection) + private bool StartRound(GUIButton button, object selection) { if (GameMain.GameSession.Map.SelectedConnection == null) return false; - GameMain.Instance.ShowLoading(ShiftLoading()); + GameMain.Instance.ShowLoading(LoadRound()); return true; } - private IEnumerable ShiftLoading() + private IEnumerable LoadRound() { - GameMain.GameSession.StartShift(selectedLevel, true); + GameMain.GameSession.StartRound(selectedLevel, true); GameMain.GameScreen.Select(); yield return CoroutineStatus.Success; diff --git a/Barotrauma/BarotraumaShared/Content/Sounds/sounds.xml b/Barotrauma/BarotraumaShared/Content/Sounds/sounds.xml index f3ccdc486..8aae1829b 100644 --- a/Barotrauma/BarotraumaShared/Content/Sounds/sounds.xml +++ b/Barotrauma/BarotraumaShared/Content/Sounds/sounds.xml @@ -73,7 +73,7 @@ - + diff --git a/Barotrauma/BarotraumaShared/Source/Events/EventManager.cs b/Barotrauma/BarotraumaShared/Source/Events/EventManager.cs index f43754fc6..978a71605 100644 --- a/Barotrauma/BarotraumaShared/Source/Events/EventManager.cs +++ b/Barotrauma/BarotraumaShared/Source/Events/EventManager.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; namespace Barotrauma { @@ -19,7 +18,7 @@ namespace Barotrauma events = new List(); } - public void StartShift(Level level) + public void StartRound(Level level) { CreateScriptedEvents(level); foreach (ScriptedEvent ev in events) @@ -28,7 +27,7 @@ namespace Barotrauma } } - public void EndShift() + public void EndRound() { events.Clear(); } diff --git a/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/GameMode.cs b/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/GameMode.cs index bbc151774..4689b779d 100644 --- a/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/GameMode.cs +++ b/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/GameMode.cs @@ -95,7 +95,7 @@ namespace Barotrauma if (endMessage != "" || this.endMessage == null) this.endMessage = endMessage; - GameMain.GameSession.EndShift(endMessage); + GameMain.GameSession.EndRound(endMessage); } diff --git a/Barotrauma/BarotraumaShared/Source/GameSession/GameSession.cs b/Barotrauma/BarotraumaShared/Source/GameSession/GameSession.cs index 37b0f35a2..7b1d735a9 100644 --- a/Barotrauma/BarotraumaShared/Source/GameSession/GameSession.cs +++ b/Barotrauma/BarotraumaShared/Source/GameSession/GameSession.cs @@ -143,14 +143,14 @@ namespace Barotrauma } } - public void StartShift(string levelSeed, bool loadSecondSub = false) + public void StartRound(string levelSeed, bool loadSecondSub = false) { Level randomLevel = Level.CreateRandom(levelSeed); - StartShift(randomLevel, true, loadSecondSub); + StartRound(randomLevel, true, loadSecondSub); } - public void StartShift(Level level, bool reloadSub = true, bool loadSecondSub = false) + public void StartRound(Level level, bool reloadSub = true, bool loadSecondSub = false) { #if CLIENT GameMain.LightManager.LosEnabled = GameMain.NetworkMember == null || GameMain.NetworkMember.CharacterInfo != null; @@ -195,21 +195,21 @@ namespace Barotrauma if (gameMode.Mission != null) Mission.Start(Level.Loaded); - TaskManager.StartShift(level); + TaskManager.StartRound(level); if (gameMode != null) gameMode.MsgBox(); Entity.Spawner = new EntitySpawner(); #if CLIENT - shiftSummary = new ShiftSummary(this); + roundSummary = new RoundSummary(this); GameMain.GameScreen.ColorFade(Color.Black, Color.TransparentBlack, 5.0f); SoundPlayer.SwitchMusic(); #endif } - public void EndShift(string endMessage) + public void EndRound(string endMessage) { if (Mission != null) Mission.End(); @@ -225,16 +225,16 @@ namespace Barotrauma } #if CLIENT - if (shiftSummary != null) + if (roundSummary != null) { - GUIFrame summaryFrame = shiftSummary.CreateSummaryFrame(endMessage); + GUIFrame summaryFrame = roundSummary.CreateSummaryFrame(endMessage); GUIMessageBox.MessageBoxes.Add(summaryFrame); var okButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Ok", Alignment.BottomRight, "", summaryFrame.children[0]); okButton.OnClicked = (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(summaryFrame); return true; }; } #endif - TaskManager.EndShift(); + TaskManager.EndRound(); currentMission = null; diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs index 1642b1663..89dbc0546 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs @@ -1141,7 +1141,7 @@ namespace Barotrauma.Networking connectedClients.ForEach(c => c.TeamID = hostTeam); } - GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1); + GameMain.GameSession.StartRound(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1); GameServer.Log("Starting a new round...", ServerLog.MessageType.ServerMessage); GameServer.Log("Submarine: " + selectedSub.Name, ServerLog.MessageType.ServerMessage);