Calling the dunder method has to:
1. Look up the dunder method for that object/class
2. Bind a new method instance to the object instance
3. Call the method with its arguments
4. Run the appropriate operation on the object
Whereas running the appropriate operation on the object from the start
skips straight to step 4.
Region.Register.__getitem__ is called a lot without #4583. In that case,
generation of 10 template Blasphemous yamls with
`--skip_output --seed 1` and progression balancing disabled went from
19.0s to 18.8s (1.3% reduction in generation duration).
From profiling with `timeit`
```py
def __getitem__(self, index: int) -> Location:
return self._list[index]
```
appears to be about twice as fast as the old code:
```py
def __getitem__(self, index: int) -> Location:
return self._list.__getitem__(index)
```
Besides this, there is not expected to be any noticeable difference in
performance, and there is not expected to be any difference in semantics
with these changes.
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* adds docstring to make_gui describing what things you might want to change without dealing with kivy/kvui directly (there are better places to document those)
* Update CommonClient.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Update CommonClient.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
---------
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Introduce 'Hint Priority' concept
* fix error when sorting hints while not connected
* fix 'found' -> 'status' kivy stuff
* remove extraneous warning
this warning fired if you clicked to select or toggle priority of any hint, as you weren't clicking on the header...
* skip scanning individual header widgets when not clicking on the header
* update hints on disconnection
* minor cleanup
* minor fixes/cleanup
* fix: hints not updating properly for receiving player
* update re: review
* 'type() is' -> 'isinstance()'
* cleanup, re: Jouramie's review
* Change 'priority' to 'status', add 'Unspecified' and 'Avoid' statuses, update colors
* cleanup
* move dicts out of functions
* fix: new hints being returned when hint already exists
* fix: show `Found` properly when hinting already-found hints
* import `Hint` and `HintStatus` directly from `NetUtils`
* Default any hinted `Trap` item to be classified as `Avoid` by default
* add some sanity checks
* re: Vi's feedback
* move dict out of function
* Update kvui.py
* remove unneeded dismiss message
* allow lclick to drop hint status dropdown
* underline hint statuses to indicate clickability
* only underline clickable statuses
* Update kvui.py
* Update kvui.py
---------
Co-authored-by: Silvris <58583688+Silvris@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Launcher "Text Client" --connect archipelago.gg:38281
should work, it doesn't, this fixes that
* more explicit handling of expected values
* removing launcher updates meaning this pr cannot stand alone but will not have merge issues later
* add parser failure when an invalid url is found
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* adds handling for the `--` cli arg by having launcher capture, ignore, and pass through all of the values after it, while only processing (and validating) the values before it
updates text client and its components to allow for args to be passed through, captured in run_as_textclient, and used in parse_args if present
* Update worlds/LauncherComponents.py
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* explicitly using default args for parse_args when launched directly
* revert manual arg parsing by request
* Update CommonClient.py
* Update LauncherComponents.py
* :)
---------
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* 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 <mmmcheese158@gmail.com>
* Update CommonClient.py
treble suggestion 2
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Update CommonClient.py
treble suggestion 3
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* 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 <mmmcheese158@gmail.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Core: have webhost slot name links go through the launcher so that components can use them
* fix query handling, remove debug prints, and change mousover text for new behavior
* remove a missed debug and unused function
* filter room id to suuid since that's what everything else uses
* pass args to common client correctly
* add GUI to select which client to open
* remove args parsing and "require" components to parse it themselves
* support for messenger since it was basically already done
* use "proper" args argparsing and clean up uri handling
* use a timer and auto launch text client if no component is found
* change the timer to be a bit more appealing. also found a bug lmao
* don't hold 5 hostage and capitalize URI ig
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* makes the kivy connect button do the same username forgetting that /connect does to fix an issue where losing connection would make you unable to connect to a different server
* extract duplicate code
* per request, adds handling on any disconnect to forget the saved password as to not leak it to other servers
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* client: Added command history access with up/down and command echo in common client
* client: Changed command echo colour to orange
* client: removed star import from typing
* client: updated code style to match style guideline
* client: adjusted ordering of calling parent constructor in command prompt input constructor
* client: Fixed issues identified by beauxq in PR; fixed some typing issues
* client: PR comments; replaced command history list with deque
* Core: typing for async_start
* CommonClient: add a framework for clients to subscribe to data storage key notifications
* Core: update version to 0.4.2
* lufia2ac: coop support
* Factorio: move Client into world folder
* Factorio: declare Client as Client Component
* FactorioClient: use centralized launch_subprocess
* TextClient: make always available
* Clients: use certifi for wss
On Windows, the local cert store might be outdated and refuse connection to some servers.
* Clients: lazily create ssl_context