mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 01:59:33 +08:00
feat: mumu extras (#8939)
Co-authored-by: uye <99072975+ABA2396@users.noreply.github.com> Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,13 @@
|
||||
#include "Utils/Logger.hpp"
|
||||
#include <meojson/json.hpp>
|
||||
|
||||
void asst::GeneralConfig::set_connection_extras(const std::string& name, const json::object& extras)
|
||||
{
|
||||
LogInfo << name << extras;
|
||||
|
||||
m_adb_cfg[name].extras = extras;
|
||||
}
|
||||
|
||||
bool asst::GeneralConfig::parse(const json::value& json)
|
||||
{
|
||||
LogTraceFunction;
|
||||
@@ -17,13 +24,19 @@ bool asst::GeneralConfig::parse(const json::value& json)
|
||||
// m_options.print_window = options_json.at("printWindow").as_boolean();
|
||||
m_options.adb_extra_swipe_dist = options_json.get("adbExtraSwipeDist", 100);
|
||||
m_options.adb_extra_swipe_duration = options_json.get("adbExtraSwipeDuration", -1);
|
||||
m_options.adb_swipe_duration_multiplier = options_json.get("adbSwipeDurationMultiplier", 10.0);
|
||||
m_options.adb_swipe_x_distance_multiplier = options_json.get("adbSwipeXDistanceMultiplier", 0.8);
|
||||
m_options.adb_swipe_duration_multiplier =
|
||||
options_json.get("adbSwipeDurationMultiplier", 10.0);
|
||||
m_options.adb_swipe_x_distance_multiplier =
|
||||
options_json.get("adbSwipeXDistanceMultiplier", 0.8);
|
||||
m_options.minitouch_extra_swipe_dist = options_json.get("minitouchExtraSwipeDist", 100);
|
||||
m_options.minitouch_extra_swipe_duration = options_json.get("minitouchExtraSwipeDuration", -1);
|
||||
m_options.minitouch_swipe_default_duration = options_json.get("minitouchSwipeDefaultDuration", 200);
|
||||
m_options.minitouch_swipe_extra_end_delay = options_json.get("minitouchSwipeExtraEndDelay", 150);
|
||||
m_options.swipe_with_pause_required_distance = options_json.get("swipeWithPauseRequiredDistance", 50);
|
||||
m_options.minitouch_extra_swipe_duration =
|
||||
options_json.get("minitouchExtraSwipeDuration", -1);
|
||||
m_options.minitouch_swipe_default_duration =
|
||||
options_json.get("minitouchSwipeDefaultDuration", 200);
|
||||
m_options.minitouch_swipe_extra_end_delay =
|
||||
options_json.get("minitouchSwipeExtraEndDelay", 150);
|
||||
m_options.swipe_with_pause_required_distance =
|
||||
options_json.get("swipeWithPauseRequiredDistance", 50);
|
||||
if (auto order = options_json.find<json::array>("minitouchProgramsOrder")) {
|
||||
m_options.minitouch_programs_order.clear();
|
||||
for (const auto& type : *order) {
|
||||
@@ -66,7 +79,7 @@ bool asst::GeneralConfig::parse(const json::value& json)
|
||||
std::string base_name = cfg_json.get("baseConfig", std::string());
|
||||
const AdbCfg& base_cfg = base_name.empty() ? AdbCfg() : m_adb_cfg.at(base_name);
|
||||
|
||||
AdbCfg adb;
|
||||
AdbCfg& adb = m_adb_cfg[cfg_json.at("configName").as_string()];
|
||||
adb.connect = cfg_json.get("connect", base_cfg.connect);
|
||||
adb.display_id = cfg_json.get("displayId", base_cfg.display_id);
|
||||
adb.uuid = cfg_json.get("uuid", base_cfg.uuid);
|
||||
@@ -74,7 +87,8 @@ bool asst::GeneralConfig::parse(const json::value& json)
|
||||
adb.swipe = cfg_json.get("swipe", base_cfg.swipe);
|
||||
adb.press_esc = cfg_json.get("pressEsc", base_cfg.press_esc);
|
||||
adb.display = cfg_json.get("display", base_cfg.display);
|
||||
adb.screencap_raw_with_gzip = cfg_json.get("screencapRawWithGzip", base_cfg.screencap_raw_with_gzip);
|
||||
adb.screencap_raw_with_gzip =
|
||||
cfg_json.get("screencapRawWithGzip", base_cfg.screencap_raw_with_gzip);
|
||||
adb.screencap_raw_by_nc = cfg_json.get("screencapRawByNC", base_cfg.screencap_raw_by_nc);
|
||||
adb.nc_address = cfg_json.get("ncAddress", base_cfg.nc_address);
|
||||
adb.screencap_encode = cfg_json.get("screencapEncode", base_cfg.screencap_encode);
|
||||
@@ -88,8 +102,6 @@ bool asst::GeneralConfig::parse(const json::value& json)
|
||||
adb.call_minitouch = cfg_json.get("callMinitouch", base_cfg.call_minitouch);
|
||||
adb.call_maatouch = cfg_json.get("callMaatouch", base_cfg.call_maatouch);
|
||||
adb.back_to_home = cfg_json.get("back_to_home", base_cfg.back_to_home);
|
||||
|
||||
m_adb_cfg[cfg_json.at("configName").as_string()] = std::move(adb);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user