aboutsummaryrefslogtreecommitdiffstats
path: root/chuni-hands-evolved.py
diff options
context:
space:
mode:
Diffstat (limited to 'chuni-hands-evolved.py')
-rw-r--r--chuni-hands-evolved.py19
1 files changed, 12 insertions, 7 deletions
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)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage