Various Fixes

Newly created drones now register their origin colony correctly
Hauling behavior fixed for multiple items
Buttons can't be dragged unless explicitly enabled
Inspecting a colony with lots of compound commodities no longer sets your computer on fire
This commit is contained in:
hyperion51 2020-07-03 01:33:42 +01:00
commit 1e2b474fc1
11 changed files with 133 additions and 47 deletions

View file

@ -14,12 +14,15 @@ public class PropertiesList : PropertiesPanel
public VerticalLayoutGroup LayoutGroup;
public int FoldedPadding = -8;
public int ExpandedPadding = 8;
public event Action<bool> OnExpand;
private bool _expanded = false;
private float _targetFoldoutRotation = 0;
private float _foldoutRotation = 0;
public void Start()
public bool Expanded => _expanded;
public new void Awake()
{
Button.OnClick += _ => ToggleExpand();
OnPropertyAdded += go => go.SetActive(_expanded);
@ -49,6 +52,7 @@ public class PropertiesList : PropertiesPanel
_foldoutRotation = _targetFoldoutRotation;
FoldoutIcon.transform.localRotation = Quaternion.Euler(0,0, _foldoutRotation);
}
OnExpand?.Invoke(_expanded);
}
// public override PropertyLabel AddProperty(string name, Func<string> read = null, Action<PointerEventData> onClick = null, bool radio = false)