Closed DaveA2021 closed 2 months ago
Hey, so I was not able to reproduces this bug fully.
I've added a few more paragraphs to the first demo readable (note_welcome) and I can scroll with the mouse and the scrollbar as expected.
https://github.com/Phazorknight/Cogito/assets/70389309/7d7e4722-fb3d-4fb3-8690-c93eddabd0b0
Have you by chance changed the ReadableComponent setup? If so, could you show your node setup?
The behavior with the readable scrolling when the player highlights inventory slot is caused by the follow_focus_center script. This script basically "auto-scrolls" the ScrollContainer relative to whatever Control node is in focus, even if those nodes are the Inventory slots. It's not really a major issue.
If you want the player to be unable to have the Inventory and a Readable open at the same time, make sure to turn Ignore Open GUI
off in the InteractionComponent section of your ReadableComponent.
As a side note: I've noticed that you couldn't scroll the readables with a game pad. I've just pushed a small update that fixes this, enabling the player to scroll readables with the right thumbstick.
Thanks for your response! I have not changed the set up as far as I know (unless I did something by accident) but here is the book in question:-
I also noticed that if I add paragraphs to another readable I have, I also cannot scroll.
Edit: Just confirming - I can use the scroll in the COGITO_3_Lobby scene after your update but still can't scroll in my scene - readables seem to be set up the same.
Hm... would you mind sharing the node setup of your scene?
For anything UI related, node order inside the hierarchy matters, so I suspect that somehow another node might be "on top" of your readable, blocking the input.
As a quick test, you could try putting your readable object into one of the demo scenes as well and see if that changes the behavior.
Ok I feel silly now :D I moved the player node to the top of the hierarchy in my scene and the scrolling now works!
Thank you for the help :D
Don't feel silly! I've run into this problem more times than I can count. Glad you were able to solve it!
Cogito and Godot Engine Version: beta 202406.02 Godot 4.2.2
Description: When interacting with readables that have scrolling enabled, the player is unable to scroll the text with the mouse wheel or by clicking the visible scroll bar. mousing over squares inside the inventory GUI causes the text to scroll whether the readable is visible on the screen or not
Reproduction steps:
Expected behavior: The expected behavior is to be able to move the scroll bar with the mouse wheel or by clicking on the visible bar.
Screenshots:
Follow Focus Script :-
Readable Script:-
Inventory Slot Script:-