void Update() { pause_panel.SetVisible(TheGame.Get().IsPausedByPlayer()); foreach (PlayerControls controls in PlayerControls.GetAll()) { if (controls.IsPressPause() && !TheGame.Get().IsPausedByPlayer()) { TheGame.Get().Pause(); } else if (controls.IsPressPause() && TheGame.Get().IsPausedByPlayer()) { TheGame.Get().Unpause(); } } //Gamepad auto focus UISlotPanel focus_panel = UISlotPanel.GetFocusedPanel(); if (focus_panel != pause_panel && TheGame.Get().IsPausedByPlayer() && PlayerControls.IsAnyGamePad()) { pause_panel.Focus(); } if (focus_panel == pause_panel && !TheGame.Get().IsPausedByPlayer()) { UISlotPanel.UnfocusAll(); } }
private void OnAccept(UISlot slot) { OnClick(slot); UISlotPanel.UnfocusAll(); if (prev_panel != null) { prev_panel.Focus(); } }
private void OnAccept(UISlot slot) { PlayerCharacter player = PlayerCharacter.Get(GetPlayerID()); CraftInfoPanel.Get(GetPlayerID())?.OnClickCraft(); if (player.Crafting.IsBuildMode()) { UISlotPanel.UnfocusAll(); } }
private void OnPressAttack() { UISlotPanel selected_panel = UISlotPanel.GetFocusedPanel(); if (selected_panel is InventoryPanel || selected_panel is EquipPanel) { ItemSlotPanel.CancelSelectionAll(); UISlotPanel.UnfocusAll(); } }
public void NavigateAuto(UISlotPanel panel, Vector2 dir) { if (panel != null) { int slots_per_row = panel.slots_per_row; int prev_select = panel.selection_index; if (IsLeft(dir)) { panel.selection_index--; } else if (IsRight(dir)) { panel.selection_index++; } else if (IsUp(dir)) { panel.selection_index -= slots_per_row; } else if (IsDown(dir)) { panel.selection_index += slots_per_row; } if (panel.IsSelectedInvisible()) { Navigate(panel, dir); //Continue same dir } if (!panel.unfocus_when_out && !panel.IsSelectedValid()) { panel.selection_index = prev_select; //Dont exit panel, set to previous } if (panel.unfocus_when_out && !panel.IsSelectedValid()) { UISlotPanel.UnfocusAll(); //Exit panel } } }
private void OnAccept(UISlot slot) { OnClick(slot); UISlotPanel.UnfocusAll(); }
public void StopNavigate() { ActionSelector.Get(player_id)?.Hide(); ActionSelectorUI.Get(player_id)?.Hide(); UISlotPanel.UnfocusAll(); }
private void OnCancel(UISlot slot) { ItemSlotPanel.CancelSelectionAll(); UISlotPanel.UnfocusAll(); }
private void OnCancel(UISlot slot) { Toggle(); CraftSubPanel.Get(GetPlayerID())?.Hide(); UISlotPanel.UnfocusAll(); }