Within my current game I have a screen that updates a series of calculations each time a button is pressed that affects the input variables.
A example of this button code is below:
This then runs the Manu(), which does the calculation. A subset of this is below (abbrev. manu()).
The above all works very well within the screen itself.
The challenge is that I also modify the variables such as manu_plating_iron within a label. Hence I want to recalculate all of the variables in def manu() as part of that label without requiring a button press. Is it possible to run Manu() from within a label?
PS: The simple solution is to just copy all of the formulae into the label, however this is less than elegant.
A example of this button code is below:
Python:
imagebutton auto "/pur/bp_buy_1_%s.png" action [SetVariable("manu_plating_iron", manu_plating_iron + 1),Manu()]
Python:
class Manu(Action):
def __call__(self):
manu()
renpy.restart_interaction()
def manu():
store.dem_iron = manu_framing_iron * 10 + manu_framing_stainless * 6 + manu_plating_iron * 12
The challenge is that I also modify the variables such as manu_plating_iron within a label. Hence I want to recalculate all of the variables in def manu() as part of that label without requiring a button press. Is it possible to run Manu() from within a label?
PS: The simple solution is to just copy all of the formulae into the label, however this is less than elegant.