So, in short, I have a gui setup for the user. on the gui, there is a day/time area. I create a button to "wait" to progress the time.
When trying to make the "wait" button work, I have been a bit unsuccessful.
Function
Code: Select all
class Time(object):
def __init__(self):
self._day = 1
self._time = 1
self._days_passed = 0
def advance_time(self):
# add time
self._time += 1
# if it's evening
if self._time > 3:
self._time = 1 # go back to Morning
self._day += 1 # go to next day
self._days_passed += 1 # add to day count
# if it's sunday
if self._day > 7:
self._day = 1
# else add time
else:
self._time += 1
Code: Select all
frame:
style "wait"
imagebutton:
action time.advance_time
idle "gui/footer/wait.png"
hover "gui/footer/wait_hover.png"
focus_mask True
hovered [ Show("header_txt", menuText="Wait", ht_x=221) ]
unhovered [Hide("header_txt")]
It may be a design flaw, but eventually, when advancing time, it would cause different action to occur, i.e. change the scene from day to night, move characters to different rooms, etc.
But, I am not sure how to actually go about that yet. I've tried creating a label to add the call to the function, but it just sends me to the main menu.
If I want to make this correctly, what is the best way to go about..
Example:
Time is Monday - Morning
Clicking wait moves to Monday - Afternoon
once it progresses to Monday - Afternoon, I need to make other adjustments, such as screen changes and so on. Any good examples out there?