Level isn't drawn outside the edges of the radar, UI improvements
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user