Level isn't drawn outside the edges of the radar, UI improvements

This commit is contained in:
Regalis11
2015-09-06 16:23:26 +03:00
parent 04d55891f0
commit b77fa5df90
6 changed files with 20 additions and 20 deletions

View File

@@ -270,6 +270,7 @@ namespace Subsurface
Game1.LobbyScreen.Select();
break;
case "savemap":
case "savesub":
if (commands.Length < 2) break;
string fileName = string.Join(" ", commands.Skip(1));
@@ -282,6 +283,7 @@ namespace Subsurface
NewMessage("map saved", Color.Green);
break;
case "loadmap":
case "loadsub":
if (commands.Length < 2) break;
Submarine.Load("Content/SavedMaps/" + string.Join(" ", commands.Skip(1)));
break;

View File

@@ -111,6 +111,9 @@ namespace Subsurface.Items.Components
for (int i = 0; i < edges.Count; i++)
{
if ((edges[i][0] * displayScale).Length() > radius) continue;
if ((edges[i][1] * displayScale).Length() > radius) continue;
GUI.DrawLine(spriteBatch,
center + (edges[i][0] - offset) * displayScale,
center + (edges[i][1] - offset) * displayScale, Color.White);
@@ -132,15 +135,14 @@ namespace Subsurface.Items.Components
if (c.AnimController.CurrentHull != null) continue;
Vector2 pos = c.Position * displayScale;
if (c.SimPosition != Vector2.Zero && pos.Length() < radius)
{
int width = (int)MathHelper.Clamp(c.Mass / 20, 1, 10);
if (c.SimPosition == Vector2.Zero || pos.Length() > radius) continue;
int width = (int)MathHelper.Clamp(c.Mass / 20, 1, 10);
pos.Y = -pos.Y;
pos += center;
pos.Y = -pos.Y;
pos += center;
GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - width / 2, (int)pos.Y - width / 2, width, width), Color.White, true);
}
GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - width / 2, (int)pos.Y - width / 2, width, width), Color.White, true);
}
if (screenOverlay!=null)

View File

@@ -635,11 +635,12 @@ namespace Subsurface
}
}
editingHUD = new GUIFrame(new Rectangle(x, y, width, 110 + (editableProperties.Count() + requiredItemCount) * 30), Color.Black * 0.5f);
editingHUD = new GUIFrame(new Rectangle(x, y, width, 110 + (editableProperties.Count() + requiredItemCount) * 30), GUI.style);
editingHUD.Padding = new Vector4(10, 10, 0, 0);
editingHUD.UserData = this;
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, GUI.style, editingHUD);
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, GUI.style,
Alignment.TopLeft, Alignment.TopLeft, editingHUD, false, GUI.LargeFont);
y += 20;
@@ -647,7 +648,8 @@ namespace Subsurface
{
if (prefab.IsLinkable)
{
new GUITextBlock(new Rectangle(0, 20, 100, 20), "Hold space to link to another construction", GUI.style, editingHUD);
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Hold space to link to another item",
GUI.style, Alignment.TopLeft, Alignment.TopRight, editingHUD);
y += 25;
}
foreach (ItemComponent ic in components)

View File

@@ -37,18 +37,16 @@ namespace Subsurface
menuTabs[(int)Tabs.Main] = new GUIFrame(panelRect, GUI.style);
//menuTabs[(int)Tabs.Main].Padding = GUI.style.smallPadding;
//GUIButton button = new GUIButton(new Rectangle(0, 0, 0, 30), "Tutorial", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
//button.OnClicked = TutorialButtonClicked;
GUIButton button = new GUIButton(new Rectangle(0, 0, 0, 30), "Tutorial", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button.OnClicked = TutorialButtonClicked;
GUIButton button = new GUIButton(new Rectangle(0, 70, 0, 30), "New Game", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button = new GUIButton(new Rectangle(0, 70, 0, 30), "New Game", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button.UserData = (int)Tabs.NewGame;
button.OnClicked = SelectTab;
//button.Enabled = false;
button = new GUIButton(new Rectangle(0, 130, 0, 30), "Load Game", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button.UserData = (int)Tabs.LoadGame;
button.OnClicked = SelectTab;
//button.Enabled = false;
button = new GUIButton(new Rectangle(0, 200, 0, 30), "Join Server", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
//button.UserData = (int)Tabs.JoinServer;
@@ -57,7 +55,6 @@ namespace Subsurface
button = new GUIButton(new Rectangle(0, 260, 0, 30), "Host Server", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button.UserData = (int)Tabs.HostServer;
button.OnClicked = SelectTab;
//button.Enabled = false;
button = new GUIButton(new Rectangle(0, 330, 0, 30), "Quit", Alignment.CenterX, GUI.style, menuTabs[(int)Tabs.Main]);
button.OnClicked = QuitClicked;

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Subsurface", "Subsurface\Subsurface.csproj", "{008C0F83-E914-4966-9135-EA885059EDD8}"
EndProject
@@ -307,7 +307,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal

Binary file not shown.