Bar/hotbar range problem

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Bar/hotbar range problem

#1 Post by SleepKirby »

The hotbar problem in this topic was fixed, but then I noticed another problem with the bars.
Take the text speed bar for example. When you put it all the way to the left, _preferences.text_cps would be 200 (as seen by in-game behavior and renpy.watch). When put all the way to the right, it goes to 201.
200 is supposed to be the max value for text speed, and when the bar's all the way right, text speed is supposed to be 0 (indicating infinite speed).

After some testing I noticed the problem happened for both regular Bars and hotbars; and it only happened for the text speed and auto-forward time bars, not the volume bars.

As an example, try this Settings screen (basically from the documentation):
test_settings_screen.rpy
Sample settings screen. Put it in the template game, for example.
(3.38 KiB) Downloaded 18 times

I think I might've found the fix though. In common/00screen.rpy, at line 757, change this:

Code: Select all

        def changed(self, value):

            if self.max_is_zero:
                if value == 0:
                    value = self.range
                else:
                    value = value + 1
to this:

Code: Select all

        def changed(self, value):

            if self.max_is_zero:
                if value == self.range:
                    value = 0
                else:
                    value = value + 1
Is this fix correct?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Bar/hotbar range problem

#2 Post by PyTom »

It's correct. Thanks for the fix!
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users