JocysCom / TextToSpeech

Jocys.com Text To Speech Monitor and WoW Addon - Reads quests and chat messages with text-to-speech voices.
https://www.jocys.com/TTS
GNU Lesser General Public License v3.0
28 stars 11 forks source link

Add option to disable scroll feature to start or stop TTS. #54

Open ryankhart opened 2 years ago

ryankhart commented 2 years ago

This issue #53 got me thinking that if we had an option to turn off that scroll feature (up to queue more text to speech and down to stop text to speech), then there would have been a workaround for issue #53.

I would actually want to disable it regardless because I'll sometimes want to scroll down the quest dialogue window but doing so will stop the TTS instead.

VJocys commented 2 years ago

In WoW Addon version 10.0.2.2 (2022-11-25) I added TTS ScrollFrame check-box in "Options" window to set TTS ScrollFrame width 50% of parent frame. It will let to use mouse scroll as TTS start-stop function (left side 50%) and dialogue windows scroll-up-down (right side 50%) at the same time.

JocysCom_TTS_WoW_Addon_ScrollFrame

ryankhart commented 2 years ago

Oh! That's cool! I like the 50% width idea. I may even keep it on in that case, but it's nice to have the option to turn it off if a WoW update ever breaks the feature again in the future.

I'll be looking through your commits to teach myself how you did it, so I can maybe contribute to addon development.

VJocys commented 2 years ago

WoW removed or renamed WoW's GossipGreetingScrollFrame. Therefore, TTS Addon's JocysCom_DialogueScrollFrame could not find and attach itself to it. Code I used to set 50% width:

1026    -- Set default right margin.
1027    local frameMargin = 0
1030    -- Set default parent frame.
1031    local frameScroll = GossipFrameInset

1076    -- Set JocysCom_DialogueScrollFrame right margin width 50% of parent frame width.
1077    if JocysCom_ScrollFrameCheckButton:GetChecked() then
1078        -- Get parent frame width.
1079        local frameWidth, frameHeight = frameScroll:GetSize()
1080        -- Set right margin width 50% of parent frame.
1081        frameMargin = math.ceil(frameWidth / -2)
1082    end

1088    -- Set parent frame and bottom-right margins for JocysCom_DialogueScrollFrame.
1089    JocysCom_DialogueScrollFrame:SetPoint("BOTTOMRIGHT", frameScroll, frameMargin, 4)