Support nearest resurrection route selection
This commit is contained in:
@@ -320,6 +320,8 @@ class GameLoopWorker(QThread):
|
||||
flight_land_key=None,
|
||||
flight_land_hold_sec=None,
|
||||
resurrection_waypoints_path=None,
|
||||
resurrection_route_a_path=None,
|
||||
resurrection_route_b_path=None,
|
||||
release_spirit_key=None,
|
||||
resurrect_key=None,
|
||||
enable_mouse_loot=True,
|
||||
@@ -363,6 +365,8 @@ class GameLoopWorker(QThread):
|
||||
self.flight_land_key = flight_land_key
|
||||
self.flight_land_hold_sec = flight_land_hold_sec
|
||||
self.resurrection_waypoints_path = resurrection_waypoints_path
|
||||
self.resurrection_route_a_path = resurrection_route_a_path or resurrection_waypoints_path
|
||||
self.resurrection_route_b_path = resurrection_route_b_path
|
||||
self.release_spirit_key = release_spirit_key
|
||||
self.resurrect_key = resurrect_key
|
||||
self.enable_mouse_loot = enable_mouse_loot
|
||||
@@ -407,6 +411,8 @@ class GameLoopWorker(QThread):
|
||||
eat_max_wait_sec=self.eat_max_wait_sec,
|
||||
stop_check=lambda: not self.running,
|
||||
resurrection_waypoints_path=self.resurrection_waypoints_path,
|
||||
resurrection_route_a_path=self.resurrection_route_a_path,
|
||||
resurrection_route_b_path=self.resurrection_route_b_path,
|
||||
release_spirit_key=self.release_spirit_key,
|
||||
resurrect_key=self.resurrect_key,
|
||||
enable_mouse_loot=self.enable_mouse_loot,
|
||||
@@ -721,9 +727,12 @@ class WoWMultiKeyGUI(QMainWindow):
|
||||
refresh_btn.clicked.connect(self._refresh_recorder_combos)
|
||||
patrol_layout.addRow("巡逻点 JSON:", self.waypoints_combo)
|
||||
patrol_layout.addRow("修理商 JSON:", self.vendor_combo)
|
||||
self.resurrection_waypoints_combo = QComboBox()
|
||||
self.resurrection_waypoints_combo.setMinimumWidth(200)
|
||||
patrol_layout.addRow("复活点路线 JSON:", self.resurrection_waypoints_combo)
|
||||
self.resurrection_route_a_combo = QComboBox()
|
||||
self.resurrection_route_a_combo.setMinimumWidth(200)
|
||||
self.resurrection_route_b_combo = QComboBox()
|
||||
self.resurrection_route_b_combo.setMinimumWidth(200)
|
||||
patrol_layout.addRow("复活路线 A JSON:", self.resurrection_route_a_combo)
|
||||
patrol_layout.addRow("复活路线 B JSON:", self.resurrection_route_b_combo)
|
||||
patrol_layout.addRow("攻击循环:", self.patrol_attack_loop_combo)
|
||||
patrol_layout.addRow("", refresh_btn)
|
||||
self.patrol_group.setVisible(False)
|
||||
@@ -1467,14 +1476,16 @@ class WoWMultiKeyGUI(QMainWindow):
|
||||
elif combo.count() > 1:
|
||||
combo.setCurrentIndex(1)
|
||||
combo.blockSignals(False)
|
||||
# 复活点路线下拉(无默认值,可置空)
|
||||
if hasattr(self, "resurrection_waypoints_combo"):
|
||||
self.resurrection_waypoints_combo.blockSignals(True)
|
||||
self.resurrection_waypoints_combo.clear()
|
||||
self.resurrection_waypoints_combo.addItem("-- 置空(直接跑尸体) --", "")
|
||||
for name, path in items:
|
||||
self.resurrection_waypoints_combo.addItem(name, path)
|
||||
self.resurrection_waypoints_combo.blockSignals(False)
|
||||
# 复活路线下拉(无默认值,可置空)
|
||||
for combo_name in ("resurrection_route_a_combo", "resurrection_route_b_combo"):
|
||||
if hasattr(self, combo_name):
|
||||
combo = getattr(self, combo_name)
|
||||
combo.blockSignals(True)
|
||||
combo.clear()
|
||||
combo.addItem("-- 置空(直接跑尸体) --", "")
|
||||
for name, path in items:
|
||||
combo.addItem(name, path)
|
||||
combo.blockSignals(False)
|
||||
|
||||
def _refresh_repair_vendor_json_combo(self):
|
||||
"""刷新“回城修理配置”的修理商下拉框。"""
|
||||
@@ -1612,11 +1623,13 @@ class WoWMultiKeyGUI(QMainWindow):
|
||||
waypoints_path = None
|
||||
vendor_path = None
|
||||
flight_json_path = None
|
||||
resurrection_waypoints_path = None
|
||||
resurrection_route_a_path = None
|
||||
resurrection_route_b_path = None
|
||||
if mode == 'patrol':
|
||||
wp = self.waypoints_combo.currentData() or ""
|
||||
vp = self.vendor_combo.currentData() or ""
|
||||
rwp = self.resurrection_waypoints_combo.currentData() or ""
|
||||
route_a = self.resurrection_route_a_combo.currentData() or ""
|
||||
route_b = self.resurrection_route_b_combo.currentData() or ""
|
||||
if not wp:
|
||||
QMessageBox.warning(self, "提示", "巡逻打怪模式需选择巡逻点 JSON 文件")
|
||||
return
|
||||
@@ -1629,9 +1642,16 @@ class WoWMultiKeyGUI(QMainWindow):
|
||||
if not os.path.exists(vp):
|
||||
QMessageBox.warning(self, "提示", f"修理商文件不存在: {vp}")
|
||||
return
|
||||
if route_a and not os.path.exists(route_a):
|
||||
QMessageBox.warning(self, "提示", f"复活路线 A 文件不存在: {route_a}")
|
||||
return
|
||||
if route_b and not os.path.exists(route_b):
|
||||
QMessageBox.warning(self, "提示", f"复活路线 B 文件不存在: {route_b}")
|
||||
return
|
||||
waypoints_path = wp
|
||||
vendor_path = vp
|
||||
resurrection_waypoints_path = rwp if rwp and os.path.exists(rwp) else None
|
||||
resurrection_route_a_path = route_a or None
|
||||
resurrection_route_b_path = route_b or None
|
||||
attack_loop_path = None
|
||||
if mode == 'patrol':
|
||||
attack_loop_path = self.patrol_attack_loop_combo.currentData() or None
|
||||
@@ -1728,7 +1748,8 @@ class WoWMultiKeyGUI(QMainWindow):
|
||||
flight_takeoff_hold_sec=self.flight_takeoff_hold_spin.value(),
|
||||
flight_land_key=self.flight_land_key_edit.text(),
|
||||
flight_land_hold_sec=self.flight_land_hold_spin.value(),
|
||||
resurrection_waypoints_path=resurrection_waypoints_path,
|
||||
resurrection_route_a_path=resurrection_route_a_path,
|
||||
resurrection_route_b_path=resurrection_route_b_path,
|
||||
release_spirit_key=release_spirit_key,
|
||||
resurrect_key=resurrect_key,
|
||||
enable_mouse_loot=enable_mouse_loot,
|
||||
|
||||
Reference in New Issue
Block a user