mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Stickers: scrollwheel to switch selected sticker
This commit is contained in:
parent
9638e22daf
commit
852520973c
2 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using MelonLoader;
|
||||
using NAK.Stickers.Integrations;
|
||||
using NAK.Stickers.Networking;
|
||||
|
@ -31,6 +32,14 @@ public class StickerMod : MelonMod
|
|||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (StickerSystem.Instance == null)
|
||||
return;
|
||||
|
||||
if (Input.mouseScrollDelta.y != 0f
|
||||
&& Cursor.lockState == CursorLockMode.Locked // prevent scrolling while in menus
|
||||
&& !CVRInputManager.Instance.zoom) // prevent scrolling while using scroll zoom
|
||||
StickerSystem.Instance.SelectedStickerSlot += (int)Input.mouseScrollDelta.y;
|
||||
|
||||
if (!ModSettings.Entry_UsePlaceBinding.Value)
|
||||
return;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public partial class StickerSystem
|
|||
get => _selectedStickerSlot;
|
||||
set
|
||||
{
|
||||
_selectedStickerSlot = Mathf.Clamp(value, 0, ModSettings.MaxStickerSlots - 1);
|
||||
_selectedStickerSlot = value < 0 ? ModSettings.MaxStickerSlots - 1 : value % ModSettings.MaxStickerSlots;
|
||||
IsInStickerMode = IsInStickerMode; // refresh sticker mode
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue