better:优化快捷设置
This commit is contained in:
@@ -56,6 +56,15 @@ class ConfigEditor:
|
||||
self.main_frame.columnconfigure(1, weight=1)
|
||||
self.main_frame.rowconfigure(1, weight=1) # 修改为1,因为第0行是版本号
|
||||
|
||||
# 默认选择快捷设置栏
|
||||
self.current_section = "quick_settings"
|
||||
self.create_quick_settings_widgets()
|
||||
# 选中导航树中的快捷设置项
|
||||
for item in self.tree.get_children():
|
||||
if self.tree.item(item)["values"][0] == "quick_settings":
|
||||
self.tree.selection_set(item)
|
||||
break
|
||||
|
||||
def load_editor_config(self):
|
||||
"""加载编辑器配置"""
|
||||
try:
|
||||
@@ -539,13 +548,13 @@ class ConfigEditor:
|
||||
current = current.get(key, {})
|
||||
value = current.get(path[-1]) # 获取最后一个键的值
|
||||
|
||||
# 创建名称标签
|
||||
name_label = ttk.Label(frame, text=setting["name"], font=("微软雅黑", 18))
|
||||
# 创建名称标签(加粗)
|
||||
name_label = ttk.Label(frame, text=setting["name"], font=("微软雅黑", 16, "bold"))
|
||||
name_label.pack(fill=tk.X, padx=5, pady=(2, 0))
|
||||
|
||||
# 创建描述标签
|
||||
if setting.get("description"):
|
||||
desc_label = ttk.Label(frame, text=setting['description'], foreground="gray", font=("微软雅黑", 16))
|
||||
desc_label = ttk.Label(frame, text=setting['description'], foreground="gray", font=("微软雅黑", 10))
|
||||
desc_label.pack(fill=tk.X, padx=5, pady=(0, 2))
|
||||
|
||||
# 根据类型创建不同的控件
|
||||
@@ -562,14 +571,14 @@ class ConfigEditor:
|
||||
elif setting_type == "text":
|
||||
value = str(value) if value is not None else ""
|
||||
var = tk.StringVar(value=value)
|
||||
entry = ttk.Entry(frame, textvariable=var, width=40, font=("微软雅黑", 18))
|
||||
entry = ttk.Entry(frame, textvariable=var, width=40, font=("微软雅黑", 12))
|
||||
entry.pack(fill=tk.X, padx=5, pady=(0,5))
|
||||
var.trace_add("write", lambda *args, p=path, v=var: self.on_quick_setting_changed(p, v))
|
||||
|
||||
elif setting_type == "number":
|
||||
value = str(value) if value is not None else "0"
|
||||
var = tk.StringVar(value=value)
|
||||
entry = ttk.Entry(frame, textvariable=var, width=10, font=("微软雅黑", 18))
|
||||
entry = ttk.Entry(frame, textvariable=var, width=10, font=("微软雅黑", 12))
|
||||
entry.pack(fill=tk.X, padx=5, pady=(0,5))
|
||||
var.trace_add("write", lambda *args, p=path, v=var: self.on_quick_setting_changed(p, v))
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ window_width = 1000
|
||||
window_height = 800
|
||||
save_delay = 1.0
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "核心性格"
|
||||
description = "麦麦的核心性格描述,建议50字以内"
|
||||
path = "personality.personality_core"
|
||||
type = "text"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "性格细节"
|
||||
description = "麦麦性格的细节描述,条数任意,不能为0"
|
||||
@@ -33,53 +39,57 @@ path = "chat.chat_mode"
|
||||
type = "text"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "退出专注阈值"
|
||||
description = "自动退出专注聊天的阈值,越低越容易退出专注聊天"
|
||||
path = "chat.exit_focus_threshold"
|
||||
name = "回复频率(normal模式)"
|
||||
description = "麦麦回复频率,一般为1,默认频率下,30分钟麦麦回复30条(约数)"
|
||||
path = "normal_chat.talk_frequency"
|
||||
type = "number"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "偷取表情包"
|
||||
description = "是否偷取表情包,让麦麦可以发送她保存的这些表情包"
|
||||
path = "emoji.steal_emoji"
|
||||
type = "bool"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "核心性格"
|
||||
description = "麦麦的核心性格描述,建议50字以内"
|
||||
path = "personality.personality_core"
|
||||
type = "text"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "自动专注阈值"
|
||||
name = "自动专注阈值(auto模式)"
|
||||
description = "自动切换到专注聊天的阈值,越低越容易进入专注聊天"
|
||||
path = "chat.auto_focus_threshold"
|
||||
type = "number"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "自我识别处理器"
|
||||
name = "退出专注阈值(auto模式)"
|
||||
description = "自动退出专注聊天的阈值,越低越容易退出专注聊天"
|
||||
path = "chat.exit_focus_threshold"
|
||||
type = "number"
|
||||
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "思考间隔(focus模式)"
|
||||
description = "思考的时间间隔(秒),可以有效减少消耗"
|
||||
path = "focus_chat.think_interval"
|
||||
type = "number"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "自我识别处理器(focus模式)"
|
||||
description = "是否启用自我识别处理器"
|
||||
path = "focus_chat_processor.self_identify_processor"
|
||||
type = "bool"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "工具使用处理器"
|
||||
name = "工具使用处理器(focus模式)"
|
||||
description = "是否启用工具使用处理器"
|
||||
path = "focus_chat_processor.tool_use_processor"
|
||||
type = "bool"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "工作记忆处理器"
|
||||
name = "工作记忆处理器(focus模式)"
|
||||
description = "是否启用工作记忆处理器,不稳定,消耗量大"
|
||||
path = "focus_chat_processor.working_memory_processor"
|
||||
type = "bool"
|
||||
|
||||
[[editor.quick_settings.items]]
|
||||
name = "显示聊天模式"
|
||||
name = "显示聊天模式(debug模式)"
|
||||
description = "是否在回复后显示当前聊天模式"
|
||||
path = "experimental.debug_show_chat_mode"
|
||||
type = "bool"
|
||||
|
||||
|
||||
|
||||
|
||||
[translations.sections.inner]
|
||||
name = "版本"
|
||||
description = "麦麦的内部配置,包含版本号等信息。此部分仅供显示,不可编辑。"
|
||||
|
||||
Reference in New Issue
Block a user