import os

# ==================== 屏幕配置 ====================
# 手机屏幕分辨率（横屏）
SCREEN_WIDTH = 2400
SCREEN_HEIGHT = 1080

# ==================== 摇杆配置 ====================
# 摇杆中心点（横屏左下角，不贴边）
# 向右上移动一点
JOYSTICK_CENTER_X = int(SCREEN_WIDTH * 0.20)   # 480 (右移)
JOYSTICK_CENTER_Y = int(SCREEN_HEIGHT * 0.80)  # 864 (上移)

# 滑动距离（像素）- 先测试 100
JOYSTICK_RADIUS = 100

# ==================== 视角控制配置 ====================
CAMERA_CONTROL_ENABLED = True
CAMERA_SENSITIVITY = 0.3
CAMERA_STEP_PIXELS = 30
CAMERA_DEAD_ZONE = 5
CAMERA_START_X = int(SCREEN_WIDTH * 0.8)
CAMERA_START_Y = int(SCREEN_HEIGHT * 0.5)

# ==================== ADB 路径配置 ====================
def find_adb_path():
    current_dir = os.path.dirname(os.path.abspath(__file__))
    project_dir = os.path.dirname(current_dir)
    
    project_adb = os.path.join(project_dir, "platform-tools", "platform-tools", "adb.exe")
    if os.path.exists(project_adb):
        return project_adb
    
    common_paths = [
        os.path.expanduser("~") + "\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe",
        os.path.expanduser("~") + "\\AppData\\Local\\Android\\sdk\\platform-tools\\adb.exe",
        "C:\\adb\\adb.exe",
        "C:\\Program Files\\Android\\platform-tools\\adb.exe",
    ]
    
    for path in common_paths:
        if os.path.exists(path):
            return path
    
    import shutil
    adb_in_path = shutil.which("adb")
    if adb_in_path:
        return adb_in_path
    
    return None

ADB_PATH = find_adb_path()

if ADB_PATH is None:
    print("警告: 未找到 ADB 工具!")
    ADB_PATH = "adb"
