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

CommonClient: allow worlds to change title of run_gui without rewriting it #3297

Merged
merged 12 commits into from
Sep 8, 2024

Conversation

qwint
Copy link
Collaborator

@qwint qwint commented May 13, 2024

What is this fixing or adding?

moves GameManager to an optional attribute that worlds can update or overwrite as needed

How was this tested?

ran text client with the change, saw no issues,
updated my client to not define run_gui and use self.ui_manager.base_title = "Minit Client" in the init instead and ran it, saw no issues

If this makes graphical changes, please attach screenshots.

…ted to the normal default so others using it don't have to rewrite everything
@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 13, 2024
Copy link
Contributor

@nicholassaylor nicholassaylor left a comment

Choose a reason for hiding this comment

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

LGTM

@qwint
Copy link
Collaborator Author

qwint commented May 13, 2024

updated description to reflect the new design

@qwint qwint requested a review from nicholassaylor May 13, 2024 23:09
qwint and others added 3 commits May 13, 2024 19:50
treble suggestion 1

Co-authored-by: Aaron Wagener <[email protected]>
treble suggestion 2

Co-authored-by: Aaron Wagener <[email protected]>
treble suggestion 3

Co-authored-by: Doug Hoskisson <[email protected]>
@qwint
Copy link
Collaborator Author

qwint commented May 14, 2024

whoops, didn't notice until i pressed the button that one of those wasn't a treble suggestion lol

@Exempt-Medic Exempt-Medic added the is: enhancement Issues requesting new features or pull requests implementing new features. label May 19, 2024
@ScipioWright ScipioWright added waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 29, 2024
@NewSoupVi
Copy link
Member

I've reran the unit tests on this branch twice, it refuses to work.

@qwint
Copy link
Collaborator Author

qwint commented Aug 19, 2024

per discussion in core-dev discord channel, changed to a method that returns the kivy App and tested with my own apworld that the following works and i can get rid of my build_gui() override

    def make_gui(self):
        ProxyManager = super().make_gui()
        ProxyManager.base_title = "Minit Client"
        return ProxyManager

@qwint
Copy link
Collaborator Author

qwint commented Aug 23, 2024

to consider: have make_gui return the class instead of an instance of it so if people want to subclass it they can, seemed to work in light testing but have nothing to commit yet

@qwint
Copy link
Collaborator Author

qwint commented Sep 6, 2024

retested new format with the following (and no run_gui)

        ui = super().make_gui()

        class MinitApp(ui):
            base_title = "Minit Client"
        return MinitApp
        ui = super().make_gui()
        ui.base_title = "Minit Client"
        return ui

@NewSoupVi NewSoupVi merged commit b8c2e14 into ArchipelagoMW:main Sep 8, 2024
18 checks passed
@qwint qwint deleted the cc_abstract_title branch September 8, 2024 15:55
AustinSumigray pushed a commit to AustinSumigray/Archipelago that referenced this pull request Jan 4, 2025
…ng it (ArchipelagoMW#3297)

* moves the title name in CommonContext.run_gui into a parameter defaulted to the normal default so others using it don't have to rewrite everything

* Change to using a GameManager attribute instead of a default param

* Update CommonClient.py

treble suggestion 1

Co-authored-by: Aaron Wagener <[email protected]>

* Update CommonClient.py

treble suggestion 2

Co-authored-by: Aaron Wagener <[email protected]>

* Update CommonClient.py

treble suggestion 3

Co-authored-by: Doug Hoskisson <[email protected]>

* Use make_gui() instead of a property to push kivy importing back to lazy loading regardless of gui_enabled status

* cleanup

* almost forgot to type it

* change make_gui to be a class so clients can subclass it

* clean up code readability

---------

Co-authored-by: Aaron Wagener <[email protected]>
Co-authored-by: Doug Hoskisson <[email protected]>
Co-authored-by: NewSoupVi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants