Skip to content

Commit

Permalink
2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Devil4ngle committed Nov 14, 2024
1 parent 5e0b738 commit 9f4df31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
5 changes: 2 additions & 3 deletions scripts/image_layering.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ def capture_screenshot():
return cropped_image


def overlay_images(image_data):
zoomed_in_image = capture_screenshot()
def overlay_images(image_data,zoomed_in_image):
clean_minimap = cv2.imdecode(np.frombuffer(image_data, np.uint8), cv2.IMREAD_COLOR)
downscale_factor = 0.4
downscale_factor = 0.8
clean_minimap_small = cv2.resize(clean_minimap, None, fx=downscale_factor, fy=downscale_factor, interpolation=cv2.INTER_LINEAR)

# Feature detection and description on downscaled clean_minimap
Expand Down
14 changes: 5 additions & 9 deletions squad_mortar_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from websockets.server import serve
from tkinter import simpledialog
import json
from scripts.image_layering import overlay_images
from scripts.image_layering import capture_screenshot, overlay_images
from tkinter import messagebox
import requests

VERSION = "2.3.2"
VERSION = "2.3.3"

DEFAULT_CONFIG = {
"hotkey": "!",
Expand All @@ -25,11 +25,7 @@

CONFIG_FILE_PATH = "config/config.json"

TEXT_CONTENT = """ When this application is started,
https://squadcalc.app/ (SquadCalc) needs to be
refreshed if already open.
TEXT_CONTENT = """
When changing settings they will be applied upon
adding new mortar points on (SquadCalc).
Expand Down Expand Up @@ -77,9 +73,10 @@ async def handle_map(websocket):
await websocket.send("Open")
while True:
if keyboard.is_pressed(settings["hotkey"]):
zoomed_in_image = capture_screenshot()
await websocket.send("Map")
image_data = await websocket.recv()
modified_image_data = overlay_images(image_data)
modified_image_data = overlay_images(image_data,zoomed_in_image)
await websocket.send(modified_image_data)
await asyncio.sleep(0.5)
await asyncio.sleep(0.1)
Expand Down Expand Up @@ -152,7 +149,6 @@ def start_loop_coordinates():

# GUI Part
root = tk.Tk()
root.geometry("560x300")

try:
icon_path = "favicon.ico"
Expand Down

0 comments on commit 9f4df31

Please sign in to comment.