Best I can tell without testing is:
Code: Select all
class NewAdj(renpy.display.behavior.Adjustment):
def change(self,value):
Overwrites normal behavior of change method of Adjustment class to return someplace/quit the game (less likely) when the value is above the range and and is exactly equal the range.
Code: Select all
def store_yvalue(y):
global yvalue
yvalue = int(y)
Function to change the yvalue on global namespace, that is not particularity useful.
==============
I did not read the whole code
My point remains the same, did you try:
Code: Select all
default adj = NewAdj(changed = store_yvalue, step = 300)
instead of:
Code: Select all
$ adj = NewAdj(changed = store_yvalue, step = 300)
==============
This, is particularly odd:
Code: Select all
action Function(adj.change, adj.value - 1)
You're using direct access to classes namespace! Instead of using the control function you have defined:
At this point I don't really know what to suggest...
==============
If you want to use my code, your code needs to look like this:
Code: Select all
screen text_history:
#use navigation
tag menu
default adj = ui.adjustment()
key "b" action Return()
if not current_line and len(readback_buffer) == 0:
$ lines_to_show = []
elif current_line and len(readback_buffer) == 0:
$ lines_to_show = [current_line]
elif current_line and not ( ( len(readback_buffer) == 3 and current_line == readback_buffer[-2]) or current_line == readback_buffer[-1]):
$ lines_to_show = readback_buffer + [current_line]
else:
$ lines_to_show = readback_buffer
window:
style_group "readback"
side "c r":
frame:
has viewport:
mousewheel True
draggable True
yadjustment adj
yinitial adj.value - .1
vbox:
null height 10
for line in lines_to_show:
if line[0] and line[0] != " ":
label line[0] # name
# if there's no voice just log a dialogue
if not line[2]:
text line[1]
# else, dialogue will be saved as a button of which plays voice when clicked
else:
textbutton line[1] action Play("voice", line[2])
null height 10
imagebutton auto "image/ui/backlog/previous_line_%s.png" xpos 745 ypos 223 focus_mask True action Function(adj.change, adj.value - 1), renpy.restart_interaction
imagebutton auto "image/ui/backlog/backlog_exit_%s.png" xpos 748 ypos 277 focus_mask True action Return()
You can setup pages, lines, steps. You can even create buttons to change them whenever you like directly accessing the instance of the class. I just don't get the logic of the code you've posted. You'll have to explain what you require it to do providing an example/project to mess with...