diff options
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | chuni-hands-evolved.py | 19 |
2 files changed, 21 insertions, 9 deletions
@@ -7,8 +7,15 @@ Another mysterious tool that detects things. Inspired by [chuni-hands](https://g # Usage Notes In most cases you will not need to turn on keybinds output option (unless you are doing something custom) -If you are using this with UMIGURI and are using [brokenithm-evolved-ios-umi](https://git.moekyun.me/pinapelz/brokenithm-evolved-ios-umi), keybinds option is not needed. +If you are using this with UMIGURI and are using [brokenithm-evolved-ios-umi](https://gitea.tendokyu.moe/pinapelz/brokenithm-evolved-ios-umi), keybinds option is not needed. The UI will lag when the update rate is set to low, its recommended that you first configure using a high update rate, then set it as low as possible for use to ensure minimal latency. -*It takes some time to start up, so please be patient*.
\ No newline at end of file +*It takes some time to start up, so please be patient*. + +- Low-quality webcams will make detection difficult +- Expanding the areas of the air-zones will allow for higher accuracy, as it takes the average lighting within a larger area +- The GUI "scales", please adjust window height accordingly (i love tkinter yep.) + +# Config +On first launch a `config.json` file will be created. Saving your configs from the UI will write to this file, unsaved changes wil be lost.
\ No newline at end of file diff --git a/chuni-hands-evolved.py b/chuni-hands-evolved.py index 9859d9c..cda7010 100644 --- a/chuni-hands-evolved.py +++ b/chuni-hands-evolved.py @@ -19,12 +19,12 @@ zones = [ ] _UMIGIRI_32_AIRZONE_LAYOUT = { - 0: "o", - 1: "0", - 2: "p", - 3: "l", - 4: ",", - 5: ".", + 0: ".", + 1: ",", + 2: "P", + 3: "L", + 4: "O", + 5: "0", } base_positions = [{"x": zone["x"], "y": zone["y"]} for zone in zones] @@ -200,6 +200,7 @@ def setup_gui(camera_width: int, camera_height: int, preview_width: int, preview "width": int(width_var.get()), "camera_index": current_camera_index, "chuniio_enabled": chuniio_enabled.get(), + "layout": _UMIGIRI_32_AIRZONE_LAYOUT } with open(CONFIG_FILE, "w") as f: json.dump(config, f) @@ -350,9 +351,13 @@ def load_config() -> dict: return {} def main(): - global root, current_camera_index, cap, video_canvas, x_slider, y_slider, width_var, spacing_slider, sensitivity_var, keystrokes_enabled, chuniio_enabled, update_rate, CAMERA_WIDTH, CAMERA_HEIGHT, latest_frame, running + global root, current_camera_index, cap, video_canvas, x_slider, y_slider, width_var, spacing_slider, sensitivity_var, keystrokes_enabled, chuniio_enabled, update_rate, CAMERA_WIDTH, CAMERA_HEIGHT, latest_frame, running, _UMIGIRI_32_AIRZONE_LAYOUT print("Now starting up... please wait a bit...") config = load_config() + if config.get("layout") is not None: + print("Loading key-layout from config") + _UMIGIRI_32_AIRZONE_LAYOUT = {int(k): v for k, v in config.get("layout").items()} + print(_UMIGIRI_32_AIRZONE_LAYOUT) current_camera_index = config.get("camera_index", 0) cap = cv2.VideoCapture(current_camera_index) cap.set(cv2.CAP_PROP_FRAME_WIDTH, CAMERA_WIDTH) |
