Menu Screen + UI Restyle
Created menu screen Created inventory tab with 2 cargo panes and properties panel Updated the style of every UI prefab Implemented Blurred UI material Implemented UI shaders for map layers Created Map tab (still needs input)
This commit is contained in:
parent
ac0361fd9b
commit
4f19189244
106 changed files with 11233 additions and 24584 deletions
|
|
@ -2,9 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
using int2 = Unity.Mathematics.int2;
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public class InventoryPanel : MonoBehaviour
|
|||
spriteIndex += 1 << i;
|
||||
}
|
||||
|
||||
if (spriteIndex == 15)
|
||||
if (spriteIndex == 0)
|
||||
{
|
||||
var empty = new GameObject("Empty Node", typeof(RectTransform));
|
||||
empty.transform.SetParent(Grid.transform);
|
||||
|
|
@ -80,7 +80,54 @@ public class InventoryPanel : MonoBehaviour
|
|||
var node = NodePrototype.Instantiate<Prototype>().gameObject;
|
||||
var image = node.GetComponentInChildren<Image>();
|
||||
image.sprite = NodeTextures[spriteIndex];
|
||||
image.color = hardpoint != null ? hardpoint.TintColor.ToColor() : interior ? Color.white * .5f : Color.white;
|
||||
image.color = hardpoint?.TintColor.ToColor() ?? (interior ? Color.white * .5f : Color.white);
|
||||
return node;
|
||||
});
|
||||
}
|
||||
|
||||
public void Display(ItemManager manager, EquippedCargoBay cargo)
|
||||
{
|
||||
Grid.constraintCount = cargo.Data.Shape.Width;
|
||||
_nodeInstances = cargo.Data.Shape.AllCoordinates
|
||||
.ToDictionary(v => v,
|
||||
v =>
|
||||
{
|
||||
if (!cargo.Data.Shape[v])
|
||||
{
|
||||
var empty = new GameObject("Empty Node", typeof(RectTransform));
|
||||
empty.transform.SetParent(Grid.transform);
|
||||
return empty;
|
||||
}
|
||||
|
||||
var spriteIndex = 0;
|
||||
var item = cargo.Occupancy[v.x, v.y];
|
||||
|
||||
bool ItemMatch(int2 offset) =>
|
||||
!cargo.Data.Shape[v + offset] ||
|
||||
item == null ||
|
||||
cargo.Occupancy[v.x + offset.x, v.y + offset.y] != item;
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
if (ItemMatch(_offsets[i]))
|
||||
spriteIndex += 1 << i;
|
||||
|
||||
if (spriteIndex == 0)
|
||||
{
|
||||
var empty = new GameObject("Empty Node", typeof(RectTransform));
|
||||
empty.transform.SetParent(Grid.transform);
|
||||
return empty;
|
||||
}
|
||||
|
||||
var node = NodePrototype.Instantiate<Prototype>().gameObject;
|
||||
var image = node.GetComponentInChildren<Image>();
|
||||
image.sprite = NodeTextures[spriteIndex];
|
||||
var itemData = manager.GetData(item);
|
||||
if (item == null)
|
||||
image.color = Color.white * .5f;
|
||||
else if (itemData is EquippableItemData equippable)
|
||||
image.color = HardpointData.GetColor(equippable.HardpointType).ToColor();
|
||||
else
|
||||
image.color = Color.white;
|
||||
return node;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue