Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ra1ny-Yuki committed May 18, 2022
1 parent 37d3090 commit 3a06bde
Show file tree
Hide file tree
Showing 12 changed files with 421 additions and 483 deletions.
87 changes: 50 additions & 37 deletions lang/en_us.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
mcd_task:
help_msg: |
§7-----§r MCDR {1} v{2} §7-----§r
§7-----§r MCDR {name} v{ver} §7-----§r
§d【Command Help】§r
§7{0} help§r Show this help message
§7{0} list§r List all tasks
§7{0} detail §6<task>§r Show detail of the specified task
§7{0} detail-all§r Show detail of all the tasks
§7{0} add §6<task> §a[desc(optional)]§r Add a new task
§7{0} remove §6<task>§r Delete a task
§7{0} rename §6<task> <new_name>§r Rename a task
§7{0} change §6<task> §a<desc>§r Edit a task description
§7{0} done §6<task>§r Mark a task as done
§7{0} undone §6<task>§r Mark a task as undone
§7{0} deadline §6<task> §b<period(d)>§r Set a task deadline
§7{0} player §e<player> §rShow tasks of a player
§7{0} priority §6<task> §9<priority>§rSet a task priority
§7{0} res§8ponsible §6<task> §e<name>§r Set task responsibles
§7{0} unres§8ponsible §6<task> §e<name> §rDel responsibles
§7{0} list-res§8ponsibles §6<task> §rList task responsibles
§7{pre} overview§r Show task overview
§7{pre} help§r Show this help message
§7{pre} list§r List all tasks
§7{pre} reload§r Reload this plugin
§7{pre} detail §e<task>§r Show detail of the specified task
§7{pre} list-all§r List full map of the tasks
§7{pre} add §e<task> §a[desc(optional)]§r Add a new task
§7{pre} remove §e<task>§r Delete a task
§7{pre} rename §e<task> <new_name>§r Rename a task
§7{pre} change §e<task> §a<desc>§r Edit a task description
§7{pre} done §e<task>§r Mark a task as done
§7{pre} undone §e<task>§r Mark a task as undone
§7{pre} deadline §e<task> §c<period(d)>§r Set a task deadline
§7{pre} player §e<player> §rShow tasks of a player
§7{pre} priority §e<task> §6<priority>§rSet a task priority
§7{pre} res§8ponsible §e<task> §3<name>§r Set task responsibles
§7{pre} unres§8ponsible §e<task> §3<name> §rDel responsibles
§d【Tips】§r
1. You can click task text to show detail or plus mark to add a task
2. All the §6<task>§r above can be replaced by §6<task>.<sub_task>§r to access the sub-tasks
1. Click task text to show detail or plus mark to add a task
2. Use §e<task>.<sub_task>§r to access the sub-tasks
3. §cDO NOT§r name the task with §cdot(.)§r
§d【Command Example】§r
If task §ewitch_farm§r exists, you can add a sub-task to it with this command:
§7!!task add §6witch_farm.floor §aAFK lay black glass§r
You can add a sub-task to task §ewitch_farm§r with this command:
§7{pre} add §ewitch_farm.floor §aAFK lay black glass§r
mcdr_help: Manage progression of project tasks
overview_help: |
§7{0} list§r Show full task list
Expand All @@ -37,21 +38,20 @@ mcd_task:
invalid_number: Invalid number, click to reinput a number
resuggest_cmd_hover: Click here to refill command {}
rename_task_hover: Click here to rename this task
info_player_hover: Click here to browse player info
info_player_hover: Click here to §6browse §eplayer info§r
mark_task_done_hover: Click here to mark task as §edone§r
mark_task_undone_hover: Click here to mark task as §eundone§r
info_task_hover: Click here to browse task info
time_format: '%b.%d %Y %H:%M:%S'
ddl_set: Task {} now has a deadline for {} days ({})
task_renamed: 'Task {} has been renamed to {}: '
player_tasks_title: 'Player {} has {} tasks to do: '
info_task_title: 'Task information list: '
add_task_hover: Click here to add a new task
info_task_single_title: 'Task detailed information: '
ddl_set: "Task deadline has been changed"
task_renamed: 'Task §e{}§a§l has been renamed: '
player_tasks_title: 'Player §3{}§a§l has §3{}§a§l tasks to do: '
list_task_title: 'Task information list: '
add_task_hover: Click here to §6add§e a new task§r
add_sub_task_hover: Click here to §6add§e a new sub-task§r
info_task_title: 'Task detailed information: '
done_task_button: '[Finished tasks...]'
done_task_hover: Click here to browse tasks marked as §edone§r
edit_task_hover: Click here to edit description
show_desc_hover: Click here to browse description
info_task_hover: Click here to §6browse§r task §e{} §rdetail
task_already_exist: Task already exist, click to browse task list
new_task_created: 'New task created: '
detailed_info_task_title: 'Task detailed information list: '
Expand All @@ -60,17 +60,30 @@ mcd_task:
done_task_list_title: 'Finished task lists: '
on_player_joined: You have {} outdated tasks, please hurry up!
on_player_renamed: Detected your nickname changed, inherited {} tasks
list_responsible_title: 'This task has {} responsibles: '
removed_responsibles_title: 'Removed {} responsibles: '
added_responsibles_title: 'Added {} responsibles: '
list_responsible_title: 'This task has §3{}§a§l responsibles: '
removed_responsibles_title: 'Removed §3{}§a§l responsibles: '
added_responsibles_title: 'Added §3{}§a§l responsibles: '
illegal_call: This command without argument can only be called as player
set_ddl_hover: Click here to set deadline
set_ddl_hover: Click here to §6set§e deadline
help_msg_suggest_hover: Click here to fill §7{}§r
reloaded: "[Task] Plugin reloaded"
reloaded: "[Task] §a§lPlugin reloaded§r"
overview_headline: "Top priorities:"
no_priority: No priorities found, check full list for more tasks
date_approaching: |
Deadline is approaching or already passed:
{}
has_a_high_priority: "This task has a high priority: {}"
detail_priority: "Priority: {}"
detail_priority: "Priority: §6{} §r[✎]"
priority_hover: Click to §6set§e priority of this task
priority_set: Task priority has been changed
detail_desc: 'Task description: §7{} §r[✎]'
desc_hover: Click here to §6edit§e description
detail_deadline: "Deadline: §c{} §r[✎]"
detail_sub: "Sub-tasks: "
not_set: Not set yet
changed_desc_title: Task description changed
done_task_title: Task was marked as done
undone_task_title: Task was marked as undone
detail_res: "Responsibles: §5§l[+]§r"
add_res_hover: Click to §6add§e responsibles§r to this task
rm_res_hover: Click to §6remove§e {} as reponsible§r from this task
84 changes: 47 additions & 37 deletions lang/zh_cn.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
mcd_task:
help_msg: |
§7-----§r MCDR {1} v{2} §7-----§r
§7-----§r MCDR {name} v{ver} §7-----§r
§d【指令帮助】§r
§7{0} §r 显示{3}
§7{0} help§r 显示帮助信息
§7{0} list§r 显示任务列表
§7{0} detail §6<任务名称>§r 查看任务详细信息
§7{0} detail-all§r 查看所有任务详细信息
§7{0} add §6<任务名称> §a[任务描述(可选)]§r 添加任务
§7{0} del §6<任务名称>§r 删除任务
§7{0} rename §6<旧任务名称> §e<新任务名称>§r 重命名任务
§7{0} change §6<任务名称> §a<新任务描述>§r 修改任务描述
§7{0} done §6<任务名称>§r 标注任务为已完成
§7{0} undone §6<任务名称>§r 标注任务为未完成
§7{0} deadline §6<任务名称> §b<工期(日)>§r 为任务设置工期
§7{0} player §3<玩家> §r查看玩家任务列表
§7{0} priority §6<任务名称>§9 <优先级> §r为任务设置优先级
§7{0} res§8ponsible §6<任务名称> §3<玩家>§r 设置任务的责任人
§7{0} unres§8ponsible §6<任务名称> §3<玩家> §r移除任务的责任人
§7{0} list-res§8ponsibles §6<任务名称> §r列出该任务的责任人
§7{pre} overview§r 显示任务概览
§7{pre} help§r 显示帮助信息
§7{pre} list§r 显示任务列表
§7{pre} reload§r 重载该插件
§7{pre} detail §e<任务名称>§r 查看任务详细信息
§7{pre} list-all§r 列出完整的任务表
§7{pre} add §e<任务名称> §a[任务描述(可选)]§r 添加任务
§7{pre} del §e<任务名称>§r 删除任务
§7{pre} rename §e<旧任务名称> §e<新任务名称>§r 重命名任务
§7{pre} change §e<任务名称> §a<新任务描述>§r 修改任务描述
§7{pre} done §e<任务名称>§r 标注任务为已完成
§7{pre} undone §e<任务名称>§r 标注任务为未完成
§7{pre} deadline §e<任务名称> §c<工期(日)>§r 为任务设置工期
§7{pre} player §3<玩家> §r查看玩家任务列表
§7{pre} priority §e<任务名称>§6 <优先级> §r为任务设置优先级
§7{pre} res§8ponsible §e<任务名称> §3<玩家>§r 设置任务的责任人
§7{pre} unres§8ponsible §e<任务名称> §3<玩家> §r移除任务的责任人
§d【注意事项】§r
1. 可用鼠标点击任务查看详情,或点击加号快速添加新任务
2. 上述所有 §6<任务名称>§r 可以用 §6<任务名称>.<子任务名称>§r 的形式来访问子任务
2. 可用 §e<任务名称>§r.§e<子任务名称>§r 的形式来访问子任务
3. 命名子任务时,其名称§c不可包含小数点(即.)§r
§d【命令范例】§r
(若已经有 §e女巫塔§r 任务, 可使用以下命令添加子任务)
§7!!task add §6女巫塔.铺地板 §a挂机铺黑色玻璃§r
§7{pre} add §6女巫塔.铺地板 §a挂机铺黑色玻璃§r
mcdr_help: 工程任务进度管理
overview_help: |
§7{0} list§r 显示完整的任务列表
Expand All @@ -36,23 +36,22 @@ mcd_task:
task_not_found: 任务不存在! 点此查阅任务列表
task_not_found_hover: 点此§6查阅§e任务列表§r
invalid_number: 无效的数字! 点此重新输入数字
resuggest_cmd_hover: 点此重新补全指令 {}
resuggest_cmd_hover: 点此重新补全指令 §7{}§r
rename_task_hover: 点此§6重命名§e任务§r
info_player_hover: 点此§6查阅§e玩家详情§r
mark_task_done_hover: 点此将任务§6设为§e完成§r
mark_task_undone_hover: 点此将任务§6设为§e未完成§r
info_task_hover: 点此查阅§e任务详情§r
info_task_hover: 点此§6查阅§r任务 §e{}§r 详情§r
time_format: '%Y-%m-%d %H:%M:%S'
ddl_set: 为任务 §e{}§r 设置了 §e{}§r 日(§e{}§r)的截止日期
task_renamed: '任务{}已被重命名为{}:'
player_tasks_title: '玩家{}肩负了{}项重任: '
info_task_title: '搬砖信息列表: '
ddl_set: 已变更任务的截止日期
task_renamed: '任务 §e{}§a§l 已被重命名:'
player_tasks_title: '玩家 §3{} §a§l肩负了 §3{} §a§l项重任: '
info_task_title: '任务详细信息: '
list_task_title: "搬砖信息列表: "
add_task_hover: 点此§6添加§e新任务§r
info_task_single_title: '任务详细信息: '
add_sub_task_hover: 点此§6添加§e新子任务§r
done_task_button: '[已完成任务...]'
done_task_hover: 点此§6查阅§r被标记为§e完成§r的任务
edit_task_hover: 点此§6编辑§e任务描述§r
show_desc_hover: 点此查阅§e任务描述§r
task_already_exist: 任务已存在, 点此查阅任务列表
new_task_created: '创建了新的任务: '
detailed_info_task_title: '搬砖详细信息列表: '
Expand All @@ -61,19 +60,30 @@ mcd_task:
done_task_list_title: '已完成任务列表: '
on_player_joined: 您有{}项已逾期的任务, 请赶快填坑!
on_player_renamed: 检测到游戏ID变更, 继承了{}项任务
list_responsible_title: '此任务由{}名玩家承包: '
removed_responsibles_title: '移除了{}名责任人: '
added_responsibles_title: '添加了{}名责任人: '
list_responsible_title: '此任务由 §3{}§ r名玩家承包: '
removed_responsibles_title: '移除了 §3{}§r 名责任人: '
added_responsibles_title: '添加了 §3{}§r 名责任人: '
illegal_call: 不含额外参数的该指令仅可作为玩家使用
help_msg_suggest_hover: 点此以填入 §7{}§r
set_ddl_hover: 点此为任务设置工期
reloaded: "[Task] 插件已重载"
set_ddl_hover: 点此为任务§6设置§e工期§r
reloaded: "[Task] §a§l插件已重载§r"
overview_headline: "当务之急: "
no_priority: 暂无优先事项, 可查阅完整列表获取更多任务
priority_set: 已将任务{}的优先级设置为{}
priority_set: 任务优先级已变更
date_approaching: |
截止日期临近或已过:
§c{}§r
has_a_high_priority: "该任务的优先级较高: §6{}§r"
detail_priority: '优先级: {}'
priority_hover: '点此设置该任务的优先级'
detail_priority: '优先级: §6{} §r[✎]'
priority_hover: '点此§6设置§e该任务的优先级§r'
detail_desc: '任务描述: §7{} §r[✎]'
desc_hover: 点此§6编辑§e任务描述§r
detail_deadline: '截止日期: §c{} §r[✎]'
detail_sub: "子任务: "
not_set: "暂未设定"
changed_desc_title: 已变更任务描述
done_task_title: 任务被标记为已完成
undone_task_title: 任务被标记为未完成
detail_res: "责任人: §5§l[+]§r"
add_res_hover: 点击为该任务§6添加§e责任人§r
rm_res_hover: 点击自此任务§6移除§e责任人 {}§r
7 changes: 2 additions & 5 deletions mcd_task/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from mcd_task import global_variables
from mcd_task.command_actions import *
from mcd_task.global_variables import GlobalVariables
from mcd_task.task_manager import *
Expand All @@ -13,7 +12,6 @@ def on_info(server: PluginServerInterface, info: Info):
psd = parse(PLAYER_RENAMED, info.content)
if psd is not None:
inherit_responsible(info, **psd.named)
server.as_plugin_server_interface()

if info.is_user and DEBUG_MODE:
if info.content.startswith('!!task debug '):
Expand All @@ -22,7 +20,7 @@ def on_info(server: PluginServerInterface, info: Info):
if args[2] == 'base-title':
info.get_command_source().reply('Manager title is {}'.format(GlobalVariables.task_manager.title))
elif args[2] == 'full-path' and len(args) == 4:
info.get_command_source().reply(GlobalVariables.task_manager[args[3]].full_path())
info.get_command_source().reply(GlobalVariables.task_manager[args[3]].titles)
elif args[2] == 'player-join':
on_player_joined(server, info.player, info)
elif args[2] == 'player-renamed' and len(args) == 5:
Expand All @@ -38,13 +36,12 @@ def on_info(server: PluginServerInterface, info: Info):
def on_player_joined(server: PluginServerInterface, player: str, info: Info):
player_tasks = []
now_time = float(time.time())
for t in GlobalVariables.task_manager.get_responsible_manager()[player]:
for t in GlobalVariables.task_manager.responsible_manager[player]:
task = GlobalVariables.task_manager[t]
if not task.done and now_time > task.deadline != 0:
player_tasks.append(task)
if len(player_tasks) > 0:
task_timed_out(server, player, player_tasks)
info.get_server()


def on_load(server: PluginServerInterface, prev_module):
Expand Down
Loading

0 comments on commit 3a06bde

Please sign in to comment.