Blackboard: Optimise and Refactor Hint Section Show/Hide
This MR optimises and improves the Hint-related functionality in three main ways:
- Hint-related items are now only shown/hidden once instead of constantly on the
hintTimer
trigger. This allows them to display faster, as they are only toggled on thehintButton
action trigger, on thehintTimer
finishing, or on thenextAnagram
signal (see below) - To reduce duplication, Hint-related items are toggled using a helper function that toggles their visibility instead of their opacity.
- This toggles based on
visibility
rather thanopacity
, with the logic being thatopacity
here is for styling purposes and is not tweened in any way, so there is no animation. Further, sinceopacity
is static, there is little chance of code that changes the opacity setting it to the wrong value. - If it is strongly preferred, though, we could go back to using opacity. But since it is only used for styling, I think it makes more sense to use
visibility.
- This toggles based on
- Fix a bug where a hint would stay displayed when moving between anagrams, and this would show the hint for that next anagram. Now, the hint is hidden whenever the
nextAnagram
signal is emitted, if thehintTimer
is still active.
Note: For this MR, I skipped the wikiButton
, wikiSection
, and wikiText
components. There was a FIXME comment, but I did not check for this MR if it still applies.