private void OnAdminSoundsCheckToggled(BaseButton.ButtonEventArgs args) { UpdateChanges(); }
private void JoinPublicServerButtonPressed(BaseButton.ButtonEventArgs args) { TryConnect(PublicServerAddress); }
private void OnToggleActionsMenu(BaseButton.ButtonEventArgs args) { ToggleActionsMenu(); }
private void MidiStopButtonOnPressed(BaseButton.ButtonEventArgs obj) { MidiPlaybackSetButtonsDisabled(true); _owner.Instrument.CloseMidi(); }
private void OptionsButtonPressed(BaseButton.ButtonEventArgs args) { OptionsMenu.OpenCentered(); }
private void OnSuicideButtonClicked(BaseButton.ButtonEventArgs args) { _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxSuicide>()); }
private void ClearAllButtonPressed(BaseButton.ButtonEventArgs obj) { var constructionSystem = EntitySystem.Get <ConstructionSystem>(); constructionSystem.ClearAllGhosts(); }
private void OnRespawnButtonOnOnPressed(BaseButton.ButtonEventArgs args) { _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxRespawn>()); }
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(); }
private void OnMachineLinkingButtonClicked(BaseButton.ButtonEventArgs args) { LinkMachines(); }
private void OnSpawnTilesButtonClicked(BaseButton.ButtonEventArgs args) { ToggleTilesWindow(); }
private void OnGiveAghostButtonClicked(BaseButton.ButtonEventArgs args) { _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxGiveAghost>()); }
private void OnToggleLightButtonClicked(BaseButton.ButtonEventArgs args) { ToggleLight(); }
private void OnCallShuttleButtonPressed(BaseButton.ButtonEventArgs args) { }
private void OnToggleFovButtonClicked(BaseButton.ButtonEventArgs args) { ToggleFov(); }
private void OnClearButtonPressed(BaseButton.ButtonEventArgs args) { SearchBar.Clear(); }
private void OnToggleShadowsButtonClicked(BaseButton.ButtonEventArgs args) { ToggleShadows(); }
private void QuitButtonPressed(BaseButton.ButtonEventArgs args) { _controllerProxy.Shutdown(); }
private void OnToggleSubfloorButtonClicked(BaseButton.ButtonEventArgs args) { ToggleSubFloor(); }
private void DirectConnectButtonPressed(BaseButton.ButtonEventArgs args) { var input = _mainMenuControl.AddressBox; TryConnect(input.Text); }
private void OnShowMarkersButtonClicked(BaseButton.ButtonEventArgs args) { ShowMarkers(); }
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(); }
private void OnShowBbButtonClicked(BaseButton.ButtonEventArgs args) { ShowBb(); }
private void OnLockPressed(BaseButton.ButtonEventArgs obj) { Locked = !Locked; _lockButton.TextureNormal = Locked ? _lockTexture : _unlockTexture; }
private void OnLobbyMusicCheckToggled(BaseButton.ButtonEventArgs args) { UpdateChanges(); }