private void OnAdminSoundsCheckToggled(BaseButton.ButtonEventArgs args)
 {
     UpdateChanges();
 }
Beispiel #2
0
 private void JoinPublicServerButtonPressed(BaseButton.ButtonEventArgs args)
 {
     TryConnect(PublicServerAddress);
 }
Beispiel #3
0
 private void OnToggleActionsMenu(BaseButton.ButtonEventArgs args)
 {
     ToggleActionsMenu();
 }
 private void MidiStopButtonOnPressed(BaseButton.ButtonEventArgs obj)
 {
     MidiPlaybackSetButtonsDisabled(true);
     _owner.Instrument.CloseMidi();
 }
Beispiel #5
0
 private void OptionsButtonPressed(BaseButton.ButtonEventArgs args)
 {
     OptionsMenu.OpenCentered();
 }
Beispiel #6
0
 private void OnSuicideButtonClicked(BaseButton.ButtonEventArgs args)
 {
     _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxSuicide>());
 }
Beispiel #7
0
        private void ClearAllButtonPressed(BaseButton.ButtonEventArgs obj)
        {
            var constructionSystem = EntitySystem.Get <ConstructionSystem>();

            constructionSystem.ClearAllGhosts();
        }
Beispiel #8
0
 private void OnRespawnButtonOnOnPressed(BaseButton.ButtonEventArgs args)
 {
     _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxRespawn>());
 }
Beispiel #9
0
 private void OnSpawnEntitiesButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleEntitySpawnWindow();
 }
 private void OnDisconnectButtonClicked(BaseButton.ButtonEventArgs args)
 {
     _console.ProcessCommand("disconnect");
     Dispose();
 }
 private void OnOptionsButtonClicked(BaseButton.ButtonEventArgs args)
 {
     optionsMenu.OpenCentered();
 }
 private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
 {
     _console.ProcessCommand("quit");
     Dispose();
 }
 private void OnCallPressed(BaseButton.ButtonEventArgs obj)
 {
     ShuttleCallRequested?.Invoke();
 }
 private void OnSpaceAmbienceCheckToggled(BaseButton.ButtonEventArgs args)
 {
     UpdateChanges();
 }
Beispiel #15
0
 private void OnMachineLinkingButtonClicked(BaseButton.ButtonEventArgs args)
 {
     LinkMachines();
 }
Beispiel #16
0
 private void OnSpawnTilesButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleTilesWindow();
 }
Beispiel #17
0
 private void OnGiveAghostButtonClicked(BaseButton.ButtonEventArgs args)
 {
     _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxGiveAghost>());
 }
Beispiel #18
0
 private void OnToggleLightButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleLight();
 }
Beispiel #19
0
 private void OnCallShuttleButtonPressed(BaseButton.ButtonEventArgs args)
 {
 }
Beispiel #20
0
 private void OnToggleFovButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleFov();
 }
Beispiel #21
0
 private void OnClearButtonPressed(BaseButton.ButtonEventArgs args)
 {
     SearchBar.Clear();
 }
Beispiel #22
0
 private void OnToggleShadowsButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleShadows();
 }
Beispiel #23
0
 private void QuitButtonPressed(BaseButton.ButtonEventArgs args)
 {
     _controllerProxy.Shutdown();
 }
Beispiel #24
0
 private void OnToggleSubfloorButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ToggleSubFloor();
 }
Beispiel #25
0
        private void DirectConnectButtonPressed(BaseButton.ButtonEventArgs args)
        {
            var input = _mainMenuControl.AddressBox;

            TryConnect(input.Text);
        }
Beispiel #26
0
 private void OnShowMarkersButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ShowMarkers();
 }
Beispiel #27
0
        private void OnItemButtonUp(BaseButton.ButtonEventArgs args)
        {
            // note the buttonup only fires on the control that was originally
            // pressed to initiate the drag, NOT the one we are currently hovering
            if (args.Event.Function != EngineKeyFunctions.UIClick)
            {
                return;
            }

            if (UserInterfaceManager.CurrentlyHovered is ActionSlot targetSlot)
            {
                if (!_dragDropHelper.IsDragging || _dragDropHelper.Dragged?.Action == null)
                {
                    _dragDropHelper.EndDrag();
                    return;
                }

                // drag and drop
                switch (_dragDropHelper.Dragged.Action)
                {
                // assign the dragged action to the target slot
                case ActionPrototype actionPrototype:
                    _actionsComponent.Assignments.AssignSlot(_actionsUI.SelectedHotbar, targetSlot.SlotIndex, ActionAssignment.For(actionPrototype.ActionType));
                    break;

                case ItemActionPrototype itemActionPrototype:
                    // the action menu doesn't show us if the action has an associated item,
                    // so when we perform the assignment, we should check if we currently have an unassigned state
                    // for this item and assign it tied to that item if so, otherwise assign it "itemless"

                    // this is not particularly efficient but we don't maintain an index from
                    // item action type to its action states, and this method should be pretty infrequent so it's probably fine
                    var assigned = false;
                    foreach (var(item, itemStates) in _actionsComponent.ItemActionStates())
                    {
                        foreach (var(actionType, _) in itemStates)
                        {
                            if (actionType != itemActionPrototype.ActionType)
                            {
                                continue;
                            }
                            var assignment = ActionAssignment.For(actionType, item);
                            if (_actionsComponent.Assignments.HasAssignment(assignment))
                            {
                                continue;
                            }
                            // no assignment for this state, assign tied to the item
                            assigned = true;
                            _actionsComponent.Assignments.AssignSlot(_actionsUI.SelectedHotbar, targetSlot.SlotIndex, assignment);
                            break;
                        }

                        if (assigned)
                        {
                            break;
                        }
                    }

                    if (!assigned)
                    {
                        _actionsComponent.Assignments.AssignSlot(_actionsUI.SelectedHotbar, targetSlot.SlotIndex, ActionAssignment.For(itemActionPrototype.ActionType));
                    }
                    break;
                }

                _actionsUI.UpdateUI();
            }

            _dragDropHelper.EndDrag();
        }
Beispiel #28
0
 private void OnShowBbButtonClicked(BaseButton.ButtonEventArgs args)
 {
     ShowBb();
 }
Beispiel #29
0
 private void OnLockPressed(BaseButton.ButtonEventArgs obj)
 {
     Locked = !Locked;
     _lockButton.TextureNormal = Locked ? _lockTexture : _unlockTexture;
 }
 private void OnLobbyMusicCheckToggled(BaseButton.ButtonEventArgs args)
 {
     UpdateChanges();
 }