public void OpenContextMenu(IEntity entity, ScreenCoordinates screenCoordinates) { if (_currentVerbListRoot != null) { CloseVerbMenu(); } _currentEntity = entity.Uid; _currentVerbListRoot = new VerbPopup(); _userInterfaceManager.ModalRoot.AddChild(_currentVerbListRoot); _currentVerbListRoot.OnPopupHide += CloseVerbMenu; _currentVerbListRoot.List.AddChild(new Label {Text = "Waiting on Server..."}); RaiseNetworkEvent(new VerbSystemMessages.RequestVerbsMessage(_currentEntity)); var box = UIBox2.FromDimensions(screenCoordinates.Position, (1, 1)); _currentVerbListRoot.Open(box); }
public void OpenContextMenu(IEntity entity, ScreenCoordinates screenCoordinates) { if (_currentPopup != null) { _closeContextMenu(); } _currentEntity = entity.Uid; _currentPopup = new VerbPopup(); _currentPopup.UserInterfaceManager.StateRoot.AddChild(_currentPopup); _currentPopup.OnPopupHide += _closeContextMenu; _currentPopup.List.AddChild(new Label { Text = "Waiting on Server..." }); RaiseNetworkEvent(new VerbSystemMessages.RequestVerbsMessage(_currentEntity)); var size = _currentPopup.List.CombinedMinimumSize; var box = UIBox2.FromDimensions(screenCoordinates.Position, size); _currentPopup.Open(box); }