diff --git a/Engines/Forms/FlatRedBall.Forms/FlatRedBall.Forms.Shared/Controls/ListBox.cs b/Engines/Forms/FlatRedBall.Forms/FlatRedBall.Forms.Shared/Controls/ListBox.cs index c1fd513f1..7488715f6 100644 --- a/Engines/Forms/FlatRedBall.Forms/FlatRedBall.Forms.Shared/Controls/ListBox.cs +++ b/Engines/Forms/FlatRedBall.Forms/FlatRedBall.Forms.Shared/Controls/ListBox.cs @@ -23,8 +23,13 @@ public class ListBox : ItemsControl , IInputReceiver public bool DoListItemsHaveFocus { get => doListBoxItemsHaveFocus; - private set + set { + if(!IsFocused && value) + { + IsFocused = true; + } + doListBoxItemsHaveFocus = value; if (SelectedIndex > -1 && SelectedIndex < ListBoxItemsInternal.Count) @@ -146,6 +151,10 @@ public int SelectedIndex /// public event Action SelectionChanged; public event FocusUpdateDelegate FocusUpdate; + + /// + /// Event raised when the user presses a button at the top-level (if the list box has focus, but the individual items do not) + /// public event Action ControllerButtonPushed; public event Action GenericGamepadButtonPushed; diff --git a/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/EmbeddedCodeFiles/CollidableListVsTileShapeCollectionRelationship.cs b/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/EmbeddedCodeFiles/CollidableListVsTileShapeCollectionRelationship.cs index 53d96f3aa..1ca48f376 100644 --- a/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/EmbeddedCodeFiles/CollidableListVsTileShapeCollectionRelationship.cs +++ b/FRBDK/Glue/TileGraphicsPlugin/TileGraphicsPlugin/EmbeddedCodeFiles/CollidableListVsTileShapeCollectionRelationship.cs @@ -31,10 +31,19 @@ public class CollidableListVsTileShapeCollectionRelationship : public CollidableListVsTileShapeCollectionRelationship(PositionedObjectList list, TileShapeCollection tileShapeCollection) { - data = new CollidableVsTileShapeCollectionData(tileShapeCollection); + SetTileShapeCollection(tileShapeCollection); this.list = list; } + /// + /// Sets the TileShapeCollection used by this CollisionRelationship. This is automatically called by the constructor, so it should only be manually called to change the TileShapeCollection after this relationship has been created. + /// + /// + public void SetTileShapeCollection(TileShapeCollection tileShapeCollection) + { + data = new CollidableVsTileShapeCollectionData(tileShapeCollection); + } + public override bool DoCollisions() { bool didCollisionOccur = false;