Skip to content
2 changes: 1 addition & 1 deletion renpy/common/_errorhandling.rpym
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ screen _exception:

has vbox

text "[renpy.game.exception_info]" size gui._scale(22)
text "[renpy.game.exception_info!q]" size gui._scale(22)
frame style '_trace':
text fmt_short substitute False safe True

Expand Down
15 changes: 15 additions & 0 deletions renpy/display/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,8 @@ class Bar(renpy.display.displayable.Displayable):
"""

_store_transform_event = True
extra_changed = None
action = None

@property
def _draggable(self):
Expand Down Expand Up @@ -2275,6 +2277,7 @@ def __init__(
hovered=None,
unhovered=None,
released=None,
action=None,
**properties,
):
self.value = None
Expand All @@ -2286,6 +2289,7 @@ def __init__(

self.value = value
adjustment = value.get_adjustment()
self.extra_changed = changed

if renpy.game.interface is not None:
renpy.game.interface.timeout(0)
Expand Down Expand Up @@ -2330,6 +2334,7 @@ def __init__(
self.unhovered = unhovered

self.released = released
self.action = action

def per_interact(self):
if self.value is not None:
Expand Down Expand Up @@ -2631,6 +2636,16 @@ def event(self, ev, x, y, st):
if rv is not None:
return rv

if self.extra_changed is not None:
rv = run(self.extra_changed, value)
if rv is not None:
return rv

if self.action is not None:
rv = run(self.action)
if rv is not None:
return rv

if ignore_event:
raise renpy.display.core.IgnoreEvent()
else:
Expand Down
2 changes: 2 additions & 0 deletions renpy/display/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,8 @@ def get_mouse_names(self):

rv.append(getattr(renpy.store, "default_mouse", "default"))

rv = [ i for i in rv if i is not None ]

if pygame.mouse.get_pressed()[0]:
new_rv = [ ]
for i in rv:
Expand Down
5 changes: 4 additions & 1 deletion renpy/display/scenelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@ def set_layer_at_list(self, layer, at_list, reset=True, camera=False):
self.layer_at_list[layer] = (None, list(at_list))

if reset:
self.layer_transform[layer] = None
if camera:
self.camera_transform[layer] = None
else:
self.layer_transform[layer] = None

def set_times(self, time):
"""
Expand Down
2 changes: 2 additions & 0 deletions renpy/sl2/sldisplayables.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def sl2bar(context=None, **properties):
Keyword("hovered")
Keyword("unhovered")
Keyword("released")
Keyword("action")
add(bar_properties)


Expand Down Expand Up @@ -307,6 +308,7 @@ def sl2vbar(context=None, **properties):
Keyword("hovered")
Keyword("unhovered")
Keyword("released")
Keyword("action")
add(bar_properties)

# Omit autobar. (behavior)
Expand Down
11 changes: 10 additions & 1 deletion renpy/text/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,16 @@ def take_style(self, style, layout, context=None):
% (context,)
)

self.shader = renpy.text.shader.get_textshader(style.textshader)
new_shader = renpy.text.shader.get_textshader(style.textshader)

if context and self.shader and not new_shader:

raise Exception(
"%s removes a textshader, but the Text displayable already has a textshader. Textshaders cannot be removed once applied. Consider using config.default_textshader."
% (context,)
)

self.shader = new_shader

# From here down is the public glyph API.

Expand Down
5 changes: 5 additions & 0 deletions sphinx/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Changelog (Ren'Py 7.x-)
Features
--------

The `changed` property of bars can now be supplied in addition to a bar value.

Bars now take an `action` property, which is an action that is run when the bar value changes. Unlike `change`, `action`
is not supplied the bar value, and so can be used with the same actions as buttons.

Layered images now support ``at`` and ``at transform`` clauses at the same time.

The new :var:`config.special_directory_map` variable maps special directory names
Expand Down
6 changes: 5 additions & 1 deletion sphinx/source/screens.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ data. It takes the following properties:
.. screen-property:: range

The maximum value of the bar. This is required if `value` is a
number.
number. It is ignored if `value` is a bar value object.

.. screen-property:: adjustment

Expand All @@ -464,6 +464,10 @@ data. It takes the following properties:
An action to run when the bar button is released. This will be invoked
even if the bar has not changed its value.

.. screen-property:: action

An action to run when the bar value is changed.

One of `value` or `adjustment` must be given. In addition, this
function takes:

Expand Down