Compare commits

...

2 Commits

Author SHA1 Message Date
Asriel Senna 7d8644f2f8 Changelog and rework the section 2023-10-30 23:59:30 +01:00
Asriel Senna c7a284c1e4 Reimplement disable_on_enter based on new inputvalue implem 2023-10-30 23:55:21 +01:00
2 changed files with 25 additions and 16 deletions
+10 -4
View File
@@ -86,6 +86,7 @@ init -1510 python:
default = True
editable = True
returnable = False
disable_on_enter = False
def get_text(self):
raise NotImplementedError
@@ -96,8 +97,9 @@ init -1510 python:
def enter(self):
if self.returnable:
return self.get_text()
else:
return None
elif self.disable_on_enter:
renpy.run(self.Disable())
raise renpy.IgnoreEvent
def Enable(self):
if self.editable:
@@ -123,11 +125,12 @@ init -1510 python:
common features of the documented input value classes.
"""
equality_fields = ("default", "returnable")
equality_fields = ("default", "returnable", "disable_on_enter")
def __init__(self, default=True, returnable=False):
def __init__(self, default=True, returnable=False, disable_on_enter=False):
self.default = default
self.returnable = returnable
self.disable_on_enter = disable_on_enter
class ScreenVariableInputValue(__GenericInputValue):
"""
@@ -287,6 +290,9 @@ init -1510 python hide:
`returnable`
If true, the value of this input will be returned when the
user presses enter.
`disable_on_enter`
If true, and if `returnable` is not true, pressing enter
will disable this input.
""")
for ivalue in (ScreenVariableInputValue, FieldInputValue, VariableInputValue, DictInputValue, LocalVariableInputValue):
+15 -12
View File
@@ -124,27 +124,30 @@ displayed. Clicking on the filename and line will open
the file in the default text editor, at the given line,
if possible.
Data Actions
------------
Actions and Screen Values
-------------------------
The :ref:`data-actions` are now presented and explained in a more
condensed manner. These actions have been reimplemented using a data
manager that describes what to do with the data (Set-, Toggle-, Cycle-, Increment-)
and a data accessor that describes the kind of data to change (-Variable, -ScreenVariable, -LocalVariable, -Field, -Dict).
The :ref:`data-actions` are now presented and explained in a more condensed
manner. These actions have been reimplemented using a data manager that
describes what to do with the data (Set-, Toggle-, Cycle-, Increment-) and a
data accessor that describes the kind of data to change
(-Variable, -ScreenVariable, -LocalVariable, -Field, -Dict).
There are two new managers:
* The Cycle- actions (CycleVariable, CycleLocalVariable, CycleField...)
take a list of values and each time the action is run (i.e each time
the button is clicked), the target value is set to be the next element in
the list.
* The Cycle- actions (CycleVariable, CycleLocalVariable, CycleField...) take a
list of values and each time the action is run (i.e each time the button is
clicked), the target value is set to be the next element in the list.
* The Increment- actions (IncrementVariable, IncrementDict, IncrementField...)
add a certain value (by default, 1) to the target value. These can also be used
to decrement the field.
add a certain value (by default, 1) to the target value. These can also be
used to decrement the field.
The :class:`LocalVariableValue` bar value and :class:`LocalVariableInputValue` input
values have been added, for completeness.
:ref:`input-values` now take an optional `disable_on_enter` parameter which
makes them disable themselves when the enter key is pressed.
HTTPS/HTTP Fetch
----------------