Skip to content
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

Launcher: deprecate FUNC Component type #1872

Merged
merged 6 commits into from
Jun 19, 2023
Merged

Conversation

Berserker66
Copy link
Member

What is this fixing or adding?

removes that any callable is always FUNC, instead of say CLIENT

How was this tested?

running Launcher.py

If this makes graphical changes, please attach screenshots.

@@ -31,9 +32,8 @@ def __init__(self, display_name: str, script_name: Optional[str] = None, frozen_
self.cli = cli
self.type = component_type or \
None if not display_name else \
Copy link
Member

Choose a reason for hiding this comment

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

while you are at it,

  • i don't think bool(display_name) should ever be False, so we could remove the None if ... and change the type hint for type to not be optional? if we want hide a button, it'd be better to use a special type or an additional flag rather than having display_name = ""



class Type(Enum):
TOOL = auto()
FUNC = auto() # not a real component
FUNC = auto() # not a real component, do not use anymore
Copy link
Member

Choose a reason for hiding this comment

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

might be better the other way around? i.e. MISC = auto(); MISC = FUNC ? anyway, this way we can't give a DeprecationWarning. My original idea would've been renaming FUNC -> MISC, and then adding a new FUNC which gets checked and replaecd in Components.__init__ to generate a DeprecationWarning.

Copy link
Member

@black-sliver black-sliver left a comment

Choose a reason for hiding this comment

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

I think
component_type: Type = None should be component_type: Optional[Type] = None
and type: Optional[Type] should be type: Type now

Plus below

worlds/LauncherComponents.py Show resolved Hide resolved
@Berserker66 Berserker66 merged commit 25f285b into main Jun 19, 2023
@Berserker66 Berserker66 deleted the launcher_deprecate_func branch June 19, 2023 07:57
Berserker66 added a commit that referenced this pull request Jun 20, 2023
* Launcher: add hidden component type

---------

Co-authored-by: black-sliver <[email protected]>
Witchybun pushed a commit to Witchybun/Archipelago that referenced this pull request Jun 26, 2023
* Launcher: add hidden component type

---------

Co-authored-by: black-sliver <[email protected]>
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
* Launcher: add hidden component type

---------

Co-authored-by: black-sliver <[email protected]>
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
* Launcher: add hidden component type

---------

Co-authored-by: black-sliver <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants