Renamed screens (EditMapScreen -> SubEditorScreen, EditCharacterScreen -> CharacterEditorScreen)
This commit is contained in:
@@ -222,7 +222,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (Screen.Selected == GameMain.EditMapScreen) return;
|
||||
if (Screen.Selected == GameMain.SubEditorScreen) return;
|
||||
|
||||
if (character.IsUnconscious || (character.Oxygen < 80.0f && !character.IsDead))
|
||||
{
|
||||
|
||||
@@ -223,12 +223,12 @@ namespace Barotrauma
|
||||
{
|
||||
Submarine.Load(string.Join(" ", args), true);
|
||||
}
|
||||
GameMain.EditMapScreen.Select();
|
||||
GameMain.SubEditorScreen.Select();
|
||||
}));
|
||||
|
||||
commands.Add(new Command("editcharacter", "", (string[] args) =>
|
||||
{
|
||||
GameMain.EditCharacterScreen.Select();
|
||||
GameMain.CharacterEditorScreen.Select();
|
||||
}));
|
||||
|
||||
commands.Add(new Command("editparticles", "", (string[] args) =>
|
||||
@@ -280,9 +280,9 @@ namespace Barotrauma
|
||||
{
|
||||
if (args.Length < 1) return;
|
||||
|
||||
if (GameMain.EditMapScreen.CharacterMode)
|
||||
if (GameMain.SubEditorScreen.CharacterMode)
|
||||
{
|
||||
GameMain.EditMapScreen.ToggleCharacterMode();
|
||||
GameMain.SubEditorScreen.ToggleCharacterMode();
|
||||
}
|
||||
|
||||
string fileName = string.Join(" ", args);
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace Barotrauma
|
||||
public static NetLobbyScreen NetLobbyScreen;
|
||||
public static ServerListScreen ServerListScreen;
|
||||
|
||||
public static EditMapScreen EditMapScreen;
|
||||
public static EditCharacterScreen EditCharacterScreen;
|
||||
public static SubEditorScreen SubEditorScreen;
|
||||
public static CharacterEditorScreen CharacterEditorScreen;
|
||||
public static ParticleEditorScreen ParticleEditorScreen;
|
||||
|
||||
public static Lights.LightManager LightManager;
|
||||
@@ -285,8 +285,8 @@ namespace Barotrauma
|
||||
|
||||
ServerListScreen = new ServerListScreen();
|
||||
|
||||
EditMapScreen = new EditMapScreen();
|
||||
EditCharacterScreen = new EditCharacterScreen();
|
||||
SubEditorScreen = new SubEditorScreen();
|
||||
CharacterEditorScreen = new CharacterEditorScreen();
|
||||
ParticleEditorScreen = new ParticleEditorScreen();
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
infoBox = CreateInfoFrame("Press \"Structure\" at the left side of the screen to start placing some walls.");
|
||||
|
||||
while (GameMain.EditMapScreen.SelectedTab != (int)MapEntityCategory.Structure)
|
||||
while (GameMain.SubEditorScreen.SelectedTab != (int)MapEntityCategory.Structure)
|
||||
{
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Barotrauma.Items.Components
|
||||
0.3f);
|
||||
}
|
||||
|
||||
if (!editing || !GameMain.EditMapScreen.WiringMode) return;
|
||||
if (!editing || !GameMain.SubEditorScreen.WiringMode) return;
|
||||
|
||||
for (int i = 0; i < nodes.Count; i++)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace Barotrauma.Items.Components
|
||||
if (draggingWire.connections[0] != null && draggingWire.connections[0].Item.Submarine != null) sub = draggingWire.connections[0].Item.Submarine;
|
||||
if (draggingWire.connections[1] != null && draggingWire.connections[1].Item.Submarine != null) sub = draggingWire.connections[1].Item.Submarine;
|
||||
|
||||
Vector2 nodeWorldPos = GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition) - sub.HiddenSubPosition - sub.Position;// Nodes[(int)selectedNodeIndex];
|
||||
Vector2 nodeWorldPos = GameMain.SubEditorScreen.Cam.ScreenToWorld(PlayerInput.MousePosition) - sub.HiddenSubPosition - sub.Position;// Nodes[(int)selectedNodeIndex];
|
||||
|
||||
nodeWorldPos.X = MathUtils.Round(nodeWorldPos.X, Submarine.GridSize.X / 2.0f);
|
||||
nodeWorldPos.Y = MathUtils.Round(nodeWorldPos.Y, Submarine.GridSize.Y / 2.0f);
|
||||
@@ -150,7 +150,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (selectedWire != null)
|
||||
{
|
||||
Vector2 mousePos = GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||
Vector2 mousePos = GameMain.SubEditorScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||
if (selectedWire.item.Submarine != null) mousePos -= (selectedWire.item.Submarine.Position + selectedWire.item.Submarine.HiddenSubPosition);
|
||||
|
||||
//left click while holding ctrl -> check if the cursor is on a wire section,
|
||||
@@ -199,7 +199,7 @@ namespace Barotrauma.Items.Components
|
||||
float closestDist = 0.0f;
|
||||
foreach (Wire w in wires)
|
||||
{
|
||||
Vector2 mousePos = GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||
Vector2 mousePos = GameMain.SubEditorScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||
if (w.item.Submarine != null) mousePos -= (w.item.Submarine.Position + w.item.Submarine.HiddenSubPosition);
|
||||
|
||||
float dist = 0.0f;
|
||||
|
||||
@@ -118,12 +118,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (editingHUD == null || editingHUD.UserData as Item != this)
|
||||
{
|
||||
editingHUD = CreateEditingHUD(Screen.Selected != GameMain.EditMapScreen);
|
||||
editingHUD = CreateEditingHUD(Screen.Selected != GameMain.SubEditorScreen);
|
||||
}
|
||||
|
||||
editingHUD.Update((float)Timing.Step);
|
||||
|
||||
if (Screen.Selected != GameMain.EditMapScreen) return;
|
||||
if (Screen.Selected != GameMain.SubEditorScreen) return;
|
||||
|
||||
if (!prefab.IsLinkable) return;
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace Barotrauma
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
{
|
||||
if (Screen.Selected is EditMapScreen)
|
||||
if (Screen.Selected is SubEditorScreen)
|
||||
{
|
||||
if (editingHUD != null) editingHUD.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Barotrauma
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
|
||||
{
|
||||
if (back && Screen.Selected != GameMain.EditMapScreen)
|
||||
if (back && Screen.Selected != GameMain.SubEditorScreen)
|
||||
{
|
||||
DrawDecals(spriteBatch);
|
||||
return;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (editingHUD == null || editingHUD.UserData as Structure != this)
|
||||
{
|
||||
editingHUD = CreateEditingHUD(Screen.Selected != GameMain.EditMapScreen);
|
||||
editingHUD = CreateEditingHUD(Screen.Selected != GameMain.SubEditorScreen);
|
||||
}
|
||||
|
||||
editingHUD.Update((float)Timing.Step);
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Barotrauma
|
||||
|
||||
msgBox.Buttons[0].OnClicked += (btn, obj) =>
|
||||
{
|
||||
GameMain.EditMapScreen.Cam.Position = e.WorldPosition;
|
||||
GameMain.SubEditorScreen.Cam.Position = e.WorldPosition;
|
||||
return true;
|
||||
};
|
||||
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class EditCharacterScreen : Screen
|
||||
class CharacterEditorScreen : Screen
|
||||
{
|
||||
Camera cam;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Barotrauma
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 260, 200, 30), "Submarine Editor", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
button.OnClicked = (GUIButton btn, object userdata) => { GameMain.EditMapScreen.Select(); return true; };
|
||||
button.OnClicked = (GUIButton btn, object userdata) => { GameMain.SubEditorScreen.Select(); return true; };
|
||||
|
||||
button = new GUIButton(new Rectangle(50, y + 320, 200, 30), "Settings", null, Alignment.TopLeft, Alignment.Left, "", buttonsTab);
|
||||
button.Color = button.Color * 0.8f;
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Reflection;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class EditMapScreen : Screen
|
||||
class SubEditorScreen : Screen
|
||||
{
|
||||
private Camera cam;
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
|
||||
public EditMapScreen()
|
||||
public SubEditorScreen()
|
||||
{
|
||||
cam = new Camera();
|
||||
//cam.Translate(new Vector2(-10.0f, 50.0f));
|
||||
@@ -43,10 +43,9 @@ namespace Barotrauma
|
||||
|
||||
public static readonly Screen ServerListScreen = UnimplementedScreen.Instance;
|
||||
|
||||
public static readonly Screen EditMapScreen = UnimplementedScreen.Instance;
|
||||
public static readonly Screen EditCharacterScreen = UnimplementedScreen.Instance;
|
||||
|
||||
//
|
||||
public static readonly Screen SubEditorScreen = UnimplementedScreen.Instance;
|
||||
public static readonly Screen CharacterEditorScreen = UnimplementedScreen.Instance;
|
||||
|
||||
public static bool ShouldRun = true;
|
||||
|
||||
public static ContentPackage SelectedPackage
|
||||
|
||||
@@ -1072,7 +1072,7 @@ namespace Barotrauma
|
||||
|
||||
if (distanceToItem > item.InteractDistance && item.InteractDistance > 0.0f) return false;
|
||||
|
||||
if (!item.Prefab.InteractThroughWalls && Screen.Selected != GameMain.EditMapScreen && !insideTrigger)
|
||||
if (!item.Prefab.InteractThroughWalls && Screen.Selected != GameMain.SubEditorScreen && !insideTrigger)
|
||||
{
|
||||
Vector2 itemPosition = item.SimPosition;
|
||||
if (Submarine == null && item.Submarine != null)
|
||||
@@ -1253,7 +1253,7 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
if ((!isLocalPlayer && IsKeyHit(InputType.Select) && GameMain.Server == null) ||
|
||||
(isLocalPlayer && (findFocusedTimer <= 0.0f || Screen.Selected == GameMain.EditMapScreen)))
|
||||
(isLocalPlayer && (findFocusedTimer <= 0.0f || Screen.Selected == GameMain.SubEditorScreen)))
|
||||
{
|
||||
focusedCharacter = FindCharacterAtPosition(mouseSimPos);
|
||||
focusedItem = FindItemAtPosition(mouseSimPos, AnimController.InWater ? 0.5f : 0.25f);
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else //the submarine is not being loaded, which means we're either in the sub editor or the item has been spawned mid-round
|
||||
{
|
||||
if (Screen.Selected == GameMain.EditMapScreen)
|
||||
if (Screen.Selected == GameMain.SubEditorScreen)
|
||||
{
|
||||
//in the sub editor, attach
|
||||
AttachToWall();
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Barotrauma.Items.Components
|
||||
var rightHand = picker.AnimController.GetLimb(LimbType.RightHand);
|
||||
|
||||
pickTimer = 0.0f;
|
||||
while (pickTimer < requiredTime && Screen.Selected != GameMain.EditMapScreen)
|
||||
while (pickTimer < requiredTime && Screen.Selected != GameMain.SubEditorScreen)
|
||||
{
|
||||
if (picker.IsKeyDown(InputType.Aim) || !picker.CanInteractWith(item))
|
||||
{
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Barotrauma.Items.Components
|
||||
if (connections[0] != null && connections[0].Item.Submarine != null) sub = connections[0].Item.Submarine;
|
||||
if (connections[1] != null && connections[1].Item.Submarine != null) sub = connections[1].Item.Submarine;
|
||||
|
||||
if ((item.Submarine != sub || sub == null) && Screen.Selected != GameMain.EditMapScreen)
|
||||
if ((item.Submarine != sub || sub == null) && Screen.Selected != GameMain.SubEditorScreen)
|
||||
{
|
||||
ClearConnections();
|
||||
return;
|
||||
@@ -339,7 +339,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private Vector2 RoundNode(Vector2 position, Hull hull)
|
||||
{
|
||||
if (Screen.Selected == GameMain.EditMapScreen)
|
||||
if (Screen.Selected == GameMain.SubEditorScreen)
|
||||
{
|
||||
position.X = MathUtils.Round(position.X, Submarine.GridSize.X / 2.0f);
|
||||
position.Y = MathUtils.Round(position.Y, Submarine.GridSize.Y / 2.0f);
|
||||
|
||||
@@ -1052,7 +1052,7 @@ namespace Barotrauma
|
||||
foreach (ItemComponent ic in components)
|
||||
{
|
||||
bool pickHit = false, selectHit = false;
|
||||
if (Screen.Selected == GameMain.EditMapScreen)
|
||||
if (Screen.Selected == GameMain.SubEditorScreen)
|
||||
{
|
||||
pickHit = picker.IsKeyHit(InputType.Select);
|
||||
selectHit = picker.IsKeyHit(InputType.Select);
|
||||
@@ -1083,7 +1083,7 @@ namespace Barotrauma
|
||||
|
||||
if (tempRequiredSkill != null) requiredSkill = tempRequiredSkill;
|
||||
|
||||
bool showUiMsg = picker == Character.Controlled && Screen.Selected != GameMain.EditMapScreen;
|
||||
bool showUiMsg = picker == Character.Controlled && Screen.Selected != GameMain.SubEditorScreen;
|
||||
if (!ignoreRequiredItems && !ic.HasRequiredItems(picker, showUiMsg)) continue;
|
||||
if ((ic.CanBePicked && pickHit && ic.Pick(picker)) ||
|
||||
(ic.CanBeSelected && selectHit && ic.Select(picker)))
|
||||
@@ -1115,7 +1115,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
#if CLIENT
|
||||
if (!hasRequiredSkills && Character.Controlled == picker && Screen.Selected != GameMain.EditMapScreen)
|
||||
if (!hasRequiredSkills && Character.Controlled == picker && Screen.Selected != GameMain.SubEditorScreen)
|
||||
{
|
||||
GUI.AddMessage("Your skills may be insufficient to use the item!", Color.Red, 5.0f);
|
||||
if (requiredSkill != null)
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Barotrauma
|
||||
|
||||
LinkedSubmarine linkedSub = null;
|
||||
|
||||
if (Screen.Selected == GameMain.EditMapScreen)
|
||||
if (Screen.Selected == GameMain.SubEditorScreen)
|
||||
{
|
||||
//string filePath = ToolBox.GetAttributeString(element, "filepath", "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user