~hokiegeek/tw5-location-crafts

2ce0d341cab9e8e0ee04d34386c1616dd5aa4fe7 — HokieGeek 9 months ago 4d9bf66 0.3.0
Adds progress point tracking
3 files changed, 40 insertions(+), 1 deletions(-)

M macros.tid
M plugin.info
M styles.tid
M macros.tid => macros.tid +31 -0
@@ 26,6 26,37 @@ and how to mark them off?
            {{$:/core/images/new-button}}
        </$button>
    </div>
    <div style="display: grid; width: fit-content;">
        <div style="grid-column-start: 1; font-size: .8rem; margin-right: .5rem;">
            Progress points:
        </div>
        <div style="grid-column-start: 2">
            <$reveal type="gt" stateTitle=<<currentTiddler>> stateField="crafted-$type$-points" text="0">
            <$let next-points={{{ [is[current]get[crafted-$type$-points]subtract[1]] }}}>
            <$button setTitle=<<currentTiddler>> setField=crafted-$type$-points setTo=<<next-points>> tooltip="remove progress points" aria-label="remove progress points" class="tc-btn-invisible tc-btn-mini">
                {{$:/core/images/minus-button}}
            </$button>
            </$let>
            </$reveal>
            <$list filter="[is[current]get[crafted-$type$-points]else[0]compare:integer:lteq[0]]">
            <span class="btn-disabled">
                {{$:/core/images/minus-button}}
            </span>
            </$list>
        </div>
        <div style="grid-column-start: 3; padding-left: 0.5rem; padding-right: 0.5rem;">
        <$list filter="[is[current]get[crafted-$type$-points]else[0]]">
        <<currentTiddler>>
        </$list>
        </div>
        <div style="grid-column-start: 4">
            <$let next-points={{{ [is[current]get[crafted-$type$-points]else[0]add[1]] }}}>
            <$button setTitle=<<currentTiddler>> setField=crafted-$type$-points setTo=<<next-points>> tooltip="add progress points" aria-label="add progress points" class="tc-btn-invisible tc-btn-mini">
                {{$:/core/images/plus-button}}
            </$button>
            </$let>
        </div>
    </div>
    <ol>
        <$let me={{!!title}}>
        <$list filter="[is[current]get[crafted-$type$]enlist-input:raw[]]" counter="counter" emptyMessage="no $type$ setup">

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/location-crafts",
    "description": "Some templates and stuff for recording information created with the RPG tool The Location Crafter",
    "author": "hokiegeek",
    "version": "0.2.1",
    "version": "0.3.0",
    "core-version": ">=5.2.1",
    "source": "https://git.sr.ht/~hokiegeek/tw5-location-crafts",
    "plugin-type": "plugin",

M styles.tid => styles.tid +8 -0
@@ 43,3 43,11 @@ type: text/vnd.tiddlywiki
    opacity: .9;
    fill: red;
}

.btn-disabled svg {
    height: 1em;
    width: 1em;
    opacity: .3;
    vertical-align: middle;
    padding: 0px 1px 1px 0px;
}