Buttons and Flyout Menus [SOLVED]
Posted: Wed Jun 29, 2011 2:04 pm
Okay, I'm trying to go the Princess Maker route, creating a day-planner that lets you choose working, studying, etc., with sub-menus for what job/class/thingy to do that week. Unfortunately, despite scrutinizing the DSE files and demo_ui.rpy from the tutorial, and scouring the wiki and stuff for clues, I just can't get how to make it work. Here's what I got so far:
When I click on the Job button, nothing happens.
I don't understand; is it the way the button is implemented? Is it techinically working, but needs to re-draw the screen in order for the menu to show up?
What's really aggravating is that this isn't the first time I've gotten stuck on buttons; the manual just says "call a function with no arguments!", but no matter what I try, either the button does nothing when clicked, or the function is called *without* waiting for the button to be clicked on... Sorry, I'm just frustrated. Can anyone help?
Code: Select all
init python:
style.window.left_padding = 100
show_main_plan_menu = True
selecting_plan = False
show_job_menu = False
show_class_menu = False
def show_jobs():
selecting_plan = True
show_job_menu = True
job_menu()
def planner():
def job_menu_button():
if selecting_plan:
ui.textbutton("Work", clicked= None, xminimum=150)
else:
ui.textbutton("Work", clicked= show_jobs, xminimum=150)
if show_main_plan_menu:
ui.frame(xpos=0, ypos=0, xanchor='left', yanchor='top', yfill = True)
ui.vbox(xpos=0, ypos=0, xanchor='left', yanchor='top')
job_menu_button()
ui.textbutton("Class", clicked=None, xminimum=150)
ui.textbutton("Rest", clicked=None, xminimum=150)
ui.textbutton("Adventure", clicked=None, xminimum=150)
ui.close()
def job_menu():
if show_job_menu:
ui.frame(xpos=0.5, ypos=0.5, xanchor='center', yanchor='center')
ui.vbox()
ui.textbutton("Done", clicked = None, xminimum = 80)
ui.close()
I don't understand; is it the way the button is implemented? Is it techinically working, but needs to re-draw the screen in order for the menu to show up?
What's really aggravating is that this isn't the first time I've gotten stuck on buttons; the manual just says "call a function with no arguments!", but no matter what I try, either the button does nothing when clicked, or the function is called *without* waiting for the button to be clicked on... Sorry, I'm just frustrated. Can anyone help?