Skip to content

alttp: Add fill_slot_data function #1919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
17 changes: 17 additions & 0 deletions worlds/alttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,23 @@ def get_pre_fill_items(self):
res.append(item)
return res

def fill_slot_data(self):
slot_data = {}
if not self.multiworld.is_race:
for option_name in alttp_options:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that this is pulling every option in the options system. I know that isn't currently a lot for LTTP, but there's still some there that I doubt you need, like palette shuffle, and this will only get worse as the options get moved over.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that this is pulling every option in the options system. I know that isn't currently a lot for LTTP, but there's still some there that I doubt you need, like palette shuffle, and this will only get worse as the options get moved over.

which version would you prefere then?
having a static list, iterating over it and adding it to slot_data?
OR simply having ~20 static, basically identical, lines for each option i need/want for the tracker?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having a static list, iterating over it and adding it to slot_data?

This exactly. you make it sound like a bad thing? fwiw #993 makes this significantly easier, but we don't have that yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. no. I have nothing against that solution and never had.

I will change that when i'm back home.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that what you intended it look like?

option = getattr(self.multiworld, option_name)[self.player]
slot_data[option_name] = option.value

slot_data.update({
'mode': self.multiworld.mode[self.player],
'goal': self.multiworld.goal[self.player],
'dark_room_logic': self.multiworld.dark_room_logic[self.player],
'mm_medalion': self.multiworld.required_medallions[self.player][0],
'tr_medalion': self.multiworld.required_medallions[self.player][1],
'shop_shuffle': self.multiworld.shop_shuffle[self.player]}
)
return slot_data


def get_same_seed(world, seed_def: tuple) -> str:
seeds: typing.Dict[tuple, str] = getattr(world, "__named_seeds", {})
Expand Down