Skip to content

Commit

Permalink
Merge pull request #32 from crash1115/dev
Browse files Browse the repository at this point in the history
Version 0.4.6
  • Loading branch information
crash1115 authored Oct 7, 2020
2 parents 64de048 + 7be7fcc commit 949221c
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 95 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ If you'd like to contribute, please get in touch with me or create a pull reques
### Unsupported Modules
- Obsidian (no plans to support at this time)

### Known Issues
- Roll dialog does not show up if you're using Downtime Tracker along with the Use Average Rolls setting of Group Roll Checks and Saves. This issue has been reports here, and this page will be updated when it gets fixed: https://github.com/trdischat/grouproll/issues/10

## Got Questions? Find a Bug?
Contact me on Discord (CRASH1115#2944) to chat, or create an issue right here on GitHub.

## Attributions and Special Thanks
- Thanks to platypus_pi for help with English localization
- Thanks to KLO#1490 for Korean localization
- Thanks to hmqgg#5775 for Chinese localization

## License
- This work is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode).
Expand Down
15 changes: 2 additions & 13 deletions audit-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ export default class AuditLog extends FormApplication {

let actorId = formData.actorId;
let actor = game.actors.get(actorId);
let flags = actor.data.flags['5e-training'];
let activities = flags.trainingItems;
let activities = await actor.getFlag("5e-training", "trainingItems");

// Same loop as before. Cycle through each activity, if it's got no change array,
// move on to the next one. If it does, cycle through it and see if the timestamp
Expand All @@ -76,17 +75,7 @@ export default class AuditLog extends FormApplication {
}

// Update actor and flags
flags.trainingItems = activities;
// Foundry versions 0.7.0 and earlier required the use of a workaround to get the flags to set properly
// In 0.7.1 and onward, this workaround resulted in data loss and was no longer required.
// Check for core version here, and do the right thing so nothing gets nuked.
if(game.data.version < "0.7.1"){
actor.update({'flags.5e-training': null}).then(function(){
actor.update({'flags.5e-training': flags});
});
} else {
actor.update({'flags.5e-training': flags});
}
await actor.setFlag("5e-training", "trainingItems", activities);

}

Expand Down
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## Version 0.4.6
Improvements:
- Changed the way activity data is updated behind the scenes so things don't explode for no good reason. Special thanks to Ethck#6879 for slogging through it with me.
- Added Chinese localization thanks to hmqgg#5775

Fixes:
- Fixed a bug where the names of the rolls were displaying as ??? in the audit log. This doesn't fix any activities that have been logged as ??? already, but will prevent them from saving that way going forward.

## Version 0.4.5
Compatibility patch for 0.7.1+
- Modifies the way flags are updated to prevent data loss when using Foundry core versions higher than 0.7.0
Expand All @@ -9,7 +17,6 @@ Improvements:
- Added the ability to select tools in addition to skills and ability checks. Tools are limited to those the actor has in their inventory. This means they're not available on NPC sheets.

Changes:

- "Ability" progression mode is now called "Ability/Skill/Tool Check" mode.
- "DC" progression mode is now called "Check with DC".
- Together, these modes are referred to as "Check-Based" progression modes, since they both utilize checks. You'll see them referred to this way in the module settings.
Expand Down
119 changes: 119 additions & 0 deletions lang/cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"C5ETRAINING.Ability": "属性",
"C5ETRAINING.AbilityCha": "魅力",
"C5ETRAINING.AbilityCheck": "属性检定",
"C5ETRAINING.AbilityCon": "体质",
"C5ETRAINING.AbilityDex": "敏捷",
"C5ETRAINING.AbilityInt": "智力",
"C5ETRAINING.AbilitySkillToolCheck": "属性/技能/工具检定",
"C5ETRAINING.AbilityStr": "力量",
"C5ETRAINING.AbilityWis": "感知",
"C5ETRAINING.Action": "动作",
"C5ETRAINING.Activity": "活动",
"C5ETRAINING.ActivityProgress": "活动进度",
"C5ETRAINING.Add": "添加",
"C5ETRAINING.Advantage": "优势",
"C5ETRAINING.AdjustProgressValue": "调整进度",
"C5ETRAINING.AdvanceActivityProgress": "推进活动进度",
"C5ETRAINING.AnnounceActivityCompletionFor": "宣告活动完成:",
"C5ETRAINING.AnnounceActivityCompletionForHint": "选择一种角色类型,该类角色会在活动完成时触发发送聊天消息。",
"C5ETRAINING.Apply": "应用",
"C5ETRAINING.Attempt": "尝试",
"C5ETRAINING.AttemptsToComplete": "尝试完成",
"C5ETRAINING.AuditLog": "变更记录",
"C5ETRAINING.AuditLogDeleteNote": "注意: 取消变更并不会回滚。 如果你想要回滚这里看到的更改的内容,你必须手动处理。但如果需要的话这个记录可以帮助你找出变更的部分。",
"C5ETRAINING.AuditLogInstructionsGm": "该记录展示了对该角色休整活动的进度产生的所有变更的列表。你可以在查看时通过点击‘取消’栏的勾选框并点击窗口底部的按钮来从该列表中移除项目。一旦确认,你或者玩家都无法看到被删除的项目。",
"C5ETRAINING.AuditLogInstructionsPlayer": "该记录展示了GM还没有审阅的你的休整活动的进度产生的所有变更的列表。检查后,这些记录将不再在这里显示。",

"C5ETRAINING.Cancel": "取消",
"C5ETRAINING.CheckDC": "检定DC",
"C5ETRAINING.CheckWithDC": "检定DC",
"C5ETRAINING.Completed": "已完成",
"C5ETRAINING.CompletedADowntimeActivity": "完成了一项休整活动。",
"C5ETRAINING.CompletionTarget": "完成目标",
"C5ETRAINING.Create": "创建",
"C5ETRAINING.CreateNewDowntimeActivity": "创建一个新的休整活动",
"C5ETRAINING.CurrentProgress": "当前进度",
"C5ETRAINING.Custom": "自定义",
"C5ETRAINING.CustomRoll": "自定义掷骰",

"C5ETRAINING.DC": "DC",
"C5ETRAINING.DefaultAbility": "基于检定进度的默认属性/技能",
"C5ETRAINING.DefaultAbilityHint": "为基于检定进度的休整活动,在创建时设置默认的属性/技能。在创建后可以编辑。",
"C5ETRAINING.DefaultAbilityCompletion": "默认活动完成目标(属性/技能/工具检定)",
"C5ETRAINING.DefaultAbilityCompletionHint": "为基于检定进度的休整活动,设定完成100%活动完成度默认所需要的目标数值。通常来说,平均每个人每次检定可以为活动进度贡献10点。默认值是300(也就是说每人每天独立训练平均需要30天)。",
"C5ETRAINING.DefaultDcDifficulty": "默认检定难度(检定DC)",
"C5ETRAINING.DefaultDcDifficultyHint": "为基于检定DC的休整活动,设定默认所需要的能力检定DC。默认值是10。",
"C5ETRAINING.DefaultDcSuccesses": "默认活动完成目标(检定DC)",
"C5ETRAINING.DefaultDcSuccessesHint": "为基于检定DC的休整活动,设定完成100%活动完成度默认所需要的检定成功次数。默认值是5次成功。",
"C5ETRAINING.DefaultSimpleCompletion": "默认活动完成目标(简单)",
"C5ETRAINING.DefaultSimpleCompletionHint": "为基于简单进度的休整活动,设定完成100%活动完成度默认所需要的尝试目标次数。默认值是10次尝试。",
"C5ETRAINING.DefaultTimeCompletion": "默认活动完成目标(时间)",
"C5ETRAINING.DefaultTimeCompletionHint": "为基于时间进度的休整活动,设定完成100%活动完成度默认所需要的天数。默认值是30天。(需要使用 About Time 模组)。",
"C5ETRAINING.Delete": "删除",
"C5ETRAINING.DeleteConfirmation": "你确定要删除该项目吗?",
"C5ETRAINING.DeleteDowntimeActivity": "删除休整活动",
"C5ETRAINING.Description": "描述",
"C5ETRAINING.Disadvantage": "劣势",
"C5ETRAINING.Dismiss": "取消",
"C5ETRAINING.DismissSelected": "取消已选择的",
"C5ETRAINING.DowntimeActivityComplete": "修正活动完成",
"C5ETRAINING.DowntimeTabName": "休整活动选项卡名称",
"C5ETRAINING.DowntimeTabNameHint": "设定训练选项卡的标题。默认值是'Downtime,'但你可以任意更改。",

"C5ETRAINING.Edit": "编辑",
"C5ETRAINING.EditDowntimeActivity": "编辑休整活动",
"C5ETRAINING.EnableDowntimeReminders": "启用休整活动提醒",
"C5ETRAINING.EnableDowntimeRemindersHint": "启用该选项将会给GM在每天开始时显示一个提示,提醒让有休整活动的玩家是否推进进度。(需要使用 About Time 模组)。",

"C5ETRAINING.InvalidNumberWarning": "无效输入值。请输入一个数字。",
"C5ETRAINING.InvalidTool": "未找到工具",

"C5ETRAINING.Name": "名称",
"C5ETRAINING.NewDowntimeActivity": "新的休整活动",
"C5ETRAINING.None": "",
"C5ETRAINING.Normal": "正常",
"C5ETRAINING.NpcsOnly": "仅限NPC",

"C5ETRAINING.PcsAndNpcs": "PC和NPC",
"C5ETRAINING.PcsOnly": "仅限PC",
"C5ETRAINING.ProgressChange": "进度变更",
"C5ETRAINING.ProgressionType": "进度类型",

"C5ETRAINING.ReviewChanges": "审阅变更",
"C5ETRAINING.Roll": "掷骰",

"C5ETRAINING.SelectAnAbility": "选择一项进度使用的属性",
"C5ETRAINING.ShowDowntimeTabPc": "显示休整选项卡(PC)",
"C5ETRAINING.ShowDowntimeTabPcHint": "开启该项将会在所有PC的角色卡上显示休整活动选项卡。需要关闭重开角色卡来生效。",
"C5ETRAINING.ShowDowntimeTabNpc": "显示休整选项卡(NPC)",
"C5ETRAINING.ShowDowntimeTabNpcHint": "开启该项将会在所有NPC的角色卡上显示休整活动选项卡。需要关闭重开角色卡来生效。",
"C5ETRAINING.Simple": "简单",
"C5ETRAINING.Skill": "技能",
"C5ETRAINING.SkillAcr": "特技",
"C5ETRAINING.SkillAni": "驯兽",
"C5ETRAINING.SkillArc": "奥秘",
"C5ETRAINING.SkillAth": "运动",
"C5ETRAINING.SkillDec": "欺瞒",
"C5ETRAINING.SkillHis": "历史",
"C5ETRAINING.SkillIns": "洞悉",
"C5ETRAINING.SkillInv": "调查",
"C5ETRAINING.SkillItm": "威吓",
"C5ETRAINING.SkillMed": "医疗",
"C5ETRAINING.SkillNat": "自然",
"C5ETRAINING.SkillPer": "游说",
"C5ETRAINING.SkillPrc": "察觉",
"C5ETRAINING.SkillPrf": "表演",
"C5ETRAINING.SkillRel": "宗教",
"C5ETRAINING.SkillSlt": "巧手",
"C5ETRAINING.SkillSte": "隐匿",
"C5ETRAINING.SkillSur": "生存",
"C5ETRAINING.SuccessesRequired": "需要成功",

"C5ETRAINING.Time": "时间(UTC)",
"C5ETRAINING.ToggleInfo": "切换信息",
"C5ETRAINING.Tool": "工具",
"C5ETRAINING.ToolNotFoundWarning": "没有找到选择的工具。请编辑该活动并选择新的。",

"C5ETRAINING.User": "用户"
}
11 changes: 8 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "5e-training",
"title": "Crash's 5e Downtime Tracking",
"description": "Adds a section to the character sheet to keep track of downtime activity progression. Track proficiency training, spell scribing, and anything else you can think of.",
"version": "0.4.5",
"version": "0.4.6",
"author": "CRASH1115#2944",
"minimumCoreVersion": "0.6.6",
"compatibleCoreVersion": "0.7.2",
"compatibleCoreVersion": "0.7.3",
"systems": ["dnd5e"],
"esmodules": ["training.js"],
"styles": ["styles/training.css"],
Expand All @@ -19,9 +19,14 @@
"lang": "ko",
"name": "Korean",
"path": "lang/ko.json"
},
{
"lang": "cn",
"name": "中文",
"path": "lang/cn.json"
}
],
"url": "https://github.com/crash1115/5e-training",
"manifest": "https://raw.githubusercontent.com/crash1115/5e-training/master/module.json",
"download": "https://github.com/crash1115/5e-training/releases/download/v0.4.5/5e-training.zip"
"download": "https://github.com/crash1115/5e-training/releases/download/v0.4.6/5e-training.zip"
}
Loading

0 comments on commit 949221c

Please sign in to comment.