Skip to content

Commit

Permalink
0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sdenec committed Jan 11, 2021
1 parent 3141fd9 commit ea497ca
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 8 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Additional Translations generously provided by:
Thank you very much!

*Version 0.4.7*
- french translation update thanks Github @Nildran
- tried to fix strange behaviour of ability hover
- french translation update and localization fixes thanks Github @Nildran
- tried to fix strange hover behaviour of ability mods
- minor css fix for NPC CR text color
- NPC sheets now have a toggle button for the personality infos (now hidden by default) in the biography tab
- fix to prevent items sometimes becoming invisible when toggling the item details

*Version 0.4.6*
- fixed character art popup when pressing enter/return while editing an input field
Expand Down
17 changes: 17 additions & 0 deletions src/_scss/_npc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,21 @@
}
}

.left-notes.hidden {
display: none;
}

.toggle-personality-info {
padding: 20px 4px;
background: var(--faint-color);
border-radius: 3px;
margin-right: 4px;
color: var(--tertiary-color);
cursor: pointer;

&:hover {
color: var(--secondary-color);
}
}

}
2 changes: 1 addition & 1 deletion src/_scss/partials/_inventory.scss
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@

.item-name {
display: flex;
flex: 1;
flex: 1 1 1px;
cursor: default;
flex-wrap: nowrap;
font-size: 12px;
Expand Down
19 changes: 18 additions & 1 deletion src/css/tidy5e.css
Original file line number Diff line number Diff line change
Expand Up @@ -2807,7 +2807,7 @@

.tidy5e.sheet.actor .list-layout .items-list .item .item-name {
display: flex;
flex: 1;
flex: 1 1 1px;
cursor: default;
flex-wrap: nowrap;
font-size: 12px;
Expand Down Expand Up @@ -3964,6 +3964,23 @@
font-size: 12px;
}

.tidy5e.sheet.actor.npc .left-notes.hidden {
display: none;
}

.tidy5e.sheet.actor.npc .toggle-personality-info {
padding: 20px 4px;
background: var(--faint-color);
border-radius: 3px;
margin-right: 4px;
color: var(--tertiary-color);
cursor: pointer;
}

.tidy5e.sheet.actor.npc .toggle-personality-info:hover {
color: var(--secondary-color);
}

.tidy5e.sheet.actor.vehicle {
min-width: 690px;
min-height: 210px;
Expand Down
1 change: 1 addition & 0 deletions src/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"TIDY5E.JournalQuests": "Aufträge",
"TIDY5E.JournalMisc": "Verschiedenes",
"TIDY5E.JournalEntries": "Tagebucheinträge",
"TIDY5E.TogglePersonalityInfo": "Persönlichkeits-Infos umschalten",

"TIDY5E.EnableEdit": "Bearbeiten erlauben",
"TIDY5E.DisableEdit": "Bearbeiten verbieten",
Expand Down
1 change: 1 addition & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"TIDY5E.JournalQuests": "Quests",
"TIDY5E.JournalMisc": "Miscellaneous",
"TIDY5E.JournalEntries": "Journal Entries",
"TIDY5E.TogglePersonalityInfo": "Toggle Personality Info",

"TIDY5E.EnableEdit": "Enable Edit",
"TIDY5E.DisableEdit": "Disable Edit",
Expand Down
1 change: 1 addition & 0 deletions src/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"TIDY5E.BioFlaws": "Défauts",
"TIDY5E.BioAppearance": "Apparence",
"TIDY5E.BioBackground": "Background/Biographie",
"TIDY5E.TogglePersonalityInfo": "Informations de personnalité",

"TIDY5E.JournalPoi": "Personnages Importants",
"TIDY5E.JournalLoi": "Lieux Importants",
Expand Down
15 changes: 12 additions & 3 deletions src/scripts/tidy5e-npc.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ export default class Tidy5eNPC extends ActorSheet5e {
tidy5eShowActorArt(html, actor);


html.find(".toggle-personality-info").click( async (event) => {
if(actor.getFlag('tidy5e-sheet', 'showNpcPersonalityInfo')){
await actor.unsetFlag('tidy5e-sheet', 'showNpcPersonalityInfo');
} else {
await actor.setFlag('tidy5e-sheet', 'showNpcPersonalityInfo', true);
}
});

html.find(".rollable[data-action=rollInitiative]").click(function(){
return actor.rollInitiative({createCombatants: true});
});
Expand Down Expand Up @@ -370,9 +378,10 @@ async function resetTempHp(app, html, data){
// Set Sheet Classes
async function setSheetClasses(app, html, data) {
const {token} = app;
// if (game.settings.get("tidy5e-sheet", "disableRightClick")) {
// html.find('.tidy5e-sheet .items-list').addClass('alt-context');
// }
const actor = app.actor;
if(actor.getFlag('tidy5e-sheet', 'showNpcPersonalityInfo')){
html.find('.tidy5e-sheet .left-notes').removeClass('hidden');
}
if (game.settings.get("tidy5e-sheet", "disableRightClick")) {
if(game.settings.get("tidy5e-sheet", "useClassicControls")){
html.find('.tidy5e-sheet .grid-layout .items-list').addClass('alt-context');
Expand Down
3 changes: 2 additions & 1 deletion src/templates/actors/tidy5e-npc.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ <h4>{{ localize "DND5E.LairAct" }}</h4>

{{!-- Biography Tab --}}
<div class="tab biography" data-group="primary" data-tab="biography">
<div class="left-notes note-entries">
<div class="toggle-personality-info" title="{{localize 'TIDY5E.TogglePersonalityInfo'}}">{{#if actor.flags.tidy5e-sheet.showNpcPersonalityInfo}}<i class="fas fa-angle-double-left"></i>{{else}}<i class="fas fa-angle-double-right"></i>{{/if}}</div>
<div class="left-notes note-entries hidden">
<article>
<div class="section-titles biopage">{{ localize "DND5E.PersonalityTraits" }}</div>
{{editor content=data.details.trait target="data.details.trait" button=true owner=owner editable=editable}}
Expand Down

0 comments on commit ea497ca

Please sign in to comment.