Current bugs:
- The text won't display immediately, and waits for the timer to time out once before displaying for the first time. I feel like there's a simple solution for this but I'm derping on what it is.
- When changing from a non-zero cps value to zero, the actual_text screen will be displayed twice, on top of itself. The fact that cps=0 uses "use" I think means the tag is ignored, and that's why we get the screen showing twice, but I haven't yet figured out a way to show that screen on top of the preferences screen without being triggered by an action. ;w;
- The text will stay on screen until it is finished displaying, even if I change screens in the middle. I know I can counter this by putting Hide actions on the navigation buttons, but it seems like a needlessly verbose solution. Is there nothing more elegant to solve this?
And an extra nuance I'd like it to have:
- Changing text speed should restart the text animation immediately. - I should be able to tie some action to the Changed property of the slider for text speed and do this, but it will be dependent on the solution to the problems above.
Code: Select all
screen preferences:
use text_preview
init -2:
$lorem_ipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean bibendum in urna vel dapibus. Nulla et urna imperdiet, feugiat ligula id."
screen text_preview:
# If text speed is set to instant, just display it normally
if _preferences.text_cps == 0:
use actualtext
# Otherwise, display it with the current text speed
else:
$ show_after = len(lorem_ipsum)/_preferences.text_cps + 0.6
timer show_after repeat True action [Hide("actualtext"), ShowMenu("actualtext", animating=True)]
screen actualtext(animating=False):
if animating:
text lorem_ipsum slow_cps True style "say_dialogue"
text "[_preferences.text_cps:.5] characters per second"
else:
text lorem_ipsum style "say_dialogue"