(It seemed like it would be best to re-open this topic rather than create a new one, but I can do that if it's preferred.)
So I broke things again by once more adding extra complexity. This is the current code I'm working on.
Code: Select all
default systemmap_location_lists = {
"sol" : #primary location
{
"coordinates": (489, 414), #where to place the dropdown menu
"target position": (360, 425), #where the location arrow will bounce
"buttons": #list of button/action lists
[
["Dyson Ring",
[SetVariable("player_destination_broad", "sol"), SetVariable("player_destination_granular", "the Dyson Ring"), SetVariable("player_destination_label", "loc_sol_dyson"), Hide("systemmap_location_menus"), Show("destination_checker")],
],
],
},
"venus" : {
"coordinates": (632, 525),
"target position": (360, 425),
"buttons":
[
["Aeneas Station",
[SetVariable("player_destination_broad", "venus"), SetVariable("player_destination_granular", "Aeneas Station"), SetVariable("player_destination_label", "loc_venus_aeneas"), Hide("systemmap_location_menus"), Show("destination_checker")]
],
["Venus Aerostat",
[SetVariable("player_destination_broad", "venus"), SetVariable("player_destination_granular", "Venus Aerostat"), SetVariable("player_destination_label", "loc_venus_aerostat"), Hide("systemmap_location_menus"), Show("destination_checker")],
],
],
},
screen systemmap_location_menus(location):
modal True
imagebutton:
idle "gui/systemmap/5percent.png"
hover "gui/systemmap/5percent.png"
focus_mask None
action Hide("systemmap_location_menus")
frame:
pos systemmap_location_lists[location]["coordinates"]
background Frame("gui/systemmap/location_frame.png", left=25, top=25, right=25, bottom=25, tile=False)
padding (10, 10)
vbox:
spacing -30
for i2 in systemmap_location_lists[location]["buttons"]:
textbutton i2:
text_style "mapmenu_location_buttons"
action NullAction()
I decided that I wanted to give each button it's own actions, so I changed from having a list of all button names, to giving each name it's own list, containing it's name and the specific actions I want to give it. But that's not working and I'm once again floundering, in over my head.
Currently, a location will correctly generate a button if there is only one sub-location, like Earth, but Venus crashes.
Code: Select all
...
File "game/scripts/systemmap.rpy", line 355, in execute
Exception: Cannot display [<store.SetField object at 0x0D393AB0>, <store.SetField object at 0x0D393D30>, <store.SetField object at 0x0D393A70>, <store.Hide object at 0x0D393BD0>] as text.
...
Line 355 is
I am still just calling the screen with a button action based on the location:
Code: Select all
action Show("systemmap_location_menus", location="sol")