diff --git a/README.md b/README.md index 858e4e6..9245641 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,11 @@ Sometimes we forget things. Sometimes we mess up. Version 0.3.0 of the module ad [![Image from Gyazo](https://i.gyazo.com/5fa7f966fd12c3ad321bb2bf4359be55.png)](https://gyazo.com/5fa7f966fd12c3ad321bb2bf4359be55) ## Localization (v0.3.0+) -This module includes support for localization. If you'd like to contribute, please get in touch with me on Discord, or add an issue to the repo. Currently supported languages are: +This module includes support for localization. Currently supported languages are: - English +- Korean + +If you'd like to contribute, please get in touch with me or create a pull request with your translations. For existing translations, new keys may get added as the module is update. If this is the case, you'll be able to find a .json file with all the newly added, untranslated keys in the `lang/missing` directory. ## Compatibility ### Supported Modules @@ -61,6 +64,7 @@ Contact me on Discord (CRASH1115#2944) to chat, or create an issue right here on ## Attributions and Special Thanks - Thanks to platypus_pi for help with English localization +- Thanks to KLO#1490 for Korean localization ## License - This work is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode). diff --git a/changelog.md b/changelog.md index dd64b40..73b7431 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,20 @@ # Change Log +## Version 0.3.2 +Improvements: +- Increased width of progress adjustment column to allow for larger values +- Updated styling for the activity completion notifications +- Korean language translation, courtesy of KLO#1490 + +Removed: +- The toggle for the Tidy5e delete lock. Deleing downtime items requires confirmation already. Essentially asking for it twice was needlessly annoying for some folks. + +Fixes: +- Fixed some styling for the item control buttons + ## Version 0.3.1 Fixes: -- Fixed an issue where enabling MQoL's Item Delete Check setting prevented downtime activities from being deleted on some character sheets. +- Fixed an issue where enabling MQoL's Item Delete Check setting prevented downtime activities from being deleted on some character sheets. ## Version 0.3.0 New Features: diff --git a/lang/en.json b/lang/en.json index 2b2b2ac..8ac5b36 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,13 +1,23 @@ { + "C5ETRAINING.AbilityCha": "Charisma", + "C5ETRAINING.AbilityCheck": "Ability Check", + "C5ETRAINING.AbilityCon": "Constitution", + "C5ETRAINING.AbilityDex": "Dexterity", + "C5ETRAINING.AbilityInt": "Intelligence", + "C5ETRAINING.AbilityStr": "Strength", + "C5ETRAINING.AbilityWis": "Wisdom", "C5ETRAINING.Action": "Action", "C5ETRAINING.Activity": "Activity", "C5ETRAINING.ActivityProgress": "Activity Progress", + "C5ETRAINING.Add": "Add", + "C5ETRAINING.Advantage": "Advantage", "C5ETRAINING.AdjustProgressValue": "Adjust Progress", "C5ETRAINING.AdvanceActivityProgress": "Advance Activity Progress", "C5ETRAINING.AnnounceActivityCompletionFor": "Announce Activity Completion For:", "C5ETRAINING.AnnounceActivityCompletionForHint": "Choose which actor types you would like to have trigger chat messages upon activity completion.", "C5ETRAINING.Apply": "Apply", + "C5ETRAINING.AttemptsToComplete": "Attempts to complete", "C5ETRAINING.AuditLog": "Change Log", "C5ETRAINING.AuditLogDeleteNote": "Note: Dismissing changes does NOT revert them. If you'd like to revert changes you see here, you must do so manually, but this log can serve as a guide to help you figure out what changes to make if required.", "C5ETRAINING.AuditLogInstructionsGm": "This log shows a list of all changes made to the progress of each of this character's downtime activities. You may remove items from this list after you've reviewed them by checking the box in the Dismiss column and hitting the button at the bottom of the window. Once you do this, neither you nor the player will be able to see them anymore.", @@ -16,6 +26,7 @@ "C5ETRAINING.Cancel": "Cancel", "C5ETRAINING.Completed": "completed", "C5ETRAINING.CompletedADowntimeActivity": "completed a downtime activity.", + "C5ETRAINING.CompletionTarget": "Completion Target", "C5ETRAINING.Create": "Create", "C5ETRAINING.CreateNewDowntimeActivity": "Create New Downtime Activity", "C5ETRAINING.CurrentProgress": "Current Progress", @@ -31,6 +42,7 @@ "C5ETRAINING.Delete": "Delete", "C5ETRAINING.DeleteConfirmation": "Are you sure you want to delete this item?", "C5ETRAINING.DeleteDowntimeActivity": "Delete Downtime Activity", + "C5ETRAINING.Disadvantage": "Disadvantage", "C5ETRAINING.Dismiss": "Dismiss", "C5ETRAINING.DismissSelected": "Dismiss Selected", "C5ETRAINING.DowntimeActivityComplete": "Downtime Activity Complete", @@ -46,6 +58,8 @@ "C5ETRAINING.Name": "Name", "C5ETRAINING.NewDowntimeActivity": "New Downtime Activity", + "C5ETRAINING.None": "None", + "C5ETRAINING.Normal": "Normal", "C5ETRAINING.NpcsOnly": "NPC's Only", "C5ETRAINING.PcsAndNpcs": "PC's and NPC's", @@ -55,6 +69,7 @@ "C5ETRAINING.ReviewChanges": "Review Changes", + "C5ETRAINING.SelectAnAbility": "Select an ability to use for progression", "C5ETRAINING.ShowDowntimeTab": "Show Downtime Tab", "C5ETRAINING.ShowDowntimeTabHint": "Toggling this on will display the training tab on all player character sheets. You will need to close and reopen sheets for this to take effect.", "C5ETRAINING.Simple": "Simple", diff --git a/lang/ko.json b/lang/ko.json new file mode 100644 index 0000000..32905ce --- /dev/null +++ b/lang/ko.json @@ -0,0 +1,65 @@ + +{ + "C5ETRAINING.Action": "액션", + "C5ETRAINING.Activity": "활동", + "C5ETRAINING.ActivityProgress": "활동 진행률", + "C5ETRAINING.AdjustProgressValue": "진행률 조정", + "C5ETRAINING.AdvanceActivityProgress": "고급 활동 진행률", + "C5ETRAINING.AnnounceActivityCompletionFor": "활동 완료 알림 : ", + "C5ETRAINING.AnnounceActivityCompletionForHint": "활동 완료 시 채팅 메시지를 작동 시킬 액터 유형을 선택한다", + "C5ETRAINING.Apply": "적용", + "C5ETRAINING.AuditLog": "기록 변경", + "C5ETRAINING.AuditLogDeleteNote": "참고:변경을 취소해도 변경사항은 복구되지 않는다. 여기에 표시된 변경사항을 되돌리려면 수동으로 변경해야 하지만 기록을 사용하여 변경사항을 파악하는데 도움을 줄 수 있다.", + "C5ETRAINING.AuditLogInstructionsGm": "이 기록은 이 캐릭터의 여가 활동의 진행 상황에 대한 모든 변경 내역을 보여준다. 취소 열의 상자를 선택하고 창 하단의 버튼을 눌러 확인 후 항목을 제거할 수 있다. 이렇게 할 경우 다시 볼 수 없다.", + "C5ETRAINING.AuditLogInstructionsPlayer": "이 기록은 GM이 아직 확인하지 않은 각 여가 활동의 진행률에 대한 변경사항 목록을 보여준다. 확인 될 경우 더 이상 보이지 않게 된다.", + + "C5ETRAINING.Cancel": "취소", + "C5ETRAINING.Completed": "완료 :", + "C5ETRAINING.CompletedADowntimeActivity": "완료된 여가 활동", + "C5ETRAINING.Create": "생성", + "C5ETRAINING.CreateNewDowntimeActivity": "새 여가 활동 생성", + "C5ETRAINING.CurrentProgress": "현재 진행률", + + "C5ETRAINING.DefaultAbility": "능력 판정 진행에 대한 기본 속성", + "C5ETRAINING.DefaultAbilityHint": "생성시 여가 활동에 할당된 기본 속성을 설정한다. 생성 후 편집할 수 있다.", + "C5ETRAINING.DefaultAbilityCompletion": "기본 활동 달성 목표 (능력 판정)", + "C5ETRAINING.DefaultAbilityCompletionHint": "능력 판정 진행을 통한 여가 활동의 100% 완료에 필요한 기본 목표 수를 설정한다. 경험에 비추어 볼 때 평균적 개인은 활동 진행을 위해 판정 당 전체 점수에 10점 정도를 기여할 수 있다. 기본값은 300(또는 일별 평균 개인 훈련의 경우 30일)이다.", + "C5ETRAINING.DefaultSimpleCompletion": "기본 활동 완료 목표 (심플)", + "C5ETRAINING.DefaultSimpleCompletionHint": "심플 진행을 통한 여가 활동에 대해 100% 완료에 필요한 기본 목표 시도 횟수를 설정한다. 기본값은 10이다.", + "C5ETRAINING.DefaultTimeCompletion": "기본 활동 완료 목표 (시간)", + "C5ETRAINING.DefaultTimeCompletionHint": "시간 기반 진행을 이용한 여가 활동의 100% 완료에 필요한 기본 목표 일수를 설정한다. 기본값은 30일(About Time 모듈 필요)", + "C5ETRAINING.Delete": "삭제", + "C5ETRAINING.DeleteConfirmation": "이 항목을 정말로 삭제하시겠습니까?", + "C5ETRAINING.DeleteDowntimeActivity": "여가 활동 삭제", + "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.Name": "이름", + "C5ETRAINING.NewDowntimeActivity": "새 여가 활동", + "C5ETRAINING.NpcsOnly": "NPC만", + + "C5ETRAINING.PcsAndNpcs": "PC와 NPC", + "C5ETRAINING.PcsOnly": "PC만", + "C5ETRAINING.ProgressChange": "진행률 변경", + "C5ETRAINING.ProgressionType": "진행 유형", + + "C5ETRAINING.ReviewChanges": "변경 내용 확인", + + "C5ETRAINING.ShowDowntimeTab": "여가시간 탭 표시", + "C5ETRAINING.ShowDowntimeTabHint": "이것을 활성화 하면 모든 플레이어 시트에 훈련 탭이 표시된다. 이를 적용하려면 시트를 다시 열어야 한다.", + "C5ETRAINING.Simple": "심플", + + "C5ETRAINING.Time": "시간 (UTC)", + + "C5ETRAINING.User": "유저" +} diff --git a/lang/missing/en.json b/lang/missing/en.json new file mode 100644 index 0000000..604dc9d --- /dev/null +++ b/lang/missing/en.json @@ -0,0 +1,4 @@ + +{ + +} diff --git a/lang/missing/ko.json b/lang/missing/ko.json new file mode 100644 index 0000000..1426668 --- /dev/null +++ b/lang/missing/ko.json @@ -0,0 +1,22 @@ + +{ + "C5ETRAINING.AbilityCha": "Charisma", + "C5ETRAINING.AbilityCheck": "Ability Check", + "C5ETRAINING.AbilityCon": "Constitution", + "C5ETRAINING.AbilityDex": "Dexterity", + "C5ETRAINING.AbilityInt": "Intelligence", + "C5ETRAINING.AbilityStr": "Strength", + "C5ETRAINING.AbilityWis": "Wisdom", + "C5ETRAINING.Add": "Add", + "C5ETRAINING.Advantage": "Advantage", + "C5ETRAINING.AttemptsToComplete": "Attempts to complete", + + "C5ETRAINING.CompletionTarget": "Completion Target", + + "C5ETRAINING.Disadvantage": "Disadvantage", + + "C5ETRAINING.None": "None", + "C5ETRAINING.Normal": "Normal", + + "C5ETRAINING.SelectAnAbility": "Select an ability to use for progression", +} diff --git a/module.json b/module.json index d3018cf..a8837be 100644 --- a/module.json +++ b/module.json @@ -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.3.1", + "version": "0.3.2", "author": "CRASH1115#2944", "minimumCoreVersion": "0.6.0", - "compatibleCoreVersion": "0.6.4", + "compatibleCoreVersion": "0.6.5", "systems": ["dnd5e"], "esmodules": ["training.js"], "styles": ["styles/training.css"], @@ -14,9 +14,14 @@ "lang": "en", "name": "English", "path": "lang/en.json" + }, + { + "lang": "ko", + "name": "Korean", + "path": "lang/ko.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.3.1/5e-training.zip" + "download": "https://github.com/crash1115/5e-training/releases/download/v0.3.2/5e-training.zip" } diff --git a/styles/training.css b/styles/training.css index fce9e9e..6d84d8e 100644 --- a/styles/training.css +++ b/styles/training.css @@ -16,10 +16,15 @@ } /* Type Column */ -.training .item-detail { +.training .item-detail.type { text-transform: capitalize; } +/* Override Column */ +.dnd5e.sheet.actor .training .inventory-list .item-detail.override { + flex: 0 0 90px; +} + /* Progress Columns */ .training .item-detail.bar { flex: 1 !important; @@ -31,7 +36,7 @@ padding-top: 1px; line-height: 1; display: inline; - max-width: 30px; + max-width: 40px; } /* Training Bar */ @@ -139,16 +144,6 @@ /* SUPPORT FOR TIDY 5E */ /*****************************/ -/* Hide the lock by default */ -.training .tidy5e-delete-lock { - display: none; -} - -/* Show the lock when tidy is active*/ -.tidy5e.sheet.actor .training .tidy5e-delete-lock { - display: inline-block; -} - .tidy5e .training .item-controls .item-create { padding-left: 5px; padding-right: 5px; @@ -169,6 +164,10 @@ line-height: 30px; } +.tidy5e.sheet.actor.npc .training .inventory-list .item-detail .training-override { + max-width: 40px; +} + .tidy5e.sheet.actor.npc .training .inventory-list .inventory-header .item-controls a.item-create { margin-top: 0px; padding: 4px 5px; diff --git a/templates/add-training-dialog.html b/templates/add-training-dialog.html index f77f950..7032738 100644 --- a/templates/add-training-dialog.html +++ b/templates/add-training-dialog.html @@ -7,7 +7,7 @@
diff --git a/templates/completion-message.html b/templates/completion-message.html new file mode 100644 index 0000000..8527811 --- /dev/null +++ b/templates/completion-message.html @@ -0,0 +1,14 @@ +
+
+

{{ localize "C5ETRAINING.DowntimeActivityComplete" }}

+
+ +
+ {{actor.name}} {{ localize "C5ETRAINING.Completed" }} {{activity.name}}! +
+ + + +
diff --git a/templates/partials/ability.html b/templates/partials/ability.html index 00cc171..727910a 100644 --- a/templates/partials/ability.html +++ b/templates/partials/ability.html @@ -1,16 +1,16 @@
- +
- +
diff --git a/templates/partials/simple.html b/templates/partials/simple.html index d2b9f1d..b8b8cb6 100644 --- a/templates/partials/simple.html +++ b/templates/partials/simple.html @@ -1,4 +1,4 @@
- +
diff --git a/templates/training-section.html b/templates/training-section.html index bb2c890..578bace 100644 --- a/templates/training-section.html +++ b/templates/training-section.html @@ -3,17 +3,11 @@
  • {{ localize 'C5ETRAINING.ActivityProgress' }}

    - - - {{ localize 'C5ETRAINING.AuditLog' }} - {{ localize 'DND5E.Add' }} + {{ localize 'C5ETRAINING.Add' }}
  • @@ -24,10 +18,10 @@

    {{ localize 'C5ETRAINING.ActivityProgress' }}

    {{training.name}}

    -
    +
    {{training.progressionStyle}} {{#if (eq training.progressionStyle "ability")}}({{training.ability}}){{/if}}
    -
    +
    / {{training.completionAt}}
    diff --git a/training.js b/training.js index 5154b0f..9b65a49 100644 --- a/training.js +++ b/training.js @@ -37,12 +37,12 @@ Hooks.once("init", () => { config: true, type: String, choices: { - "str": game.i18n.localize("DND5E.AbilityStr"), - "dex": game.i18n.localize("DND5E.AbilityDex"), - "con": game.i18n.localize("DND5E.AbilityCon"), - "int": game.i18n.localize("DND5E.AbilityInt"), - "wis": game.i18n.localize("DND5E.AbilityWis"), - "cha":game.i18n.localize("DND5E.AbilityCha"), + "str": game.i18n.localize("C5ETRAINING.AbilityStr"), + "dex": game.i18n.localize("C5ETRAINING.AbilityDex"), + "con": game.i18n.localize("C5ETRAINING.AbilityCon"), + "int": game.i18n.localize("C5ETRAINING.AbilityInt"), + "wis": game.i18n.localize("C5ETRAINING.AbilityWis"), + "cha":game.i18n.localize("C5ETRAINING.AbilityCha"), }, default: "int", }); @@ -95,7 +95,7 @@ Hooks.once("init", () => { "pc": game.i18n.localize("C5ETRAINING.PcsOnly"), "npc": game.i18n.localize("C5ETRAINING.NpcsOnly"), "both": game.i18n.localize("C5ETRAINING.PcsAndNpcs"), - "none": game.i18n.localize("DND5E.None"), + "none": game.i18n.localize("C5ETRAINING.None"), }, default: "pc" }); @@ -132,20 +132,6 @@ async function addTrainingTab(app, html, data) { let trainingTabHtml = $(await renderTemplate('modules/5e-training/templates/training-section.html', data)); sheet.append(trainingTabHtml); - // Check for Tidy5e and add listener for delete lock - let tidy5eSheetActive = (game.modules.get("tidy5e-sheet") !== undefined) && (game.modules.get("tidy5e-sheet").active); - if (tidy5eSheetActive){ - html.find('.tidy5e-delete-toggle').click(async (event) => { - event.preventDefault(); - let actor = game.actors.entities.find(a => a.data._id === data.actor._id);; - if(actor.getFlag('tidy5e-sheet', 'allow-delete')){ - await actor.unsetFlag('tidy5e-sheet', 'allow-delete'); - } else { - await actor.setFlag('tidy5e-sheet', 'allow-delete', true); - } - }); - } - // Add New Downtime Activity html.find('.training-add').click(async (event) => { event.preventDefault(); @@ -414,7 +400,7 @@ function calculateNewProgress(activity, actionName, change, absolute = false){ } // Checks for completion of an activity and logs it if it's done -function checkCompletion(actor, activity){ +async function checkCompletion(actor, activity){ if(activity.progress >= activity.completionAt){ let alertFor = game.settings.get("5e-training", "announceCompletionFor"); let isPc = actor.isPC; @@ -439,7 +425,8 @@ function checkCompletion(actor, activity){ if (sendIt){ console.log("Crash's 5e Downtime Tracking | " + actor.name + " " + game.i18n.localize("C5ETRAINING.CompletedADowntimeActivity")); - ChatMessage.create({alias: game.i18n.localize("C5ETRAINING.DowntimeActivityComplete"), content: actor.name + " " + game.i18n.localize("C5ETRAINING.Completed") + " " + activity.name}); + let chatHtml = await renderTemplate('modules/5e-training/templates/completion-message.html', {actor:actor, activity:activity}); + ChatMessage.create({content: chatHtml}); } } } @@ -447,9 +434,9 @@ function checkCompletion(actor, activity){ // Takes in the die roll string and returns whether it was made at adv/disadv/normal function getRollMode(formula){ let d20Roll = formula.split(" ")[0]; - if(d20Roll == "2d20kh"){ return game.i18n.localize("DND5E.Advantage"); } - else if(d20Roll == "2d20kl"){ return game.i18n.localize("DND5E.Disadvantage"); } - else { return game.i18n.localize("DND5E.Normal"); } + if(d20Roll == "2d20kh"){ return game.i18n.localize("C5ETRAINING.Advantage"); } + else if(d20Roll == "2d20kl"){ return game.i18n.localize("C5ETRAINING.Disadvantage"); } + else { return game.i18n.localize("C5ETRAINING.Normal"); } } Hooks.on(`renderActorSheet`, (app, html, data) => {