diff --git a/langs/en-ca.json b/langs/en-ca.json
index c40e853..badf3f2 100644
--- a/langs/en-ca.json
+++ b/langs/en-ca.json
@@ -172,7 +172,8 @@
"numberOfDice": "# of Dice",
"rollTarget": "Target",
"difficulty": "(DC: {dc})",
- "RichEditor-no-collaborative": "Warning: This editor is not collaborative, that means that if you and someone else are editing it at the same time, you won't see that someone else is making changes until they save, and then your changes will be lost."
+ "RichEditor-no-collaborative": "Warning: This editor is not collaborative, that means that if you and someone else are editing it at the same time, you won't see that someone else is making changes until they save, and then your changes will be lost.",
+ "no-ammo": "You don't have any ammo!"
},
"notifs": {
"error": {
diff --git a/module/Apps/popovers/AmmoTracker.mjs b/module/Apps/popovers/AmmoTracker.mjs
index a86e569..e1203c0 100644
--- a/module/Apps/popovers/AmmoTracker.mjs
+++ b/module/Apps/popovers/AmmoTracker.mjs
@@ -19,8 +19,8 @@ export class AmmoTracker extends GenericPopoverMixin(HandlebarsApplicationMixin(
};
static PARTS = {
- main: {
- template: filePath(`templates/Apps/popovers/AmmoTracker/content.hbs`),
+ ammoList: {
+ template: filePath(`templates/Apps/popovers/AmmoTracker/ammoList.hbs`),
},
};
// #endregion
@@ -29,6 +29,12 @@ export class AmmoTracker extends GenericPopoverMixin(HandlebarsApplicationMixin(
// #endregion
// #region Lifecycle
+ async _preparePartContext(partId, data) {
+ const ctx = { partId };
+ ctx.canPin = false;
+ ctx.ammos = data.ammos;
+ return ctx;
+ };
// #endregion
// #region Actions
diff --git a/module/gameTerms.mjs b/module/gameTerms.mjs
index 5bcbe71..86507ad 100644
--- a/module/gameTerms.mjs
+++ b/module/gameTerms.mjs
@@ -37,6 +37,7 @@ export const gameTerms = Object.preventExtensions({
}),
/** The types of items that contribute to the gear limit */
gearItemTypes: new Set([
+ `ammo`,
`armour`,
`weapon`,
`shield`,
diff --git a/templates/Apps/popovers/AmmoTracker/ammoList.hbs b/templates/Apps/popovers/AmmoTracker/ammoList.hbs
new file mode 100644
index 0000000..87118d7
--- /dev/null
+++ b/templates/Apps/popovers/AmmoTracker/ammoList.hbs
@@ -0,0 +1,23 @@
+
+ {{#if ammos}}
+
+ {{else}}
+
+ {{ rc-i18n "RipCrypt.Apps.no-ammo" }}
+
+ {{/if}}
+
\ No newline at end of file
diff --git a/templates/Apps/popovers/AmmoTracker/content.hbs b/templates/Apps/popovers/AmmoTracker/content.hbs
deleted file mode 100644
index 80f0024..0000000
--- a/templates/Apps/popovers/AmmoTracker/content.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Hello
-
\ No newline at end of file
diff --git a/templates/Apps/popovers/AmmoTracker/style.css b/templates/Apps/popovers/AmmoTracker/style.css
index 63e4d92..1f1cf1d 100644
--- a/templates/Apps/popovers/AmmoTracker/style.css
+++ b/templates/Apps/popovers/AmmoTracker/style.css
@@ -1,4 +1,38 @@
-.ripcrypt--AmmoTracker {
- color: var(--base-text);
- background: var(--base-background);
+.ripcrypt--AmmoTracker.ripcrypt--AmmoTracker {
+ color: var(--popover-text);
+ background: var(--popover-background);
+ padding: 4px 8px;
+
+ --button-text: var(--header-text);
+ --button-background: var(--header-background);
+
+ button {
+ border-radius: 4px;
+ }
+
+ ul {
+ &:nth-child(even) {
+ color: var(--popover-alt-row-text);
+ background: var(--popover-alt-row-background);
+ --button-text: unset;
+ --button-background: unset;
+ }
+ }
+
+ .ammo {
+ display: grid;
+ grid-template-columns: 150px 30px min-content;
+ grid-template-rows: min-content;
+ align-items: center;
+ justify-items: center;
+ /* display: flex;
+ flex-direction: row;
+ align-items: center; */
+ gap: 8px;
+
+ .name {
+ flex-grow: 1;
+ justify-self: left;
+ }
+ }
}
diff --git a/templates/css/elements/button.css b/templates/css/elements/button.css
index 14fd464..e912a42 100644
--- a/templates/css/elements/button.css
+++ b/templates/css/elements/button.css
@@ -1,5 +1,4 @@
-.ripcrypt.popover.frameless button,
-.ripcrypt.hud button,
+.ripcrypt:where(.popover.frameless, .hud) button,
.ripcrypt > .window-content button {
all: revert;
outline: none;
diff --git a/templates/css/elements/lists.css b/templates/css/elements/lists.css
index 74ac6f3..24aa561 100644
--- a/templates/css/elements/lists.css
+++ b/templates/css/elements/lists.css
@@ -36,6 +36,9 @@
}
ul {
+ margin: 0;
+ padding: 0;
+
> li {
margin: 0;
}
diff --git a/templates/css/themes/dark.css b/templates/css/themes/dark.css
index aa4a8a4..b454025 100644
--- a/templates/css/themes/dark.css
+++ b/templates/css/themes/dark.css
@@ -27,6 +27,16 @@
--col-gap: 2px;
--row-gap: 0px;
+ /* Popover Variables */
+ --popover-text: var(--base-text);
+ --popover-background: var(--base-background);
+
+ --popover-alt-row-text: var(--alt-row-text);
+ --popover-alt-row-background: var(--alt-row-background);
+
+ --popover-header-text: var(--header-text);
+ --popover-header-background: var(--header-background);
+
/* Additional Variables */
--string-tags-border: inherit;
--string-tags-tag-background: inherit;